From 3dbd9261cd984e567a2a2972ce63923338af871f Mon Sep 17 00:00:00 2001 From: Simon Jackson Date: Sun, 27 Nov 2022 16:28:14 +0000 Subject: [PATCH] Updated Depth Texture sampler in UI Particles Shaders Resolves: - https://github.com/Unity-UI-Extensions/com.unity.uiextensions/issues/401 --- Runtime/Resources/Shaders/UI Particle Add.shader | 2 +- Runtime/Resources/Shaders/UI Particle AddMultiply.shader | 2 +- Runtime/Resources/Shaders/UI Particle AddSmooth.shader | 5 ++--- Runtime/Resources/Shaders/UI Particle Alpha Blend.shader | 5 ++--- Runtime/Resources/Shaders/UI Particle Blend.shader | 5 ++--- Runtime/Resources/Shaders/UI Particle Multiply.shader | 5 ++--- Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader | 5 ++--- .../Resources/Shaders/UI Particle Premultiply Blend.shader | 5 ++--- .../Resources/Shaders/UI Particle VertexLit Blended.shader | 2 +- 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/Runtime/Resources/Shaders/UI Particle Add.shader b/Runtime/Resources/Shaders/UI Particle Add.shader index f1017e3..1c63363 100644 --- a/Runtime/Resources/Shaders/UI Particle Add.shader +++ b/Runtime/Resources/Shaders/UI Particle Add.shader @@ -82,7 +82,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f IN) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle AddMultiply.shader b/Runtime/Resources/Shaders/UI Particle AddMultiply.shader index 7cd819a..e0e0df3 100644 --- a/Runtime/Resources/Shaders/UI Particle AddMultiply.shader +++ b/Runtime/Resources/Shaders/UI Particle AddMultiply.shader @@ -82,7 +82,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle AddSmooth.shader b/Runtime/Resources/Shaders/UI Particle AddSmooth.shader index b12bf2d..1d3d576 100644 --- a/Runtime/Resources/Shaders/UI Particle AddSmooth.shader +++ b/Runtime/Resources/Shaders/UI Particle AddSmooth.shader @@ -2,8 +2,7 @@ Shader "UI Extensions/Particles/Additive (Soft)" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -81,7 +80,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader b/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader index 3b76f8e..f5b00b9 100644 --- a/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader +++ b/Runtime/Resources/Shaders/UI Particle Alpha Blend.shader @@ -3,8 +3,7 @@ Properties { _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5) _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -82,7 +81,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle Blend.shader b/Runtime/Resources/Shaders/UI Particle Blend.shader index f6e08a6..6276bd1 100644 --- a/Runtime/Resources/Shaders/UI Particle Blend.shader +++ b/Runtime/Resources/Shaders/UI Particle Blend.shader @@ -2,8 +2,7 @@ Shader "UI Extensions/Particles/Blend" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -81,7 +80,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle Multiply.shader b/Runtime/Resources/Shaders/UI Particle Multiply.shader index 8e4770e..1d2c940 100644 --- a/Runtime/Resources/Shaders/UI Particle Multiply.shader +++ b/Runtime/Resources/Shaders/UI Particle Multiply.shader @@ -2,8 +2,7 @@ Shader "UI Extensions/Particles/Multiply" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -80,7 +79,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader b/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader index c8ec832..24dae3c 100644 --- a/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader +++ b/Runtime/Resources/Shaders/UI Particle MultiplyDouble.shader @@ -2,8 +2,7 @@ Shader "UI Extensions/Particles/Multiply (Double)" { Properties { _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -81,7 +80,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f i) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader b/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader index 10d0ff1..5672889 100644 --- a/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader +++ b/Runtime/Resources/Shaders/UI Particle Premultiply Blend.shader @@ -3,8 +3,7 @@ Properties { _MainTex ("Particle Texture", 2D) = "white" {} _InvFade ("Soft Particles Factor", Range(0.01,3.0)) = 1.0 - - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255 @@ -82,7 +81,7 @@ Category { return v; } - sampler2D_float _CameraDepthTexture; + UNITY_DECLARE_DEPTH_TEXTURE(_CameraDepthTexture); float _InvFade; fixed4 frag (v2f IN) : SV_Target diff --git a/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader b/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader index 4b5738e..c0f5e79 100644 --- a/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader +++ b/Runtime/Resources/Shaders/UI Particle VertexLit Blended.shader @@ -3,7 +3,7 @@ Properties { _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0) _MainTex ("Particle Texture", 2D) = "white" {} - _StencilComp ("Stencil Comparison", Float) = 8 + _StencilComp ("Stencil Comparison", Float) = 8 _Stencil ("Stencil ID", Float) = 0 _StencilOp ("Stencil Operation", Float) = 0 _StencilWriteMask ("Stencil Write Mask", Float) = 255