GetMainLight in shader in URP does not respect light culling mask

\Library\PackageCache\com.unity.render-pipelines.universal@7.3.1\ShaderLibrary\Lighting.hlsl

Light GetMainLight(float4 shadowCoord)
{
Light light = GetMainLight();
light.shadowAttenuation = MainLightRealtimeShadow(shadowCoord);
return light;
}

When using this method there is no way to set a certain light as main for certain material and it does not respect Light.cullingmask settings. All materials receive same main light settings.

I would expect shader when using this method should set main light with culling mask setting in mind.

If there is work around i would appreciate it.

2 Likes

This feature does work in the built-in renderer. And the feature table for URP does include light culling per layer and per object.

I have submitted a bug report. I recommend submitting a bug report in cases like this as a fix could have been in the works already :^)