- Home /
Light Culling Mask does not work in URP
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
Answer by bowrainunity · Jul 06, 2021 at 01:17 AM
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
Your answer
 
 
             Follow this Question
Related Questions
Brake Light Button 1 Answer
Lightmap - Blotchy & Square 1 Answer
[Q] How do I make a light influence only one object? 1 Answer
shader which only is visible when isn't afected by lights 0 Answers
What is wrong with my C# script? 2 Answers
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                