Advertisement
_Dunno_

Untitled

Jan 26th, 2024 (edited)
1,355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Shader "StencilFullScreen"
  2. {
  3.     Properties
  4.     {
  5.         _Color("Color", Color) = (1,1,1,1)
  6.         [IntRange] _StencilID ("Stencil ID", Range(0, 255)) = 0
  7.     }
  8.     SubShader
  9.     {
  10.         Tags
  11.         {
  12.             "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"
  13.         }
  14.         LOD 100
  15.  
  16.         Stencil
  17.         {
  18.             Ref [_StencilID]
  19.             Comp Equal
  20.         }
  21.        
  22.         Pass
  23.         {
  24.             HLSLPROGRAM
  25.             #pragma vertex Vert
  26.             #pragma fragment Frag
  27.             #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
  28.             #include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
  29.            
  30.             half4 Frag(Varyings input) : SV_Target
  31.             {
  32.                 const float4 sceneColor = FragBilinear(input);
  33.                
  34.                 return sceneColor + half4(0, 0.1, 0, 0);
  35.             }
  36.             ENDHLSL
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement