Search Unity

What is "Pass"

Discussion in 'Shaders' started by MatheusMarkies, May 17, 2020.

  1. MatheusMarkies

    MatheusMarkies

    Joined:
    Apr 16, 2017
    Posts:
    67
    Code (CSharp):
    1. Pass <--- what this is?
    2.         {
    3.             CGPROGRAM
    4. #pragma vertex vert
    5. #pragma fragment horizontalFrag
    6. #pragma target 4.0
    7.  
    8.             fixed4 horizontalFrag(v2f input) : SV_Target
    9.             {
    10.                 return BilateralBlur(input, float2(1, 0), _QuarterResDepthBuffer, QUARTER_RES_BLUR_KERNEL_SIZE, _QuarterResTexelSize.xy);
    11.             }
    12.  
    13.             ENDCG
    14.         }
    Good Morning! I would like to know how to use the Pass in the HLSL shader
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,549
    It's mostly all explained here:
    https://docs.unity3d.com/Manual/SL-Pass.html

    If the pass isn't named, then the first one in the list of passes that is suitable for the build target will be used (at least on HDRP/URP, on the old pipeline it will render every unnamed pass that is compatible with the build target, one after the other). If it's named, then it can be called manually by name or is automatically used by a given render pipeline depending on the name, such as a SHADOWCASTER pass.
     
    Last edited: May 20, 2020
    MatheusMarkies likes this.