multi_compile and builtin keywords ... is there any document?!

While programing shaders in unity, I came across many things that doesn’t have any documentation around, such as (which are important) :

  • #pragma multi_compile_#####.
    e.g. “fwdbase” “fwdadd” …etc
  • Keywords for point 1.
    e.g. “DIRECTIONAL” “VERTEXLIGHT_ON” …etc

Most of keywords I get when I open the compiled shader but only if I knew what to put in point 1 and they are easy to be understood through thier names. As for now I only know the fwdbase and fwdadd. I don’t know if there are others.

These points are important to get rid of many issues like what happens if you program the 4 per-vertex lights which will not reset the array of lights colors to zeros(black) when you disable the lights. So you need VERTEXLIGHT_ON for that which is not documented as far as I know.

If there is any documents, please post its URL.

1 Like

there are some similar questions around, forum.unity3d.com/threads/139129-using-ifdef-LIGHTMAP_ON-or-ifndef-LIGHTMAP_OFF
for some reason it took me also about 1 hour to figure it out, i kept not getting the syntax perfect… if you search this forum for multi compile perhaps the answer will be there.