Search Unity

Where can i find all #pragma directives for Shader

Discussion in 'Shaders' started by Jimbo2D_WaterLaw, Mar 29, 2018.

  1. Jimbo2D_WaterLaw

    Jimbo2D_WaterLaw

    Joined:
    Nov 19, 2015
    Posts:
    4
    The Topic allready said it . where can i find all pragma directives for Shader in Unity?
    For Example im looking for an Explanation for this line. Especially the lighting keyword.
    so I have a custom lighting model called ToonRamp and below it i have this line.

    #pragma lighting ToonRamp exclude_path: prepass

    here the full shader:
    https://gist.github.com/mandarinx/ef1516e2750ebb8630c4daed69f77a83

    What's it all about with the lighting keyword i am trying to find some some information about that now for a while an cant find anything. Please help me
     
    BrainSlugs83 likes this.
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,546
  3. Jimbo2D_WaterLaw

    Jimbo2D_WaterLaw

    Joined:
    Nov 19, 2015
    Posts:
    4

    first off all thanks for the reply but that is not what im looking for i read the site multiple times and there is nothing said about a #pragma lighting... so obviously those are not all directives. If i havent stumbled over the toonramp shader i actually wouldnt know that there is the possiblity to use the keyword lighting.
     
    BrainSlugs83 likes this.
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,546
    The details are on that page, they just don't use the 'lighting" directive there, normally you simply write the name of the lighting model you want to use without the directive. Scroll down to the "Required parameters" section and click the link it has for "Custom Lighting Models".

    I don't believe "lighting" is even a directive, if you comment out that line in the shader, you'll notice nothing changes. Custom lighting to use is defined in the "#pragma surface surf" line.
     
    Last edited: Mar 30, 2018
  5. Jimbo2D_WaterLaw

    Jimbo2D_WaterLaw

    Joined:
    Nov 19, 2015
    Posts:
    4

    ok thanks
     
  6. BrainSlugs83

    BrainSlugs83

    Joined:
    Jun 18, 2015
    Posts:
    38
    I don't even understand how the link is relevant to the question -- he's asking for all the pragmas... there's tons and they're scattered all over the documentation (like #pragma multi_compile, and #pragma shader_feature, shown here: https://docs.unity3d.com/Manual/SL-MultipleProgramVariants.html )

    Neither of these pages is a definitive source for all of the possible pragmas.