├── Built-in
├── Built-in_AxiuEffectsShader.shader
├── Built-in_ColorGradient.shader
├── Built-in_StylizedWater.shader
├── Built-in_StylizedWater_ShadowUtilities.cginc
├── Built-in_StylizedWater_WaterUtilities.cginc
├── README.txt
├── Soung_Built-in_AutoGlitch.shader
├── Soung_Built-in_AutoNeon.shader
├── Soung_Built-in_BaseAdd.shader
├── Soung_Built-in_BaseAlpha.shader
├── Soung_Built-in_BaseSoloTex.shader
├── Soung_Built-in_CartoonCrack.shader
├── Soung_Built-in_ChormaHeat.shader
├── Soung_Built-in_ChormaNiuqu.shader
├── Soung_Built-in_CodeRainLit.shader
├── Soung_Built-in_CodeRainUnLit.shader
├── Soung_Built-in_DepthShield.shader
├── Soung_Built-in_DissolvePro.shader
├── Soung_Built-in_DoubleFresnel.shader
├── Soung_Built-in_ExtraHeat.shader
├── Soung_Built-in_Fire-Pro.shader
├── Soung_Built-in_Fire-Simple.shader
├── Soung_Built-in_Flipbook.shader
├── Soung_Built-in_FlowMap.shader
├── Soung_Built-in_FresnelShield.shader
├── Soung_Built-in_GenerateDot.shader
├── Soung_Built-in_GenerateGlow.shader
├── Soung_Built-in_LitVFXBall.shader
├── Soung_Built-in_Liuguang.shader
├── Soung_Built-in_MaskDistortion.shader
├── Soung_Built-in_PixelArt.shader
├── Soung_Built-in_Scale_Star.shader
├── Soung_Built-in_ScreenFlip.shader
├── Soung_Built-in_Screen_Post.shader
├── Soung_Built-in_SimpleToon.shader
├── Soung_Built-in_SnowPlane.shader
├── Soung_Built-in_TwoFace.shader
├── Soung_Built-in_UnlitVFXBall.shader
├── Soung_Built-in_XingKongDao.shader
└── Soung_Built-in_Zhuanchang.shader
├── Editor
├── CustomEffectShaderGUI.cs
├── LTY_ShaderGUI_Built_in.cs
├── Soung_ShaderGUI_Built_in_beta.cs
└── Soung_ShaderGUI_URP_beta.cs
├── LICENSE
├── README.md
├── SampleTex
├── 111.png
├── CausticsShallow.jpg
├── FlipMask.png
├── Flow01.png
├── GentleWaves.bmp
├── Mouth_mask.png
├── SeaPattern.TGA
├── particle.png
├── saomiao.png
└── waters.png
├── UI
├── Soung_UIAdd.shader
├── Soung_UIAutoGlitch.shader
├── Soung_UICustom_Liuguang.shader
├── Soung_UILiuguang.shader
├── Soung_UIMaskAdd.shader
├── Soung_UIMaskNoise.shader
├── Soung_UINeon.shader
├── Soung_UINoiseDis.shader
├── Soung_UIPixelArt.shader
├── Soung_UIZhuanchang.shader
└── Soung_UI_KongBianDis.shader
├── URP
├── GenshinCharacterShader
│ ├── GenshinCharacterShaderZhihuVer.shader
│ ├── NiloInvLerpRemap.hlsl
│ ├── NiloOutlineUtil.hlsl
│ └── NiloZOffset.hlsl
├── LF_URP后期2.0.shader
├── LTY_shader_ALL3.0_URP.shader
├── PandaShaderSamPleURPV1.1
│ ├── CustomSwitchV1.1.asset
│ ├── DistortFunctionSampleURPV1.1.asset
│ ├── PandaGrab.cs
│ ├── PandaShaderSampleURPV1.1.shader
│ ├── SampleGUIURP.cs
│ ├── Tex3FunctionSampleURPV1.1.asset
│ └── TexFunctionSampleURPV1.1.asset
├── PrimoToon
│ ├── Dependencies
│ │ └── GetDepth.prefab
│ ├── PrimoToon-helpers.hlsl
│ ├── PrimoToon-inputs.hlsli
│ ├── PrimoToon-main.hlsl
│ ├── PrimoToon-outlines.hlsl
│ ├── PrimoToon-shadows.hlsl
│ ├── PrimoToon.shader
│ └── Scripts
│ │ ├── AverageNormals.cs
│ │ └── ImportMat.cs
├── ShaderGraph
│ ├── Add单面_SGOffsetOneSide.shadergraph
│ ├── Add基本_SGAdd.ShaderGraph
│ ├── Alpha基本_SGBlend.ShaderGraph
│ ├── Alpha溶解_SGDissolveTexture.ShaderGraph
│ ├── Alpha点状纹理_SGBlendDot.shadergraph
│ ├── Alpha遮罩_SGPolar.ShaderGraph
│ ├── 内置扭曲_SGOffsetMask.ShaderGraph
│ ├── 双层纹理_SGIce.ShaderGraph
│ ├── 双面溶解_SGDoubleSide.ShaderGraph
│ ├── 水纹理_SGWater.shadergraph
│ ├── 点状溶解_SGDissolve.ShaderGraph
│ └── 简易生长_SGIvy.shadergraph
├── SinC_BlendURP.shader
├── SinC_PBRURP.shader
├── SoftParticleFade.hlsl
├── Soung_All_in_One.shader
├── Soung_AutoGlitch.shader
├── Soung_BaseAdd.shader
├── Soung_BaseAlphaBlend.shader
├── Soung_Flipbook.shader
├── Soung_FlowMap.shader
├── Soung_FrenrShield.shader
├── Soung_FrenrShield_URP.shader
├── Soung_Liuguang.shader
├── Soung_MaskFlowURP.shader
├── Soung_NeonSpark.shader
├── Soung_ParticlesDot.shader
├── Soung_PixelArt.shader
├── Soung_RaodongURP.shader
├── Soung_ScreenFlip.shader
├── Soung_SimpleCrack.shader
├── Soung_URP_AllEffect.shader
├── Soung_shader_ALL_URP.shader
├── URP_CelRender.shader
├── UnityURPToonLitShaderExample
│ ├── NiloInvLerpRemap.hlsl
│ ├── NiloOutlineUtil.hlsl
│ ├── NiloZOffset.hlsl
│ ├── SimpleURPToonLitOutlineExample.shader
│ ├── SimpleURPToonLitOutlineExample_LightingEquation.hlsl
│ └── SimpleURPToonLitOutlineExample_Shared.hlsl
├── X7_Blend_OutLIne.shader
├── X7_Scroll2Layers-AlphaAdditive.shader
├── X7_Scroll2Layers-AlphaBlend.shader
├── X7_particleDissolve.shader
└── 流麻flow.shader
└── shaderINFO_12.1
├── Built-in
├── Built-in_AxiuEffectsShader.shader
├── Built-in_ColorGradient.shader
├── Built-in_StylizedWater.shader
├── Built-in_StylizedWater_ShadowUtilities.cginc
├── Built-in_StylizedWater_WaterUtilities.cginc
├── README.txt
├── Soung_Built-in_AutoGlitch.shader
├── Soung_Built-in_AutoNeon.shader
├── Soung_Built-in_BaseAdd.shader
├── Soung_Built-in_BaseAlpha.shader
├── Soung_Built-in_BaseSoloTex.shader
├── Soung_Built-in_CartoonCrack.shader
├── Soung_Built-in_ChormaHeat.shader
├── Soung_Built-in_ChormaNiuqu.shader
├── Soung_Built-in_CodeRainLit.shader
├── Soung_Built-in_CodeRainUnLit.shader
├── Soung_Built-in_DepthShield.shader
├── Soung_Built-in_DissolvePro.shader
├── Soung_Built-in_DoubleFresnel.shader
├── Soung_Built-in_ExtraHeat.shader
├── Soung_Built-in_Fire-Pro.shader
├── Soung_Built-in_Fire-Simple.shader
├── Soung_Built-in_Flipbook.shader
├── Soung_Built-in_FlowMap.shader
├── Soung_Built-in_FresnelShield.shader
├── Soung_Built-in_GenerateDot.shader
├── Soung_Built-in_GenerateGlow.shader
├── Soung_Built-in_LitVFXBall.shader
├── Soung_Built-in_Liuguang.shader
├── Soung_Built-in_MaskDistortion.shader
├── Soung_Built-in_PixelArt.shader
├── Soung_Built-in_Scale_Star.shader
├── Soung_Built-in_ScreenFlip.shader
├── Soung_Built-in_Screen_Post.shader
├── Soung_Built-in_SimpleToon.shader
├── Soung_Built-in_SnowPlane.shader
├── Soung_Built-in_TwoFace.shader
├── Soung_Built-in_UnlitVFXBall.shader
├── Soung_Built-in_XingKongDao.shader
└── Soung_Built-in_Zhuanchang.shader
├── Editor
└── CustomEffectShaderGUI.cs
├── PBR扭曲球体.png
├── ShaderCheck.xlsx
├── Unfinished
├── ShaderGUI_Soung_Built-in_AllEffect.cs
└── Soung_Built-in_AllEffect.shader
├── games101.md
├── 全功能.png
├── 全面屏幕后处理.png
├── 卡通视差地裂.png
├── 无光照扭曲球体.png
├── 星星收缩.png
├── 星星收缩_bt.unitypackage
├── 星空刀光.png
├── 程序光晕.png
├── 自动故障扰动.png
├── 色差扭曲流动.png
├── 转场遮罩.png
├── 遮罩热扭曲.png
└── 雪地材质与脚印.png
/Built-in/Built-in_ColorGradient.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/渐变颜色制作"
2 | {
3 | Properties
4 | {
5 | _Up_Color("前颜色", Color) = (1,0.5,1, 1.0)
6 | _Down_Color("后颜色", Color) = (0.5,1,0.5, 1.0)
7 | _Gradation_thickness("颜色过渡值", Float) = 4
8 | _Gradation_height("颜色分割值", Range(-1.0, 1.0)) = 0.5
9 | [HideInInspector] _texcoord( "", 2D ) = "white" {}
10 | }
11 |
12 | SubShader
13 | {
14 | Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
15 | Cull Back
16 | CGPROGRAM
17 | #pragma target 3.0
18 | #pragma surface surf Unlit keepalpha addshadow fullforwardshadows
19 | struct Input
20 | {
21 | float2 uv_texcoord;
22 | };
23 |
24 | uniform float4 _Down_Color;
25 | uniform float4 _Up_Color;
26 | uniform float _Gradation_height;
27 | uniform float _Gradation_thickness;
28 |
29 | inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
30 | {
31 | return half4 ( 0, 0, 0, s.Alpha );
32 | }
33 |
34 | void surf( Input i , inout SurfaceOutput o )
35 | {
36 | float4 lerpResult = lerp( _Down_Color , _Up_Color , saturate( ( ( i.uv_texcoord.y - _Gradation_height ) * _Gradation_thickness ) ));
37 | o.Emission = lerpResult.rgb;
38 | o.Alpha = 1;
39 | }
40 |
41 | ENDCG
42 | }
43 | Fallback "Diffuse"
44 | }
--------------------------------------------------------------------------------
/Built-in/Built-in_StylizedWater_ShadowUtilities.cginc:
--------------------------------------------------------------------------------
1 | #ifndef SHADOW_UTILITIES
2 | #define SHADOW_UTILITIES
3 |
4 | // Returns the shadow-space coordinate for the given world-space position.
5 | float4 GetShadowCoordinate(float3 positionWS, float4 weights)
6 | {
7 | // Calculate the shadow coordinates for each cascade.
8 | float4 sc0 = mul(unity_WorldToShadow[0], float4(positionWS, 1));
9 | float4 sc1 = mul(unity_WorldToShadow[1], float4(positionWS, 1));
10 | float4 sc2 = mul(unity_WorldToShadow[2], float4(positionWS, 1));
11 | float4 sc3 = mul(unity_WorldToShadow[3], float4(positionWS, 1));
12 |
13 | // Get the final shadow coordinate by multiplying by the weights.
14 | return sc0 * weights.x + sc1 * weights.y + sc2 * weights.z + sc3 * weights.w;
15 | }
16 |
17 | float GetLightVisibility(sampler2D shadowMap, float3 positionWS, float maxDistance)
18 | {
19 | // Calculate the weights for each shadow cascade.
20 | float distFromCam = length(positionWS - _WorldSpaceCameraPos.xyz);
21 |
22 | // If we are beyond the edge of the shadow map, return 1.0 (no shadow).
23 | if (distFromCam > maxDistance)
24 | {
25 | return 1.0;
26 | }
27 |
28 | // Otherwise, calculate the weights...
29 | float4 near = float4 (distFromCam >= _LightSplitsNear);
30 | float4 far = float4 (distFromCam < _LightSplitsFar);
31 | float4 cascadeWeights = near * far;
32 |
33 | // ...and the shadow coordinate.
34 | float4 shadowCoord = GetShadowCoordinate(positionWS, cascadeWeights);
35 | // shadowCoord /= shadowCoord.w;
36 |
37 | // Then sample the shadow map and return whether the point is in shadow or not.
38 | return tex2Dproj(shadowMap, shadowCoord) < shadowCoord.z/shadowCoord.w;
39 | }
40 |
41 |
42 |
43 | #endif // SHADOW_UTILITIES
--------------------------------------------------------------------------------
/Built-in/Built-in_StylizedWater_WaterUtilities.cginc:
--------------------------------------------------------------------------------
1 | #ifndef WATER_UTILITIES
2 | #define WATER_UTILITIES
3 |
4 |
5 |
6 | // DEFINES.
7 | #define PI (3.1415926536)
8 |
9 |
10 |
11 | // Returns a simple waveform (to be used as a height offset) from the input wave parameters.
12 | float SimpleWave(float2 position, float2 direction, float wavelength, float amplitude, float speed)
13 | {
14 | float x = PI * dot(position, direction) / wavelength;
15 | float phase = speed * _Time.y;
16 | return amplitude * sin(x + phase);
17 | return amplitude * (1 - abs(sin(x + phase)));
18 | }
19 |
20 |
21 |
22 | // Pans the input uv in the given direction and speed.
23 | float2 Panner(float2 uv, float2 direction, float speed)
24 | {
25 | return uv + normalize(direction)*speed*_Time.y;
26 | }
27 |
28 |
29 |
30 | // Tiles a texture in an interesting wave-like way.
31 | // Inspired by the function of the same name in Unreal Engine.
32 | float3 MotionFourWayChaos(sampler2D tex, float2 uv, float speed, bool unpackNormal)
33 | {
34 | float2 uv1 = Panner(uv + float2(0.000, 0.000), float2( 0.1, 0.1), speed);
35 | float2 uv2 = Panner(uv + float2(0.418, 0.355), float2(-0.1, -0.1), speed);
36 | float2 uv3 = Panner(uv + float2(0.865, 0.148), float2(-0.1, 0.1), speed);
37 | float2 uv4 = Panner(uv + float2(0.651, 0.752), float2( 0.1, -0.1), speed);
38 |
39 | float3 sample1;
40 | float3 sample2;
41 | float3 sample3;
42 | float3 sample4;
43 |
44 | if (unpackNormal)
45 | {
46 | sample1 = UnpackNormal(tex2D(tex, uv1)).rgb;
47 | sample2 = UnpackNormal(tex2D(tex, uv2)).rgb;
48 | sample3 = UnpackNormal(tex2D(tex, uv3)).rgb;
49 | sample4 = UnpackNormal(tex2D(tex, uv4)).rgb;
50 |
51 | return normalize(sample1 + sample2 + sample3 + sample4);
52 | }
53 | else
54 | {
55 | sample1 = tex2D(tex, uv1).rgb;
56 | sample2 = tex2D(tex, uv2).rgb;
57 | sample3 = tex2D(tex, uv3).rgb;
58 | sample4 = tex2D(tex, uv4).rgb;
59 |
60 | return (sample1 + sample2 + sample3 + sample4) / 4.0;
61 | }
62 | }
63 |
64 |
65 | float3 MotionFourWaySparkle(sampler2D tex, float2 uv, float4 coordinateScale, float speed)
66 | {
67 | float2 uv1 = Panner(uv * coordinateScale.x, float2( 0.1, 0.1), speed);
68 | float2 uv2 = Panner(uv * coordinateScale.y, float2(-0.1, -0.1), speed);
69 | float2 uv3 = Panner(uv * coordinateScale.z, float2(-0.1, 0.1), speed);
70 | float2 uv4 = Panner(uv * coordinateScale.w, float2( 0.1, -0.1), speed);
71 |
72 | float3 sample1 = UnpackNormal(tex2D(tex, uv1)).rgb;
73 | float3 sample2 = UnpackNormal(tex2D(tex, uv2)).rgb;
74 | float3 sample3 = UnpackNormal(tex2D(tex, uv3)).rgb;
75 | float3 sample4 = UnpackNormal(tex2D(tex, uv4)).rgb;
76 |
77 | float3 normalA = float3(sample1.x, sample2.y, 1);
78 | float3 normalB = float3(sample3.x, sample4.y, 1);
79 |
80 | return normalize(float3( (normalA+normalB).xy, (normalA*normalB).z ));
81 | }
82 |
83 |
84 | #endif // WATER_UTILITIES
--------------------------------------------------------------------------------
/Built-in/README.txt:
--------------------------------------------------------------------------------
1 | ASE v1.9.15
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_BaseAdd.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/基础Additive"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_BaseColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend SrcAlpha One
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 |
29 |
30 | Pass
31 | {
32 | Name "Unlit"
33 |
34 | CGPROGRAM
35 |
36 |
37 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
38 | //only defining to not throw compilation error over Unity 5.5
39 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
40 | #endif
41 | #pragma vertex vert
42 | #pragma fragment frag
43 | #pragma multi_compile_instancing
44 | #include "UnityCG.cginc"
45 |
46 |
47 | struct appdata
48 | {
49 | float4 vertex : POSITION;
50 | float4 color : COLOR;
51 | float4 ase_texcoord : TEXCOORD0;
52 | UNITY_VERTEX_INPUT_INSTANCE_ID
53 | };
54 |
55 | struct v2f
56 | {
57 | float4 vertex : SV_POSITION;
58 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
59 | float3 worldPos : TEXCOORD0;
60 | #endif
61 | float4 ase_texcoord1 : TEXCOORD1;
62 | float4 ase_color : COLOR;
63 | UNITY_VERTEX_INPUT_INSTANCE_ID
64 | UNITY_VERTEX_OUTPUT_STEREO
65 | };
66 |
67 | uniform half4 _BaseColor;
68 | uniform sampler2D _MainTex;
69 | uniform half4 _MainTex_ST;
70 |
71 |
72 | v2f vert ( appdata v )
73 | {
74 | v2f o;
75 | UNITY_SETUP_INSTANCE_ID(v);
76 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
77 | UNITY_TRANSFER_INSTANCE_ID(v, o);
78 |
79 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
80 | o.ase_color = v.color;
81 |
82 | //setting value to unused interpolator channels and avoid initialization warnings
83 | o.ase_texcoord1.zw = 0;
84 | float3 vertexValue = float3(0, 0, 0);
85 | #if ASE_ABSOLUTE_VERTEX_POS
86 | vertexValue = v.vertex.xyz;
87 | #endif
88 | vertexValue = vertexValue;
89 | #if ASE_ABSOLUTE_VERTEX_POS
90 | v.vertex.xyz = vertexValue;
91 | #else
92 | v.vertex.xyz += vertexValue;
93 | #endif
94 | o.vertex = UnityObjectToClipPos(v.vertex);
95 |
96 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
97 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
98 | #endif
99 | return o;
100 | }
101 |
102 | fixed4 frag (v2f i ) : SV_Target
103 | {
104 | UNITY_SETUP_INSTANCE_ID(i);
105 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
106 | fixed4 finalColor;
107 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
108 | float3 WorldPosition = i.worldPos;
109 | #endif
110 | half2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
111 |
112 |
113 | finalColor = ( _BaseColor * tex2D( _MainTex, uv_MainTex ) * i.ase_color );
114 | return finalColor;
115 | }
116 | ENDCG
117 | }
118 | }
119 | CustomEditor "ASEMaterialInspector"
120 |
121 | Fallback Off
122 | }
123 | /*ASEBEGIN
124 | Version=19105
125 | Node;AmplifyShaderEditor.SamplerNode;1;-383,-20.5;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
126 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-594,3.5;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
127 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-55,-39.5;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
128 | Node;AmplifyShaderEditor.ColorNode;3;-300,-194.5;Inherit;False;Property;_BaseColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
129 | Node;AmplifyShaderEditor.VertexColorNode;4;-261,169.5;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
130 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;79,-39;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/基础Additive;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;8;5;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;False;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
131 | WireConnection;1;1;2;0
132 | WireConnection;5;0;3;0
133 | WireConnection;5;1;1;0
134 | WireConnection;5;2;4;0
135 | WireConnection;0;0;5;0
136 | ASEEND*/
137 | //CHKSM=D42732A3E293AB37C73AAF7851DC36D200A67AE1
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_BaseAlpha.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/基础AlphaBlend"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_BaseColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend SrcAlpha OneMinusSrcAlpha
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 |
29 |
30 |
31 | Pass
32 | {
33 | Name "Unlit"
34 |
35 | CGPROGRAM
36 |
37 |
38 |
39 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
40 | //only defining to not throw compilation error over Unity 5.5
41 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
42 | #endif
43 | #pragma vertex vert
44 | #pragma fragment frag
45 | #pragma multi_compile_instancing
46 | #include "UnityCG.cginc"
47 |
48 |
49 | struct appdata
50 | {
51 | float4 vertex : POSITION;
52 | float4 color : COLOR;
53 | float4 ase_texcoord : TEXCOORD0;
54 | UNITY_VERTEX_INPUT_INSTANCE_ID
55 | };
56 |
57 | struct v2f
58 | {
59 | float4 vertex : SV_POSITION;
60 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
61 | float3 worldPos : TEXCOORD0;
62 | #endif
63 | float4 ase_texcoord1 : TEXCOORD1;
64 | float4 ase_color : COLOR;
65 | UNITY_VERTEX_INPUT_INSTANCE_ID
66 | UNITY_VERTEX_OUTPUT_STEREO
67 | };
68 |
69 | uniform half4 _BaseColor;
70 | uniform sampler2D _MainTex;
71 | uniform half4 _MainTex_ST;
72 |
73 |
74 | v2f vert ( appdata v )
75 | {
76 | v2f o;
77 | UNITY_SETUP_INSTANCE_ID(v);
78 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
79 | UNITY_TRANSFER_INSTANCE_ID(v, o);
80 |
81 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
82 | o.ase_color = v.color;
83 |
84 | //setting value to unused interpolator channels and avoid initialization warnings
85 | o.ase_texcoord1.zw = 0;
86 | float3 vertexValue = float3(0, 0, 0);
87 | #if ASE_ABSOLUTE_VERTEX_POS
88 | vertexValue = v.vertex.xyz;
89 | #endif
90 | vertexValue = vertexValue;
91 | #if ASE_ABSOLUTE_VERTEX_POS
92 | v.vertex.xyz = vertexValue;
93 | #else
94 | v.vertex.xyz += vertexValue;
95 | #endif
96 | o.vertex = UnityObjectToClipPos(v.vertex);
97 |
98 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
99 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
100 | #endif
101 | return o;
102 | }
103 |
104 | fixed4 frag (v2f i ) : SV_Target
105 | {
106 | UNITY_SETUP_INSTANCE_ID(i);
107 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
108 | fixed4 finalColor;
109 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
110 | float3 WorldPosition = i.worldPos;
111 | #endif
112 | half2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
113 |
114 |
115 | finalColor = ( _BaseColor * tex2D( _MainTex, uv_MainTex ) * i.ase_color );
116 | return finalColor;
117 | }
118 | ENDCG
119 | }
120 | }
121 | CustomEditor "ASEMaterialInspector"
122 |
123 | Fallback Off
124 | }
125 | /*ASEBEGIN
126 | Version=19105
127 | Node;AmplifyShaderEditor.SamplerNode;1;-383,-20.5;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
128 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-594,3.5;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
129 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-55,-39.5;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
130 | Node;AmplifyShaderEditor.ColorNode;3;-300,-194.5;Inherit;False;Property;_BaseColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
131 | Node;AmplifyShaderEditor.VertexColorNode;4;-261,169.5;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
132 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;79,-39;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/基础AlphaBlend;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;False;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
133 | WireConnection;1;1;2;0
134 | WireConnection;5;0;3;0
135 | WireConnection;5;1;1;0
136 | WireConnection;5;2;4;0
137 | WireConnection;0;0;5;0
138 | ASEEND*/
139 | //CHKSM=665DF80AA56B71AB1D5AE372956EA1E982607205
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_ChormaHeat.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/色差热扭曲"
2 | {
3 | Properties
4 | {
5 | [Header(Heat)]
6 | _Distortion_Tex("热扭曲纹理", 2D) = "white" {}
7 | _DistortionU("热扭曲U速率", Float) = 0
8 | _DistortionV("热扭曲V速率", Float) = 0
9 | _Indensity("扭曲强度", Range(0.0, 1.0)) = 0.5
10 |
11 | [Header(Mask)]
12 | _AlphaTex("扭曲遮罩", 2D) = "white" {}
13 | _AlphaU("遮罩1U速率", Float) = 0
14 | _AlphaV("遮罩1V速率", Float) = 0
15 | _AlphaTex1("扭曲遮罩2", 2D) = "white" {}
16 | _AlphaTex1U("遮罩2U速率", Float) = 0
17 | _AlphaTex1V("遮罩2V速率", Float) = 0
18 |
19 | [Header(Refraction)]
20 | _IOR1("材质最小折射率", Float) = 1
21 | _IOR2("材质最大折射率", Float) = 1.4
22 | _ChromaticAberration("色差强度", Range(0.0, 0.5)) = 0.1
23 |
24 | [HideInInspector] _texcoord( "", 2D ) = "white" {}
25 | [HideInInspector] _texcoord2( "", 2D ) = "white" {}
26 | [HideInInspector] __dirty( "", Int ) = 1
27 | }
28 |
29 | SubShader
30 | {
31 | Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
32 | Cull Off
33 | GrabPass{ }
34 | CGPROGRAM
35 | #include "UnityShaderVariables.cginc"
36 | #pragma target 3.5
37 |
38 | #pragma multi_compile _ALPHAPREMULTIPLY_ON
39 |
40 | #pragma surface surf BlinnPhong alpha:fade keepalpha finalcolor:RefractionF noshadow exclude_path:deferred noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd
41 | struct Input
42 | {
43 | float2 uv_texcoord;
44 | float2 uv2_texcoord2;
45 | float4 vertexColor : COLOR;
46 | float4 screenPos;
47 | float3 worldPos;
48 | };
49 |
50 | uniform sampler2D _Distortion_Tex;
51 | uniform float4 _Distortion_Tex_ST;
52 | uniform float _DistortionU;
53 | uniform float _DistortionV;
54 | uniform float _Indensity;
55 | uniform sampler2D _GrabTexture;
56 | uniform float _ChromaticAberration;
57 | uniform float _IOR1;
58 | uniform float _IOR2;
59 | uniform sampler2D _AlphaTex;
60 | uniform float4 _AlphaTex_ST;
61 | uniform float _AlphaU;
62 | uniform float _AlphaV;
63 | uniform sampler2D _AlphaTex1;
64 | uniform float4 _AlphaTex1_ST;
65 | uniform float _AlphaTex1U;
66 | uniform float _AlphaTex1V;
67 |
68 | inline float4 Refraction( Input i, SurfaceOutput o, float indexOfRefraction, float chomaticAberration ) {
69 | float3 worldNormal = o.Normal;
70 | float4 screenPos = i.screenPos;
71 | #if UNITY_UV_STARTS_AT_TOP
72 | float scale = -1.0;
73 | #else
74 | float scale = 1.0;
75 | #endif
76 | float halfPosW = screenPos.w * 0.5;
77 | screenPos.y = ( screenPos.y - halfPosW ) * _ProjectionParams.x * scale + halfPosW;
78 | #if SHADER_API_D3D9 || SHADER_API_D3D11
79 | screenPos.w += 0.00000000001;
80 | #endif
81 | float2 projScreenPos = ( screenPos / screenPos.w ).xy;
82 | float3 worldViewDir = normalize( UnityWorldSpaceViewDir( i.worldPos ) );
83 | float3 refractionOffset = ( ( ( ( indexOfRefraction - 1.0 ) * mul( UNITY_MATRIX_V, float4( worldNormal, 0.0 ) ) ) * ( 1.0 / ( screenPos.z + 1.0 ) ) ) * ( 1.0 - dot( worldNormal, worldViewDir ) ) );
84 | float2 cameraRefraction = float2( refractionOffset.x, -( refractionOffset.y * _ProjectionParams.x ) );
85 | float4 redAlpha = tex2D( _GrabTexture, ( projScreenPos + cameraRefraction ) );
86 | float green = tex2D( _GrabTexture, ( projScreenPos + ( cameraRefraction * ( 1.0 - chomaticAberration ) ) ) ).g;
87 | float blue = tex2D( _GrabTexture, ( projScreenPos + ( cameraRefraction * ( 1.0 + chomaticAberration ) ) ) ).b;
88 | return float4( redAlpha.r, green, blue, redAlpha.a );
89 | }
90 |
91 | void RefractionF( Input i, SurfaceOutput o, inout half4 color )
92 | {
93 | #ifdef UNITY_PASS_FORWARDBASE
94 | float temp_output_63_0 = ( i.vertexColor.a * _Indensity );
95 | float2 uv0_AlphaTex = i.uv_texcoord * _AlphaTex_ST.xy + _AlphaTex_ST.zw;
96 | float2 uv1_AlphaTex = i.uv2_texcoord2 * _AlphaTex_ST.xy + _AlphaTex_ST.zw;
97 |
98 | float2 staticSwitch72 = uv0_AlphaTex;
99 |
100 | float2 appendResult46 = (float2(_AlphaU , _AlphaV));
101 | float3 desaturateInitialColor65 = tex2D( _AlphaTex, ( staticSwitch72 + ( _Time.y * appendResult46 ) ) ).rgb;
102 | float desaturateDot65 = dot( desaturateInitialColor65, float3( 0.299, 0.587, 0.114 ));
103 | float3 desaturateVar65 = lerp( desaturateInitialColor65, desaturateDot65.xxx, 0.0 );
104 |
105 | float2 uv0_AlphaTex1 = i.uv_texcoord * _AlphaTex1_ST.xy + _AlphaTex1_ST.zw;
106 | float2 staticSwitch82 = uv0_AlphaTex1;
107 |
108 | float2 appendResult80 = (float2(_AlphaTex1U , _AlphaTex1V));
109 | float3 desaturateInitialColor87 = tex2D( _AlphaTex1, ( staticSwitch82 + ( _Time.y * appendResult80 ) ) ).rgb;
110 | float desaturateDot87 = dot( desaturateInitialColor87, float3( 0.299, 0.587, 0.114 ));
111 | float3 desaturateVar87 = lerp( desaturateInitialColor87, desaturateDot87.xxx, 1.0 );
112 |
113 | float lerpResult67 = lerp( _IOR1 , _IOR2 , ( temp_output_63_0 * desaturateVar65 * (desaturateVar87).x).x);
114 | color.rgb = color.rgb + Refraction( i, o, lerpResult67, _ChromaticAberration ) * ( 1 - color.a );
115 | color.a = 1;
116 | #endif
117 | }
118 |
119 | void surf( Input i , inout SurfaceOutput o )
120 | {
121 | o.Normal = float3(0,0,1);
122 | float2 uv0_Distortion_Tex = i.uv_texcoord * _Distortion_Tex_ST.xy + _Distortion_Tex_ST.zw;
123 |
124 | float2 staticSwitch70 = uv0_Distortion_Tex;
125 |
126 | float2 appendResult3 = (float2(_DistortionU , _DistortionV));
127 | float temp_output_63_0 = ( i.vertexColor.a * _Indensity );
128 | float4 lerpResult60 = lerp( float4( float3(0,0,1) , 0.0 ) , tex2D( _Distortion_Tex, ( staticSwitch70 + ( _Time.y * appendResult3 ) ) ) , temp_output_63_0);
129 | o.Normal = lerpResult60.rgb;
130 | o.Alpha = 0.0;
131 | o.Normal = o.Normal + 0.00001 * i.screenPos * i.worldPos;
132 | }
133 |
134 | ENDCG
135 | }
136 | Fallback "Diffuse"
137 | }
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_DoubleFresnel.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/简易双层菲涅尔_Fresnel"
2 | {
3 | Properties
4 | {
5 | [HDR]_RimColor ("边缘颜色", Color) = (1.0,1.0,1.0,1.0)
6 | [HDR]_InnerColor ("内部颜色", Color) = (1.0,1.0,1.0,1.0)
7 | _AlphaPower ("内部颜色范围", Range(0.0,8.0)) = 4.0
8 | _InnerColorPower ("内部颜色强度", Range(0.0,1.0)) = 0.5
9 | _RimPower ("边缘颜色范围", Range(0.0,5.0)) = 4
10 | _AllPower ("整体强度", Range(0.0, 10.0)) = 1.0
11 | }
12 |
13 | SubShader
14 | {
15 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
16 | LOD 100
17 |
18 | ZWrite Off
19 | Blend SrcAlpha One
20 |
21 | //surface着色器,此处不能使用Pass块
22 | CGPROGRAM
23 | #pragma surface surf Lambert alpha
24 |
25 | struct Input
26 | {
27 | float3 viewDir;
28 | INTERNAL_DATA
29 | };
30 |
31 | float4 _RimColor;
32 | float4 _InnerColor;
33 | half _AlphaPower;
34 | half _InnerColorPower;
35 | half _RimPower;
36 | half _AllPower;
37 |
38 | //边缘光计算
39 | void surf (Input IN, inout SurfaceOutput o)
40 | {
41 | half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
42 | o.Emission = _RimColor.rgb * pow (rim, _RimPower)*_AllPower+(_InnerColor.rgb*2*_InnerColorPower);
43 | o.Alpha = (pow (rim, _AlphaPower))*_AllPower;
44 | }
45 | ENDCG
46 | }
47 | Fallback "Off"
48 | }
49 |
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_FresnelShield.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/特殊制作/简易菲尼尔护盾"
4 | {
5 | Properties
6 | {
7 | [Enum(Addtive,1,AlphaBlend,10)]_BlendMode("混合模式", Float) = 0
8 | [Enum(UnityEngine.Rendering.CullMode)]_CullingMode("剔除模式", Float) = 0
9 | [HDR]_Color0("主颜色", Color) = (1,1,1,1)
10 | _TextureSample0("流动纹理", 2D) = "white" {}
11 | [KeywordEnum(R,A)] _Keyword0("切换贴图通道", Float) = 0
12 | Uspeed("U速度", Float) = 0
13 | _Vspeed("V速度", Float) = 0
14 | _Freset("菲涅尔整体/边缘/强度", Vector) = (0,1,5,0)
15 |
16 | }
17 |
18 | SubShader
19 | {
20 |
21 |
22 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
23 | LOD 100
24 |
25 | CGINCLUDE
26 | #pragma target 3.0
27 | ENDCG
28 | Blend SrcAlpha [_BlendMode]
29 | AlphaToMask Off
30 | Cull [_CullingMode]
31 | ColorMask RGBA
32 | ZWrite On
33 | ZTest LEqual
34 | Offset 0 , 0
35 |
36 |
37 |
38 | Pass
39 | {
40 | Name "Unlit"
41 |
42 | CGPROGRAM
43 |
44 |
45 |
46 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
47 | //only defining to not throw compilation error over Unity 5.5
48 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
49 | #endif
50 | #pragma vertex vert
51 | #pragma fragment frag
52 | #pragma multi_compile_instancing
53 | #include "UnityCG.cginc"
54 | #include "UnityShaderVariables.cginc"
55 | #define ASE_NEEDS_FRAG_WORLD_POSITION
56 | #pragma shader_feature_local _KEYWORD0_R _KEYWORD0_A
57 |
58 |
59 | struct appdata
60 | {
61 | float4 vertex : POSITION;
62 | float4 color : COLOR;
63 | float4 ase_texcoord : TEXCOORD0;
64 | float3 ase_normal : NORMAL;
65 | UNITY_VERTEX_INPUT_INSTANCE_ID
66 | };
67 |
68 | struct v2f
69 | {
70 | float4 vertex : SV_POSITION;
71 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
72 | float3 worldPos : TEXCOORD0;
73 | #endif
74 | float4 ase_color : COLOR;
75 | float4 ase_texcoord1 : TEXCOORD1;
76 | float4 ase_texcoord2 : TEXCOORD2;
77 | UNITY_VERTEX_INPUT_INSTANCE_ID
78 | UNITY_VERTEX_OUTPUT_STEREO
79 | };
80 |
81 | uniform float _CullingMode;
82 | uniform float _BlendMode;
83 | uniform float4 _Color0;
84 | uniform sampler2D _TextureSample0;
85 | uniform float Uspeed;
86 | uniform float _Vspeed;
87 | uniform float4 _TextureSample0_ST;
88 | uniform float3 _Freset;
89 |
90 |
91 | v2f vert ( appdata v )
92 | {
93 | v2f o;
94 | UNITY_SETUP_INSTANCE_ID(v);
95 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
96 | UNITY_TRANSFER_INSTANCE_ID(v, o);
97 |
98 | float3 ase_worldNormal = UnityObjectToWorldNormal(v.ase_normal);
99 | o.ase_texcoord2.xyz = ase_worldNormal;
100 |
101 | o.ase_color = v.color;
102 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
103 |
104 | //setting value to unused interpolator channels and avoid initialization warnings
105 | o.ase_texcoord1.zw = 0;
106 | o.ase_texcoord2.w = 0;
107 | float3 vertexValue = float3(0, 0, 0);
108 | #if ASE_ABSOLUTE_VERTEX_POS
109 | vertexValue = v.vertex.xyz;
110 | #endif
111 | vertexValue = vertexValue;
112 | #if ASE_ABSOLUTE_VERTEX_POS
113 | v.vertex.xyz = vertexValue;
114 | #else
115 | v.vertex.xyz += vertexValue;
116 | #endif
117 | o.vertex = UnityObjectToClipPos(v.vertex);
118 |
119 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
120 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
121 | #endif
122 | return o;
123 | }
124 |
125 | fixed4 frag (v2f i ) : SV_Target
126 | {
127 | UNITY_SETUP_INSTANCE_ID(i);
128 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
129 | fixed4 finalColor;
130 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
131 | float3 WorldPosition = i.worldPos;
132 | #endif
133 | float2 appendResult18 = (float2(Uspeed , _Vspeed));
134 | float2 uv_TextureSample0 = i.ase_texcoord1.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
135 | float2 panner9 = ( 1.0 * _Time.y * appendResult18 + uv_TextureSample0);
136 | float4 tex2DNode4 = tex2D( _TextureSample0, panner9 );
137 | #if defined(_KEYWORD0_R)
138 | float staticSwitch5 = tex2DNode4.r;
139 | #elif defined(_KEYWORD0_A)
140 | float staticSwitch5 = tex2DNode4.a;
141 | #else
142 | float staticSwitch5 = tex2DNode4.r;
143 | #endif
144 | float3 ase_worldViewDir = UnityWorldSpaceViewDir(WorldPosition);
145 | ase_worldViewDir = normalize(ase_worldViewDir);
146 | float3 ase_worldNormal = i.ase_texcoord2.xyz;
147 | float fresnelNdotV1 = dot( ase_worldNormal, ase_worldViewDir );
148 | float fresnelNode1 = ( _Freset.x + _Freset.y * pow( 1.0 - fresnelNdotV1, _Freset.z ) );
149 |
150 |
151 | finalColor = ( i.ase_color * _Color0 * staticSwitch5 * saturate( fresnelNode1 ) );
152 | return finalColor;
153 | }
154 | ENDCG
155 | }
156 | }
157 | CustomEditor "ASEMaterialInspector"
158 |
159 | Fallback Off
160 | }
161 | /*ASEBEGIN
162 | Version=19105
163 | Node;AmplifyShaderEditor.CommentaryNode;27;-491.0801,102.9186;Inherit;False;272;133;Comment;2;26;25;设置;1,1,1,1;0;0
164 | Node;AmplifyShaderEditor.PannerNode;9;-962.3602,-139.4378;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
165 | Node;AmplifyShaderEditor.RangedFloatNode;20;-1263.08,57.91864;Inherit;False;Property;_Vspeed;V速度;7;0;Create;False;0;0;0;False;0;False;0;-0.2;0;0;0;1;FLOAT;0
166 | Node;AmplifyShaderEditor.RangedFloatNode;19;-1259.08,-19.08136;Inherit;False;Property;Uspeed;U速度;6;0;Create;False;0;0;0;False;0;False;0;0.2;0;0;0;1;FLOAT;0
167 | Node;AmplifyShaderEditor.DynamicAppendNode;18;-1120.08,5.91864;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
168 | Node;AmplifyShaderEditor.TextureCoordinatesNode;8;-1252.36,-144.4378;Inherit;False;0;4;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
169 | Node;AmplifyShaderEditor.SamplerNode;4;-789.4805,-167.8778;Inherit;True;Property;_TextureSample0;流动纹理;4;0;Create;False;0;0;0;False;0;False;-1;None;0222f30b8947b4a47b30891c67383f40;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
170 | Node;AmplifyShaderEditor.StaticSwitch;5;-483.3632,-96.14751;Inherit;False;Property;_Keyword0;切换贴图通道;5;0;Create;False;0;0;0;False;0;False;0;0;0;True;;KeywordEnum;2;R;A;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
171 | Node;AmplifyShaderEditor.FresnelNode;1;-790.2618,21.78886;Inherit;True;Standard;WorldNormal;ViewDir;False;False;5;0;FLOAT3;0,0,1;False;4;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
172 | Node;AmplifyShaderEditor.SaturateNode;2;-499.1979,22.81381;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
173 | Node;AmplifyShaderEditor.Vector3Node;22;-996.0801,40.91864;Inherit;False;Property;_Freset;菲涅尔整体/边缘/强度;8;0;Create;False;0;0;0;False;0;False;0,1,5;0,1,5;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
174 | Node;AmplifyShaderEditor.ColorNode;7;-502.3796,-270.7159;Inherit;False;Property;_Color0;主颜色;3;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,261.0196,1024,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
175 | Node;AmplifyShaderEditor.VertexColorNode;6;-469.94,-439.4973;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
176 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-268.1979,-138.1862;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
177 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;-137.8,-139.3001;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/特殊制作/简易菲尼尔护盾;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;True;_BlendMode;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;True;True;0;True;_CullingMode;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
178 | Node;AmplifyShaderEditor.RangedFloatNode;26;-347.0801,149.9186;Inherit;False;Property;_BlendMode;混合模式;1;1;[Enum];Create;False;0;2;Addtive;1;AlphaBlend;10;0;True;0;False;0;1;0;0;0;1;FLOAT;0
179 | Node;AmplifyShaderEditor.RangedFloatNode;25;-475.0801,149.9186;Inherit;False;Property;_CullingMode;剔除模式;2;1;[Enum];Create;False;0;1;Option1;0;1;UnityEngine.Rendering.CullMode;True;0;False;0;2;0;0;0;1;FLOAT;0
180 | WireConnection;9;0;8;0
181 | WireConnection;9;2;18;0
182 | WireConnection;18;0;19;0
183 | WireConnection;18;1;20;0
184 | WireConnection;4;1;9;0
185 | WireConnection;5;1;4;1
186 | WireConnection;5;0;4;4
187 | WireConnection;1;1;22;1
188 | WireConnection;1;2;22;2
189 | WireConnection;1;3;22;3
190 | WireConnection;2;0;1;0
191 | WireConnection;3;0;6;0
192 | WireConnection;3;1;7;0
193 | WireConnection;3;2;5;0
194 | WireConnection;3;3;2;0
195 | WireConnection;16;0;3;0
196 | ASEEND*/
197 | //CHKSM=54657A8437EB7B7D76F5279600CAD1CEED30911D
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_GenerateDot.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/通用程序粒子"
4 | {
5 | Properties
6 | {
7 | [HDR]_BaseColor("颜色 (辉光)", Color) = (1,1,1,1)
8 | _MaskPow("光点范围", Range( 0 , 1)) = 0.5
9 | _DotPwr("光点亮度", Range( 0 , 1)) = 0.3
10 |
11 | }
12 |
13 | SubShader
14 | {
15 |
16 |
17 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
18 | LOD 100
19 |
20 | CGINCLUDE
21 | #pragma target 3.0
22 | ENDCG
23 | Blend SrcAlpha One
24 | AlphaToMask Off
25 | Cull Back
26 | ColorMask RGBA
27 | ZWrite Off
28 | ZTest LEqual
29 | Offset 0 , 0
30 |
31 |
32 |
33 | Pass
34 | {
35 | Name "Unlit"
36 |
37 | CGPROGRAM
38 |
39 |
40 |
41 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
42 | //only defining to not throw compilation error over Unity 5.5
43 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
44 | #endif
45 | #pragma vertex vert
46 | #pragma fragment frag
47 | #pragma multi_compile_instancing
48 | #include "UnityCG.cginc"
49 |
50 |
51 | struct appdata
52 | {
53 | float4 vertex : POSITION;
54 | float4 color : COLOR;
55 | float4 ase_texcoord : TEXCOORD0;
56 | UNITY_VERTEX_INPUT_INSTANCE_ID
57 | };
58 |
59 | struct v2f
60 | {
61 | float4 vertex : SV_POSITION;
62 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
63 | float3 worldPos : TEXCOORD0;
64 | #endif
65 | float4 ase_color : COLOR;
66 | float4 ase_texcoord1 : TEXCOORD1;
67 | UNITY_VERTEX_INPUT_INSTANCE_ID
68 | UNITY_VERTEX_OUTPUT_STEREO
69 | };
70 |
71 | uniform half _MaskPow;
72 | uniform half _DotPwr;
73 | uniform half4 _BaseColor;
74 |
75 |
76 | v2f vert ( appdata v )
77 | {
78 | v2f o;
79 | UNITY_SETUP_INSTANCE_ID(v);
80 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
81 | UNITY_TRANSFER_INSTANCE_ID(v, o);
82 |
83 | o.ase_color = v.color;
84 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
85 |
86 | //setting value to unused interpolator channels and avoid initialization warnings
87 | o.ase_texcoord1.zw = 0;
88 | float3 vertexValue = float3(0, 0, 0);
89 | #if ASE_ABSOLUTE_VERTEX_POS
90 | vertexValue = v.vertex.xyz;
91 | #endif
92 | vertexValue = vertexValue;
93 | #if ASE_ABSOLUTE_VERTEX_POS
94 | v.vertex.xyz = vertexValue;
95 | #else
96 | v.vertex.xyz += vertexValue;
97 | #endif
98 | o.vertex = UnityObjectToClipPos(v.vertex);
99 |
100 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
101 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
102 | #endif
103 | return o;
104 | }
105 |
106 | fixed4 frag (v2f i ) : SV_Target
107 | {
108 | UNITY_SETUP_INSTANCE_ID(i);
109 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
110 | fixed4 finalColor;
111 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
112 | float3 WorldPosition = i.worldPos;
113 | #endif
114 | half2 texCoord29 = i.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
115 |
116 |
117 | finalColor = ( i.ase_color * saturate( ( pow( ( 1.0 - distance( texCoord29 , half2( 0.5,0.5 ) ) ) , (5.0 + (_MaskPow - 0.0) * (50.0 - 5.0) / (1.0 - 0.0)) ) * (0.0 + (_DotPwr - 0.0) * (5.0 - 0.0) / (1.0 - 0.0)) ) ) * _BaseColor );
118 | return finalColor;
119 | }
120 | ENDCG
121 | }
122 | }
123 | CustomEditor "ASEMaterialInspector"
124 |
125 | Fallback Off
126 | }
127 | /*ASEBEGIN
128 | Version=19105
129 | Node;AmplifyShaderEditor.PowerNode;36;-1225.115,26.30396;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
130 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-1085.116,27.30396;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
131 | Node;AmplifyShaderEditor.SaturateNode;40;-954.6964,27.07692;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
132 | Node;AmplifyShaderEditor.VertexColorNode;3;-953.3826,-138.9149;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
133 | Node;AmplifyShaderEditor.ColorNode;88;-991.5688,241.5534;Inherit;False;Property;_BaseColor;颜色 (辉光);0;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
134 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;83;-763.886,2.751457;Inherit;True;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
135 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;-561.4608,3.1063;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/通用程序粒子;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;8;5;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
136 | Node;AmplifyShaderEditor.TextureCoordinatesNode;29;-2088,-39;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
137 | Node;AmplifyShaderEditor.Vector2Node;31;-2030,78;Inherit;False;Constant;_uvdotcenter;uvdotcenter;6;0;Create;True;0;0;0;False;0;False;0.5,0.5;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
138 | Node;AmplifyShaderEditor.DistanceOpNode;30;-1863,-39;Inherit;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT;0
139 | Node;AmplifyShaderEditor.OneMinusNode;32;-1660,-39;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
140 | Node;AmplifyShaderEditor.RangedFloatNode;38;-1659.245,215.5872;Inherit;False;Property;_DotPwr;光点亮度;2;0;Create;False;0;0;0;False;0;False;0.3;1;0;1;0;1;FLOAT;0
141 | Node;AmplifyShaderEditor.TFHCRemapNode;106;-1398.727,220.7395;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;5;False;1;FLOAT;0
142 | Node;AmplifyShaderEditor.RangedFloatNode;34;-1664.114,46.30202;Inherit;False;Property;_MaskPow;光点范围;1;0;Create;False;0;0;0;False;0;False;0.5;0;0;1;0;1;FLOAT;0
143 | Node;AmplifyShaderEditor.TFHCRemapNode;107;-1398.727,50.7395;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;4;FLOAT;50;False;1;FLOAT;0
144 | WireConnection;36;0;32;0
145 | WireConnection;36;1;107;0
146 | WireConnection;37;0;36;0
147 | WireConnection;37;1;106;0
148 | WireConnection;40;0;37;0
149 | WireConnection;83;0;3;0
150 | WireConnection;83;1;40;0
151 | WireConnection;83;2;88;0
152 | WireConnection;0;0;83;0
153 | WireConnection;30;0;29;0
154 | WireConnection;30;1;31;0
155 | WireConnection;32;0;30;0
156 | WireConnection;106;0;38;0
157 | WireConnection;107;0;34;0
158 | ASEEND*/
159 | //CHKSM=6836C76E144FB9A8C6904F78FE35606F23087C0B
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_PixelArt.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/特殊制作/像素风格化"
4 | {
5 | Properties
6 | {
7 | _MainTexU("主纹理", 2D) = "white" {}
8 | [HDR]_MainColor("主颜色", Color) = (1,1,1,1)
9 | [Enum(Dot,0,Pixel,1)]_PixelMode("像素风格", Float) = 0
10 | _DotSize("点状大小", Range( 0 , 1)) = 1
11 | _PixelSize("方块大小", Range( 0 , 1)) = 1
12 |
13 | }
14 |
15 | SubShader
16 | {
17 |
18 |
19 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
20 | LOD 100
21 |
22 | CGINCLUDE
23 | #pragma target 3.0
24 | ENDCG
25 | Blend SrcAlpha OneMinusSrcAlpha
26 | AlphaToMask Off
27 | Cull Back
28 | ColorMask RGBA
29 | ZWrite Off
30 | ZTest LEqual
31 | Offset 0 , 0
32 |
33 |
34 |
35 | Pass
36 | {
37 | Name "Unlit"
38 |
39 | CGPROGRAM
40 |
41 |
42 |
43 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
44 | //only defining to not throw compilation error over Unity 5.5
45 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
46 | #endif
47 | #pragma vertex vert
48 | #pragma fragment frag
49 | #pragma multi_compile_instancing
50 | #include "UnityCG.cginc"
51 |
52 |
53 | struct appdata
54 | {
55 | float4 vertex : POSITION;
56 | float4 color : COLOR;
57 | float4 ase_texcoord : TEXCOORD0;
58 | UNITY_VERTEX_INPUT_INSTANCE_ID
59 | };
60 |
61 | struct v2f
62 | {
63 | float4 vertex : SV_POSITION;
64 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
65 | float3 worldPos : TEXCOORD0;
66 | #endif
67 | float4 ase_texcoord1 : TEXCOORD1;
68 | float4 ase_color : COLOR;
69 | UNITY_VERTEX_INPUT_INSTANCE_ID
70 | UNITY_VERTEX_OUTPUT_STEREO
71 | };
72 |
73 | uniform sampler2D _MainTexU;
74 | uniform float4 _MainTexU_ST;
75 | uniform float _PixelSize;
76 | uniform float _DotSize;
77 | uniform float _PixelMode;
78 | uniform float4 _MainColor;
79 |
80 |
81 | v2f vert ( appdata v )
82 | {
83 | v2f o;
84 | UNITY_SETUP_INSTANCE_ID(v);
85 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
86 | UNITY_TRANSFER_INSTANCE_ID(v, o);
87 |
88 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
89 | o.ase_color = v.color;
90 |
91 | //setting value to unused interpolator channels and avoid initialization warnings
92 | o.ase_texcoord1.zw = 0;
93 | float3 vertexValue = float3(0, 0, 0);
94 | #if ASE_ABSOLUTE_VERTEX_POS
95 | vertexValue = v.vertex.xyz;
96 | #endif
97 | vertexValue = vertexValue;
98 | #if ASE_ABSOLUTE_VERTEX_POS
99 | v.vertex.xyz = vertexValue;
100 | #else
101 | v.vertex.xyz += vertexValue;
102 | #endif
103 | o.vertex = UnityObjectToClipPos(v.vertex);
104 |
105 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
106 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
107 | #endif
108 | return o;
109 | }
110 |
111 | fixed4 frag (v2f i ) : SV_Target
112 | {
113 | UNITY_SETUP_INSTANCE_ID(i);
114 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
115 | fixed4 finalColor;
116 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
117 | float3 WorldPosition = i.worldPos;
118 | #endif
119 | float2 uv_MainTexU = i.ase_texcoord1.xy * _MainTexU_ST.xy + _MainTexU_ST.zw;
120 | float temp_output_23_0 = (25.0 + (_PixelSize - 0.0) * (125.0 - 25.0) / (1.0 - 0.0));
121 | float2 appendResult19 = (float2(temp_output_23_0 , temp_output_23_0));
122 | float2 temp_output_5_0 = ( uv_MainTexU * appendResult19 );
123 | float2 appendResult11_g1 = (float2(_DotSize , _DotSize));
124 | float temp_output_17_0_g1 = length( ( (frac( temp_output_5_0 )*2.0 + -1.0) / appendResult11_g1 ) );
125 | float4 tex2DNode2 = tex2D( _MainTexU, ( floor( temp_output_5_0 ) / appendResult19 ) );
126 | float4 lerpResult12 = lerp( ( saturate( ( ( 1.0 - temp_output_17_0_g1 ) / fwidth( temp_output_17_0_g1 ) ) ) * tex2DNode2 * 1.2 ) , tex2DNode2 , _PixelMode);
127 |
128 |
129 | finalColor = ( lerpResult12 * _MainColor * i.ase_color );
130 | return finalColor;
131 | }
132 | ENDCG
133 | }
134 | }
135 | CustomEditor "ASEMaterialInspector"
136 |
137 | Fallback Off
138 | }
139 | /*ASEBEGIN
140 | Version=19105
141 | Node;AmplifyShaderEditor.TFHCRemapNode;23;-1623.676,-227.7656;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;25;False;4;FLOAT;125;False;1;FLOAT;0
142 | Node;AmplifyShaderEditor.RangedFloatNode;18;-1889.048,-232.9345;Inherit;False;Property;_PixelSize;方块大小;4;0;Create;False;0;0;0;False;0;False;1;0.170647;0;1;0;1;FLOAT;0
143 | Node;AmplifyShaderEditor.DynamicAppendNode;19;-1443.048,-233.9345;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
144 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-1306.381,-354.7614;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
145 | Node;AmplifyShaderEditor.FloorOpNode;7;-1175.302,-297.9638;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
146 | Node;AmplifyShaderEditor.FractNode;9;-1176.831,-398.0928;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
147 | Node;AmplifyShaderEditor.TextureCoordinatesNode;4;-1530.459,-360.0124;Inherit;False;0;2;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
148 | Node;AmplifyShaderEditor.SimpleDivideOpNode;8;-1045.204,-257.516;Inherit;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
149 | Node;AmplifyShaderEditor.FunctionNode;10;-765.5698,-398.1295;Inherit;True;Ellipse;-1;;1;3ba94b7b3cfd5f447befde8107c04d52;0;3;2;FLOAT2;0,0;False;7;FLOAT;1;False;9;FLOAT;1;False;1;FLOAT;0
150 | Node;AmplifyShaderEditor.RangedFloatNode;17;-1059.205,-341.7161;Inherit;False;Property;_DotSize;点状大小;3;0;Create;False;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
151 | Node;AmplifyShaderEditor.ColorNode;3;-682.2053,8.664253;Inherit;False;Property;_MainColor;主颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
152 | Node;AmplifyShaderEditor.VertexColorNode;24;-640.9358,182.0977;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
153 | Node;AmplifyShaderEditor.LerpOp;12;-280.8899,-202.0647;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
154 | Node;AmplifyShaderEditor.RangedFloatNode;22;-677.9973,-474.7273;Inherit;False;Constant;_EllipseFix;EllipseFix;5;0;Create;True;0;0;0;False;0;False;1.2;0;0;0;0;1;FLOAT;0
155 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-441.879,-398.2892;Inherit;False;3;3;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
156 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;1;-125.8516,-201.8515;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
157 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;1.59138,-201.6713;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/特殊制作/像素风格化;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
158 | Node;AmplifyShaderEditor.SamplerNode;2;-770.2028,-181.0747;Inherit;True;Property;_MainTexU;主纹理;0;0;Create;False;0;0;0;False;0;False;-1;None;14b5f663e1f1907429ef0238a746aaff;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
159 | Node;AmplifyShaderEditor.RangedFloatNode;13;-413.1895,-159.1645;Inherit;False;Property;_PixelMode;像素风格;2;1;[Enum];Create;False;0;2;Dot;0;Pixel;1;0;False;0;False;0;1;0;0;0;1;FLOAT;0
160 | WireConnection;23;0;18;0
161 | WireConnection;19;0;23;0
162 | WireConnection;19;1;23;0
163 | WireConnection;5;0;4;0
164 | WireConnection;5;1;19;0
165 | WireConnection;7;0;5;0
166 | WireConnection;9;0;5;0
167 | WireConnection;8;0;7;0
168 | WireConnection;8;1;19;0
169 | WireConnection;10;2;9;0
170 | WireConnection;10;7;17;0
171 | WireConnection;10;9;17;0
172 | WireConnection;12;0;11;0
173 | WireConnection;12;1;2;0
174 | WireConnection;12;2;13;0
175 | WireConnection;11;0;10;0
176 | WireConnection;11;1;2;0
177 | WireConnection;11;2;22;0
178 | WireConnection;1;0;12;0
179 | WireConnection;1;1;3;0
180 | WireConnection;1;2;24;0
181 | WireConnection;0;0;1;0
182 | WireConnection;2;1;8;0
183 | ASEEND*/
184 | //CHKSM=6E0EE989A7E0E4F6A101A61C6FEB13713B23BBE7
--------------------------------------------------------------------------------
/Built-in/Soung_Built-in_SimpleToon.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/进阶功能/简易卡通着色器"
2 | {
3 | Properties
4 | {
5 | [Header(BaseColor)]
6 | [HDR]_Color("基础颜色", Color) = (1,1,1,1)
7 | _MainTex("漫反射(RGB)", 2D) = "white" {}
8 | [Normal]_Normal("法线贴图", 2D) = "bump" {}
9 | _LightCutoff("光照范围", Range(0,1)) = 0.5
10 | _ShadowBands("阴影过渡", Range(1,4)) = 1
11 |
12 | [Header(Specular)]
13 | _SpecularMap("高光反射", 2D) = "white" {}
14 | _Glossiness("光滑度", Range(0,1)) = 0.5
15 | [HDR]_SpecularColor("高光颜色", Color) = (0,0,0,1)
16 |
17 | [Header(Rim)]
18 | _RimSize("描边大小", Range(0,1)) = 0
19 | [HDR]_RimColor("描边颜色", Color) = (0,0,0,1)
20 | [Toggle(SHADOWED_RIM)]
21 | _ShadowedRim("阴影影响描边", float) = 0
22 |
23 | [Header(Emission)]
24 | [HDR]_Emission("自发光颜色", Color) = (0,0,0,1)
25 | }
26 | SubShader
27 | {
28 | Tags { "RenderType" = "Opaque" }
29 | ZWrite On
30 |
31 | Pass
32 | {
33 | Tags { "LightMode" = "ForwardBase" }
34 |
35 | CGPROGRAM
36 |
37 | #pragma multi_compile_fwdbase
38 | #pragma shader_feature SHADOWED_RIM
39 | #pragma target 3.0
40 |
41 | #pragma vertex vert
42 | #pragma fragment frag
43 | #include "UnityCG.cginc"
44 | #include "Lighting.cginc"
45 | #include "AutoLight.cginc"
46 |
47 | fixed4 _Color;
48 | sampler2D _MainTex;
49 | float4 _MainTex_ST;
50 | sampler2D _Normal;
51 | float _LightCutoff;
52 | float _ShadowBands;
53 |
54 | sampler2D _SpecularMap;
55 | float4 _SpecularMap_ST;
56 | half _Glossiness;
57 | fixed4 _SpecularColor;
58 |
59 | float _RimSize;
60 | fixed4 _RimColor;
61 | fixed4 _Emission;
62 |
63 | struct a2v
64 | {
65 | float4 vertex : POSITION;
66 | float3 normal : NORMAL;
67 | float4 tangent : TANGENT;
68 | float4 texcoord : TEXCOORD0;
69 | };
70 |
71 | struct v2f
72 | {
73 | float4 pos : SV_POSITION;
74 | float4 uv : TEXCOORD0;
75 | float4 TtoW0 : TEXCOORD1;
76 | float4 TtoW1 : TEXCOORD2;
77 | float4 TtoW2 : TEXCOORD3;
78 | SHADOW_COORDS(4)
79 | };
80 |
81 | v2f vert(a2v v)
82 | {
83 | v2f o;
84 | o.pos = UnityObjectToClipPos(v.vertex);
85 |
86 | o.uv.xy = v.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
87 | o.uv.zw = v.texcoord.xy * _SpecularMap_ST.xy + _SpecularMap_ST.zw;
88 |
89 | float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
90 | fixed3 worldNormal = UnityObjectToWorldNormal(v.normal);
91 | fixed3 worldTangent = UnityObjectToWorldDir(v.tangent.xyz);
92 | fixed3 worldBinormal = cross(worldNormal, worldTangent) * v.tangent.w;
93 |
94 | o.TtoW0 = float4(worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x);
95 | o.TtoW1 = float4(worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y);
96 | o.TtoW2 = float4(worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z);
97 |
98 | TRANSFER_SHADOW(o);
99 |
100 | return o;
101 | }
102 |
103 | half4 frag(v2f i) : SV_Target
104 | {
105 | float3 worldPos = float3(i.TtoW0.w, i.TtoW1.w, i.TtoW2.w);
106 | fixed3 lightDir = normalize(UnityWorldSpaceLightDir(worldPos));
107 | fixed3 viewDir = normalize(UnityWorldSpaceViewDir(worldPos));
108 | fixed3 normal = UnpackNormal(tex2D(_Normal, i.uv.xy));
109 | normal = normalize(half3(dot(i.TtoW0.xyz, normal), dot(i.TtoW1.xyz, normal), dot(i.TtoW2.xyz, normal)));
110 | half nDotL = saturate(dot(normal, lightDir));
111 | half diff = round(saturate(nDotL / _LightCutoff) * _ShadowBands) / _ShadowBands;
112 |
113 | UNITY_LIGHT_ATTENUATION(atten, i, worldPos);
114 | half stepAtten = round(atten);
115 | half shadow = diff * stepAtten;
116 | float3 refl = reflect(lightDir, normal);
117 | float vDotRefl = dot(viewDir, -refl);
118 | float smoothness = tex2D(_SpecularMap, i.uv.zw).x * _Glossiness;
119 | float3 specular = _SpecularColor.rgb * step(1 - smoothness, vDotRefl);
120 | //float3 rim = _RimColor * step(1 - _RimSize, 1 - saturate(dot(viewDir, normal)));
121 | float3 rim = _RimColor * (step(1 - _RimSize, 1 - saturate(dot(viewDir, normal))) * -1);
122 | fixed4 albedo = tex2D(_MainTex, i.uv.xy) * _Color;
123 | half3 col = (albedo.rgb + specular) * _LightColor0;
124 | half4 c;
125 |
126 | //描边受阴影影响
127 | #ifdef SHADOWED_RIM
128 | c.rgb = (col + rim) * shadow;
129 | #else
130 | c.rgb = col * shadow + rim;
131 | #endif
132 | c.a = albedo.a;
133 | c.rgb = c.rgb + albedo.rgb * _Emission.rgb;
134 |
135 | return c;
136 | }
137 |
138 | ENDCG
139 |
140 | }
141 | }
142 | FallBack "Diffuse"
143 | }
--------------------------------------------------------------------------------
/Editor/LTY_ShaderGUI_Built_in.cs:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/Editor/LTY_ShaderGUI_Built_in.cs
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 | A201-Shaders Collection /// Personal Usage
8 | ===========================
9 |
10 |
11 |
12 | →→ **[查看更新日志](#更新日志)** →→ **[前往下载地址](https://github.com/Soung2279/Unity-Shaders-Collection/releases)**
13 |
14 |
15 |
16 | 简介
17 | ===========================
18 |
19 | 收录用于``Unity``的``Built-in`` & ``URP`` 适用的 **着色器合集**。若您有一定技术美术知识,您可读取着色器中的片段代码,并将其迁移到其它引擎(如UE,GoDot等)中。
20 |
21 | ### 仓库来源
22 |
23 | 本仓库是[个人](https://github.com/Soung2279)在学习与工作生涯中,对制作、收集的各种shader进行的统一收录。本仓库收录的shader适用于[Unity](https://unity.com/cn)引擎,绝大部分用于*特效制作*。均作了大量 **汉化** 处理。
24 |
25 | ### 文件说明
26 |
27 | 为了方便使用,本人将所有的着色器目录路径(Shader Path)均 **统一**在了 **Soung/** 路径下,并按着色器的使用类型进行了 **分类** 。方便特效艺术家、技术美术等进在编辑器中进行直观的shader切换。
28 |
29 | 因游戏美术行业发展迅速,技术日新月异,本仓库收录的shader适用的环境为:
30 |
31 | [](https://unity.com/cn)
32 | [](https://docs.unity3d.com/cn/Packages/com.unity.render-pipelines.universal@12.1/manual/index.html)
33 |
34 |
35 | - [x] ``Unity 2018-2023``, ``ALL Built-in``, ``Universal Render Pipeline 7.0-16.0``
36 |
37 | - [ ] 理论上支持 ``Unity 6.000`` 和 ``TuanJie 1.0``, ``Universal Render Pipeline 17.0`` 及以上系列。
38 |
39 | *暂时未收录 ``HDRP`` 可用的shader。*
40 |
41 |
42 |
43 |
44 | (V1) 以往的shader分类
45 |
46 | ~~目前存在的分类如下:~~
47 | - ~~全面功能:包含溶解、遮罩、扭曲、偏移、菲涅尔等多项功能的全面shader~~
48 | - ~~基本效果:基础的additive或alphablend着色器~~
49 | - ~~后期处理:用于屏幕特效、色散、黑白闪、晕影等~~
50 | - ~~进阶功能:多遮罩或多功能的单项shader~~
51 | - ~~特殊制作:视差地裂、流麻、分层纹理、渐变等特殊需求shader~~
52 | - ~~未知类型:未知用途的shader~~
53 |
54 |
55 |
56 | > 在漫长的工作生涯中,我认识到,shader并不在于多,而在于精、兼容性强和泛用性广。毕竟能跑就不要动它。同时,虽然以往收集的shader数量很多,但是大部分功能都重合了,并且由于代码风格不一,不便于功能迁移。所以,V2.0及以后的版本,会秉持简约的理念,尽可能收录一些通用的,快速上手的shader。同时我会对收集和个人制作的shader进行优化处理,使其能在部分中小型项目中直接使用。因为涉及到对Shader Path和部分shader代码的调整,所以V1与V2完全不互通。但是本质的业务代码都是可用的,只是V2更贴近项目需求。
57 |
58 | 本合集收录的shader大体分类为:
59 | - 特效用单贴图着色器
60 | - 多种溶解、扭曲、流光等着色器
61 | - 复合功能特效着色器
62 | - 后期处理 **屏幕扭曲/色差/晕影/黑白闪** 着色器
63 | - 部分PBR相关着色器
64 | - 简易卡通渲染着色器
65 |
66 | 开始使用
67 | ===========================
68 |
69 | #### 1. 确认您的项目环境
70 |
71 | - 确认您的Unity项目为何种渲染管线(通常为 ``Built-in`` 或 ``URP``,本仓库shader也仅支持这两种),根据对应管线在本仓库 [Release](https://github.com/Soung2279/Unity-Shaders-Collection/releases) 处下载对应发布包。
72 |
73 | #### 2. 解压已下载包
74 |
75 | - 将下载好的Release包解压在任意目录,并将解压后的文件夹全部复制到您的Unity项目中,如果您不知道放哪个位置,请直接放在 ``Asset/`` 目录下。
76 | - (可选)(将 "Amplify Shader Editor v1.9.1.5.unitypackage",如项目中已有ASE则无需额外导入。)
77 | - (本仓库大部分Shader使用ASE 1.9.1.5版制作/编辑,建议ASE环境不低于1.8)
78 |
79 | #### 3. 检查控制台 ``Colsole`` 信息,若无意外,仅会产生黄色警告信息,不影响使用。
80 |
81 | - (如有红色错误信息,可尝试检查错误来源或重新导入。)
82 |
83 |
84 | > *额外:预制环境>>>
85 | > 本仓库 [Release](https://github.com/Soung2279/Unity-Shaders-Collection/releases/tag/RESOURCES_1) 提供了一个基础的特效制作环境(Unity项目压缩包),下载后即开即用,已预先配置好了着色器、后处理配置等(Shader包版本V1.5)。
86 |
87 | #### 4. 着色器更新:
88 |
89 | - 通常情况下,本合集目录不会有较大变更,在 [Release](https://github.com/Soung2279/Unity-Shaders-Collection/releases) 处选择对应文件下载后,直接**覆盖更新**即可。覆盖后,请手动删除Unity对应路径下的 ``.meta`` 文件。
90 |
91 | - 特殊情况下,在 [更新日志](#更新日志) 中应有对应的更新指南,按指南操作即可。若日志中没有给出更新方法,请备份上一版本的shader后,覆盖更新,并使用 ``notepad++``, ``Windows记事本`` 或 ``VSCode`` 等IDE打开shader,查看新的着色器目录路径(Shader Path)(通常在文件的前5行)。
92 |
93 | - 自行更新:若您有更高版本或适用于新效果的着色器,推荐自行统一着色器目录路径(Shader Path)为 **A201-Shader/** 。
94 |
95 | - 使用ASE编辑:若您想使用ASE自行编辑现有着色器,则可能出现汉化还原的情况,不影响使用,但建议 [此问题](https://github.com/Soung2279/Unity-Shaders-Collection/issues/1) 修复前避免使用ASE重复编辑 。
96 |
97 | 说明
98 | ========================
99 |
100 | 1. Shader使用:在Unity材质球处切换Shader时,选择"A201-Shader/"目录下的Shader即可,Shader已做分类处理。
101 |
102 | 2. 若部分ShaderGUI缺失,请检查包内的 ``Editor`` 是否正常导入。
103 |
104 | 3. 特殊说明:
``PPX_BA_shader.shader`` (A201-Shader/特殊制作/BA式卡通着色器_PPX_BA):需配合*SampleTex*中的嘴型遮罩 ``Mouth_mask.png`` 使用。
``流麻flow.shader`` (A201-Shader/特殊制作/URP视差流麻_Jiji):需配合*SampleTex*中的粒子点噪 ``particle.png`` 使用。
[(已解决)](https://github.com/Soung2279/Unity-Shaders-Collection/issues/2) ~~``Soung_FlipAddtive.shader`` (同AlphaBlend) 使用 ``ASE`` ``Flipbook`` 节点制作,若出现边缘有无法消除的白线,请使用*SampleTex*中的修复遮罩 ``FlipMask.png``.~~ 已增加程序遮罩修复功能,更新shader即可。
105 |
106 | 4. [(待解决)](https://github.com/Soung2279/Unity-Shaders-Collection/issues/1) 对于所有的汉化Shader来说,应尽可能**避免**使用 ``ASE`` 二次编辑,这会导致汉化失效。``ShaderGraph`` 则不受影响。
107 |
108 | 5. ``Post-Processing Scan`` 为脚本驱动的后处理屏幕扫描特效,使用方法详见 [Post-Processing-Scan - MirzaBeig](https://github.com/MirzaBeig/Post-Processing-Scan)
109 |
110 | 6. ``Soung_UICustom_Liuguang.shader`` 是用于UI通用流光材质的UI着色器,请使用*SampleTex*中的``saomiao.png``预览效果。(该着色器实现自定义间隔时间有一定性能开销,请注意)
111 |
112 | ## 特别鸣谢
113 |
114 | [UnityURPToonLitShader](https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample)
115 |
116 | [Post-Processing-Scan](https://github.com/MirzaBeig/Post-Processing-Scan)
117 |
118 | [Bilibili: 多喝热水嗝嗝嗝](https://space.bilibili.com/2537966)
119 |
120 | [Bilibili: Cz_wang](https://space.bilibili.com/15396626)
121 | ****
122 |
123 | ## 更新日志
124 |
125 | ### 2025.4.9 | 更新说明 | Obsoleted V1.9.0
126 |
127 | *更新:*
128 |
129 | 更新全功能着色器(双管线)及其shaderGUI.
130 |
131 | 更新ASE包至1.9.81
132 |
133 | *说明:*
134 | 此次更新后,V.1.9.0 Release包将作为最后一个 V1 版本发布。**不再进行后续维护**。此仓库着色器将以 V2 版本继续更新。
135 |
136 | ### 2023.12.29 | 更新说明 | Preview - Standard V1.8.7
137 |
138 | *新增:*
139 |
140 | 新增 **个人制作** 分类下的全部shader URP版本
141 |
142 | 新增带ShaderGUI的全功能着色器(双管线)
143 |
144 | *说明:*
145 | 此次更新仅作临时备份上传,非正式更新。(但所有已上传shader均通过可行性验证)
146 | 另,此次更新较为完整,将作为最新Release包
147 |
148 | ### 2023.12.20 | 更新说明 | Preview - Standard V1.8.4
149 |
150 | *新增:*
151 |
152 | 代码雨、像素风格、通用贴图变换、双三角护盾
153 |
154 | UI控边溶解、故障扰动、霓虹灯闪烁、转场
155 |
156 | builtin转场、故障扰动、双面材质面具、控边溶解、霓虹灯
157 |
158 | 此次新增15项,其中6项为UI适用。
159 |
160 | *TODO:*
161 | 目前个人制作的着色器数量已达37个(包含UI用),**在未来会取消此分类结构,重构着色器路径**,简化不必要的轻量效果并以更高可读性的目录结构展示。
162 |
163 | *说明:*
164 |
165 | 此次更新仅作临时备份上传,非正式更新。(但所有已上传shader均通过可行性验证)
166 |
167 | ### 2023.12.13 | 更新说明 | Standard 1.8
168 |
169 | **重要更新:新增 UI 分类**
170 |
171 | *新增:*
172 |
173 | Buit-in | 序列帧屏幕扭曲、通用程序粒子材质、Flowmap软溶解
174 |
175 | UI | 叠加纹理流动、*间隔流光、遮罩扰动与溶解等
176 |
177 | URP | 序列帧屏幕扭曲、遮罩流动
178 |
179 | *修复:*
180 |
181 | 修复简易菲尼尔护盾在切换渲染管线后显示不正确的问题 (Built-in&URP)
182 |
183 | *优化:*
184 |
185 | 优化了部分shader的材质属性,清理了未使用的节点
186 |
187 | 去除了重复的风格化水面包 (URP)
188 |
189 | *其它:*
190 |
191 | 考虑到目前 个人制作 分类下的shader较多,在未来会删除此分类并将shaders分配到对应分类下
192 |
193 | 目前Release分类较多 (Built-in、UI、URP),在未来可能以更合理的方式重新分类。
194 |
195 | 因目前shader较多,功能较复杂,在未来会编写一份对应使用说明。目前请暂时通过 [更新说明](#更新日志) 查看使用方法
196 |
197 | *间隔流光:请使用黑底图用以流光纹理,在 [说明](#说明) 处已给出了一张示例图。
198 |
199 | ### 2023.11.7 | 更新说明 | Standard 1.7
200 |
201 | 新增:风格化卡通火焰与其简化版、风格化卡通地裂与其简化版、菲涅尔护盾和适用于URP的风格化水面包
202 |
203 | 修复:修复了序列帧材质边缘切线问题 [issue #2](https://github.com/Soung2279/Unity-Shaders-Collection/issues/2)
204 |
205 | #定位了一个问题,此问题导致使用ASE重新编辑本仓库shader后会使汉化失效。
206 |
207 | ### 2023.10.12 | 更新说明 | Standard 1.6
208 |
209 | 新增:Panda熊猫shaderURP版,雨天地面,雨幕折射与屏幕模糊,雪地轨迹地面,简单序列帧材质,built-in
210 |
211 | **重要更新**:Panda熊猫10.10 最新V2.3改。提供 [熊猫最新版发布地址](https://www.magesbox.com/article/detail/id/1321.html)
212 |
213 | #个人制作shader均使用ASE 1.9.1.5 制作。
214 |
215 | #简单序列帧材质 ``FlipAddtive`` 与 ``FlipAlphaB`` 建议配合修复遮罩贴图使用。详见 →→ **[查看说明](#说明)**
216 |
217 | ### 2023.9.3 | 更新说明 | Standard 1.5.1
218 |
219 | 新增:风格化水面与屏幕扫描(脚本驱动),可在 [Post-Processing-Scan - MirzaBeig](https://github.com/MirzaBeig/Post-Processing-Scan) 查看屏幕扫描使用方法。
220 |
221 | 修复:修复了 [Standard V1.5 Release](https://github.com/Soung2279/Unity-Shaders-Collection/releases/tag/StandardV1.5) 错误的版本号。
222 |
223 | ### 2023.9.3 | 更新说明 | Standard 1.5.1
224 |
225 | ^更新:已全部汉化原ShaderGraph系列shader并部分优化。
226 |
227 | *优化:优化了URP适用的 ``SinC_BlendURP``、``SinC_PBRURP`` 并完全汉化。
228 |
229 | 优化了着色器路径目录,现在URP适用的shader将单独显示在URP分支中。
230 |
231 | ^因数据更新,在旧版本的ShaderGraph上,着色器表现可能有差异。同时,请勿使用 ``ASE`` 编辑此着色器,这会导致着色器失效。
232 |
233 | *因汉化与 ASE 冲突,请勿通过 ASE 编辑此shader。
234 |
235 | ### 2023.8.25 | 更新说明 | Standard 1.4
236 |
237 | 新增:屏幕后期处理、BA式卡通渲染、星星缩放、流麻Flow(URP)等shader。
238 |
239 | #建议使用前在项目中导入ASE环境。
240 |
241 | 更新了基础特效制作环境。[Release](https://github.com/Soung2279/Unity-Shaders-Collection/releases/tag/RESOURCES_1) 处查看。
242 |
243 | ### 2023.7.31 | 更新说明 | Standard 1.3
244 |
245 | 新增:适用于URP管线的溶解(消融)、纹理叠加(遮罩)、简易描边等Shaders。
246 |
247 | 本次更新仅适用于URP项目。
248 |
249 | 考虑到项目制作需要,今后会将偏向更新适用于URP环境的shaders。
250 |
251 | ### 2023.6.9 | 更新说明 | Standard 1.2
252 |
253 | 说明:添加合集版本号,方便归档。
254 |
255 | 新增:新增额外菲涅尔、多重遮罩溶解、标准PBR、额外色差与屏幕扭曲Shaders。
256 |
257 | 修复:修复部分Shader功能失效的错误。
258 |
259 | 优化:将SinC_Blend进行性能优化。
260 |
261 | 汉化:完整汉化新增Shader,并进行归纳排版。
262 |
263 | 请导入文件目录下的Amplify Shader Editor(ASE)包来修复报错问题。
264 |
265 | 此次更新将Built-in/URP/HDRP等渲染管线平行分离,此次更新仅适用于Built-in。
266 |
267 | ### 2023.5.18 | 更新说明 | Standard 1.1
268 |
269 | 新增:新增屏幕扭曲shader,使用法线贴图来控制屏幕扭曲效果。
270 |
271 | ~~已知故障:进阶处理-多功能溶解ADD/Alpha Double的自定义顶点流可能失效,等待ShaderForge重置修复。~~
272 |
273 | ### 2023.5.4 | 更新说明 | Standard 1.0
274 |
275 | 资源优化:移除了部分失效Shader。
276 |
277 | 目录层级重构:现在所有Shader均按使用类型放置在 **A201-Shader/** 目录下。
278 |
279 | 更新:更新后期处理shader到最新版本,更新LTY-shader到最新版本。
280 |
281 | 增添:部分复杂Shader在面板中添加了导航链接。
282 |
283 | 重构:使用UnityPackage打包资源,而非直接以文件夹形式传输。
284 |
285 |
286 | ### 2023.4.17 | 更新说明 | Beta 0.2
287 |
288 | 修复:修复了"RongJieSD"持续提示缺失GUI脚本的错误。
289 |
290 | 更新:新增三个URP特供卡通着色Shader。
291 |
292 | 完善:完善了README,重归类文件目录结构。
--------------------------------------------------------------------------------
/SampleTex/111.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/111.png
--------------------------------------------------------------------------------
/SampleTex/CausticsShallow.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/CausticsShallow.jpg
--------------------------------------------------------------------------------
/SampleTex/FlipMask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/FlipMask.png
--------------------------------------------------------------------------------
/SampleTex/Flow01.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/Flow01.png
--------------------------------------------------------------------------------
/SampleTex/GentleWaves.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/GentleWaves.bmp
--------------------------------------------------------------------------------
/SampleTex/Mouth_mask.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/Mouth_mask.png
--------------------------------------------------------------------------------
/SampleTex/SeaPattern.TGA:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/SeaPattern.TGA
--------------------------------------------------------------------------------
/SampleTex/particle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/particle.png
--------------------------------------------------------------------------------
/SampleTex/saomiao.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/saomiao.png
--------------------------------------------------------------------------------
/SampleTex/waters.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/SampleTex/waters.png
--------------------------------------------------------------------------------
/URP/GenshinCharacterShader/NiloInvLerpRemap.hlsl:
--------------------------------------------------------------------------------
1 | // https://github.com/ronja-tutorials/ShaderTutorials/blob/master/Assets/047_InverseInterpolationAndRemap/Interpolation.cginc
2 | // edit float to half for optimization, because we usually use this to process color data(half)
3 |
4 | #ifndef Include_NiloInvLerpRemap
5 | #define Include_NiloInvLerpRemap
6 |
7 | // just like smoothstep(), but linear, not clamped
8 | half invLerp(half from, half to, half value)
9 | {
10 | return (value - from) / (to - from);
11 | }
12 | half invLerpClamp(half from, half to, half value)
13 | {
14 | return saturate(invLerp(from,to,value));
15 | }
16 | // full control remap, but slower
17 | half remap(half origFrom, half origTo, half targetFrom, half targetTo, half value)
18 | {
19 | half rel = invLerp(origFrom, origTo, value);
20 | return lerp(targetFrom, targetTo, rel);
21 | }
22 | #endif
23 |
--------------------------------------------------------------------------------
/URP/GenshinCharacterShader/NiloOutlineUtil.hlsl:
--------------------------------------------------------------------------------
1 | // For more information, visit -> https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample
2 |
3 | #ifndef Include_NiloOutlineUtil
4 | #define Include_NiloOutlineUtil
5 |
6 | // If your project has a faster way to get camera fov in shader, you can replace this slow function to your method.
7 | // For example, you write cmd.SetGlobalFloat("_CurrentCameraFOV",cameraFOV) using a new RendererFeature in C#.
8 | // For this tutorial shader, we will keep things simple and use this slower but convenient method to get camera fov
9 | float GetCameraFOV()
10 | {
11 | //https://answers.unity.com/questions/770838/how-can-i-extract-the-fov-information-from-the-pro.html
12 | float t = unity_CameraProjection._m11;
13 | float Rad2Deg = 180 / 3.1415;
14 | float fov = atan(1.0f / t) * 2.0 * Rad2Deg;
15 | return fov;
16 | }
17 | float ApplyOutlineDistanceFadeOut(float inputMulFix)
18 | {
19 | //make outline "fadeout" if character is too small in camera's view
20 | return saturate(inputMulFix);
21 | }
22 | float GetOutlineCameraFovAndDistanceFixMultiplier(float positionVS_Z)
23 | {
24 | float cameraMulFix;
25 | if(unity_OrthoParams.w == 0)
26 | {
27 | ////////////////////////////////
28 | // Perspective camera case
29 | ////////////////////////////////
30 |
31 | // keep outline similar width on screen accoss all camera distance
32 | cameraMulFix = abs(positionVS_Z);
33 |
34 | // can replace to a tonemap function if a smooth stop is needed
35 | cameraMulFix = ApplyOutlineDistanceFadeOut(cameraMulFix);
36 |
37 | // keep outline similar width on screen accoss all camera fov
38 | cameraMulFix *= GetCameraFOV();
39 | }
40 | else
41 | {
42 | ////////////////////////////////
43 | // Orthographic camera case
44 | ////////////////////////////////
45 | float orthoSize = abs(unity_OrthoParams.y);
46 | orthoSize = ApplyOutlineDistanceFadeOut(orthoSize);
47 | cameraMulFix = orthoSize * 50; // 50 is a magic number to match perspective camera's outline width
48 | }
49 |
50 | return cameraMulFix * 0.00005; // mul a const to make return result = default normal expand amount WS
51 | }
52 | #endif
53 |
54 |
--------------------------------------------------------------------------------
/URP/GenshinCharacterShader/NiloZOffset.hlsl:
--------------------------------------------------------------------------------
1 | // For more information, visit -> https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample
2 |
3 | #ifndef Include_NiloZOffset
4 | #define Include_NiloZOffset
5 |
6 | // Push an imaginary vertex towards camera in view space (linear, view space unit),
7 | // then only overwrite original positionCS.z using imaginary vertex's result positionCS.z value
8 | // Will only affect ZTest ZWrite's depth value of vertex shader
9 |
10 | // Useful for:
11 | // -Hide ugly outline on face/eye
12 | // -Make eyebrow render on top of hair
13 | // -Solve ZFighting issue without moving geometry
14 | float4 NiloGetNewClipPosWithZOffset(float4 originalPositionCS, float viewSpaceZOffsetAmount)
15 | {
16 | if(unity_OrthoParams.w == 0)
17 | {
18 | ////////////////////////////////
19 | //Perspective camera case
20 | ////////////////////////////////
21 | float2 ProjM_ZRow_ZW = UNITY_MATRIX_P[2].zw;
22 | float modifiedPositionVS_Z = -originalPositionCS.w + -viewSpaceZOffsetAmount; // push imaginary vertex
23 | float modifiedPositionCS_Z = modifiedPositionVS_Z * ProjM_ZRow_ZW[0] + ProjM_ZRow_ZW[1];
24 | originalPositionCS.z = modifiedPositionCS_Z * originalPositionCS.w / (-modifiedPositionVS_Z); // overwrite positionCS.z
25 | return originalPositionCS;
26 | }
27 | else
28 | {
29 | ////////////////////////////////
30 | //Orthographic camera case
31 | ////////////////////////////////
32 | originalPositionCS.z += -viewSpaceZOffsetAmount / _ProjectionParams.z; // push imaginary vertex and overwrite positionCS.z
33 | return originalPositionCS;
34 | }
35 | }
36 |
37 | #endif
38 |
39 |
--------------------------------------------------------------------------------
/URP/PandaShaderSamPleURPV1.1/CustomSwitchV1.1.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
13 | m_Name: CustomSwitchV1
14 | m_EditorClassIdentifier:
15 | m_functionInfo: "// Made with Amplify Shader Editor\n// Available at the Unity
16 | Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=18935\n-2553;96;2560;1283;2006;581.5;1;True;True\nNode;AmplifyShaderEditor.TextureCoordinatesNode;3;-1019,205.5;Inherit;False;2;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.RangedFloatNode;8;-1145,-299.5;Inherit;False;Constant;_Float0;Float
17 | 0;0;0;Create;True;0;0;0;False;0;False;0;0;0;0;0;1;FLOAT;0\nNode;AmplifyShaderEditor.TextureCoordinatesNode;1;-1020,-165.5;Inherit;False;0;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.FunctionInput;7;-958,-299.5;Inherit;False;Num;1;0;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.TextureCoordinatesNode;2;-1020,20.5;Inherit;False;1;-1;4;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT4;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.CustomExpressionNode;5;-674,-56.5;Inherit;False;$
18 | if(Num==0)${$F= 0@$}$else if(Num==1)${$F=c1x@$}$else if(Num==2)${$F=c1y@$}$else
19 | if(Num==3)${$F= c1z@$}$else if(Num==4)${$F= c1w@$}$else if(Num==5)${$F=c2x@$}$else
20 | if(Num==6)${$F= c2y@$}$else if(Num==7)${$F=c2z@$}$else if(Num==8)${$F= c2w@$}$$return
21 | 0@;1;Create;10;True;Num;FLOAT;0;In;;Inherit;False;True;c1x;FLOAT;0;In;;Inherit;False;True;c1y;FLOAT;0;In;;Inherit;False;True;c1z;FLOAT;0;In;;Inherit;False;True;c1w;FLOAT;0;In;;Inherit;False;True;c2x;FLOAT;0;In;;Inherit;False;True;c2y;FLOAT;0;In;;Inherit;False;True;c2z;FLOAT;0;In;;Inherit;False;True;c2w;FLOAT;0;In;;Inherit;False;True;F;FLOAT;0;Out;;Float;False;CustomChanelSwitch;True;False;1;-1;;False;10;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;9;FLOAT;0;False;2;FLOAT;0;FLOAT;10\nNode;AmplifyShaderEditor.FunctionOutput;0;-389,-49;Inherit;False;True;-1;Output;0;False;1;0;FLOAT;0;False;1;FLOAT;0\nWireConnection;7;0;8;0\nWireConnection;5;0;7;0\nWireConnection;5;1;1;3\nWireConnection;5;2;1;4\nWireConnection;5;3;2;1\nWireConnection;5;4;2;2\nWireConnection;5;5;2;3\nWireConnection;5;6;2;4\nWireConnection;5;7;3;1\nWireConnection;5;8;3;2\nWireConnection;0;0;5;10\nASEEND*/\n//CHKSM=CC4D6920D530D394C82000BBCB8FEF8B6B8E9787"
22 | m_functionName:
23 | m_description:
24 | m_additionalIncludes:
25 | m_additionalIncludes: []
26 | m_outsideIncludes: []
27 | m_additionalPragmas:
28 | m_additionalPragmas: []
29 | m_outsidePragmas: []
30 | m_additionalDirectives:
31 | m_validData: 0
32 | m_isDirty: 0
33 | m_moduleName: ' Additional Directives'
34 | m_independentModule: 1
35 | m_customEdited: 0
36 | m_additionalDirectives: []
37 | m_shaderFunctionDirectives: []
38 | m_nativeDirectives: []
39 | m_nativeDirectivesIndex: -1
40 | m_nativeDirectivesFoldout: 0
41 | m_directivesSaveItems: []
42 | m_nodeCategory: 3
43 | m_customNodeCategory:
44 | m_previewPosition: 0
45 | m_hidden: 0
46 | m_url:
47 |
--------------------------------------------------------------------------------
/URP/PandaShaderSamPleURPV1.1/DistortFunctionSampleURPV1.1.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
13 | m_Name: DistortFunctionSampleURPV1
14 | m_EditorClassIdentifier:
15 | m_functionInfo: "// Made with Amplify Shader Editor\n// Available at the Unity
16 | Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=18935\n-2553;84;2560;1295;1424;593.5;1;True;True\nNode;AmplifyShaderEditor.SimpleAddOpNode;1;-449.8149,111.5626;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;3;-801.8149,111.5626;Inherit;False;UV;2;0;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;4;-769.8149,-80.43739;Inherit;False;IfDistort;1;1;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.Compare;5;-310.24,-73.7504;Inherit;False;0;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT2;0,0;False;3;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;2;-803.8149,197.5626;Inherit;False;Distort;2;2;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionOutput;0;-39,-69;Inherit;False;True;-1;DistortUV;0;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nWireConnection;1;0;3;0\nWireConnection;1;1;2;0\nWireConnection;5;0;4;0\nWireConnection;5;2;3;0\nWireConnection;5;3;1;0\nWireConnection;0;0;5;0\nASEEND*/\n//CHKSM=99496825A38E76B7F842068A6928C61A4E1991F8"
17 | m_functionName:
18 | m_description:
19 | m_additionalIncludes:
20 | m_additionalIncludes: []
21 | m_outsideIncludes: []
22 | m_additionalPragmas:
23 | m_additionalPragmas: []
24 | m_outsidePragmas: []
25 | m_additionalDirectives:
26 | m_validData: 0
27 | m_isDirty: 0
28 | m_moduleName: ' Additional Directives'
29 | m_independentModule: 1
30 | m_customEdited: 0
31 | m_additionalDirectives: []
32 | m_shaderFunctionDirectives: []
33 | m_nativeDirectives: []
34 | m_nativeDirectivesIndex: -1
35 | m_nativeDirectivesFoldout: 0
36 | m_directivesSaveItems: []
37 | m_nodeCategory: 3
38 | m_customNodeCategory:
39 | m_previewPosition: 0
40 | m_hidden: 0
41 | m_url:
42 |
--------------------------------------------------------------------------------
/URP/PandaShaderSamPleURPV1.1/PandaGrab.cs:
--------------------------------------------------------------------------------
1 | using UnityEngine;
2 | using UnityEngine.Rendering;
3 | using UnityEngine.Rendering.Universal;
4 |
5 | public class PandaGrab : ScriptableRendererFeature
6 | {
7 | class CustomRenderPass : ScriptableRenderPass
8 | {
9 |
10 | static string rt_name="_PandaGrabTex";
11 | static int rt_ID=Shader.PropertyToID(rt_name);
12 | // This method is called before executing the render pass.
13 | // It can be used to configure render targets and their clear state. Also to create temporary render target textures.
14 | // When empty this render pass will render to the active camera render target.
15 | // You should never call CommandBuffer.SetRenderTarget. Instead call
ConfigureTarget and
ConfigureClear.
16 | // The render pipeline will ensure target setup and clearing happens in a performant manner.
17 | public override void OnCameraSetup(CommandBuffer cmd, ref RenderingData renderingData)
18 | {
19 | RenderTextureDescriptor descriptor=new RenderTextureDescriptor(2560,1440,RenderTextureFormat.DefaultHDR,0);
20 | cmd.GetTemporaryRT(rt_ID,descriptor);
21 | ConfigureTarget(rt_ID);
22 | ConfigureClear(ClearFlag.Color,Color.black);
23 |
24 |
25 | }
26 |
27 | // Here you can implement the rendering logic.
28 | // Use
ScriptableRenderContext to issue drawing commands or execute command buffers
29 | // https://docs.unity3d.com/ScriptReference/Rendering.ScriptableRenderContext.html
30 | // You don't have to call ScriptableRenderContext.submit, the render pipeline will call it at specific points in the pipeline.
31 | public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
32 | {
33 | CommandBuffer cmd=CommandBufferPool.Get("PandaPass");
34 | cmd.Blit(renderingData.cameraData.renderer.cameraColorTarget,rt_ID);
35 | context.ExecuteCommandBuffer(cmd);
36 | cmd.Clear();
37 | cmd.Release();
38 | }
39 |
40 | // Cleanup any allocated resources that were created during the execution of this render pass.
41 | public override void OnCameraCleanup(CommandBuffer cmd)
42 | {
43 | cmd.ReleaseTemporaryRT(rt_ID);
44 | }
45 | }
46 |
47 | CustomRenderPass m_ScriptablePass;
48 |
49 | ///
50 | public override void Create()
51 | {
52 | m_ScriptablePass = new CustomRenderPass();
53 |
54 | // Configures where the render pass should be injected.
55 | m_ScriptablePass.renderPassEvent = RenderPassEvent.AfterRenderingTransparents;
56 | }
57 |
58 | // Here you can inject one or multiple render passes in the renderer.
59 | // This method is called when setting up the renderer once per-camera.
60 | public override void AddRenderPasses(ScriptableRenderer renderer, ref RenderingData renderingData)
61 | {
62 | renderer.EnqueuePass(m_ScriptablePass);
63 | }
64 | }
65 |
66 |
67 |
--------------------------------------------------------------------------------
/URP/PandaShaderSamPleURPV1.1/Tex3FunctionSampleURPV1.1.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
13 | m_Name: Tex3FunctionSampleURPV1
14 | m_EditorClassIdentifier:
15 | m_functionInfo: "// Made with Amplify Shader Editor v1.9.1.5\n// Available at the
16 | Unity Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=19105\nNode;AmplifyShaderEditor.FunctionInput;16;-1429.5,174;Inherit;False;VSpeed;1;4;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PannerNode;5;-1056.958,-41.91162;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.DynamicAppendNode;4;-1224.44,49.99188;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;12;-1039.5,-155;Inherit;False;Tex;9;0;False;1;0;SAMPLER2D;0;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.FunctionInput;18;-1805.227,-110.4978;Inherit;False;UV;2;1;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.RotatorNode;38;-1551.103,-107.2988;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0.5,0.5;False;2;FLOAT;1;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;15;-1433.5,43;Inherit;False;USpeed;1;3;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;40;-1887.553,34.96596;Inherit;False;Rotator;1;10;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PiNode;39;-1940.515,125.3094;Inherit;False;1;0;FLOAT;2;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-1693.368,67.1572;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;26;648.8652,145.9778;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;23;640.8652,-103.0222;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;28;841.2242,5.372484;Inherit;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.FunctionInput;29;782.0342,-273.9645;Inherit;False;Refine;4;13;True;1;0;FLOAT4;1,1,1,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;30;961.6821,-267.7338;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;31;1212.983,-310.3098;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PowerNode;32;1221.289,1.218584;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;33;1431.052,-0.8582764;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.LerpOp;34;1549.433,-233.4658;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;35;1805.924,-129.6232;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.DesaturateOpNode;27;649.1151,4.334055;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;1;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.DesaturateOpNode;36;2004.263,-130.662;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;1;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionInput;37;1783.078,50.0243;Inherit;False;Desaturate;1;11;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionOutput;20;2152.187,144.8673;Inherit;False;False;-1;AR;1;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionOutput;0;2445.732,-131.4777;Inherit;False;True;-1;Color;0;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionInput;25;-857.335,-671.3421;Inherit;False;VClamp;1;6;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;22;-861.3349,-377.3426;Inherit;False;FLOAT2;1;0;FLOAT2;0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.FunctionInput;43;-865.3,-548.6246;Inherit;False;UMirror;1;8;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;42;-863.3,-455.625;Inherit;False;VMirror;1;9;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.DynamicAppendNode;44;-344.8001,-467.125;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;24;-860.3349,-778.3421;Inherit;False;UClamp;1;5;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;45;-850.8,-864.1245;Inherit;False;UVClip;1;7;True;1;0;FLOAT;1;False;1;FLOAT;0\nNode;AmplifyShaderEditor.Compare;11;447.2925,123.3695;Inherit;False;0;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;19;247.561,57.12922;Inherit;False;AR;1;2;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SamplerNode;7;-176.5516,-155.0401;Inherit;True;Property;_MainTex1;MainTex1;1;0;Create;True;0;0;0;False;0;False;-1;2c6536772776dd84f872779990273bfc;2c6536772776dd84f872779990273bfc;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.SamplerNode;46;-176.1594,52.92285;Inherit;True;Property;_MainTex2;MainTex1;1;0;Create;True;0;0;0;False;0;False;-1;2c6536772776dd84f872779990273bfc;2c6536772776dd84f872779990273bfc;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.SamplerNode;47;-177.1594,261.9229;Inherit;True;Property;_MainTex3;MainTex1;1;0;Create;True;0;0;0;False;0;False;-1;2c6536772776dd84f872779990273bfc;2c6536772776dd84f872779990273bfc;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nNode;AmplifyShaderEditor.SimpleAddOpNode;49;-365.1594,53.92285;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.SimpleSubtractOpNode;50;-365.1594,232.9229;Inherit;False;2;0;FLOAT2;0,0;False;1;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.DynamicAppendNode;51;218.8406,181.9229;Inherit;False;FLOAT3;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionInput;48;-705.1594,250.9229;Inherit;False;CAFactor;1;12;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.CustomExpressionNode;21;-618.3353,-555.3422;Inherit;False;F=1@$if(UMirror==1)${$U=-U+1@$}$if(VMirror==1)${$V=V*(-1)+1@$}$$if(UClamp==1&&UVClip==1)${$
17 | if(U>1||U<0)$ {$ F=0@$ }$}$$if(UClamp==1&&UVClip==0)${$ if(U>1)$
18 | {$ U=1@$ }$ if(U<0)$ {$ U=0@$ }$}$$$if(VClamp==1&&UVClip==1)${$
19 | if(V>1||V<0)$ {$ F=0@$ }$}$if(VClamp==1&&UVClip==0)${$ if(V>1)$
20 | {$ V=1@$ }$$ if(V<0)$ {$ V=0@$ }$}$$return 0@;1;Create;8;True;UVClip;FLOAT;0;In;;Inherit;False;True;UClamp;FLOAT;0;In;;Inherit;False;True;VClamp;FLOAT;0;In;;Inherit;False;True;UMirror;FLOAT;0;In;;Inherit;False;True;VMirror;FLOAT;0;In;;Inherit;False;True;U;FLOAT;0;InOut;;Inherit;False;True;V;FLOAT;0;InOut;;Inherit;False;True;F;FLOAT;0;Out;;Inherit;False;UVClamp;True;False;0;;False;8;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;4;FLOAT;0;FLOAT;6;FLOAT;7;FLOAT;8\nWireConnection;5;0;38;0\nWireConnection;5;2;4;0\nWireConnection;4;0;15;0\nWireConnection;4;1;16;0\nWireConnection;38;0;18;0\nWireConnection;38;2;41;0\nWireConnection;41;0;40;0\nWireConnection;41;1;39;0\nWireConnection;26;0;21;8\nWireConnection;26;1;11;0\nWireConnection;23;0;21;8\nWireConnection;23;1;51;0\nWireConnection;28;0;27;0\nWireConnection;30;0;29;0\nWireConnection;31;0;30;0\nWireConnection;31;1;28;0\nWireConnection;32;0;28;0\nWireConnection;32;1;30;2\nWireConnection;33;0;30;1\nWireConnection;33;1;32;0\nWireConnection;34;0;31;0\nWireConnection;34;1;33;0\nWireConnection;34;2;30;3\nWireConnection;35;0;34;0\nWireConnection;35;1;23;0\nWireConnection;27;0;51;0\nWireConnection;36;0;35;0\nWireConnection;36;1;37;0\nWireConnection;20;0;26;0\nWireConnection;0;0;36;0\nWireConnection;22;0;5;0\nWireConnection;44;0;21;6\nWireConnection;44;1;21;7\nWireConnection;11;0;19;0\nWireConnection;11;2;7;4\nWireConnection;11;3;7;1\nWireConnection;7;0;12;0\nWireConnection;7;1;44;0\nWireConnection;46;0;12;0\nWireConnection;46;1;49;0\nWireConnection;47;0;12;0\nWireConnection;47;1;50;0\nWireConnection;49;0;44;0\nWireConnection;49;1;48;0\nWireConnection;50;0;44;0\nWireConnection;50;1;48;0\nWireConnection;51;0;46;1\nWireConnection;51;1;7;2\nWireConnection;51;2;47;3\nWireConnection;21;0;45;0\nWireConnection;21;1;24;0\nWireConnection;21;2;25;0\nWireConnection;21;3;43;0\nWireConnection;21;4;42;0\nWireConnection;21;5;22;0\nWireConnection;21;6;22;1\nASEEND*/\n//CHKSM=C8E666491755CF8E84B37D693C8BE2688D8E8A4B"
21 | m_functionName:
22 | m_description:
23 | m_additionalIncludes:
24 | m_additionalIncludes: []
25 | m_outsideIncludes: []
26 | m_additionalPragmas:
27 | m_additionalPragmas: []
28 | m_outsidePragmas: []
29 | m_additionalDirectives:
30 | m_validData: 0
31 | m_isDirty: 0
32 | m_moduleName: ' Additional Directives'
33 | m_independentModule: 1
34 | m_customEdited: 0
35 | m_additionalDirectives: []
36 | m_shaderFunctionDirectives: []
37 | m_nativeDirectives: []
38 | m_nativeDirectivesIndex: -1
39 | m_nativeDirectivesFoldout: 0
40 | m_directivesSaveItems: []
41 | m_nodeCategory: 3
42 | m_headerStyle: 0
43 | m_headerColor: {r: 1, g: 0.4, b: 0, a: 1}
44 | m_customNodeCategory:
45 | m_previewPosition: 0
46 | m_hidden: 0
47 | m_url:
48 |
--------------------------------------------------------------------------------
/URP/PandaShaderSamPleURPV1.1/TexFunctionSampleURPV1.1.asset:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!114 &11400000
4 | MonoBehaviour:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | m_GameObject: {fileID: 0}
10 | m_Enabled: 1
11 | m_EditorHideFlags: 0
12 | m_Script: {fileID: 11500000, guid: 78b2425a2284af743826c689403a4924, type: 3}
13 | m_Name: TexFunctionSampleURPV1
14 | m_EditorClassIdentifier:
15 | m_functionInfo: "// Made with Amplify Shader Editor v1.9.1.5\n// Available at the
16 | Unity Asset Store - http://u3d.as/y3X \n/*ASEBEGIN\nVersion=19105\nNode;AmplifyShaderEditor.FunctionInput;16;-1429.5,174;Inherit;False;VSpeed;1;4;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PannerNode;5;-1056.958,-41.91162;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.DynamicAppendNode;4;-1224.44,49.99188;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;12;-1039.5,-155;Inherit;False;Tex;9;0;False;1;0;SAMPLER2D;0;False;1;SAMPLER2D;0\nNode;AmplifyShaderEditor.FunctionInput;18;-1805.227,-110.4978;Inherit;False;UV;2;1;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.RotatorNode;38;-1551.103,-107.2988;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0.5,0.5;False;2;FLOAT;1;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;15;-1433.5,43;Inherit;False;USpeed;1;3;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;40;-1887.553,34.96596;Inherit;False;Rotator;1;10;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PiNode;39;-1940.515,125.3094;Inherit;False;1;0;FLOAT;2;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;41;-1693.368,67.1572;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;26;648.8652,145.9778;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;23;640.8652,-103.0222;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;28;841.2242,5.372484;Inherit;False;FLOAT3;1;0;FLOAT3;0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.FunctionInput;29;782.0342,-273.9645;Inherit;False;Refine;4;12;True;1;0;FLOAT4;1,1,1,0;False;1;FLOAT4;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;30;961.6821,-267.7338;Inherit;False;FLOAT4;1;0;FLOAT4;0,0,0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;31;1212.983,-310.3098;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.PowerNode;32;1221.289,1.218584;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;33;1431.052,-0.8582764;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.LerpOp;34;1549.433,-233.4658;Inherit;False;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SimpleMultiplyOpNode;35;1805.924,-129.6232;Inherit;False;2;2;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;1;COLOR;0\nNode;AmplifyShaderEditor.DesaturateOpNode;27;649.1151,4.334055;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;1;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.DesaturateOpNode;36;2004.263,-130.662;Inherit;False;2;0;FLOAT3;0,0,0;False;1;FLOAT;1;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionInput;37;1783.078,50.0243;Inherit;False;Desaturate;1;11;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionOutput;20;2152.187,144.8673;Inherit;False;False;-1;AR;1;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionOutput;0;2445.732,-131.4777;Inherit;False;True;-1;Color;0;False;1;0;FLOAT3;0,0,0;False;1;FLOAT3;0\nNode;AmplifyShaderEditor.FunctionInput;25;-857.335,-671.3421;Inherit;False;VClamp;1;6;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.BreakToComponentsNode;22;-861.3349,-377.3426;Inherit;False;FLOAT2;1;0;FLOAT2;0,0;False;16;FLOAT;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4;FLOAT;5;FLOAT;6;FLOAT;7;FLOAT;8;FLOAT;9;FLOAT;10;FLOAT;11;FLOAT;12;FLOAT;13;FLOAT;14;FLOAT;15\nNode;AmplifyShaderEditor.FunctionInput;43;-865.3,-548.6246;Inherit;False;UMirror;1;8;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;42;-863.3,-455.625;Inherit;False;VMirror;1;9;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.DynamicAppendNode;44;-344.8001,-467.125;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0\nNode;AmplifyShaderEditor.FunctionInput;24;-860.3349,-778.3421;Inherit;False;UClamp;1;5;True;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;45;-850.8,-864.1245;Inherit;False;UVClip;1;7;True;1;0;FLOAT;1;False;1;FLOAT;0\nNode;AmplifyShaderEditor.CustomExpressionNode;21;-618.3353,-555.3422;Inherit;False;F=1@$if(UMirror==1)${$U=-U+1@$}$if(VMirror==1)${$V=V*(-1)+1@$}$$if(UClamp==1&&UVClip==1)${$
17 | if(U>1||U<0)$ {$ F=0@$ }$}$$if(UClamp==1&&UVClip==0)${$ if(U>1)$
18 | {$ U=1@$ }$ if(U<0)$ {$ U=0@$ }$}$$$if(VClamp==1&&UVClip==1)${$
19 | if(V>1||V<0)$ {$ F=0@$ }$}$if(VClamp==1&&UVClip==0)${$ if(V>1)$
20 | {$ V=1@$ }$$ if(V<0)$ {$ V=0@$ }$}$$return 0@;1;Create;8;True;UVClip;FLOAT;0;In;;Inherit;False;True;UClamp;FLOAT;0;In;;Inherit;False;True;VClamp;FLOAT;0;In;;Inherit;False;True;UMirror;FLOAT;0;In;;Inherit;False;True;VMirror;FLOAT;0;In;;Inherit;False;True;U;FLOAT;0;InOut;;Inherit;False;True;V;FLOAT;0;InOut;;Inherit;False;True;F;FLOAT;0;Out;;Inherit;False;UVClamp;True;False;0;;False;8;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;4;FLOAT;0;FLOAT;6;FLOAT;7;FLOAT;8\nNode;AmplifyShaderEditor.Compare;11;368.2925,167.3695;Inherit;False;0;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.FunctionInput;19;207.561,58.12922;Inherit;False;AR;1;2;False;1;0;FLOAT;0;False;1;FLOAT;0\nNode;AmplifyShaderEditor.SamplerNode;7;-176.5516,-155.0401;Inherit;True;Property;_MainTex1;MainTex1;1;0;Create;True;0;0;0;False;0;False;-1;2c6536772776dd84f872779990273bfc;2c6536772776dd84f872779990273bfc;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4\nWireConnection;5;0;38;0\nWireConnection;5;2;4;0\nWireConnection;4;0;15;0\nWireConnection;4;1;16;0\nWireConnection;38;0;18;0\nWireConnection;38;2;41;0\nWireConnection;41;0;40;0\nWireConnection;41;1;39;0\nWireConnection;26;0;21;8\nWireConnection;26;1;11;0\nWireConnection;23;0;21;8\nWireConnection;23;1;7;0\nWireConnection;28;0;27;0\nWireConnection;30;0;29;0\nWireConnection;31;0;30;0\nWireConnection;31;1;28;0\nWireConnection;32;0;28;0\nWireConnection;32;1;30;2\nWireConnection;33;0;30;1\nWireConnection;33;1;32;0\nWireConnection;34;0;31;0\nWireConnection;34;1;33;0\nWireConnection;34;2;30;3\nWireConnection;35;0;34;0\nWireConnection;35;1;23;0\nWireConnection;27;0;7;0\nWireConnection;36;0;35;0\nWireConnection;36;1;37;0\nWireConnection;20;0;26;0\nWireConnection;0;0;36;0\nWireConnection;22;0;5;0\nWireConnection;44;0;21;6\nWireConnection;44;1;21;7\nWireConnection;21;0;45;0\nWireConnection;21;1;24;0\nWireConnection;21;2;25;0\nWireConnection;21;3;43;0\nWireConnection;21;4;42;0\nWireConnection;21;5;22;0\nWireConnection;21;6;22;1\nWireConnection;11;0;19;0\nWireConnection;11;2;7;4\nWireConnection;11;3;7;1\nWireConnection;7;0;12;0\nWireConnection;7;1;44;0\nASEEND*/\n//CHKSM=19C1B717BDE1FD9B84785E6A0252231760B3CFAB"
21 | m_functionName:
22 | m_description:
23 | m_additionalIncludes:
24 | m_additionalIncludes: []
25 | m_outsideIncludes: []
26 | m_additionalPragmas:
27 | m_additionalPragmas: []
28 | m_outsidePragmas: []
29 | m_additionalDirectives:
30 | m_validData: 0
31 | m_isDirty: 0
32 | m_moduleName: ' Additional Directives'
33 | m_independentModule: 1
34 | m_customEdited: 0
35 | m_additionalDirectives: []
36 | m_shaderFunctionDirectives: []
37 | m_nativeDirectives: []
38 | m_nativeDirectivesIndex: -1
39 | m_nativeDirectivesFoldout: 0
40 | m_directivesSaveItems: []
41 | m_nodeCategory: 3
42 | m_headerStyle: 0
43 | m_headerColor: {r: 1, g: 0.4, b: 0, a: 1}
44 | m_customNodeCategory:
45 | m_previewPosition: 0
46 | m_hidden: 0
47 | m_url:
48 |
--------------------------------------------------------------------------------
/URP/PrimoToon/Dependencies/GetDepth.prefab:
--------------------------------------------------------------------------------
1 | %YAML 1.1
2 | %TAG !u! tag:unity3d.com,2011:
3 | --- !u!1 &3992499312672764382
4 | GameObject:
5 | m_ObjectHideFlags: 0
6 | m_CorrespondingSourceObject: {fileID: 0}
7 | m_PrefabInstance: {fileID: 0}
8 | m_PrefabAsset: {fileID: 0}
9 | serializedVersion: 6
10 | m_Component:
11 | - component: {fileID: 8309529970171264467}
12 | - component: {fileID: 2034513840781483735}
13 | m_Layer: 0
14 | m_Name: GetDepth
15 | m_TagString: Untagged
16 | m_Icon: {fileID: 0}
17 | m_NavMeshLayer: 0
18 | m_StaticEditorFlags: 0
19 | m_IsActive: 1
20 | --- !u!4 &8309529970171264467
21 | Transform:
22 | m_ObjectHideFlags: 0
23 | m_CorrespondingSourceObject: {fileID: 0}
24 | m_PrefabInstance: {fileID: 0}
25 | m_PrefabAsset: {fileID: 0}
26 | m_GameObject: {fileID: 3992499312672764382}
27 | m_LocalRotation: {x: 0.27059805, y: -0.6532815, z: 0.27059805, w: 0.6532815}
28 | m_LocalPosition: {x: 0, y: 0, z: 0}
29 | m_LocalScale: {x: 1, y: 1, z: 1}
30 | m_Children: []
31 | m_Father: {fileID: 0}
32 | m_RootOrder: 0
33 | m_LocalEulerAnglesHint: {x: 45, y: -90, z: 0}
34 | --- !u!108 &2034513840781483735
35 | Light:
36 | m_ObjectHideFlags: 0
37 | m_CorrespondingSourceObject: {fileID: 0}
38 | m_PrefabInstance: {fileID: 0}
39 | m_PrefabAsset: {fileID: 0}
40 | m_GameObject: {fileID: 3992499312672764382}
41 | m_Enabled: 1
42 | serializedVersion: 10
43 | m_Type: 1
44 | m_Shape: 0
45 | m_Color: {r: 1, g: 1, b: 1, a: 1}
46 | m_Intensity: 0.001
47 | m_Range: 10
48 | m_SpotAngle: 30
49 | m_InnerSpotAngle: 21.80208
50 | m_CookieSize: 10
51 | m_Shadows:
52 | m_Type: 2
53 | m_Resolution: 0
54 | m_CustomResolution: -1
55 | m_Strength: 0
56 | m_Bias: 0.05
57 | m_NormalBias: 0.4
58 | m_NearPlane: 0.2
59 | m_CullingMatrixOverride:
60 | e00: 1
61 | e01: 0
62 | e02: 0
63 | e03: 0
64 | e10: 0
65 | e11: 1
66 | e12: 0
67 | e13: 0
68 | e20: 0
69 | e21: 0
70 | e22: 1
71 | e23: 0
72 | e30: 0
73 | e31: 0
74 | e32: 0
75 | e33: 1
76 | m_UseCullingMatrixOverride: 0
77 | m_Cookie: {fileID: 0}
78 | m_DrawHalo: 0
79 | m_Flare: {fileID: 0}
80 | m_RenderMode: 0
81 | m_CullingMask:
82 | serializedVersion: 2
83 | m_Bits: 4294967295
84 | m_RenderingLayerMask: 1
85 | m_Lightmapping: 4
86 | m_LightShadowCasterMode: 0
87 | m_AreaSize: {x: 1, y: 1}
88 | m_BounceIntensity: 0
89 | m_ColorTemperature: 6570
90 | m_UseColorTemperature: 0
91 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
92 | m_UseBoundingSphereOverride: 0
93 | m_ShadowRadius: 0
94 | m_ShadowAngle: 0
95 |
--------------------------------------------------------------------------------
/URP/PrimoToon/PrimoToon-inputs.hlsli:
--------------------------------------------------------------------------------
1 | struct vsIn{
2 | vector
vertex : POSITION;
3 | vector normal : NORMAL;
4 | vector tangent : TANGENT;
5 | vector uv0 : TEXCOORD0;
6 | vector uv1 : TEXCOORD1;
7 | vector vertexcol : COLOR0;
8 | };
9 |
10 | struct vsOut{
11 | vector pos : SV_POSITION;
12 | vector normal : NORMAL; // object space
13 | vector tangent : TANGENT;
14 | vector uv : TEXCOORD0; // first 2 elements of vector for UV0, last 2 for UV1
15 | vector vertexWS : TEXCOORD1;
16 | vector screenPos : TEXCOORD2;
17 | vector vertexOS : TEXCOORD3;
18 | UNITY_FOG_COORDS(4)
19 | vector vertexcol : COLOR0;
20 | };
21 |
--------------------------------------------------------------------------------
/URP/PrimoToon/PrimoToon-shadows.hlsl:
--------------------------------------------------------------------------------
1 | struct appdata{
2 | vector vertex : POSITION;
3 | vector normal : NORMAL;
4 | vector uv0 : TEXCOORD0;
5 | vector uv1 : TEXCOORD1;
6 | UNITY_VERTEX_INPUT_INSTANCE_ID
7 | };
8 |
9 | struct v2f{
10 | vector pos : SV_POSITION;
11 | vector uv : TEXCOORD0;
12 | vector vertexOS : TEXCOORD1;
13 | UNITY_VERTEX_INPUT_INSTANCE_ID
14 | UNITY_VERTEX_OUTPUT_STEREO
15 | };
16 |
17 | v2f vert (appdata v){
18 | v2f o = (v2f)0;
19 | o.uv.xy = v.uv0;
20 | o.uv.zw = v.uv1;
21 | o.vertexOS = v.vertex;
22 | UNITY_SETUP_INSTANCE_ID(v);
23 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
24 | TRANSFER_SHADOW_CASTER_NORMALOFFSET(o)
25 | return o;
26 | }
27 |
28 | vector frag (v2f i) : SV_Target{
29 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
30 |
31 | // sample textures to objects
32 | vector mainTex = _MainTex.Sample(sampler_MainTex, vector(i.uv.xy));
33 |
34 | /* WEAPON */
35 |
36 | if(_UseWeapon != 0.0){
37 | vector weaponUVs = (_ProceduralUVs != 0.0) ? (i.vertexOS.zx + 0.25) * 1.5 : i.uv.zw;
38 |
39 | vector dissolve = 0.0;
40 |
41 | /* DISSOLVE */
42 |
43 | calculateDissolve(dissolve, weaponUVs.xy, 1.0);
44 |
45 | /*buf = dissolveTex < 0.99;
46 |
47 | dissolveTex.x -= 0.001;
48 | dissolveTex.x = dissolveTex.x < 0.0;
49 | dissolveTex.x = (buf) ? dissolveTex.x : 0.0;*/
50 |
51 | /* END OF DISSOLVE */
52 |
53 | // apply dissolve
54 | //globalOutlineColor.w = dissolve.x;
55 | clip(dissolve.x - _ClipAlphaThreshold);
56 | }
57 |
58 | /* END OF WEAPON */
59 |
60 |
61 | /* CUTOUT TRANSPARENCY */
62 |
63 | if(_ToggleCutout != 0.0) clip(mainTex.w - 0.03 - _TransparencyCutoff);
64 |
65 | /* END OF CUTOUT TRANSPARENCY */
66 |
67 |
68 | return 0;
69 | }
70 |
--------------------------------------------------------------------------------
/URP/PrimoToon/Scripts/AverageNormals.cs:
--------------------------------------------------------------------------------
1 | /* https://zhuanlan.zhihu.com/p/109101851 */
2 |
3 | using System.Collections;
4 | using System.Collections.Generic;
5 | using UnityEditor;
6 | using UnityEngine; // 作者:艺术菌毯 https://www.bilibili.com/read/cv16418815 出处:bilibili
7 |
8 | public class AverageNormals
9 | {
10 | [MenuItem("Assets/Tools/Reconstruct Tangents with Split Normals")]
11 | public static void WirteAverageNormalToTangentToos()
12 | {
13 | MeshFilter[] meshFilters = Selection.activeGameObject.GetComponentsInChildren();
14 | foreach (var meshFilter in meshFilters)
15 | {
16 | Mesh mesh = meshFilter.sharedMesh;
17 | WirteAverageNormalToTangent(mesh);
18 | }
19 |
20 | SkinnedMeshRenderer[] skinMeshRenders = Selection.activeGameObject.GetComponentsInChildren();
21 | foreach (var skinMeshRender in skinMeshRenders)
22 | {
23 | Mesh mesh = skinMeshRender.sharedMesh;
24 | WirteAverageNormalToTangent(mesh);
25 | }
26 | }
27 |
28 | private static void WirteAverageNormalToTangent(Mesh mesh)
29 | {
30 | var averageNormalHash = new Dictionary();
31 | for (var j = 0; j < mesh.vertexCount; j++)
32 | {
33 | if (!averageNormalHash.ContainsKey(mesh.vertices[j]))
34 | {
35 | averageNormalHash.Add(mesh.vertices[j], mesh.normals[j]);
36 | }
37 | else
38 | {
39 | averageNormalHash[mesh.vertices[j]] =
40 | (averageNormalHash[mesh.vertices[j]] + mesh.normals[j]).normalized;
41 | }
42 | }
43 |
44 | var averageNormals = new Vector3[mesh.vertexCount];
45 | for (var j = 0; j < mesh.vertexCount; j++)
46 | {
47 | averageNormals[j] = averageNormalHash[mesh.vertices[j]];
48 | }
49 |
50 | var tangents = new Vector4[mesh.vertexCount];
51 | for (var j = 0; j < mesh.vertexCount; j++)
52 | {
53 | tangents[j] = new Vector4(averageNormals[j].x, averageNormals[j].y, averageNormals[j].z, 0);
54 | }
55 | mesh.tangents = tangents;
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/URP/SoftParticleFade.hlsl:
--------------------------------------------------------------------------------
1 | #ifndef SOFT_PARTICLE_FADE
2 | #define SOFT_PARTICLE_FADE
3 |
4 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
5 |
6 | // Z buffer to linear depth
7 | inline float LinearEyeDepth( float z )
8 | {
9 | return 1.0 / (_ZBufferParams.z * z + _ZBufferParams.w);
10 | }
11 |
12 | inline float4 TransformSoftParticle( float4 vertex )
13 | {
14 | #if SOFTPAR_ON
15 | float4 projPos = ComputeScreenPos(vertex);
16 | return projPos;
17 | #endif
18 | return 0;
19 | }
20 |
21 | inline half ApplySoftParticle( float4 projPos, half col )
22 | {
23 | #if SOFTPAR_ON
24 | half sceneZ = LinearEyeDepth(SampleSceneDepth(projPos.xy / projPos.w), _ZBufferParams);
25 | half depthDiff = sceneZ - projPos.w;
26 | half fade = (1 - _SoftParticleFade) * depthDiff * 0.5;
27 | fade = saturate(fade);
28 | return col * fade;
29 | #endif
30 | return col;
31 | }
32 |
33 | #define SOFT_PARTICLE_POS(idx) float4 projPos : TEXCOORD##idx;
34 |
35 | #define TRANSFORM_SOFT_PARTICLE_POS(o) o.projPos = TransformSoftParticle(o.vertex);
36 |
37 | #define APPLY_SOFT_PARTICLE(projPos, col) col.a = ApplySoftParticle(projPos, col.a)
38 |
39 |
40 | #endif//SOFT_PARTICLE_FADE
--------------------------------------------------------------------------------
/URP/Soung_BaseAdd.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/个人制作/基础Addtive"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_MainColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend One One
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 | Offset 0 , 0
29 |
30 |
31 |
32 | Pass
33 | {
34 | Name "Unlit"
35 |
36 | CGPROGRAM
37 |
38 |
39 |
40 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
41 | //only defining to not throw compilation error over Unity 5.5
42 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
43 | #endif
44 | #pragma vertex vert
45 | #pragma fragment frag
46 | #pragma multi_compile_instancing
47 | #include "UnityCG.cginc"
48 |
49 |
50 | struct appdata
51 | {
52 | float4 vertex : POSITION;
53 | float4 color : COLOR;
54 | float4 ase_texcoord : TEXCOORD0;
55 | UNITY_VERTEX_INPUT_INSTANCE_ID
56 | };
57 |
58 | struct v2f
59 | {
60 | float4 vertex : SV_POSITION;
61 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
62 | float3 worldPos : TEXCOORD0;
63 | #endif
64 | float4 ase_texcoord1 : TEXCOORD1;
65 | float4 ase_color : COLOR;
66 | UNITY_VERTEX_INPUT_INSTANCE_ID
67 | UNITY_VERTEX_OUTPUT_STEREO
68 | };
69 |
70 | uniform sampler2D _MainTex;
71 | uniform float4 _MainTex_ST;
72 | uniform float4 _MainColor;
73 |
74 |
75 | v2f vert ( appdata v )
76 | {
77 | v2f o;
78 | UNITY_SETUP_INSTANCE_ID(v);
79 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
80 | UNITY_TRANSFER_INSTANCE_ID(v, o);
81 |
82 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
83 | o.ase_color = v.color;
84 |
85 | //setting value to unused interpolator channels and avoid initialization warnings
86 | o.ase_texcoord1.zw = 0;
87 | float3 vertexValue = float3(0, 0, 0);
88 | #if ASE_ABSOLUTE_VERTEX_POS
89 | vertexValue = v.vertex.xyz;
90 | #endif
91 | vertexValue = vertexValue;
92 | #if ASE_ABSOLUTE_VERTEX_POS
93 | v.vertex.xyz = vertexValue;
94 | #else
95 | v.vertex.xyz += vertexValue;
96 | #endif
97 | o.vertex = UnityObjectToClipPos(v.vertex);
98 |
99 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
100 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
101 | #endif
102 | return o;
103 | }
104 |
105 | fixed4 frag (v2f i ) : SV_Target
106 | {
107 | UNITY_SETUP_INSTANCE_ID(i);
108 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
109 | fixed4 finalColor;
110 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
111 | float3 WorldPosition = i.worldPos;
112 | #endif
113 | float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
114 |
115 |
116 | finalColor = ( tex2D( _MainTex, uv_MainTex ) * _MainColor * i.ase_color );
117 | return finalColor;
118 | }
119 | ENDCG
120 | }
121 | }
122 | CustomEditor "ASEMaterialInspector"
123 |
124 | Fallback "Particles/Standard Unlit"
125 | }
126 | /*ASEBEGIN
127 | Version=19105
128 | Node;AmplifyShaderEditor.SamplerNode;1;-325.9988,-9.948395;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
129 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-528.9988,14.05161;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
130 | Node;AmplifyShaderEditor.VertexColorNode;4;-197.9988,348.0516;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
131 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-4.998779,160.0516;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
132 | Node;AmplifyShaderEditor.ColorNode;3;-238.9988,179.0516;Inherit;False;Property;_MainColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
133 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;120,160;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/个人制作/基础Addtive;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;4;1;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;Particles/Standard Unlit;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
134 | WireConnection;1;1;2;0
135 | WireConnection;5;0;1;0
136 | WireConnection;5;1;3;0
137 | WireConnection;5;2;4;0
138 | WireConnection;0;0;5;0
139 | ASEEND*/
140 | //CHKSM=BCA08ECCC03CBD5B835A8EC4F019B542D4D5C816
--------------------------------------------------------------------------------
/URP/Soung_BaseAlphaBlend.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/个人制作/基础AlphaBlend"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_MainColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend SrcAlpha OneMinusSrcAlpha
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 | Offset 0 , 0
29 |
30 |
31 |
32 | Pass
33 | {
34 | Name "Unlit"
35 |
36 | CGPROGRAM
37 |
38 |
39 |
40 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
41 | //only defining to not throw compilation error over Unity 5.5
42 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
43 | #endif
44 | #pragma vertex vert
45 | #pragma fragment frag
46 | #pragma multi_compile_instancing
47 | #include "UnityCG.cginc"
48 | #define ASE_NEEDS_FRAG_COLOR
49 |
50 |
51 | struct appdata
52 | {
53 | float4 vertex : POSITION;
54 | float4 color : COLOR;
55 | float4 ase_texcoord : TEXCOORD0;
56 | UNITY_VERTEX_INPUT_INSTANCE_ID
57 | };
58 |
59 | struct v2f
60 | {
61 | float4 vertex : SV_POSITION;
62 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
63 | float3 worldPos : TEXCOORD0;
64 | #endif
65 | float4 ase_texcoord1 : TEXCOORD1;
66 | float4 ase_color : COLOR;
67 | UNITY_VERTEX_INPUT_INSTANCE_ID
68 | UNITY_VERTEX_OUTPUT_STEREO
69 | };
70 |
71 | uniform sampler2D _MainTex;
72 | uniform float4 _MainTex_ST;
73 | uniform float4 _MainColor;
74 |
75 |
76 | v2f vert ( appdata v )
77 | {
78 | v2f o;
79 | UNITY_SETUP_INSTANCE_ID(v);
80 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
81 | UNITY_TRANSFER_INSTANCE_ID(v, o);
82 |
83 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
84 | o.ase_color = v.color;
85 |
86 | //setting value to unused interpolator channels and avoid initialization warnings
87 | o.ase_texcoord1.zw = 0;
88 | float3 vertexValue = float3(0, 0, 0);
89 | #if ASE_ABSOLUTE_VERTEX_POS
90 | vertexValue = v.vertex.xyz;
91 | #endif
92 | vertexValue = vertexValue;
93 | #if ASE_ABSOLUTE_VERTEX_POS
94 | v.vertex.xyz = vertexValue;
95 | #else
96 | v.vertex.xyz += vertexValue;
97 | #endif
98 | o.vertex = UnityObjectToClipPos(v.vertex);
99 |
100 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
101 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
102 | #endif
103 | return o;
104 | }
105 |
106 | fixed4 frag (v2f i ) : SV_Target
107 | {
108 | UNITY_SETUP_INSTANCE_ID(i);
109 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
110 | fixed4 finalColor;
111 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
112 | float3 WorldPosition = i.worldPos;
113 | #endif
114 | float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
115 | float4 tex2DNode1 = tex2D( _MainTex, uv_MainTex );
116 | float4 appendResult6 = (float4((( tex2DNode1 * _MainColor * i.ase_color )).rgb , ( tex2DNode1.a * _MainColor.a * i.ase_color.a )));
117 |
118 |
119 | finalColor = (appendResult6).xyzw;
120 | return finalColor;
121 | }
122 | ENDCG
123 | }
124 | }
125 | CustomEditor "ASEMaterialInspector"
126 |
127 | Fallback "Mobile/Particles/Alpha Blended"
128 | }
129 | /*ASEBEGIN
130 | Version=19105
131 | Node;AmplifyShaderEditor.SamplerNode;1;-450.9988,-8.948395;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
132 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-653.9988,15.05161;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
133 | Node;AmplifyShaderEditor.VertexColorNode;4;-322.9988,349.0516;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
134 | Node;AmplifyShaderEditor.ColorNode;3;-363.9988,180.0516;Inherit;False;Property;_MainColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
135 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-120.9988,161.0516;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
136 | Node;AmplifyShaderEditor.ComponentMaskNode;7;8.00061,157.5516;Inherit;False;True;True;True;False;1;0;COLOR;0,0,0,0;False;1;FLOAT3;0
137 | Node;AmplifyShaderEditor.DynamicAppendNode;6;194.0006,163.5516;Inherit;True;FLOAT4;4;0;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT4;0
138 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;8;-36.99939,396.5516;Inherit;False;3;3;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;1;FLOAT;0
139 | Node;AmplifyShaderEditor.ComponentMaskNode;9;406.0006,159.5516;Inherit;False;True;True;True;True;1;0;FLOAT4;0,0,0,0;False;1;FLOAT4;0
140 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;587,165;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/个人制作/基础AlphaBlend;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;Mobile/Particles/Alpha Blended;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
141 | WireConnection;1;1;2;0
142 | WireConnection;5;0;1;0
143 | WireConnection;5;1;3;0
144 | WireConnection;5;2;4;0
145 | WireConnection;7;0;5;0
146 | WireConnection;6;0;7;0
147 | WireConnection;6;3;8;0
148 | WireConnection;8;0;1;4
149 | WireConnection;8;1;3;4
150 | WireConnection;8;2;4;4
151 | WireConnection;9;0;6;0
152 | WireConnection;0;0;9;0
153 | ASEEND*/
154 | //CHKSM=11CE487FD1F7A30FBEBE5B00FA1E82F9F7EE2980
--------------------------------------------------------------------------------
/URP/Soung_MaskFlowURP.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/个人制作/URP遮罩流动"
4 | {
5 | Properties
6 | {
7 | _MainTex("主纹理", 2D) = "white" {}
8 | [KeywordEnum(R,A)] _Keyword0("切换贴图通道", Float) = 0
9 | [HDR]_MainColor("主颜色", Color) = (1,1,1,0.5254902)
10 | _MainSpeed("主纹理速度", Vector) = (0,0,0,0)
11 | _Mask("遮罩", 2D) = "white" {}
12 | _MaskSpeed("遮罩速度", Vector) = (0,0,0,0)
13 |
14 | }
15 |
16 | SubShader
17 | {
18 |
19 |
20 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
21 | LOD 100
22 |
23 | CGINCLUDE
24 | #pragma target 3.0
25 | ENDCG
26 | Blend One One
27 | AlphaToMask Off
28 | Cull Off
29 | ColorMask RGBA
30 | ZWrite Off
31 | ZTest LEqual
32 | Offset 0 , 0
33 |
34 |
35 |
36 | Pass
37 | {
38 | Name "Unlit"
39 |
40 | CGPROGRAM
41 |
42 |
43 |
44 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
45 | //only defining to not throw compilation error over Unity 5.5
46 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
47 | #endif
48 | #pragma vertex vert
49 | #pragma fragment frag
50 | #pragma multi_compile_instancing
51 | #include "UnityCG.cginc"
52 | #include "UnityShaderVariables.cginc"
53 | #pragma shader_feature_local _KEYWORD0_R _KEYWORD0_A
54 |
55 |
56 | struct appdata
57 | {
58 | float4 vertex : POSITION;
59 | float4 color : COLOR;
60 | float4 ase_texcoord : TEXCOORD0;
61 | UNITY_VERTEX_INPUT_INSTANCE_ID
62 | };
63 |
64 | struct v2f
65 | {
66 | float4 vertex : SV_POSITION;
67 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
68 | float3 worldPos : TEXCOORD0;
69 | #endif
70 | float4 ase_texcoord1 : TEXCOORD1;
71 | UNITY_VERTEX_INPUT_INSTANCE_ID
72 | UNITY_VERTEX_OUTPUT_STEREO
73 | };
74 |
75 | uniform sampler2D _MainTex;
76 | uniform float2 _MainSpeed;
77 | uniform float4 _MainTex_ST;
78 | uniform sampler2D _Mask;
79 | uniform float2 _MaskSpeed;
80 | uniform float4 _Mask_ST;
81 | uniform float4 _MainColor;
82 |
83 |
84 | v2f vert ( appdata v )
85 | {
86 | v2f o;
87 | UNITY_SETUP_INSTANCE_ID(v);
88 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
89 | UNITY_TRANSFER_INSTANCE_ID(v, o);
90 |
91 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
92 |
93 | //setting value to unused interpolator channels and avoid initialization warnings
94 | o.ase_texcoord1.zw = 0;
95 | float3 vertexValue = float3(0, 0, 0);
96 | #if ASE_ABSOLUTE_VERTEX_POS
97 | vertexValue = v.vertex.xyz;
98 | #endif
99 | vertexValue = vertexValue;
100 | #if ASE_ABSOLUTE_VERTEX_POS
101 | v.vertex.xyz = vertexValue;
102 | #else
103 | v.vertex.xyz += vertexValue;
104 | #endif
105 | o.vertex = UnityObjectToClipPos(v.vertex);
106 |
107 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
108 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
109 | #endif
110 | return o;
111 | }
112 |
113 | fixed4 frag (v2f i ) : SV_Target
114 | {
115 | UNITY_SETUP_INSTANCE_ID(i);
116 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
117 | fixed4 finalColor;
118 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
119 | float3 WorldPosition = i.worldPos;
120 | #endif
121 | float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
122 | float2 panner6 = ( 1.0 * _Time.y * _MainSpeed + uv_MainTex);
123 | float4 tex2DNode1 = tex2D( _MainTex, panner6 );
124 | #if defined(_KEYWORD0_R)
125 | float staticSwitch14 = tex2DNode1.r;
126 | #elif defined(_KEYWORD0_A)
127 | float staticSwitch14 = tex2DNode1.a;
128 | #else
129 | float staticSwitch14 = tex2DNode1.r;
130 | #endif
131 | float2 uv_Mask = i.ase_texcoord1.xy * _Mask_ST.xy + _Mask_ST.zw;
132 | float2 panner8 = ( 1.0 * _Time.y * _MaskSpeed + uv_Mask);
133 |
134 |
135 | finalColor = ( staticSwitch14 * tex2D( _Mask, panner8 ) * _MainColor );
136 | return finalColor;
137 | }
138 | ENDCG
139 | }
140 | }
141 | CustomEditor "ASEMaterialInspector"
142 |
143 | Fallback Off
144 | }
145 | /*ASEBEGIN
146 | Version=19105
147 | Node;AmplifyShaderEditor.TextureCoordinatesNode;5;-108.2305,-206.0778;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
148 | Node;AmplifyShaderEditor.Vector2Node;9;-43.66375,-77.25922;Inherit;False;Property;_MainSpeed;主纹理速度;3;0;Create;False;0;0;0;False;0;False;0,0;0.2,0.5;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
149 | Node;AmplifyShaderEditor.PannerNode;8;129.5365,61.84879;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
150 | Node;AmplifyShaderEditor.TextureCoordinatesNode;7;-104.4636,57.94882;Inherit;False;0;2;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
151 | Node;AmplifyShaderEditor.Vector2Node;10;-40.03563,186.9192;Inherit;False;Property;_MaskSpeed;遮罩速度;5;0;Create;False;0;0;0;False;0;False;0,0;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
152 | Node;AmplifyShaderEditor.SamplerNode;2;325.6628,32.03078;Inherit;True;Property;_Mask;遮罩;4;0;Create;False;0;0;0;False;0;False;-1;a612770946f74084ab9aad5dd7153963;a612770946f74084ab9aad5dd7153963;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
153 | Node;AmplifyShaderEditor.PannerNode;6;118.3692,-202.1778;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
154 | Node;AmplifyShaderEditor.ColorNode;13;414.8799,226.3087;Inherit;False;Property;_MainColor;主颜色;2;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,0.5254902;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
155 | Node;AmplifyShaderEditor.SamplerNode;1;283.6625,-230.9693;Inherit;True;Property;_MainTex;主纹理;0;0;Create;False;0;0;0;False;0;False;-1;a2c964cec884ca04397d9a706868d6ba;498e15623baea7d4c8308a3580ab1a41;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
156 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;761.4211,-117.1667;Inherit;True;3;3;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
157 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;988.5906,-116.0534;Float;False;True;-1;2;ASEMaterialInspector;100;5;ASE/01Mask;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;4;1;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;True;True;2;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
158 | Node;AmplifyShaderEditor.StaticSwitch;14;574.3503,-167.3147;Inherit;False;Property;_Keyword0;切换贴图通道;1;0;Create;False;0;0;0;False;0;False;0;0;0;True;;KeywordEnum;2;R;A;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
159 | WireConnection;8;0;7;0
160 | WireConnection;8;2;10;0
161 | WireConnection;2;1;8;0
162 | WireConnection;6;0;5;0
163 | WireConnection;6;2;9;0
164 | WireConnection;1;1;6;0
165 | WireConnection;11;0;14;0
166 | WireConnection;11;1;2;0
167 | WireConnection;11;2;13;0
168 | WireConnection;0;0;11;0
169 | WireConnection;14;1;1;1
170 | WireConnection;14;0;1;4
171 | ASEEND*/
172 | //CHKSM=661A638606DB34C08FC4CF648A2232227BEBD199
--------------------------------------------------------------------------------
/URP/Soung_RaodongURP.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/个人制作/URP扰动"
4 | {
5 | Properties
6 | {
7 | _MainTex("主纹理", 2D) = "white" {}
8 | _Distr("UV扰动", 2D) = "white" {}
9 | _NoiseInt("扰动强度", Range( 0 , 1)) = 0.06342169
10 | _NoiseU("扰动U方向速率", Float) = 1
11 | _NoiseV("扰动V方向速率", Float) = 1
12 | [KeywordEnum(R,A)] _Keyword0("切换贴图通道", Float) = 0
13 |
14 | }
15 |
16 | SubShader
17 | {
18 |
19 |
20 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
21 | LOD 100
22 |
23 | CGINCLUDE
24 | #pragma target 3.0
25 | ENDCG
26 | Blend SrcAlpha OneMinusSrcAlpha
27 | AlphaToMask Off
28 | Cull Off
29 | ColorMask RGBA
30 | ZWrite Off
31 | ZTest LEqual
32 | Offset 0 , 0
33 |
34 |
35 |
36 | Pass
37 | {
38 | Name "Unlit"
39 |
40 | CGPROGRAM
41 |
42 |
43 |
44 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
45 | //only defining to not throw compilation error over Unity 5.5
46 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
47 | #endif
48 | #pragma vertex vert
49 | #pragma fragment frag
50 | #pragma multi_compile_instancing
51 | #include "UnityCG.cginc"
52 | #include "UnityShaderVariables.cginc"
53 | #pragma shader_feature_local _KEYWORD0_R _KEYWORD0_A
54 |
55 |
56 | struct appdata
57 | {
58 | float4 vertex : POSITION;
59 | float4 color : COLOR;
60 | float4 ase_texcoord : TEXCOORD0;
61 | UNITY_VERTEX_INPUT_INSTANCE_ID
62 | };
63 |
64 | struct v2f
65 | {
66 | float4 vertex : SV_POSITION;
67 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
68 | float3 worldPos : TEXCOORD0;
69 | #endif
70 | float4 ase_texcoord1 : TEXCOORD1;
71 | UNITY_VERTEX_INPUT_INSTANCE_ID
72 | UNITY_VERTEX_OUTPUT_STEREO
73 | };
74 |
75 | uniform sampler2D _MainTex;
76 | uniform float4 _MainTex_ST;
77 | uniform sampler2D _Distr;
78 | uniform float _NoiseU;
79 | uniform float _NoiseV;
80 | uniform float4 _Distr_ST;
81 | uniform float _NoiseInt;
82 |
83 |
84 | v2f vert ( appdata v )
85 | {
86 | v2f o;
87 | UNITY_SETUP_INSTANCE_ID(v);
88 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
89 | UNITY_TRANSFER_INSTANCE_ID(v, o);
90 |
91 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
92 |
93 | //setting value to unused interpolator channels and avoid initialization warnings
94 | o.ase_texcoord1.zw = 0;
95 | float3 vertexValue = float3(0, 0, 0);
96 | #if ASE_ABSOLUTE_VERTEX_POS
97 | vertexValue = v.vertex.xyz;
98 | #endif
99 | vertexValue = vertexValue;
100 | #if ASE_ABSOLUTE_VERTEX_POS
101 | v.vertex.xyz = vertexValue;
102 | #else
103 | v.vertex.xyz += vertexValue;
104 | #endif
105 | o.vertex = UnityObjectToClipPos(v.vertex);
106 |
107 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
108 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
109 | #endif
110 | return o;
111 | }
112 |
113 | fixed4 frag (v2f i ) : SV_Target
114 | {
115 | UNITY_SETUP_INSTANCE_ID(i);
116 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
117 | fixed4 finalColor;
118 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
119 | float3 WorldPosition = i.worldPos;
120 | #endif
121 | float2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
122 | float2 appendResult9 = (float2(_NoiseU , _NoiseV));
123 | float2 uv_Distr = i.ase_texcoord1.xy * _Distr_ST.xy + _Distr_ST.zw;
124 | float2 panner8 = ( 1.0 * _Time.y * appendResult9 + uv_Distr);
125 | float4 tex2DNode2 = tex2D( _Distr, panner8 );
126 | #if defined(_KEYWORD0_R)
127 | float staticSwitch13 = tex2DNode2.r;
128 | #elif defined(_KEYWORD0_A)
129 | float staticSwitch13 = tex2DNode2.a;
130 | #else
131 | float staticSwitch13 = tex2DNode2.r;
132 | #endif
133 | float2 temp_cast_0 = (staticSwitch13).xx;
134 | float2 lerpResult5 = lerp( uv_MainTex , temp_cast_0 , _NoiseInt);
135 |
136 |
137 | finalColor = tex2D( _MainTex, lerpResult5 );
138 | return finalColor;
139 | }
140 | ENDCG
141 | }
142 | }
143 | CustomEditor "ASEMaterialInspector"
144 |
145 | Fallback Off
146 | }
147 | /*ASEBEGIN
148 | Version=19105
149 | Node;AmplifyShaderEditor.LerpOp;5;-798.5986,4.797736;Inherit;False;3;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;1;FLOAT2;0
150 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;-234.4519,-18.25075;Float;False;True;-1;2;ASEMaterialInspector;100;5;ASE/04Distr;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;True;True;2;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
151 | Node;AmplifyShaderEditor.SamplerNode;1;-641.2419,-24.1893;Inherit;True;Property;_MainTex;主纹理;0;0;Create;False;0;0;0;False;0;False;-1;4838c7a9192e9704f9ff8f4950911a44;498e15623baea7d4c8308a3580ab1a41;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
152 | Node;AmplifyShaderEditor.RangedFloatNode;6;-1184.334,245.54;Inherit;False;Property;_NoiseInt;扰动强度;2;0;Create;False;0;0;0;False;0;False;0.06342169;0;0;1;0;1;FLOAT;0
153 | Node;AmplifyShaderEditor.DynamicAppendNode;9;-1580.197,209.6582;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
154 | Node;AmplifyShaderEditor.RangedFloatNode;12;-1727.197,280.6582;Inherit;False;Property;_NoiseV;NoiseV;4;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
155 | Node;AmplifyShaderEditor.RangedFloatNode;11;-1729.197,204.6582;Inherit;False;Property;_NoiseU;NoiseU;3;0;Create;True;0;0;0;False;0;False;1;1;0;0;0;1;FLOAT;0
156 | Node;AmplifyShaderEditor.TextureCoordinatesNode;3;-1133.694,-69.50896;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
157 | Node;AmplifyShaderEditor.PannerNode;8;-1393.3,82.65823;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
158 | Node;AmplifyShaderEditor.TextureCoordinatesNode;7;-1668.197,82.65823;Inherit;False;0;2;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
159 | Node;AmplifyShaderEditor.SamplerNode;2;-1224.601,52.22245;Inherit;True;Property;_Distr;UV扰动;1;0;Create;False;0;0;0;False;0;False;-1;ef4eb6d271748b4478d1a301146f7faa;ef4eb6d271748b4478d1a301146f7faa;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
160 | Node;AmplifyShaderEditor.StaticSwitch;13;-943.9159,111.7945;Inherit;False;Property;_Keyword0;切换贴图通道;5;0;Create;False;0;0;0;False;0;False;0;0;0;True;;KeywordEnum;2;R;A;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
161 | WireConnection;5;0;3;0
162 | WireConnection;5;1;13;0
163 | WireConnection;5;2;6;0
164 | WireConnection;0;0;1;0
165 | WireConnection;1;1;5;0
166 | WireConnection;9;0;11;0
167 | WireConnection;9;1;12;0
168 | WireConnection;8;0;7;0
169 | WireConnection;8;2;9;0
170 | WireConnection;2;1;8;0
171 | WireConnection;13;1;2;1
172 | WireConnection;13;0;2;4
173 | ASEEND*/
174 | //CHKSM=D9AC72DFAA595B2481FE8D25EB03031673302570
--------------------------------------------------------------------------------
/URP/UnityURPToonLitShaderExample/NiloInvLerpRemap.hlsl:
--------------------------------------------------------------------------------
1 | // https://github.com/ronja-tutorials/ShaderTutorials/blob/master/Assets/047_InverseInterpolationAndRemap/Interpolation.cginc
2 | // edit float to half for optimization, because we usually use this to process color data(half)
3 |
4 | #ifndef Include_NiloInvLerpRemap
5 | #define Include_NiloInvLerpRemap
6 |
7 | // just like smoothstep(), but linear, not clamped
8 | half invLerp(half from, half to, half value)
9 | {
10 | return (value - from) / (to - from);
11 | }
12 | half invLerpClamp(half from, half to, half value)
13 | {
14 | return saturate(invLerp(from,to,value));
15 | }
16 | // full control remap, but slower
17 | half remap(half origFrom, half origTo, half targetFrom, half targetTo, half value)
18 | {
19 | half rel = invLerp(origFrom, origTo, value);
20 | return lerp(targetFrom, targetTo, rel);
21 | }
22 | #endif
23 |
--------------------------------------------------------------------------------
/URP/UnityURPToonLitShaderExample/NiloOutlineUtil.hlsl:
--------------------------------------------------------------------------------
1 | // For more information, visit -> https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample
2 |
3 | #ifndef Include_NiloOutlineUtil
4 | #define Include_NiloOutlineUtil
5 |
6 | // If your project has a faster way to get camera fov in shader, you can replace this slow function to your method.
7 | // For example, you write cmd.SetGlobalFloat("_CurrentCameraFOV",cameraFOV) using a new RendererFeature in C#.
8 | // For this tutorial shader, we will keep things simple and use this slower but convenient method to get camera fov
9 | float GetCameraFOV()
10 | {
11 | //https://answers.unity.com/questions/770838/how-can-i-extract-the-fov-information-from-the-pro.html
12 | float t = unity_CameraProjection._m11;
13 | float Rad2Deg = 180 / 3.1415;
14 | float fov = atan(1.0f / t) * 2.0 * Rad2Deg;
15 | return fov;
16 | }
17 | float ApplyOutlineDistanceFadeOut(float inputMulFix)
18 | {
19 | //make outline "fadeout" if character is too small in camera's view
20 | return saturate(inputMulFix);
21 | }
22 | float GetOutlineCameraFovAndDistanceFixMultiplier(float positionVS_Z)
23 | {
24 | float cameraMulFix;
25 | if(unity_OrthoParams.w == 0)
26 | {
27 | ////////////////////////////////
28 | // Perspective camera case
29 | ////////////////////////////////
30 |
31 | // keep outline similar width on screen accoss all camera distance
32 | cameraMulFix = abs(positionVS_Z);
33 |
34 | // can replace to a tonemap function if a smooth stop is needed
35 | cameraMulFix = ApplyOutlineDistanceFadeOut(cameraMulFix);
36 |
37 | // keep outline similar width on screen accoss all camera fov
38 | cameraMulFix *= GetCameraFOV();
39 | }
40 | else
41 | {
42 | ////////////////////////////////
43 | // Orthographic camera case
44 | ////////////////////////////////
45 | float orthoSize = abs(unity_OrthoParams.y);
46 | orthoSize = ApplyOutlineDistanceFadeOut(orthoSize);
47 | cameraMulFix = orthoSize * 50; // 50 is a magic number to match perspective camera's outline width
48 | }
49 |
50 | return cameraMulFix * 0.00005; // mul a const to make return result = default normal expand amount WS
51 | }
52 | #endif
53 |
54 |
--------------------------------------------------------------------------------
/URP/UnityURPToonLitShaderExample/NiloZOffset.hlsl:
--------------------------------------------------------------------------------
1 | // For more information, visit -> https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample
2 |
3 | #ifndef Include_NiloZOffset
4 | #define Include_NiloZOffset
5 |
6 | // Push an imaginary vertex towards camera in view space (linear, view space unit),
7 | // then only overwrite original positionCS.z using imaginary vertex's result positionCS.z value
8 | // Will only affect ZTest ZWrite's depth value of vertex shader
9 |
10 | // Useful for:
11 | // -Hide ugly outline on face/eye
12 | // -Make eyebrow render on top of hair
13 | // -Solve ZFighting issue without moving geometry
14 | float4 NiloGetNewClipPosWithZOffset(float4 originalPositionCS, float viewSpaceZOffsetAmount)
15 | {
16 | if(unity_OrthoParams.w == 0)
17 | {
18 | ////////////////////////////////
19 | //Perspective camera case
20 | ////////////////////////////////
21 | float2 ProjM_ZRow_ZW = UNITY_MATRIX_P[2].zw;
22 | float modifiedPositionVS_Z = -originalPositionCS.w + -viewSpaceZOffsetAmount; // push imaginary vertex
23 | float modifiedPositionCS_Z = modifiedPositionVS_Z * ProjM_ZRow_ZW[0] + ProjM_ZRow_ZW[1];
24 | originalPositionCS.z = modifiedPositionCS_Z * originalPositionCS.w / (-modifiedPositionVS_Z); // overwrite positionCS.z
25 | return originalPositionCS;
26 | }
27 | else
28 | {
29 | ////////////////////////////////
30 | //Orthographic camera case
31 | ////////////////////////////////
32 | originalPositionCS.z += -viewSpaceZOffsetAmount / _ProjectionParams.z; // push imaginary vertex and overwrite positionCS.z
33 | return originalPositionCS;
34 | }
35 | }
36 |
37 | #endif
38 |
39 |
--------------------------------------------------------------------------------
/URP/UnityURPToonLitShaderExample/SimpleURPToonLitOutlineExample_LightingEquation.hlsl:
--------------------------------------------------------------------------------
1 | // For more information, visit -> https://github.com/ColinLeung-NiloCat/UnityURPToonLitShaderExample
2 |
3 | // This file is intented for you to edit and experiment with different lighting equation.
4 | // Add or edit whatever code you want here
5 |
6 | // #pragma once is a safe guard best practice in almost every .hlsl (need Unity2020 or up),
7 | // doing this can make sure your .hlsl's user can include this .hlsl anywhere anytime without producing any multi include conflict
8 | #pragma once
9 |
10 | half3 ShadeGI(ToonSurfaceData surfaceData, ToonLightingData lightingData)
11 | {
12 | // hide 3D feeling by ignoring all detail SH (leaving only the constant SH term)
13 | // we just want some average envi indirect color only
14 | half3 averageSH = SampleSH(0);
15 |
16 | // can prevent result becomes completely black if lightprobe was not baked
17 | averageSH = max(_IndirectLightMinColor,averageSH);
18 |
19 | // occlusion (maximum 50% darken for indirect to prevent result becomes completely black)
20 | half indirectOcclusion = lerp(1, surfaceData.occlusion, 0.5);
21 | return averageSH * indirectOcclusion;
22 | }
23 |
24 | // Most important part: lighting equation, edit it according to your needs, write whatever you want here, be creative!
25 | // This function will be used by all direct lights (directional/point/spot)
26 | half3 ShadeSingleLight(ToonSurfaceData surfaceData, ToonLightingData lightingData, Light light, bool isAdditionalLight)
27 | {
28 | half3 N = lightingData.normalWS;
29 | half3 L = light.direction;
30 |
31 | half NoL = dot(N,L);
32 |
33 | half lightAttenuation = 1;
34 |
35 | // light's distance & angle fade for point light & spot light (see GetAdditionalPerObjectLight(...) in Lighting.hlsl)
36 | // Lighting.hlsl -> https://github.com/Unity-Technologies/Graphics/blob/master/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl
37 | half distanceAttenuation = min(4,light.distanceAttenuation); //clamp to prevent light over bright if point/spot light too close to vertex
38 |
39 | // N dot L
40 | // simplest 1 line cel shade, you can always replace this line by your own method!
41 | half litOrShadowArea = smoothstep(_CelShadeMidPoint-_CelShadeSoftness,_CelShadeMidPoint+_CelShadeSoftness, NoL);
42 |
43 | // occlusion
44 | litOrShadowArea *= surfaceData.occlusion;
45 |
46 | // face ignore celshade since it is usually very ugly using NoL method
47 | litOrShadowArea = _IsFace? lerp(0.5,1,litOrShadowArea) : litOrShadowArea;
48 |
49 | // light's shadow map
50 | litOrShadowArea *= lerp(1,light.shadowAttenuation,_ReceiveShadowMappingAmount);
51 |
52 | half3 litOrShadowColor = lerp(_ShadowMapColor,1, litOrShadowArea);
53 |
54 | half3 lightAttenuationRGB = litOrShadowColor * distanceAttenuation;
55 |
56 | // saturate() light.color to prevent over bright
57 | // additional light reduce intensity since it is additive
58 | return saturate(light.color) * lightAttenuationRGB * (isAdditionalLight ? 0.25 : 1);
59 | }
60 |
61 | half3 ShadeEmission(ToonSurfaceData surfaceData, ToonLightingData lightingData)
62 | {
63 | half3 emissionResult = lerp(surfaceData.emission, surfaceData.emission * surfaceData.albedo, _EmissionMulByBaseColor); // optional mul albedo
64 | return emissionResult;
65 | }
66 |
67 | half3 CompositeAllLightResults(half3 indirectResult, half3 mainLightResult, half3 additionalLightSumResult, half3 emissionResult, ToonSurfaceData surfaceData, ToonLightingData lightingData)
68 | {
69 | // [remember you can write anything here, this is just a simple tutorial method]
70 | // here we prevent light over bright,
71 | // while still want to preserve light color's hue
72 | half3 rawLightSum = max(indirectResult, mainLightResult + additionalLightSumResult); // pick the highest between indirect and direct light
73 | return surfaceData.albedo * rawLightSum + emissionResult;
74 | }
75 |
--------------------------------------------------------------------------------
/URP/X7_Blend_OutLIne.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/URP/简易描边_Outline"
2 | {
3 | Properties
4 | {
5 | // [Enum(UnityEngine.Rendering.BlendMode)] _SrcFactor("颜色混合因子", float) = 1
6 | // [Enum(UnityEngine.Rendering.BlendMode)] _DstFactor("背景混合因子", float) = 0
7 |
8 | _MainTex ("贴图1", 2D) = "white" {}
9 | [HDR]_MainCol ("色调",Color) = (1,1,1,1)
10 | _MainTex2 ("贴图2", 2D) = "white" {}
11 | [HDR]_MainCol2 ("色调",Color) = (1,1,1,1)
12 | _OutLine("描边长度",float) = 0.02
13 | _OutLineCol("描边颜色",Color) = (0,0,0,1)
14 |
15 |
16 | }
17 |
18 |
19 | SubShader
20 | {
21 |
22 | Tags { "RenderType"="Transparent" "RenderPipeline"="UniversalPipeline" "Queue" = "Transparent"}
23 |
24 | Blend SrcAlpha OneMinusSrcAlpha
25 | HLSLINCLUDE
26 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
27 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
28 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl"
29 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonMaterial.hlsl"
30 | TEXTURE2D(_MainTex);
31 | SAMPLER(sampler_MainTex);
32 | TEXTURE2D(_MainTex2);
33 | SAMPLER(sampler_MainTex2);
34 |
35 | CBUFFER_START(UnityPerMaterial)
36 | half4 _MainTex_ST;
37 | float4 _MainCol;
38 | half4 _MainTex2_ST;
39 | float4 _MainCol2;
40 | float _OutLine;
41 | float4 _OutLineCol;
42 | CBUFFER_END
43 | struct appdata
44 | {
45 | float4 vertex : POSITION;
46 | float3 normal : NORMAL;
47 | float2 uv : TEXCOORD0;
48 | UNITY_VERTEX_INPUT_INSTANCE_ID
49 | };
50 |
51 | struct v2f
52 | {
53 | float4 pos : SV_POSITION;
54 | float4 uv : TEXCOORD0;
55 | float3 posW :TEXCOORD1;
56 | float4 normal : TEXCOORD7;
57 | UNITY_VERTEX_INPUT_INSTANCE_ID
58 | };
59 |
60 |
61 |
62 |
63 |
64 |
65 | v2f vert (appdata v)
66 | {
67 | v2f o;
68 | UNITY_SETUP_INSTANCE_ID(v);
69 | o.pos = TransformObjectToHClip(v.vertex);
70 | o.uv.xy = TRANSFORM_TEX(v.uv, _MainTex);
71 | o.uv.zw = TRANSFORM_TEX(v.uv, _MainTex2);
72 | o.posW = TransformObjectToWorld(v.vertex.xyz);
73 |
74 | return o;
75 | }
76 |
77 | float4 frag (v2f i) : SV_Target
78 | {
79 | half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex,i.uv.xy);
80 | half4 col2 = SAMPLE_TEXTURE2D(_MainTex2, sampler_MainTex2,i.uv.zw);
81 | col *= _MainCol;
82 | col2 *= _MainCol2;
83 | half4 finalCol = col + col2;
84 | finalCol.a = saturate(finalCol.a);
85 | return finalCol;
86 | }
87 |
88 | v2f vertLine(appdata v)
89 | {
90 | v2f o;
91 | float4 viewPos = mul(UNITY_MATRIX_MV,v.vertex);
92 | float3 viewNor = mul((float3x3)UNITY_MATRIX_IT_MV,v.normal);
93 | float3 offset = normalize(viewNor) * _OutLine;
94 | viewPos.xyz += offset;
95 | o.pos = mul(UNITY_MATRIX_P,viewPos);
96 | return o;
97 | }
98 | float4 fragLine(v2f i) :SV_Target{
99 | return _OutLineCol;
100 | }
101 | ENDHLSL
102 |
103 | Pass
104 | {
105 | Tags { "LightMode" = "SRPDefaultUnlit"}
106 | // on
107 | zwrite on
108 | cull front
109 | HLSLPROGRAM
110 | #pragma vertex vert
111 | #pragma fragment frag
112 | #pragma multi_compile_instancing
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 | ENDHLSL
121 | }
122 | pass{
123 | Tags { "RenderType"="Transparent" "RenderPipeline"="UniversalPipeline" "LightMode" = "UniversalForward" "Queue" = "Transparent"}
124 | zwrite off
125 | cull back
126 | HLSLPROGRAM
127 | #pragma vertex vert
128 | #pragma fragment frag
129 | #pragma multi_compile_instancing
130 | ENDHLSL
131 | }
132 |
133 | pass
134 | {
135 | Tags { "RenderType"="Transparent" "RenderPipeline"="UniversalPipeline" "LightMode" = "LightWeightForward" "Queue" = "Transparent"}
136 | zwrite off
137 | cull front
138 | HLSLPROGRAM
139 | #pragma vertex vertLine
140 | #pragma fragment fragLine
141 | #pragma multi_compile_instancing
142 | ENDHLSL
143 |
144 | }
145 | //投影
146 |
147 | }
148 | //CustomEditor "Scarecrow.SimpleShaderGUI"
149 | }
150 |
--------------------------------------------------------------------------------
/URP/X7_Scroll2Layers-AlphaAdditive.shader:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 |
4 | Shader "A201-Shader/URP/叠加纹理_X7Additive"
5 | {
6 | Properties {
7 | _MainTex ("基础纹理", 2D) = "white" {}
8 | _DetailTex ("叠加纹理", 2D) = "white" {}
9 | _ScrollX ("基础纹理X方向流动速率", Float) = 1.0
10 | _ScrollY ("基础纹理Y方向流动速率", Float) = 0.0
11 | _Scroll2X ("叠加纹理X方向流动速率", Float) = 1.0
12 | _Scroll2Y ("叠加纹理Y方向流动速率", Float) = 0.0
13 | _Color("基础色", Color) = (1,1,1,1)
14 |
15 | _MMultiplier ("纹理混合度", Float) = 2.0
16 | [Toggle(_SOFTPARTICLES_ON)] _SoftParticles("开启软粒子", Float) = 0
17 | _InvFade ("软粒子强度", Range(0.01,3.0)) = 1.0
18 | }
19 |
20 |
21 | SubShader
22 | {
23 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "LightMode"="UniversalForward" }
24 |
25 | LOD 100
26 |
27 |
28 |
29 | Pass
30 | {
31 | Blend SrcAlpha One
32 | ColorMask RGB
33 | Cull Off Lighting Off ZWrite Off
34 | //Fog { Color (0,0,0,0) }
35 |
36 | HLSLPROGRAM
37 | #pragma vertex vert
38 | #pragma fragment frag
39 | #pragma fragmentoption ARB_precision_hint_fastest
40 | #pragma shader_feature_local _SOFTPARTICLES_ON
41 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
42 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
43 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"
44 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
45 |
46 |
47 | sampler2D _MainTex;
48 | sampler2D _DetailTex;
49 |
50 | CBUFFER_START(UnityPerMaterial)
51 | float4 _MainTex_ST;
52 | float4 _DetailTex_ST;
53 | float _ScrollX;
54 | float _ScrollY;
55 | float _Scroll2X;
56 | float _Scroll2Y;
57 | float _MMultiplier;
58 | float4 _Color;
59 | float _InvFade;
60 | CBUFFER_END
61 | struct v2f {
62 | float4 pos : SV_POSITION;
63 | float2 uv0 : TEXCOORD0;
64 | float2 uv1 : TEXCOORD1;
65 |
66 | float4 color : TEXCOORD2;
67 | #ifdef _SOFTPARTICLES_ON
68 | float4 projPos : TEXCOORD3;
69 | #endif
70 | };
71 | struct VertIn {
72 | float4 vertex : POSITION;
73 | float2 texcoord : TEXCOORD0;
74 | float4 color : COLOR;
75 |
76 | };
77 |
78 | v2f vert (VertIn v)
79 | {
80 | v2f o;
81 | o.pos = TransformObjectToHClip(v.vertex);
82 | o.uv0 = TRANSFORM_TEX(v.texcoord.xy,_MainTex) + frac(float2(_ScrollX, _ScrollY) * _Time);
83 | o.uv1 = TRANSFORM_TEX(v.texcoord.xy,_DetailTex) + frac(float2(_Scroll2X, _Scroll2Y) * _Time);
84 | #ifdef _SOFTPARTICLES_ON
85 | o.projPos = ComputeScreenPos(o.pos);
86 | o.projPos.z = - mul(UNITY_MATRIX_V, mul(unity_ObjectToWorld, float4(v.vertex.xyz, 1.0))).z;
87 | #endif
88 | o.color = _MMultiplier * _Color * v.color;
89 |
90 | return o;
91 | }
92 | float4 frag (v2f i) : COLOR
93 | {
94 | float4 o;
95 | float4 tex = tex2D (_MainTex, i.uv0);
96 | float4 tex2 = tex2D (_DetailTex, i.uv1);
97 | #ifdef _SOFTPARTICLES_ON
98 | float sceneZ = LinearEyeDepth(SampleSceneDepth( i.projPos.xy / i.projPos.w),_ZBufferParams);
99 | float partZ = i.projPos.z;
100 | float fade = saturate (_InvFade * (sceneZ-partZ));
101 | i.color.a *= fade;
102 | #endif
103 |
104 | o = tex * tex2 * i.color;
105 |
106 | return o;
107 | }
108 | ENDHLSL
109 | }
110 | }
111 | FallBack OFF
112 | }
113 |
--------------------------------------------------------------------------------
/URP/X7_Scroll2Layers-AlphaBlend.shader:
--------------------------------------------------------------------------------
1 | // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
2 |
3 |
4 | Shader "A201-Shader/URP/叠加纹理_X7AlphaBlend"
5 | {
6 | Properties {
7 | _MainTex ("基础纹理", 2D) = "white" {}
8 | _DetailTex ("叠加纹理", 2D) = "white" {}
9 | _ScrollX ("基础纹理X方向流动速率", Float) = 1.0
10 | _ScrollY ("基础纹理Y方向流动速率", Float) = 0.0
11 | _Scroll2X ("叠加纹理X方向流动速率", Float) = 1.0
12 | _Scroll2Y ("叠加纹理Y方向流动速率", Float) = 0.0
13 | _Color("基础色", Color) = (1,1,1,1)
14 |
15 | _MMultiplier ("纹理混合度", Float) = 2.0
16 | [Toggle(_SOFTPARTICLES_ON)] _SoftParticles("开启软粒子", Float) = 0
17 | _InvFade ("软粒子强度", Range(0.01,3.0)) = 1.0
18 | }
19 |
20 |
21 | SubShader
22 | {
23 | Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
24 |
25 | LOD 100
26 |
27 |
28 |
29 | Pass
30 | {
31 | Blend SrcAlpha OneMinusSrcAlpha
32 | ColorMask RGB
33 | Cull Off Lighting Off ZWrite Off
34 | //Fog { Color (0,0,0,0) }
35 |
36 | HLSLPROGRAM
37 | #pragma vertex vert
38 | #pragma fragment frag
39 | #pragma fragmentoption ARB_precision_hint_fastest
40 | #pragma shader_feature_local _SOFTPARTICLES_ON
41 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
42 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
43 | #include "Packages/com.unity.render-pipelines.core/ShaderLibrary/SpaceTransforms.hlsl"
44 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/DeclareDepthTexture.hlsl"
45 |
46 |
47 | sampler2D _MainTex;
48 | sampler2D _DetailTex;
49 | CBUFFER_START(UnityPerMaterial)
50 | float _ScrollX;
51 | float _Scroll2X;
52 | float _ScrollY;
53 | float _Scroll2Y;
54 | float _MMultiplier;
55 | float4 _MainTex_ST;
56 | float4 _DetailTex_ST;
57 |
58 | float4 _Color;
59 | float _InvFade;
60 | CBUFFER_END
61 | struct v2f {
62 | float4 pos : SV_POSITION;
63 | float2 uv0 : TEXCOORD0;
64 | float2 uv1 : TEXCOORD1;
65 | float4 color : TEXCOORD2;
66 | #ifdef _SOFTPARTICLES_ON
67 | float4 projPos : TEXCOORD3;
68 | #endif
69 | };
70 | struct VertIn {
71 | float4 vertex : POSITION;
72 | float2 texcoord : TEXCOORD0;
73 | float4 color : COLOR;
74 | };
75 |
76 | v2f vert (VertIn v)
77 | {
78 | v2f o;
79 | o.pos = TransformObjectToHClip(v.vertex);
80 | o.uv0 = TRANSFORM_TEX(v.texcoord.xy,_MainTex) + frac(float2(_ScrollX, _ScrollY) * _Time);
81 | o.uv1 = TRANSFORM_TEX(v.texcoord.xy,_DetailTex) + frac(float2(_Scroll2X, _Scroll2Y) * _Time);
82 | #ifdef _SOFTPARTICLES_ON
83 | o.projPos = ComputeScreenPos(o.pos);
84 | o.projPos.z = - mul(UNITY_MATRIX_V, mul(unity_ObjectToWorld, float4(v.vertex.xyz, 1.0))).z;
85 | #endif
86 | o.color = _MMultiplier * _Color * v.color;
87 |
88 | return o;
89 | }
90 | float4 frag (v2f i) : COLOR
91 | {
92 | float4 o;
93 | float4 tex = tex2D (_MainTex, i.uv0);
94 | float4 tex2 = tex2D (_DetailTex, i.uv1);
95 | #ifdef _SOFTPARTICLES_ON
96 | float sceneZ = LinearEyeDepth(SampleSceneDepth( i.projPos.xy / i.projPos.w),_ZBufferParams);
97 | float partZ = i.projPos.z;
98 | float fade = saturate (_InvFade * (sceneZ-partZ));
99 | i.color.a *= fade;
100 | #endif
101 | o = tex * tex2 * i.color;
102 |
103 | return o;
104 | }
105 | ENDHLSL
106 | }
107 | }
108 | FallBack OFF
109 | }
110 |
--------------------------------------------------------------------------------
/URP/X7_particleDissolve.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/URP/混合因子消融_X7PartDiss"
2 | {
3 | Properties
4 | {
5 | [Gamma][HDR]_Color("原色(RGBA)", Color) = (1,1,1,1)
6 | _MainTex("主贴图(A通道遮罩)", 2D) = "white" {}
7 | //[Gamma][HDR]_Color1("消融色(RGBA)", Color) = (1,1,1,1)
8 | //_Intencity("补一个颜色的控制强度",float) = 1
9 | //_DissolveTex("消融贴图", 2D) = "white" {}
10 | _DissolveSpeed("颜色消融速度(xyzw)", Vector) = (0.7, 0.1, 0, 0)
11 | [Toggle(SHAPEDISSOLVE_SOFT)]SHAPEDISSOLVE_SOFT("软边消融", float) = 0
12 | _DissolveTex2("形状消融贴图", 2D) = "white" {}
13 | _DissolveTex("形状消融贴图2", 2D) = "white" {}
14 | _DissolveThreshold("颜色消融阀值", Range(0,1)) = 0.16
15 | ///_FlowDir("形状消融控制(xy速度+w消融阀值)", Vector) = (0.45, 0.1, 0, 0)
16 | [Toggle(PARTICLE_CONTROL_CURVE)]_ParticleControlCurve("粒子系统曲线控制(x通道控制消融阈值)", Float) = 0
17 | [Enum(UnityEngine.Rendering.BlendMode)] _SrcFactor("颜色混合因子", Float) = 5
18 | [Enum(UnityEngine.Rendering.BlendMode)] _DstFactor("背景混合因子", Float) = 10
19 | [Enum(Off, 0, On, 1)]_ZWrite("深度写入", Float) = 0
20 | [Toggle(SOFTPAR_ON)]_Float ("是否开启深度(软粒子)", Float ) = 0
21 | _SoftParticleFade ("软粒子效果", Range(0.001,0.999)) = 0.5
22 | [Enum(UnityEngine.Rendering.CullMode)] _Cull("正反面剔除模式", Float) = 0
23 | }
24 |
25 | SubShader
26 | {
27 | Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" "RenderPipeline" = "UniversalPipeline"}
28 | Pass
29 | {
30 | ZWrite[_ZWrite]
31 | Blend[_SrcFactor][_DstFactor]
32 | Cull[_Cull]
33 | Lighting Off
34 |
35 | HLSLPROGRAM
36 | #pragma vertex vert
37 | #pragma fragment frag
38 |
39 | #pragma shader_feature _ SHAPEDISSOLVE_SOFT
40 | #pragma shader_feature _ SOFTPAR_ON
41 | #pragma shader_feature _ PARTICLE_CONTROL_CURVE
42 |
43 | #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
44 | TEXTURE2D (_MainTex);
45 | SAMPLER(sampler_MainTex);
46 | TEXTURE2D (_DissolveTex);
47 | SAMPLER(sampler_DissolveTex);
48 | TEXTURE2D (_DissolveTex2);
49 | SAMPLER(sampler_DissolveTex2);
50 | CBUFFER_START(UnityPerMaterial)
51 | half4 _MainTex_ST;
52 | half4 _Color;
53 | half4 _Color1;
54 | half4 _DissolveTex_ST;
55 | half _DissolveThreshold;
56 | half4 _DissolveSpeed;
57 |
58 | half4 _DissolveTex2_ST;
59 | half4 _FlowDir;
60 | half _Cutoff;
61 | //half _Intencity;
62 | half _SoftParticleFade;
63 | CBUFFER_END
64 |
65 | #include "SoftParticleFade.hlsl"
66 | struct appdata
67 | {
68 | half4 vertex : POSITION;
69 | half4 color : COLOR;
70 | half2 uv : TEXCOORD0;
71 | #if PARTICLE_CONTROL_CURVE
72 | half4 uv2 : TEXCOORD1;
73 | #endif
74 | };
75 |
76 | struct v2f
77 | {
78 | half4 vertex : POSITION;
79 | half4 color : COLOR;
80 | half2 uv : TEXCOORD0;
81 | #if PARTICLE_CONTROL_CURVE
82 | half4 uv2 : TEXCOORD1;
83 | #endif
84 | SOFT_PARTICLE_POS(2)
85 | };
86 |
87 | v2f vert (appdata v)
88 | {
89 | v2f o;
90 | o.vertex = TransformObjectToHClip(v.vertex.xyz);
91 | o.color = v.color;
92 | o.uv = v.uv;
93 | #if PARTICLE_CONTROL_CURVE
94 | o.uv2 = v.uv2;
95 | #endif
96 | TRANSFORM_SOFT_PARTICLE_POS(o);
97 | return o;
98 | }
99 |
100 | half4 frag(v2f i) : COLOR
101 | {
102 | //_Color1 *= _Intencity;
103 | half dissolveThreshold2 = _DissolveThreshold;
104 | half2 offset = 0;
105 | #if PARTICLE_CONTROL_CURVE
106 | //mainOffset.xy = i.uv2.zy;
107 | // mainOffset = i.uv2.z;
108 | dissolveThreshold2 = i.uv2.x;
109 | offset = i.uv2.yz;
110 | #endif
111 | half shapeVal = SAMPLE_TEXTURE2D(_DissolveTex2, sampler_DissolveTex2,TRANSFORM_TEX(i.uv,_DissolveTex2) + _Time.y * _DissolveSpeed.xy).r;
112 | half shapeVal2 = SAMPLE_TEXTURE2D(_DissolveTex, sampler_DissolveTex,TRANSFORM_TEX(i.uv,_DissolveTex) + _Time.y * _DissolveSpeed.zw).r;
113 | shapeVal *= shapeVal2;
114 | // clip(shapeVal - dissolveThreshold2);
115 | half shapeFac; //相当于clip
116 | #if SHAPEDISSOLVE_SOFT
117 | //shapeFac = smoothstep(saturate(dissolveThreshold2), 1, shapeVal);
118 | shapeFac = saturate((shapeVal - dissolveThreshold2) / (dissolveThreshold2));//shapeVal - dissolveThreshold2为可视像素溶解值
119 | //shapeFac = smoothstep(saturate(dissolveThreshold2), 1, shapeVal) / dissolveThreshold2;
120 | #else
121 | shapeFac = step(saturate(dissolveThreshold2), shapeVal);
122 | #endif
123 |
124 | half4 texCol = SAMPLE_TEXTURE2D(_MainTex,sampler_MainTex, TRANSFORM_TEX(i.uv, _MainTex) + offset);
125 | //half2 dissolveUV = TRANSFORM_TEX(i.uv, _DissolveTex);
126 | //half colorToStep = 0.5 * (SAMPLE_TEXTURE2D(_DissolveTex,sampler_DissolveTex, dissolveUV * 1.23 + _Time.y * half2(0.7, 0.1) * _DissolveSpeed) + SAMPLE_TEXTURE2D(_DissolveTex,sampler_DissolveTex, dissolveUV + _Time.y * half2(0.3, -0.5) * _DissolveSpeed));
127 | half4 color = _Color * texCol * i.color;
128 |
129 | // color.a *= i.color.a;
130 |
131 |
132 | color.a *= shapeFac;
133 | APPLY_SOFT_PARTICLE(i.projPos, color);
134 | return color;
135 | }
136 | ENDHLSL
137 | }
138 |
139 | }
140 | }
141 |
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Built-in_ColorGradient.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/渐变颜色制作"
2 | {
3 | Properties
4 | {
5 | _Up_Color("前颜色", Color) = (1,0.5,1, 1.0)
6 | _Down_Color("后颜色", Color) = (0.5,1,0.5, 1.0)
7 | _Gradation_thickness("颜色过渡值", Float) = 4
8 | _Gradation_height("颜色分割值", Range(-1.0, 1.0)) = 0.5
9 | [HideInInspector] _texcoord( "", 2D ) = "white" {}
10 | }
11 |
12 | SubShader
13 | {
14 | Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" "IsEmissive" = "true" }
15 | Cull Back
16 | CGPROGRAM
17 | #pragma target 3.0
18 | #pragma surface surf Unlit keepalpha addshadow fullforwardshadows
19 | struct Input
20 | {
21 | float2 uv_texcoord;
22 | };
23 |
24 | uniform float4 _Down_Color;
25 | uniform float4 _Up_Color;
26 | uniform float _Gradation_height;
27 | uniform float _Gradation_thickness;
28 |
29 | inline half4 LightingUnlit( SurfaceOutput s, half3 lightDir, half atten )
30 | {
31 | return half4 ( 0, 0, 0, s.Alpha );
32 | }
33 |
34 | void surf( Input i , inout SurfaceOutput o )
35 | {
36 | float4 lerpResult = lerp( _Down_Color , _Up_Color , saturate( ( ( i.uv_texcoord.y - _Gradation_height ) * _Gradation_thickness ) ));
37 | o.Emission = lerpResult.rgb;
38 | o.Alpha = 1;
39 | }
40 |
41 | ENDCG
42 | }
43 | Fallback "Diffuse"
44 | }
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Built-in_StylizedWater_ShadowUtilities.cginc:
--------------------------------------------------------------------------------
1 | #ifndef SHADOW_UTILITIES
2 | #define SHADOW_UTILITIES
3 |
4 | // Returns the shadow-space coordinate for the given world-space position.
5 | float4 GetShadowCoordinate(float3 positionWS, float4 weights)
6 | {
7 | // Calculate the shadow coordinates for each cascade.
8 | float4 sc0 = mul(unity_WorldToShadow[0], float4(positionWS, 1));
9 | float4 sc1 = mul(unity_WorldToShadow[1], float4(positionWS, 1));
10 | float4 sc2 = mul(unity_WorldToShadow[2], float4(positionWS, 1));
11 | float4 sc3 = mul(unity_WorldToShadow[3], float4(positionWS, 1));
12 |
13 | // Get the final shadow coordinate by multiplying by the weights.
14 | return sc0 * weights.x + sc1 * weights.y + sc2 * weights.z + sc3 * weights.w;
15 | }
16 |
17 | float GetLightVisibility(sampler2D shadowMap, float3 positionWS, float maxDistance)
18 | {
19 | // Calculate the weights for each shadow cascade.
20 | float distFromCam = length(positionWS - _WorldSpaceCameraPos.xyz);
21 |
22 | // If we are beyond the edge of the shadow map, return 1.0 (no shadow).
23 | if (distFromCam > maxDistance)
24 | {
25 | return 1.0;
26 | }
27 |
28 | // Otherwise, calculate the weights...
29 | float4 near = float4 (distFromCam >= _LightSplitsNear);
30 | float4 far = float4 (distFromCam < _LightSplitsFar);
31 | float4 cascadeWeights = near * far;
32 |
33 | // ...and the shadow coordinate.
34 | float4 shadowCoord = GetShadowCoordinate(positionWS, cascadeWeights);
35 | // shadowCoord /= shadowCoord.w;
36 |
37 | // Then sample the shadow map and return whether the point is in shadow or not.
38 | return tex2Dproj(shadowMap, shadowCoord) < shadowCoord.z/shadowCoord.w;
39 | }
40 |
41 |
42 |
43 | #endif // SHADOW_UTILITIES
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Built-in_StylizedWater_WaterUtilities.cginc:
--------------------------------------------------------------------------------
1 | #ifndef WATER_UTILITIES
2 | #define WATER_UTILITIES
3 |
4 |
5 |
6 | // DEFINES.
7 | #define PI (3.1415926536)
8 |
9 |
10 |
11 | // Returns a simple waveform (to be used as a height offset) from the input wave parameters.
12 | float SimpleWave(float2 position, float2 direction, float wavelength, float amplitude, float speed)
13 | {
14 | float x = PI * dot(position, direction) / wavelength;
15 | float phase = speed * _Time.y;
16 | return amplitude * sin(x + phase);
17 | return amplitude * (1 - abs(sin(x + phase)));
18 | }
19 |
20 |
21 |
22 | // Pans the input uv in the given direction and speed.
23 | float2 Panner(float2 uv, float2 direction, float speed)
24 | {
25 | return uv + normalize(direction)*speed*_Time.y;
26 | }
27 |
28 |
29 |
30 | // Tiles a texture in an interesting wave-like way.
31 | // Inspired by the function of the same name in Unreal Engine.
32 | float3 MotionFourWayChaos(sampler2D tex, float2 uv, float speed, bool unpackNormal)
33 | {
34 | float2 uv1 = Panner(uv + float2(0.000, 0.000), float2( 0.1, 0.1), speed);
35 | float2 uv2 = Panner(uv + float2(0.418, 0.355), float2(-0.1, -0.1), speed);
36 | float2 uv3 = Panner(uv + float2(0.865, 0.148), float2(-0.1, 0.1), speed);
37 | float2 uv4 = Panner(uv + float2(0.651, 0.752), float2( 0.1, -0.1), speed);
38 |
39 | float3 sample1;
40 | float3 sample2;
41 | float3 sample3;
42 | float3 sample4;
43 |
44 | if (unpackNormal)
45 | {
46 | sample1 = UnpackNormal(tex2D(tex, uv1)).rgb;
47 | sample2 = UnpackNormal(tex2D(tex, uv2)).rgb;
48 | sample3 = UnpackNormal(tex2D(tex, uv3)).rgb;
49 | sample4 = UnpackNormal(tex2D(tex, uv4)).rgb;
50 |
51 | return normalize(sample1 + sample2 + sample3 + sample4);
52 | }
53 | else
54 | {
55 | sample1 = tex2D(tex, uv1).rgb;
56 | sample2 = tex2D(tex, uv2).rgb;
57 | sample3 = tex2D(tex, uv3).rgb;
58 | sample4 = tex2D(tex, uv4).rgb;
59 |
60 | return (sample1 + sample2 + sample3 + sample4) / 4.0;
61 | }
62 | }
63 |
64 |
65 | float3 MotionFourWaySparkle(sampler2D tex, float2 uv, float4 coordinateScale, float speed)
66 | {
67 | float2 uv1 = Panner(uv * coordinateScale.x, float2( 0.1, 0.1), speed);
68 | float2 uv2 = Panner(uv * coordinateScale.y, float2(-0.1, -0.1), speed);
69 | float2 uv3 = Panner(uv * coordinateScale.z, float2(-0.1, 0.1), speed);
70 | float2 uv4 = Panner(uv * coordinateScale.w, float2( 0.1, -0.1), speed);
71 |
72 | float3 sample1 = UnpackNormal(tex2D(tex, uv1)).rgb;
73 | float3 sample2 = UnpackNormal(tex2D(tex, uv2)).rgb;
74 | float3 sample3 = UnpackNormal(tex2D(tex, uv3)).rgb;
75 | float3 sample4 = UnpackNormal(tex2D(tex, uv4)).rgb;
76 |
77 | float3 normalA = float3(sample1.x, sample2.y, 1);
78 | float3 normalB = float3(sample3.x, sample4.y, 1);
79 |
80 | return normalize(float3( (normalA+normalB).xy, (normalA*normalB).z ));
81 | }
82 |
83 |
84 | #endif // WATER_UTILITIES
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/README.txt:
--------------------------------------------------------------------------------
1 | ASE v1.9.15
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_BaseAdd.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/基础Additive"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_BaseColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend SrcAlpha One
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 |
29 |
30 | Pass
31 | {
32 | Name "Unlit"
33 |
34 | CGPROGRAM
35 |
36 |
37 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
38 | //only defining to not throw compilation error over Unity 5.5
39 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
40 | #endif
41 | #pragma vertex vert
42 | #pragma fragment frag
43 | #pragma multi_compile_instancing
44 | #include "UnityCG.cginc"
45 |
46 |
47 | struct appdata
48 | {
49 | float4 vertex : POSITION;
50 | float4 color : COLOR;
51 | float4 ase_texcoord : TEXCOORD0;
52 | UNITY_VERTEX_INPUT_INSTANCE_ID
53 | };
54 |
55 | struct v2f
56 | {
57 | float4 vertex : SV_POSITION;
58 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
59 | float3 worldPos : TEXCOORD0;
60 | #endif
61 | float4 ase_texcoord1 : TEXCOORD1;
62 | float4 ase_color : COLOR;
63 | UNITY_VERTEX_INPUT_INSTANCE_ID
64 | UNITY_VERTEX_OUTPUT_STEREO
65 | };
66 |
67 | uniform half4 _BaseColor;
68 | uniform sampler2D _MainTex;
69 | uniform half4 _MainTex_ST;
70 |
71 |
72 | v2f vert ( appdata v )
73 | {
74 | v2f o;
75 | UNITY_SETUP_INSTANCE_ID(v);
76 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
77 | UNITY_TRANSFER_INSTANCE_ID(v, o);
78 |
79 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
80 | o.ase_color = v.color;
81 |
82 | //setting value to unused interpolator channels and avoid initialization warnings
83 | o.ase_texcoord1.zw = 0;
84 | float3 vertexValue = float3(0, 0, 0);
85 | #if ASE_ABSOLUTE_VERTEX_POS
86 | vertexValue = v.vertex.xyz;
87 | #endif
88 | vertexValue = vertexValue;
89 | #if ASE_ABSOLUTE_VERTEX_POS
90 | v.vertex.xyz = vertexValue;
91 | #else
92 | v.vertex.xyz += vertexValue;
93 | #endif
94 | o.vertex = UnityObjectToClipPos(v.vertex);
95 |
96 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
97 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
98 | #endif
99 | return o;
100 | }
101 |
102 | fixed4 frag (v2f i ) : SV_Target
103 | {
104 | UNITY_SETUP_INSTANCE_ID(i);
105 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
106 | fixed4 finalColor;
107 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
108 | float3 WorldPosition = i.worldPos;
109 | #endif
110 | half2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
111 |
112 |
113 | finalColor = ( _BaseColor * tex2D( _MainTex, uv_MainTex ) * i.ase_color );
114 | return finalColor;
115 | }
116 | ENDCG
117 | }
118 | }
119 | CustomEditor "ASEMaterialInspector"
120 |
121 | Fallback Off
122 | }
123 | /*ASEBEGIN
124 | Version=19105
125 | Node;AmplifyShaderEditor.SamplerNode;1;-383,-20.5;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
126 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-594,3.5;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
127 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-55,-39.5;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
128 | Node;AmplifyShaderEditor.ColorNode;3;-300,-194.5;Inherit;False;Property;_BaseColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
129 | Node;AmplifyShaderEditor.VertexColorNode;4;-261,169.5;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
130 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;79,-39;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/基础Additive;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;8;5;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;False;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
131 | WireConnection;1;1;2;0
132 | WireConnection;5;0;3;0
133 | WireConnection;5;1;1;0
134 | WireConnection;5;2;4;0
135 | WireConnection;0;0;5;0
136 | ASEEND*/
137 | //CHKSM=D42732A3E293AB37C73AAF7851DC36D200A67AE1
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_BaseAlpha.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/基础AlphaBlend"
4 | {
5 | Properties
6 | {
7 | _MainTex("贴图", 2D) = "white" {}
8 | [HDR]_BaseColor("颜色", Color) = (1,1,1,1)
9 |
10 | }
11 |
12 | SubShader
13 | {
14 |
15 |
16 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
17 | LOD 100
18 |
19 | CGINCLUDE
20 | #pragma target 3.0
21 | ENDCG
22 | Blend SrcAlpha OneMinusSrcAlpha
23 | AlphaToMask Off
24 | Cull Back
25 | ColorMask RGBA
26 | ZWrite Off
27 | ZTest LEqual
28 |
29 |
30 |
31 | Pass
32 | {
33 | Name "Unlit"
34 |
35 | CGPROGRAM
36 |
37 |
38 |
39 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
40 | //only defining to not throw compilation error over Unity 5.5
41 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
42 | #endif
43 | #pragma vertex vert
44 | #pragma fragment frag
45 | #pragma multi_compile_instancing
46 | #include "UnityCG.cginc"
47 |
48 |
49 | struct appdata
50 | {
51 | float4 vertex : POSITION;
52 | float4 color : COLOR;
53 | float4 ase_texcoord : TEXCOORD0;
54 | UNITY_VERTEX_INPUT_INSTANCE_ID
55 | };
56 |
57 | struct v2f
58 | {
59 | float4 vertex : SV_POSITION;
60 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
61 | float3 worldPos : TEXCOORD0;
62 | #endif
63 | float4 ase_texcoord1 : TEXCOORD1;
64 | float4 ase_color : COLOR;
65 | UNITY_VERTEX_INPUT_INSTANCE_ID
66 | UNITY_VERTEX_OUTPUT_STEREO
67 | };
68 |
69 | uniform half4 _BaseColor;
70 | uniform sampler2D _MainTex;
71 | uniform half4 _MainTex_ST;
72 |
73 |
74 | v2f vert ( appdata v )
75 | {
76 | v2f o;
77 | UNITY_SETUP_INSTANCE_ID(v);
78 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
79 | UNITY_TRANSFER_INSTANCE_ID(v, o);
80 |
81 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
82 | o.ase_color = v.color;
83 |
84 | //setting value to unused interpolator channels and avoid initialization warnings
85 | o.ase_texcoord1.zw = 0;
86 | float3 vertexValue = float3(0, 0, 0);
87 | #if ASE_ABSOLUTE_VERTEX_POS
88 | vertexValue = v.vertex.xyz;
89 | #endif
90 | vertexValue = vertexValue;
91 | #if ASE_ABSOLUTE_VERTEX_POS
92 | v.vertex.xyz = vertexValue;
93 | #else
94 | v.vertex.xyz += vertexValue;
95 | #endif
96 | o.vertex = UnityObjectToClipPos(v.vertex);
97 |
98 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
99 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
100 | #endif
101 | return o;
102 | }
103 |
104 | fixed4 frag (v2f i ) : SV_Target
105 | {
106 | UNITY_SETUP_INSTANCE_ID(i);
107 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
108 | fixed4 finalColor;
109 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
110 | float3 WorldPosition = i.worldPos;
111 | #endif
112 | half2 uv_MainTex = i.ase_texcoord1.xy * _MainTex_ST.xy + _MainTex_ST.zw;
113 |
114 |
115 | finalColor = ( _BaseColor * tex2D( _MainTex, uv_MainTex ) * i.ase_color );
116 | return finalColor;
117 | }
118 | ENDCG
119 | }
120 | }
121 | CustomEditor "ASEMaterialInspector"
122 |
123 | Fallback Off
124 | }
125 | /*ASEBEGIN
126 | Version=19105
127 | Node;AmplifyShaderEditor.SamplerNode;1;-383,-20.5;Inherit;True;Property;_MainTex;贴图;0;0;Create;False;0;0;0;False;0;False;-1;None;None;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
128 | Node;AmplifyShaderEditor.TextureCoordinatesNode;2;-594,3.5;Inherit;False;0;1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
129 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-55,-39.5;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
130 | Node;AmplifyShaderEditor.ColorNode;3;-300,-194.5;Inherit;False;Property;_BaseColor;颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
131 | Node;AmplifyShaderEditor.VertexColorNode;4;-261,169.5;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
132 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;79,-39;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/基础AlphaBlend;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;False;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
133 | WireConnection;1;1;2;0
134 | WireConnection;5;0;3;0
135 | WireConnection;5;1;1;0
136 | WireConnection;5;2;4;0
137 | WireConnection;0;0;5;0
138 | ASEEND*/
139 | //CHKSM=665DF80AA56B71AB1D5AE372956EA1E982607205
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_ChormaHeat.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/色差热扭曲"
2 | {
3 | Properties
4 | {
5 | [Header(Heat)]
6 | _Distortion_Tex("热扭曲纹理", 2D) = "white" {}
7 | _DistortionU("热扭曲U速率", Float) = 0
8 | _DistortionV("热扭曲V速率", Float) = 0
9 | _Indensity("扭曲强度", Range(0.0, 1.0)) = 0.5
10 |
11 | [Header(Mask)]
12 | _AlphaTex("扭曲遮罩", 2D) = "white" {}
13 | _AlphaU("遮罩1U速率", Float) = 0
14 | _AlphaV("遮罩1V速率", Float) = 0
15 | _AlphaTex1("扭曲遮罩2", 2D) = "white" {}
16 | _AlphaTex1U("遮罩2U速率", Float) = 0
17 | _AlphaTex1V("遮罩2V速率", Float) = 0
18 |
19 | [Header(Refraction)]
20 | _IOR1("材质最小折射率", Float) = 1
21 | _IOR2("材质最大折射率", Float) = 1.4
22 | _ChromaticAberration("色差强度", Range(0.0, 0.5)) = 0.1
23 |
24 | [HideInInspector] _texcoord( "", 2D ) = "white" {}
25 | [HideInInspector] _texcoord2( "", 2D ) = "white" {}
26 | [HideInInspector] __dirty( "", Int ) = 1
27 | }
28 |
29 | SubShader
30 | {
31 | Tags{ "RenderType" = "Transparent" "Queue" = "Transparent+0" "IgnoreProjector" = "True" }
32 | Cull Off
33 | GrabPass{ }
34 | CGPROGRAM
35 | #include "UnityShaderVariables.cginc"
36 | #pragma target 3.5
37 |
38 | #pragma multi_compile _ALPHAPREMULTIPLY_ON
39 |
40 | #pragma surface surf BlinnPhong alpha:fade keepalpha finalcolor:RefractionF noshadow exclude_path:deferred noambient novertexlights nolightmap nodynlightmap nodirlightmap nofog nometa noforwardadd
41 | struct Input
42 | {
43 | float2 uv_texcoord;
44 | float2 uv2_texcoord2;
45 | float4 vertexColor : COLOR;
46 | float4 screenPos;
47 | float3 worldPos;
48 | };
49 |
50 | uniform sampler2D _Distortion_Tex;
51 | uniform float4 _Distortion_Tex_ST;
52 | uniform float _DistortionU;
53 | uniform float _DistortionV;
54 | uniform float _Indensity;
55 | uniform sampler2D _GrabTexture;
56 | uniform float _ChromaticAberration;
57 | uniform float _IOR1;
58 | uniform float _IOR2;
59 | uniform sampler2D _AlphaTex;
60 | uniform float4 _AlphaTex_ST;
61 | uniform float _AlphaU;
62 | uniform float _AlphaV;
63 | uniform sampler2D _AlphaTex1;
64 | uniform float4 _AlphaTex1_ST;
65 | uniform float _AlphaTex1U;
66 | uniform float _AlphaTex1V;
67 |
68 | inline float4 Refraction( Input i, SurfaceOutput o, float indexOfRefraction, float chomaticAberration ) {
69 | float3 worldNormal = o.Normal;
70 | float4 screenPos = i.screenPos;
71 | #if UNITY_UV_STARTS_AT_TOP
72 | float scale = -1.0;
73 | #else
74 | float scale = 1.0;
75 | #endif
76 | float halfPosW = screenPos.w * 0.5;
77 | screenPos.y = ( screenPos.y - halfPosW ) * _ProjectionParams.x * scale + halfPosW;
78 | #if SHADER_API_D3D9 || SHADER_API_D3D11
79 | screenPos.w += 0.00000000001;
80 | #endif
81 | float2 projScreenPos = ( screenPos / screenPos.w ).xy;
82 | float3 worldViewDir = normalize( UnityWorldSpaceViewDir( i.worldPos ) );
83 | float3 refractionOffset = ( ( ( ( indexOfRefraction - 1.0 ) * mul( UNITY_MATRIX_V, float4( worldNormal, 0.0 ) ) ) * ( 1.0 / ( screenPos.z + 1.0 ) ) ) * ( 1.0 - dot( worldNormal, worldViewDir ) ) );
84 | float2 cameraRefraction = float2( refractionOffset.x, -( refractionOffset.y * _ProjectionParams.x ) );
85 | float4 redAlpha = tex2D( _GrabTexture, ( projScreenPos + cameraRefraction ) );
86 | float green = tex2D( _GrabTexture, ( projScreenPos + ( cameraRefraction * ( 1.0 - chomaticAberration ) ) ) ).g;
87 | float blue = tex2D( _GrabTexture, ( projScreenPos + ( cameraRefraction * ( 1.0 + chomaticAberration ) ) ) ).b;
88 | return float4( redAlpha.r, green, blue, redAlpha.a );
89 | }
90 |
91 | void RefractionF( Input i, SurfaceOutput o, inout half4 color )
92 | {
93 | #ifdef UNITY_PASS_FORWARDBASE
94 | float temp_output_63_0 = ( i.vertexColor.a * _Indensity );
95 | float2 uv0_AlphaTex = i.uv_texcoord * _AlphaTex_ST.xy + _AlphaTex_ST.zw;
96 | float2 uv1_AlphaTex = i.uv2_texcoord2 * _AlphaTex_ST.xy + _AlphaTex_ST.zw;
97 |
98 | float2 staticSwitch72 = uv0_AlphaTex;
99 |
100 | float2 appendResult46 = (float2(_AlphaU , _AlphaV));
101 | float3 desaturateInitialColor65 = tex2D( _AlphaTex, ( staticSwitch72 + ( _Time.y * appendResult46 ) ) ).rgb;
102 | float desaturateDot65 = dot( desaturateInitialColor65, float3( 0.299, 0.587, 0.114 ));
103 | float3 desaturateVar65 = lerp( desaturateInitialColor65, desaturateDot65.xxx, 0.0 );
104 |
105 | float2 uv0_AlphaTex1 = i.uv_texcoord * _AlphaTex1_ST.xy + _AlphaTex1_ST.zw;
106 | float2 staticSwitch82 = uv0_AlphaTex1;
107 |
108 | float2 appendResult80 = (float2(_AlphaTex1U , _AlphaTex1V));
109 | float3 desaturateInitialColor87 = tex2D( _AlphaTex1, ( staticSwitch82 + ( _Time.y * appendResult80 ) ) ).rgb;
110 | float desaturateDot87 = dot( desaturateInitialColor87, float3( 0.299, 0.587, 0.114 ));
111 | float3 desaturateVar87 = lerp( desaturateInitialColor87, desaturateDot87.xxx, 1.0 );
112 |
113 | float lerpResult67 = lerp( _IOR1 , _IOR2 , ( temp_output_63_0 * desaturateVar65 * (desaturateVar87).x).x);
114 | color.rgb = color.rgb + Refraction( i, o, lerpResult67, _ChromaticAberration ) * ( 1 - color.a );
115 | color.a = 1;
116 | #endif
117 | }
118 |
119 | void surf( Input i , inout SurfaceOutput o )
120 | {
121 | o.Normal = float3(0,0,1);
122 | float2 uv0_Distortion_Tex = i.uv_texcoord * _Distortion_Tex_ST.xy + _Distortion_Tex_ST.zw;
123 |
124 | float2 staticSwitch70 = uv0_Distortion_Tex;
125 |
126 | float2 appendResult3 = (float2(_DistortionU , _DistortionV));
127 | float temp_output_63_0 = ( i.vertexColor.a * _Indensity );
128 | float4 lerpResult60 = lerp( float4( float3(0,0,1) , 0.0 ) , tex2D( _Distortion_Tex, ( staticSwitch70 + ( _Time.y * appendResult3 ) ) ) , temp_output_63_0);
129 | o.Normal = lerpResult60.rgb;
130 | o.Alpha = 0.0;
131 | o.Normal = o.Normal + 0.00001 * i.screenPos * i.worldPos;
132 | }
133 |
134 | ENDCG
135 | }
136 | Fallback "Diffuse"
137 | }
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_DoubleFresnel.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/特殊制作/简易双层菲涅尔_Fresnel"
2 | {
3 | Properties
4 | {
5 | [HDR]_RimColor ("边缘颜色", Color) = (1.0,1.0,1.0,1.0)
6 | [HDR]_InnerColor ("内部颜色", Color) = (1.0,1.0,1.0,1.0)
7 | _AlphaPower ("内部颜色范围", Range(0.0,8.0)) = 4.0
8 | _InnerColorPower ("内部颜色强度", Range(0.0,1.0)) = 0.5
9 | _RimPower ("边缘颜色范围", Range(0.0,5.0)) = 4
10 | _AllPower ("整体强度", Range(0.0, 10.0)) = 1.0
11 | }
12 |
13 | SubShader
14 | {
15 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
16 | LOD 100
17 |
18 | ZWrite Off
19 | Blend SrcAlpha One
20 |
21 | //surface着色器,此处不能使用Pass块
22 | CGPROGRAM
23 | #pragma surface surf Lambert alpha
24 |
25 | struct Input
26 | {
27 | float3 viewDir;
28 | INTERNAL_DATA
29 | };
30 |
31 | float4 _RimColor;
32 | float4 _InnerColor;
33 | half _AlphaPower;
34 | half _InnerColorPower;
35 | half _RimPower;
36 | half _AllPower;
37 |
38 | //边缘光计算
39 | void surf (Input IN, inout SurfaceOutput o)
40 | {
41 | half rim = 1.0 - saturate(dot (normalize(IN.viewDir), o.Normal));
42 | o.Emission = _RimColor.rgb * pow (rim, _RimPower)*_AllPower+(_InnerColor.rgb*2*_InnerColorPower);
43 | o.Alpha = (pow (rim, _AlphaPower))*_AllPower;
44 | }
45 | ENDCG
46 | }
47 | Fallback "Off"
48 | }
49 |
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_FresnelShield.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/特殊制作/简易菲尼尔护盾"
4 | {
5 | Properties
6 | {
7 | [Enum(Addtive,1,AlphaBlend,10)]_BlendMode("混合模式", Float) = 0
8 | [Enum(UnityEngine.Rendering.CullMode)]_CullingMode("剔除模式", Float) = 0
9 | [HDR]_Color0("主颜色", Color) = (1,1,1,1)
10 | _TextureSample0("流动纹理", 2D) = "white" {}
11 | [KeywordEnum(R,A)] _Keyword0("切换贴图通道", Float) = 0
12 | Uspeed("U速度", Float) = 0
13 | _Vspeed("V速度", Float) = 0
14 | _Freset("菲涅尔整体/边缘/强度", Vector) = (0,1,5,0)
15 |
16 | }
17 |
18 | SubShader
19 | {
20 |
21 |
22 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
23 | LOD 100
24 |
25 | CGINCLUDE
26 | #pragma target 3.0
27 | ENDCG
28 | Blend SrcAlpha [_BlendMode]
29 | AlphaToMask Off
30 | Cull [_CullingMode]
31 | ColorMask RGBA
32 | ZWrite On
33 | ZTest LEqual
34 | Offset 0 , 0
35 |
36 |
37 |
38 | Pass
39 | {
40 | Name "Unlit"
41 |
42 | CGPROGRAM
43 |
44 |
45 |
46 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
47 | //only defining to not throw compilation error over Unity 5.5
48 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
49 | #endif
50 | #pragma vertex vert
51 | #pragma fragment frag
52 | #pragma multi_compile_instancing
53 | #include "UnityCG.cginc"
54 | #include "UnityShaderVariables.cginc"
55 | #define ASE_NEEDS_FRAG_WORLD_POSITION
56 | #pragma shader_feature_local _KEYWORD0_R _KEYWORD0_A
57 |
58 |
59 | struct appdata
60 | {
61 | float4 vertex : POSITION;
62 | float4 color : COLOR;
63 | float4 ase_texcoord : TEXCOORD0;
64 | float3 ase_normal : NORMAL;
65 | UNITY_VERTEX_INPUT_INSTANCE_ID
66 | };
67 |
68 | struct v2f
69 | {
70 | float4 vertex : SV_POSITION;
71 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
72 | float3 worldPos : TEXCOORD0;
73 | #endif
74 | float4 ase_color : COLOR;
75 | float4 ase_texcoord1 : TEXCOORD1;
76 | float4 ase_texcoord2 : TEXCOORD2;
77 | UNITY_VERTEX_INPUT_INSTANCE_ID
78 | UNITY_VERTEX_OUTPUT_STEREO
79 | };
80 |
81 | uniform float _CullingMode;
82 | uniform float _BlendMode;
83 | uniform float4 _Color0;
84 | uniform sampler2D _TextureSample0;
85 | uniform float Uspeed;
86 | uniform float _Vspeed;
87 | uniform float4 _TextureSample0_ST;
88 | uniform float3 _Freset;
89 |
90 |
91 | v2f vert ( appdata v )
92 | {
93 | v2f o;
94 | UNITY_SETUP_INSTANCE_ID(v);
95 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
96 | UNITY_TRANSFER_INSTANCE_ID(v, o);
97 |
98 | float3 ase_worldNormal = UnityObjectToWorldNormal(v.ase_normal);
99 | o.ase_texcoord2.xyz = ase_worldNormal;
100 |
101 | o.ase_color = v.color;
102 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
103 |
104 | //setting value to unused interpolator channels and avoid initialization warnings
105 | o.ase_texcoord1.zw = 0;
106 | o.ase_texcoord2.w = 0;
107 | float3 vertexValue = float3(0, 0, 0);
108 | #if ASE_ABSOLUTE_VERTEX_POS
109 | vertexValue = v.vertex.xyz;
110 | #endif
111 | vertexValue = vertexValue;
112 | #if ASE_ABSOLUTE_VERTEX_POS
113 | v.vertex.xyz = vertexValue;
114 | #else
115 | v.vertex.xyz += vertexValue;
116 | #endif
117 | o.vertex = UnityObjectToClipPos(v.vertex);
118 |
119 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
120 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
121 | #endif
122 | return o;
123 | }
124 |
125 | fixed4 frag (v2f i ) : SV_Target
126 | {
127 | UNITY_SETUP_INSTANCE_ID(i);
128 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
129 | fixed4 finalColor;
130 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
131 | float3 WorldPosition = i.worldPos;
132 | #endif
133 | float2 appendResult18 = (float2(Uspeed , _Vspeed));
134 | float2 uv_TextureSample0 = i.ase_texcoord1.xy * _TextureSample0_ST.xy + _TextureSample0_ST.zw;
135 | float2 panner9 = ( 1.0 * _Time.y * appendResult18 + uv_TextureSample0);
136 | float4 tex2DNode4 = tex2D( _TextureSample0, panner9 );
137 | #if defined(_KEYWORD0_R)
138 | float staticSwitch5 = tex2DNode4.r;
139 | #elif defined(_KEYWORD0_A)
140 | float staticSwitch5 = tex2DNode4.a;
141 | #else
142 | float staticSwitch5 = tex2DNode4.r;
143 | #endif
144 | float3 ase_worldViewDir = UnityWorldSpaceViewDir(WorldPosition);
145 | ase_worldViewDir = normalize(ase_worldViewDir);
146 | float3 ase_worldNormal = i.ase_texcoord2.xyz;
147 | float fresnelNdotV1 = dot( ase_worldNormal, ase_worldViewDir );
148 | float fresnelNode1 = ( _Freset.x + _Freset.y * pow( 1.0 - fresnelNdotV1, _Freset.z ) );
149 |
150 |
151 | finalColor = ( i.ase_color * _Color0 * staticSwitch5 * saturate( fresnelNode1 ) );
152 | return finalColor;
153 | }
154 | ENDCG
155 | }
156 | }
157 | CustomEditor "ASEMaterialInspector"
158 |
159 | Fallback Off
160 | }
161 | /*ASEBEGIN
162 | Version=19105
163 | Node;AmplifyShaderEditor.CommentaryNode;27;-491.0801,102.9186;Inherit;False;272;133;Comment;2;26;25;设置;1,1,1,1;0;0
164 | Node;AmplifyShaderEditor.PannerNode;9;-962.3602,-139.4378;Inherit;False;3;0;FLOAT2;0,0;False;2;FLOAT2;0,0;False;1;FLOAT;1;False;1;FLOAT2;0
165 | Node;AmplifyShaderEditor.RangedFloatNode;20;-1263.08,57.91864;Inherit;False;Property;_Vspeed;V速度;7;0;Create;False;0;0;0;False;0;False;0;-0.2;0;0;0;1;FLOAT;0
166 | Node;AmplifyShaderEditor.RangedFloatNode;19;-1259.08,-19.08136;Inherit;False;Property;Uspeed;U速度;6;0;Create;False;0;0;0;False;0;False;0;0.2;0;0;0;1;FLOAT;0
167 | Node;AmplifyShaderEditor.DynamicAppendNode;18;-1120.08,5.91864;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
168 | Node;AmplifyShaderEditor.TextureCoordinatesNode;8;-1252.36,-144.4378;Inherit;False;0;4;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
169 | Node;AmplifyShaderEditor.SamplerNode;4;-789.4805,-167.8778;Inherit;True;Property;_TextureSample0;流动纹理;4;0;Create;False;0;0;0;False;0;False;-1;None;0222f30b8947b4a47b30891c67383f40;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
170 | Node;AmplifyShaderEditor.StaticSwitch;5;-483.3632,-96.14751;Inherit;False;Property;_Keyword0;切换贴图通道;5;0;Create;False;0;0;0;False;0;False;0;0;0;True;;KeywordEnum;2;R;A;Create;True;True;All;9;1;FLOAT;0;False;0;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;4;FLOAT;0;False;5;FLOAT;0;False;6;FLOAT;0;False;7;FLOAT;0;False;8;FLOAT;0;False;1;FLOAT;0
171 | Node;AmplifyShaderEditor.FresnelNode;1;-790.2618,21.78886;Inherit;True;Standard;WorldNormal;ViewDir;False;False;5;0;FLOAT3;0,0,1;False;4;FLOAT3;0,0,0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;1;FLOAT;0
172 | Node;AmplifyShaderEditor.SaturateNode;2;-499.1979,22.81381;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
173 | Node;AmplifyShaderEditor.Vector3Node;22;-996.0801,40.91864;Inherit;False;Property;_Freset;菲涅尔整体/边缘/强度;8;0;Create;False;0;0;0;False;0;False;0,1,5;0,1,5;0;4;FLOAT3;0;FLOAT;1;FLOAT;2;FLOAT;3
174 | Node;AmplifyShaderEditor.ColorNode;7;-502.3796,-270.7159;Inherit;False;Property;_Color0;主颜色;3;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,261.0196,1024,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
175 | Node;AmplifyShaderEditor.VertexColorNode;6;-469.94,-439.4973;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
176 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;3;-268.1979,-138.1862;Inherit;False;4;4;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;COLOR;0
177 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;16;-137.8,-139.3001;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/特殊制作/简易菲尼尔护盾;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;True;_BlendMode;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;True;True;0;True;_CullingMode;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;False;True;1;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
178 | Node;AmplifyShaderEditor.RangedFloatNode;26;-347.0801,149.9186;Inherit;False;Property;_BlendMode;混合模式;1;1;[Enum];Create;False;0;2;Addtive;1;AlphaBlend;10;0;True;0;False;0;1;0;0;0;1;FLOAT;0
179 | Node;AmplifyShaderEditor.RangedFloatNode;25;-475.0801,149.9186;Inherit;False;Property;_CullingMode;剔除模式;2;1;[Enum];Create;False;0;1;Option1;0;1;UnityEngine.Rendering.CullMode;True;0;False;0;2;0;0;0;1;FLOAT;0
180 | WireConnection;9;0;8;0
181 | WireConnection;9;2;18;0
182 | WireConnection;18;0;19;0
183 | WireConnection;18;1;20;0
184 | WireConnection;4;1;9;0
185 | WireConnection;5;1;4;1
186 | WireConnection;5;0;4;4
187 | WireConnection;1;1;22;1
188 | WireConnection;1;2;22;2
189 | WireConnection;1;3;22;3
190 | WireConnection;2;0;1;0
191 | WireConnection;3;0;6;0
192 | WireConnection;3;1;7;0
193 | WireConnection;3;2;5;0
194 | WireConnection;3;3;2;0
195 | WireConnection;16;0;3;0
196 | ASEEND*/
197 | //CHKSM=54657A8437EB7B7D76F5279600CAD1CEED30911D
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_GenerateDot.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/基本效果/通用程序粒子"
4 | {
5 | Properties
6 | {
7 | [HDR]_BaseColor("颜色 (辉光)", Color) = (1,1,1,1)
8 | _MaskPow("光点范围", Range( 0 , 1)) = 0.5
9 | _DotPwr("光点亮度", Range( 0 , 1)) = 0.3
10 |
11 | }
12 |
13 | SubShader
14 | {
15 |
16 |
17 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
18 | LOD 100
19 |
20 | CGINCLUDE
21 | #pragma target 3.0
22 | ENDCG
23 | Blend SrcAlpha One
24 | AlphaToMask Off
25 | Cull Back
26 | ColorMask RGBA
27 | ZWrite Off
28 | ZTest LEqual
29 | Offset 0 , 0
30 |
31 |
32 |
33 | Pass
34 | {
35 | Name "Unlit"
36 |
37 | CGPROGRAM
38 |
39 |
40 |
41 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
42 | //only defining to not throw compilation error over Unity 5.5
43 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
44 | #endif
45 | #pragma vertex vert
46 | #pragma fragment frag
47 | #pragma multi_compile_instancing
48 | #include "UnityCG.cginc"
49 |
50 |
51 | struct appdata
52 | {
53 | float4 vertex : POSITION;
54 | float4 color : COLOR;
55 | float4 ase_texcoord : TEXCOORD0;
56 | UNITY_VERTEX_INPUT_INSTANCE_ID
57 | };
58 |
59 | struct v2f
60 | {
61 | float4 vertex : SV_POSITION;
62 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
63 | float3 worldPos : TEXCOORD0;
64 | #endif
65 | float4 ase_color : COLOR;
66 | float4 ase_texcoord1 : TEXCOORD1;
67 | UNITY_VERTEX_INPUT_INSTANCE_ID
68 | UNITY_VERTEX_OUTPUT_STEREO
69 | };
70 |
71 | uniform half _MaskPow;
72 | uniform half _DotPwr;
73 | uniform half4 _BaseColor;
74 |
75 |
76 | v2f vert ( appdata v )
77 | {
78 | v2f o;
79 | UNITY_SETUP_INSTANCE_ID(v);
80 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
81 | UNITY_TRANSFER_INSTANCE_ID(v, o);
82 |
83 | o.ase_color = v.color;
84 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
85 |
86 | //setting value to unused interpolator channels and avoid initialization warnings
87 | o.ase_texcoord1.zw = 0;
88 | float3 vertexValue = float3(0, 0, 0);
89 | #if ASE_ABSOLUTE_VERTEX_POS
90 | vertexValue = v.vertex.xyz;
91 | #endif
92 | vertexValue = vertexValue;
93 | #if ASE_ABSOLUTE_VERTEX_POS
94 | v.vertex.xyz = vertexValue;
95 | #else
96 | v.vertex.xyz += vertexValue;
97 | #endif
98 | o.vertex = UnityObjectToClipPos(v.vertex);
99 |
100 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
101 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
102 | #endif
103 | return o;
104 | }
105 |
106 | fixed4 frag (v2f i ) : SV_Target
107 | {
108 | UNITY_SETUP_INSTANCE_ID(i);
109 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
110 | fixed4 finalColor;
111 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
112 | float3 WorldPosition = i.worldPos;
113 | #endif
114 | half2 texCoord29 = i.ase_texcoord1.xy * float2( 1,1 ) + float2( 0,0 );
115 |
116 |
117 | finalColor = ( i.ase_color * saturate( ( pow( ( 1.0 - distance( texCoord29 , half2( 0.5,0.5 ) ) ) , (5.0 + (_MaskPow - 0.0) * (50.0 - 5.0) / (1.0 - 0.0)) ) * (0.0 + (_DotPwr - 0.0) * (5.0 - 0.0) / (1.0 - 0.0)) ) ) * _BaseColor );
118 | return finalColor;
119 | }
120 | ENDCG
121 | }
122 | }
123 | CustomEditor "ASEMaterialInspector"
124 |
125 | Fallback Off
126 | }
127 | /*ASEBEGIN
128 | Version=19105
129 | Node;AmplifyShaderEditor.PowerNode;36;-1225.115,26.30396;Inherit;False;False;2;0;FLOAT;0;False;1;FLOAT;1;False;1;FLOAT;0
130 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;37;-1085.116,27.30396;Inherit;False;2;2;0;FLOAT;0;False;1;FLOAT;0;False;1;FLOAT;0
131 | Node;AmplifyShaderEditor.SaturateNode;40;-954.6964,27.07692;Inherit;True;1;0;FLOAT;0;False;1;FLOAT;0
132 | Node;AmplifyShaderEditor.VertexColorNode;3;-953.3826,-138.9149;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
133 | Node;AmplifyShaderEditor.ColorNode;88;-991.5688,241.5534;Inherit;False;Property;_BaseColor;颜色 (辉光);0;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;0,0,0,0;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
134 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;83;-763.886,2.751457;Inherit;True;3;3;0;COLOR;0,0,0,0;False;1;FLOAT;0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
135 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;-561.4608,3.1063;Half;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/基本效果/通用程序粒子;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;8;5;False;;1;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
136 | Node;AmplifyShaderEditor.TextureCoordinatesNode;29;-2088,-39;Inherit;False;0;-1;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
137 | Node;AmplifyShaderEditor.Vector2Node;31;-2030,78;Inherit;False;Constant;_uvdotcenter;uvdotcenter;6;0;Create;True;0;0;0;False;0;False;0.5,0.5;0,0;0;3;FLOAT2;0;FLOAT;1;FLOAT;2
138 | Node;AmplifyShaderEditor.DistanceOpNode;30;-1863,-39;Inherit;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT;0
139 | Node;AmplifyShaderEditor.OneMinusNode;32;-1660,-39;Inherit;False;1;0;FLOAT;0;False;1;FLOAT;0
140 | Node;AmplifyShaderEditor.RangedFloatNode;38;-1659.245,215.5872;Inherit;False;Property;_DotPwr;光点亮度;2;0;Create;False;0;0;0;False;0;False;0.3;1;0;1;0;1;FLOAT;0
141 | Node;AmplifyShaderEditor.TFHCRemapNode;106;-1398.727,220.7395;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;0;False;4;FLOAT;5;False;1;FLOAT;0
142 | Node;AmplifyShaderEditor.RangedFloatNode;34;-1664.114,46.30202;Inherit;False;Property;_MaskPow;光点范围;1;0;Create;False;0;0;0;False;0;False;0.5;0;0;1;0;1;FLOAT;0
143 | Node;AmplifyShaderEditor.TFHCRemapNode;107;-1398.727,50.7395;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;5;False;4;FLOAT;50;False;1;FLOAT;0
144 | WireConnection;36;0;32;0
145 | WireConnection;36;1;107;0
146 | WireConnection;37;0;36;0
147 | WireConnection;37;1;106;0
148 | WireConnection;40;0;37;0
149 | WireConnection;83;0;3;0
150 | WireConnection;83;1;40;0
151 | WireConnection;83;2;88;0
152 | WireConnection;0;0;83;0
153 | WireConnection;30;0;29;0
154 | WireConnection;30;1;31;0
155 | WireConnection;32;0;30;0
156 | WireConnection;106;0;38;0
157 | WireConnection;107;0;34;0
158 | ASEEND*/
159 | //CHKSM=6836C76E144FB9A8C6904F78FE35606F23087C0B
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_PixelArt.shader:
--------------------------------------------------------------------------------
1 | // Made with Amplify Shader Editor v1.9.1.5
2 | // Available at the Unity Asset Store - http://u3d.as/y3X
3 | Shader "A201-Shader/Built-in/特殊制作/像素风格化"
4 | {
5 | Properties
6 | {
7 | _MainTexU("主纹理", 2D) = "white" {}
8 | [HDR]_MainColor("主颜色", Color) = (1,1,1,1)
9 | [Enum(Dot,0,Pixel,1)]_PixelMode("像素风格", Float) = 0
10 | _DotSize("点状大小", Range( 0 , 1)) = 1
11 | _PixelSize("方块大小", Range( 0 , 1)) = 1
12 |
13 | }
14 |
15 | SubShader
16 | {
17 |
18 |
19 | Tags { "RenderType"="Transparent" "Queue"="Transparent" }
20 | LOD 100
21 |
22 | CGINCLUDE
23 | #pragma target 3.0
24 | ENDCG
25 | Blend SrcAlpha OneMinusSrcAlpha
26 | AlphaToMask Off
27 | Cull Back
28 | ColorMask RGBA
29 | ZWrite Off
30 | ZTest LEqual
31 | Offset 0 , 0
32 |
33 |
34 |
35 | Pass
36 | {
37 | Name "Unlit"
38 |
39 | CGPROGRAM
40 |
41 |
42 |
43 | #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
44 | //only defining to not throw compilation error over Unity 5.5
45 | #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
46 | #endif
47 | #pragma vertex vert
48 | #pragma fragment frag
49 | #pragma multi_compile_instancing
50 | #include "UnityCG.cginc"
51 |
52 |
53 | struct appdata
54 | {
55 | float4 vertex : POSITION;
56 | float4 color : COLOR;
57 | float4 ase_texcoord : TEXCOORD0;
58 | UNITY_VERTEX_INPUT_INSTANCE_ID
59 | };
60 |
61 | struct v2f
62 | {
63 | float4 vertex : SV_POSITION;
64 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
65 | float3 worldPos : TEXCOORD0;
66 | #endif
67 | float4 ase_texcoord1 : TEXCOORD1;
68 | float4 ase_color : COLOR;
69 | UNITY_VERTEX_INPUT_INSTANCE_ID
70 | UNITY_VERTEX_OUTPUT_STEREO
71 | };
72 |
73 | uniform sampler2D _MainTexU;
74 | uniform float4 _MainTexU_ST;
75 | uniform float _PixelSize;
76 | uniform float _DotSize;
77 | uniform float _PixelMode;
78 | uniform float4 _MainColor;
79 |
80 |
81 | v2f vert ( appdata v )
82 | {
83 | v2f o;
84 | UNITY_SETUP_INSTANCE_ID(v);
85 | UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
86 | UNITY_TRANSFER_INSTANCE_ID(v, o);
87 |
88 | o.ase_texcoord1.xy = v.ase_texcoord.xy;
89 | o.ase_color = v.color;
90 |
91 | //setting value to unused interpolator channels and avoid initialization warnings
92 | o.ase_texcoord1.zw = 0;
93 | float3 vertexValue = float3(0, 0, 0);
94 | #if ASE_ABSOLUTE_VERTEX_POS
95 | vertexValue = v.vertex.xyz;
96 | #endif
97 | vertexValue = vertexValue;
98 | #if ASE_ABSOLUTE_VERTEX_POS
99 | v.vertex.xyz = vertexValue;
100 | #else
101 | v.vertex.xyz += vertexValue;
102 | #endif
103 | o.vertex = UnityObjectToClipPos(v.vertex);
104 |
105 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
106 | o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
107 | #endif
108 | return o;
109 | }
110 |
111 | fixed4 frag (v2f i ) : SV_Target
112 | {
113 | UNITY_SETUP_INSTANCE_ID(i);
114 | UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
115 | fixed4 finalColor;
116 | #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
117 | float3 WorldPosition = i.worldPos;
118 | #endif
119 | float2 uv_MainTexU = i.ase_texcoord1.xy * _MainTexU_ST.xy + _MainTexU_ST.zw;
120 | float temp_output_23_0 = (25.0 + (_PixelSize - 0.0) * (125.0 - 25.0) / (1.0 - 0.0));
121 | float2 appendResult19 = (float2(temp_output_23_0 , temp_output_23_0));
122 | float2 temp_output_5_0 = ( uv_MainTexU * appendResult19 );
123 | float2 appendResult11_g1 = (float2(_DotSize , _DotSize));
124 | float temp_output_17_0_g1 = length( ( (frac( temp_output_5_0 )*2.0 + -1.0) / appendResult11_g1 ) );
125 | float4 tex2DNode2 = tex2D( _MainTexU, ( floor( temp_output_5_0 ) / appendResult19 ) );
126 | float4 lerpResult12 = lerp( ( saturate( ( ( 1.0 - temp_output_17_0_g1 ) / fwidth( temp_output_17_0_g1 ) ) ) * tex2DNode2 * 1.2 ) , tex2DNode2 , _PixelMode);
127 |
128 |
129 | finalColor = ( lerpResult12 * _MainColor * i.ase_color );
130 | return finalColor;
131 | }
132 | ENDCG
133 | }
134 | }
135 | CustomEditor "ASEMaterialInspector"
136 |
137 | Fallback Off
138 | }
139 | /*ASEBEGIN
140 | Version=19105
141 | Node;AmplifyShaderEditor.TFHCRemapNode;23;-1623.676,-227.7656;Inherit;False;5;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;1;False;3;FLOAT;25;False;4;FLOAT;125;False;1;FLOAT;0
142 | Node;AmplifyShaderEditor.RangedFloatNode;18;-1889.048,-232.9345;Inherit;False;Property;_PixelSize;方块大小;4;0;Create;False;0;0;0;False;0;False;1;0.170647;0;1;0;1;FLOAT;0
143 | Node;AmplifyShaderEditor.DynamicAppendNode;19;-1443.048,-233.9345;Inherit;False;FLOAT2;4;0;FLOAT;0;False;1;FLOAT;0;False;2;FLOAT;0;False;3;FLOAT;0;False;1;FLOAT2;0
144 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;5;-1306.381,-354.7614;Inherit;False;2;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
145 | Node;AmplifyShaderEditor.FloorOpNode;7;-1175.302,-297.9638;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
146 | Node;AmplifyShaderEditor.FractNode;9;-1176.831,-398.0928;Inherit;False;1;0;FLOAT2;0,0;False;1;FLOAT2;0
147 | Node;AmplifyShaderEditor.TextureCoordinatesNode;4;-1530.459,-360.0124;Inherit;False;0;2;2;3;2;SAMPLER2D;;False;0;FLOAT2;1,1;False;1;FLOAT2;0,0;False;5;FLOAT2;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
148 | Node;AmplifyShaderEditor.SimpleDivideOpNode;8;-1045.204,-257.516;Inherit;True;2;0;FLOAT2;0,0;False;1;FLOAT2;0,0;False;1;FLOAT2;0
149 | Node;AmplifyShaderEditor.FunctionNode;10;-765.5698,-398.1295;Inherit;True;Ellipse;-1;;1;3ba94b7b3cfd5f447befde8107c04d52;0;3;2;FLOAT2;0,0;False;7;FLOAT;1;False;9;FLOAT;1;False;1;FLOAT;0
150 | Node;AmplifyShaderEditor.RangedFloatNode;17;-1059.205,-341.7161;Inherit;False;Property;_DotSize;点状大小;3;0;Create;False;0;0;0;False;0;False;1;1;0;1;0;1;FLOAT;0
151 | Node;AmplifyShaderEditor.ColorNode;3;-682.2053,8.664253;Inherit;False;Property;_MainColor;主颜色;1;1;[HDR];Create;False;0;0;0;False;0;False;1,1,1,1;1,1,1,1;True;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
152 | Node;AmplifyShaderEditor.VertexColorNode;24;-640.9358,182.0977;Inherit;False;0;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
153 | Node;AmplifyShaderEditor.LerpOp;12;-280.8899,-202.0647;Inherit;False;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
154 | Node;AmplifyShaderEditor.RangedFloatNode;22;-677.9973,-474.7273;Inherit;False;Constant;_EllipseFix;EllipseFix;5;0;Create;True;0;0;0;False;0;False;1.2;0;0;0;0;1;FLOAT;0
155 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;11;-441.879,-398.2892;Inherit;False;3;3;0;FLOAT;0;False;1;COLOR;0,0,0,0;False;2;FLOAT;0;False;1;COLOR;0
156 | Node;AmplifyShaderEditor.SimpleMultiplyOpNode;1;-125.8516,-201.8515;Inherit;False;3;3;0;COLOR;0,0,0,0;False;1;COLOR;0,0,0,0;False;2;COLOR;0,0,0,0;False;1;COLOR;0
157 | Node;AmplifyShaderEditor.TemplateMultiPassMasterNode;0;1.59138,-201.6713;Float;False;True;-1;2;ASEMaterialInspector;100;5;A201-Shader/Built-in/特殊制作/像素风格化;0770190933193b94aaa3065e307002fa;True;Unlit;0;0;Unlit;2;True;True;2;5;False;;10;False;;0;1;False;;0;False;;True;0;False;;0;False;;False;False;False;False;False;False;False;False;False;True;0;False;;False;True;0;False;;False;True;True;True;True;True;0;False;;False;False;False;False;False;False;False;True;False;0;False;;255;False;;255;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;0;False;;True;True;2;False;;True;3;False;;True;True;0;False;;0;False;;True;2;RenderType=Transparent=RenderType;Queue=Transparent=Queue=0;True;2;False;0;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;False;0;;0;0;Standard;1;Vertex Position,InvertActionOnDeselection;1;0;0;1;True;False;;False;0
158 | Node;AmplifyShaderEditor.SamplerNode;2;-770.2028,-181.0747;Inherit;True;Property;_MainTexU;主纹理;0;0;Create;False;0;0;0;False;0;False;-1;None;14b5f663e1f1907429ef0238a746aaff;True;0;False;white;Auto;False;Object;-1;Auto;Texture2D;8;0;SAMPLER2D;;False;1;FLOAT2;0,0;False;2;FLOAT;0;False;3;FLOAT2;0,0;False;4;FLOAT2;0,0;False;5;FLOAT;1;False;6;FLOAT;0;False;7;SAMPLERSTATE;;False;5;COLOR;0;FLOAT;1;FLOAT;2;FLOAT;3;FLOAT;4
159 | Node;AmplifyShaderEditor.RangedFloatNode;13;-413.1895,-159.1645;Inherit;False;Property;_PixelMode;像素风格;2;1;[Enum];Create;False;0;2;Dot;0;Pixel;1;0;False;0;False;0;1;0;0;0;1;FLOAT;0
160 | WireConnection;23;0;18;0
161 | WireConnection;19;0;23;0
162 | WireConnection;19;1;23;0
163 | WireConnection;5;0;4;0
164 | WireConnection;5;1;19;0
165 | WireConnection;7;0;5;0
166 | WireConnection;9;0;5;0
167 | WireConnection;8;0;7;0
168 | WireConnection;8;1;19;0
169 | WireConnection;10;2;9;0
170 | WireConnection;10;7;17;0
171 | WireConnection;10;9;17;0
172 | WireConnection;12;0;11;0
173 | WireConnection;12;1;2;0
174 | WireConnection;12;2;13;0
175 | WireConnection;11;0;10;0
176 | WireConnection;11;1;2;0
177 | WireConnection;11;2;22;0
178 | WireConnection;1;0;12;0
179 | WireConnection;1;1;3;0
180 | WireConnection;1;2;24;0
181 | WireConnection;0;0;1;0
182 | WireConnection;2;1;8;0
183 | ASEEND*/
184 | //CHKSM=6E0EE989A7E0E4F6A101A61C6FEB13713B23BBE7
--------------------------------------------------------------------------------
/shaderINFO_12.1/Built-in/Soung_Built-in_SimpleToon.shader:
--------------------------------------------------------------------------------
1 | Shader "A201-Shader/Built-in/进阶功能/简易卡通着色器"
2 | {
3 | Properties
4 | {
5 | [Header(BaseColor)]
6 | [HDR]_Color("基础颜色", Color) = (1,1,1,1)
7 | _MainTex("漫反射(RGB)", 2D) = "white" {}
8 | [Normal]_Normal("法线贴图", 2D) = "bump" {}
9 | _LightCutoff("光照范围", Range(0,1)) = 0.5
10 | _ShadowBands("阴影过渡", Range(1,4)) = 1
11 |
12 | [Header(Specular)]
13 | _SpecularMap("高光反射", 2D) = "white" {}
14 | _Glossiness("光滑度", Range(0,1)) = 0.5
15 | [HDR]_SpecularColor("高光颜色", Color) = (0,0,0,1)
16 |
17 | [Header(Rim)]
18 | _RimSize("描边大小", Range(0,1)) = 0
19 | [HDR]_RimColor("描边颜色", Color) = (0,0,0,1)
20 | [Toggle(SHADOWED_RIM)]
21 | _ShadowedRim("阴影影响描边", float) = 0
22 |
23 | [Header(Emission)]
24 | [HDR]_Emission("自发光颜色", Color) = (0,0,0,1)
25 | }
26 | SubShader
27 | {
28 | Tags { "RenderType" = "Opaque" }
29 | ZWrite On
30 |
31 | Pass
32 | {
33 | Tags { "LightMode" = "ForwardBase" }
34 |
35 | CGPROGRAM
36 |
37 | #pragma multi_compile_fwdbase
38 | #pragma shader_feature SHADOWED_RIM
39 | #pragma target 3.0
40 |
41 | #pragma vertex vert
42 | #pragma fragment frag
43 | #include "UnityCG.cginc"
44 | #include "Lighting.cginc"
45 | #include "AutoLight.cginc"
46 |
47 | fixed4 _Color;
48 | sampler2D _MainTex;
49 | float4 _MainTex_ST;
50 | sampler2D _Normal;
51 | float _LightCutoff;
52 | float _ShadowBands;
53 |
54 | sampler2D _SpecularMap;
55 | float4 _SpecularMap_ST;
56 | half _Glossiness;
57 | fixed4 _SpecularColor;
58 |
59 | float _RimSize;
60 | fixed4 _RimColor;
61 | fixed4 _Emission;
62 |
63 | struct a2v
64 | {
65 | float4 vertex : POSITION;
66 | float3 normal : NORMAL;
67 | float4 tangent : TANGENT;
68 | float4 texcoord : TEXCOORD0;
69 | };
70 |
71 | struct v2f
72 | {
73 | float4 pos : SV_POSITION;
74 | float4 uv : TEXCOORD0;
75 | float4 TtoW0 : TEXCOORD1;
76 | float4 TtoW1 : TEXCOORD2;
77 | float4 TtoW2 : TEXCOORD3;
78 | SHADOW_COORDS(4)
79 | };
80 |
81 | v2f vert(a2v v)
82 | {
83 | v2f o;
84 | o.pos = UnityObjectToClipPos(v.vertex);
85 |
86 | o.uv.xy = v.texcoord.xy * _MainTex_ST.xy + _MainTex_ST.zw;
87 | o.uv.zw = v.texcoord.xy * _SpecularMap_ST.xy + _SpecularMap_ST.zw;
88 |
89 | float3 worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
90 | fixed3 worldNormal = UnityObjectToWorldNormal(v.normal);
91 | fixed3 worldTangent = UnityObjectToWorldDir(v.tangent.xyz);
92 | fixed3 worldBinormal = cross(worldNormal, worldTangent) * v.tangent.w;
93 |
94 | o.TtoW0 = float4(worldTangent.x, worldBinormal.x, worldNormal.x, worldPos.x);
95 | o.TtoW1 = float4(worldTangent.y, worldBinormal.y, worldNormal.y, worldPos.y);
96 | o.TtoW2 = float4(worldTangent.z, worldBinormal.z, worldNormal.z, worldPos.z);
97 |
98 | TRANSFER_SHADOW(o);
99 |
100 | return o;
101 | }
102 |
103 | half4 frag(v2f i) : SV_Target
104 | {
105 | float3 worldPos = float3(i.TtoW0.w, i.TtoW1.w, i.TtoW2.w);
106 | fixed3 lightDir = normalize(UnityWorldSpaceLightDir(worldPos));
107 | fixed3 viewDir = normalize(UnityWorldSpaceViewDir(worldPos));
108 | fixed3 normal = UnpackNormal(tex2D(_Normal, i.uv.xy));
109 | normal = normalize(half3(dot(i.TtoW0.xyz, normal), dot(i.TtoW1.xyz, normal), dot(i.TtoW2.xyz, normal)));
110 | half nDotL = saturate(dot(normal, lightDir));
111 | half diff = round(saturate(nDotL / _LightCutoff) * _ShadowBands) / _ShadowBands;
112 |
113 | UNITY_LIGHT_ATTENUATION(atten, i, worldPos);
114 | half stepAtten = round(atten);
115 | half shadow = diff * stepAtten;
116 | float3 refl = reflect(lightDir, normal);
117 | float vDotRefl = dot(viewDir, -refl);
118 | float smoothness = tex2D(_SpecularMap, i.uv.zw).x * _Glossiness;
119 | float3 specular = _SpecularColor.rgb * step(1 - smoothness, vDotRefl);
120 | //float3 rim = _RimColor * step(1 - _RimSize, 1 - saturate(dot(viewDir, normal)));
121 | float3 rim = _RimColor * (step(1 - _RimSize, 1 - saturate(dot(viewDir, normal))) * -1);
122 | fixed4 albedo = tex2D(_MainTex, i.uv.xy) * _Color;
123 | half3 col = (albedo.rgb + specular) * _LightColor0;
124 | half4 c;
125 |
126 | //描边受阴影影响
127 | #ifdef SHADOWED_RIM
128 | c.rgb = (col + rim) * shadow;
129 | #else
130 | c.rgb = col * shadow + rim;
131 | #endif
132 | c.a = albedo.a;
133 | c.rgb = c.rgb + albedo.rgb * _Emission.rgb;
134 |
135 | return c;
136 | }
137 |
138 | ENDCG
139 |
140 | }
141 | }
142 | FallBack "Diffuse"
143 | }
--------------------------------------------------------------------------------
/shaderINFO_12.1/PBR扭曲球体.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/PBR扭曲球体.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/ShaderCheck.xlsx:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/ShaderCheck.xlsx
--------------------------------------------------------------------------------
/shaderINFO_12.1/games101.md:
--------------------------------------------------------------------------------
1 | Games 101 Project 100Person
2 | ===========================
3 |
4 | ## 0.整体流程
5 |
6 | - 应用阶段
7 |
8 | 准备基本信息 >>> 设置渲染状态 >>> 准备渲染参数 >>> **调用DrawCall**
9 |
10 | > 基本场景数据:
物体Transform、Rotation、Scale;
网格Vertex、UV;
光源Type、Angel、Power;
相机Culling、FOV、PixelSize等
11 |
12 | - 几何阶段
13 |
14 | 顶点着色与处理 (Vertex) >>> 投影 >>> 裁剪 >>> 屏幕映射
15 |
16 | > 顶点空间>>>世界空间>>>视图空间>>>投影空间>>>视口坐标
17 |
18 | > 投影:xyz除以w,正交w恒为1所以xyz不变,两物体大小不变;透视w遵循近大远小所以xyz随透视距离变化
19 |
20 | > 裁剪:OpenGL:**xyz维度**(-1,1),屏幕原点左下方;
D3D:**xy维度**(-1,1),**z维度**(0,1),屏幕原点左上方
21 |
22 | - 光栅化阶段
23 |
24 | 计算图元边界(三角形设置) >>> 寻找被三角形网格所覆盖的所有像素(三角形遍历) >>> **抗锯齿**
25 |
26 | > 抗锯齿:SSAA:放大渲染分辨率,下采样(费)
MSAA:三角形采样计算
FXAA、TAA不在此阶段 (在后处理阶段)
27 |
28 | - 逐片元操作
29 |
30 | 片元着色 (Fragment) >>> 颜色混合 (Blend) >>> 目标缓冲
31 |
32 | > 颜色混合阶段会做:透明度裁剪 AlphaClip >>> 深度测试或模板测试 ZTest/Stencil Test >>>
33 |
34 | - 后处理
35 |
36 |
37 | ## 1.MVP矩阵
38 |
39 | ### 模型Model | 观察View | 投影Projection
40 |
41 | M: 模型空间 到 世界空间
42 |
43 | - 1.缩放 >>> 2.旋转 >>> 3.平移 **(顺序不能变更)**
44 |
45 | V: 世界空间 到 视觉空间(摄像机)
46 |
47 | - 1.平移 >>> 2.旋转 >>> 3.Z值取反(Unity左手坐标系) 将摄像机空间原点与世界空间重合,逆变换
48 |
49 | P: 视觉空间 到 裁剪空间(屏幕前)
50 |
51 | * 为投影Projection做准备
52 | * 判断顶点可见性
53 |
54 | - 透视投影与正交投影
--------------------------------------------------------------------------------
/shaderINFO_12.1/全功能.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/全功能.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/全面屏幕后处理.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/全面屏幕后处理.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/卡通视差地裂.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/卡通视差地裂.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/无光照扭曲球体.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/无光照扭曲球体.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/星星收缩.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/星星收缩.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/星星收缩_bt.unitypackage:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/星星收缩_bt.unitypackage
--------------------------------------------------------------------------------
/shaderINFO_12.1/星空刀光.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/星空刀光.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/程序光晕.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/程序光晕.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/自动故障扰动.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/自动故障扰动.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/色差扭曲流动.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/色差扭曲流动.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/转场遮罩.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/转场遮罩.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/遮罩热扭曲.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/遮罩热扭曲.png
--------------------------------------------------------------------------------
/shaderINFO_12.1/雪地材质与脚印.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Soung2279/Unity-Shaders-Collection/13aa87204e14adfd026518f9b41d12de6db6468d/shaderINFO_12.1/雪地材质与脚印.png
--------------------------------------------------------------------------------