From ffa4c3d047786bc2b72c56969db6be1bbe8ba8d2 Mon Sep 17 00:00:00 2001 From: Holly Newlands Date: Wed, 7 Sep 2022 16:59:07 -0700 Subject: [PATCH 1/2] Depth is no longer manually calculated --- Assets/Fur/Shaders/Shell/Depth.hlsl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Assets/Fur/Shaders/Shell/Depth.hlsl b/Assets/Fur/Shaders/Shell/Depth.hlsl index d3aefbc..ec83361 100644 --- a/Assets/Fur/Shaders/Shell/Depth.hlsl +++ b/Assets/Fur/Shaders/Shell/Depth.hlsl @@ -63,16 +63,13 @@ void geom(triangle Attributes input[3], inout TriangleStream stream) } } -void frag( - Varyings input, - out float4 outColor : SV_Target, - out float outDepth : SV_Depth) +half4 frag(Varyings input) : SV_Target { float4 furColor = SAMPLE_TEXTURE2D(_FurMap, sampler_FurMap, input.uv / _BaseMap_ST.xy * _FurScale); float alpha = furColor.r * (1.0 - input.layer); if (input.layer > 0.0 && alpha < _AlphaCutout) discard; - outColor = outDepth = input.vertex.z / input.vertex.w; + return 0; } -#endif \ No newline at end of file +#endif From 911b5c4a53d813f6be0da86c71f382fcec0e4887 Mon Sep 17 00:00:00 2001 From: Holly Newlands Date: Wed, 7 Sep 2022 16:59:36 -0700 Subject: [PATCH 2/2] Shadow depth no longer manually calculated --- Assets/Fur/Shaders/Shell/Shadow.hlsl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Assets/Fur/Shaders/Shell/Shadow.hlsl b/Assets/Fur/Shaders/Shell/Shadow.hlsl index 91acc41..7fd736a 100644 --- a/Assets/Fur/Shaders/Shell/Shadow.hlsl +++ b/Assets/Fur/Shaders/Shell/Shadow.hlsl @@ -66,16 +66,13 @@ void geom(triangle Attributes input[3], inout TriangleStream stream) } } -void frag( - Varyings input, - out float4 outColor : SV_Target, - out float outDepth : SV_Depth) +half4 frag(Varyings input) : SV_Target { float4 furColor = SAMPLE_TEXTURE2D(_FurMap, sampler_FurMap, input.uv * _FurScale); float alpha = furColor.r * (1.0 - input.layer); if (input.layer > 0.0 && alpha < _AlphaCutout) discard; - outColor = outDepth = input.vertex.z / input.vertex.w; + return 0; } -#endif \ No newline at end of file +#endif