Hello.
Using Unity 2020.3.7.
Light Culling Mask does not work in URP.
- I added 2 layers. ( Character , Background )
- Set the layer of the character object to character.
- Added directional light.
- Set the culling mask of the directional light to background.
- A light is applied to the character object.
- In the shader code we are doing additional lights calculations.
Does anyone know why not?
If not, is there any other way?
thanks
I found the cause.
I am using custom shaders.
Light mainLight = GetMainLight();
half NdotL = dot(input.normalWS, mainLight.direction);
half3 lightColor = mainLight.color;
Since we only use directional lights, we don’t use distance Attenuation.
For other layers, the distance Attenuation value is 0.
Light mainLight = GetMainLight();
half NdotL = dot(input.normalWS, mainLight.direction);
half3 lightColor = mainLight.color * mainLight.distanceAttenuation;
thanks