File tree 1 file changed +31
-6
lines changed
Assets/Shaders/NPR/Cartoon
1 file changed +31
-6
lines changed Original file line number Diff line number Diff line change @@ -166,24 +166,49 @@ Shader "Lakehani/URP/NPR/Cartoon/Rimlight Depth Offset"
166
166
167
167
Pass
168
168
{
169
+ //参考
170
+ //Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl
171
+ //Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl
169
172
//写入深度图
170
173
Name "DepthOnly"
171
174
Tags {"LightMode" = "DepthOnly" }
172
175
173
- Cull Back
174
- Blend One Zero
175
- ZTest LEqual
176
+ Name "DepthOnly"
177
+ Tags { "LightMode" = "DepthOnly" }
178
+
176
179
ZWrite On
177
180
ColorMask 0
178
181
179
182
HLSLPROGRAM
180
- // Required to compile gles 2.0 with standard srp library
181
183
182
184
#pragma vertex DepthOnlyVertex
183
185
#pragma fragment DepthOnlyFragment
184
186
185
- #include "Packages/com.unity.render-pipelines.universal/Shaders/UnlitInput.hlsl"
186
- #include "Packages/com.unity.render-pipelines.universal/Shaders/DepthOnlyPass.hlsl"
187
+ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
188
+
189
+ struct Attributes
190
+ {
191
+ float4 position : POSITION ;
192
+ };
193
+
194
+ struct Varyings
195
+ {
196
+ float4 positionCS : SV_POSITION ;
197
+ };
198
+
199
+ Varyings DepthOnlyVertex (Attributes input)
200
+ {
201
+ Varyings output;
202
+ output.positionCS = TransformObjectToHClip (input.position.xyz);
203
+ return output;
204
+ }
205
+
206
+ half4 DepthOnlyFragment (Varyings input) : SV_TARGET
207
+ {
208
+
209
+ return 0 ;
210
+ }
211
+
187
212
ENDHLSL
188
213
}
189
214
}
You can’t perform that action at this time.
0 commit comments