Preprocessor variable to check whether or not shadowmaps are on

Is they a way to know in a shader whether or not it will be compiled with shadows?
I want to combine diffuse with ambient in the vertex shader if I know that shadows are off (and that the Attenuation function is always going to return 1.)

Thanks!

Do a “Find text in files” search of the CGINC files in the Built-in shaders zip you can download for your Unity version, searching for “SHADOW”, case-sensitive. You’ll find all the shader variant macros in there.

1 Like

Thank you!