kDieletricSpec variable removed from Lighting.hlsl?

Has the kDieletricSpec variable been removed from Lighting.hlsl? I included Lighting.hlsl in a shader, which referenced the kDieletricSpec variable, which is working fine in Unity 2022, but in Unity 6 it can’t find the variable anymore.

If this variable is being deprecated, is there something that replaced it?

Quick workaround for now is by just adding the following line in my own shader:

#define kDieletricSpec half4(0.04, 0.04, 0.04, 1.0 - 0.04) // standard dielectric reflectivity coef at incident angle (= 4%)

I think it’s a typo and was corrected to “kDielectricSpec”.

Another workaround could be:

#ifndef kDieletricSpec
#define kDieletricSpec kDielectricSpec
#endif

Or if you don’t want typos:

#ifndef kDielectricSpec
#define kDielectricSpec kDieletricSpec
#endif

// and change it in your code
//...
3 Likes

Looks like you are correct. Changed the variable name and it doesn’t give the error anymore, thanks!

1 Like