Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSXRenderPipelineLighting::PushDynamicLightingParameters() incorrectly culls lights based on GameObject layer #24

Open
thebeardphantom opened this issue Oct 28, 2021 · 3 comments

Comments

@thebeardphantom
Copy link

I'm unsure if this was intentional (it looks like it to me), but BIRP, URP and HDRP do not cull lights based on if their GameObject layer is in the Camera's culling mask. PSXRenderPipelineLighting::PushDynamicLightingParameters() has a conditional on line 90 that does this:

if (IsLightLayerVisible(light.light.gameObject.layer, camera.cullingMask))

Lights already have their own culling mask for which layers they do and do not affect.

@pastasfuture
Copy link
Owner

This was intentional, but I see what you mean.
https://docs.unity3d.com/ScriptReference/Light-cullingMask.html

The goal was to allow different cameras to render different subsets of the lights. I haven't looked recently - how does URP handle this? Should I just compare the light.cullingMask against the camera.cullingMask?

@pastasfuture
Copy link
Owner

Following up - any chance you would be able to provide additional details on the behavior in URP and HDRP that you'd expect? (see my question above). Otherwise, Ill close this out soon - catching up + cleaning out old issues at the moment.

@thebeardphantom
Copy link
Author

URP works the same as built-in. The culling mask on lights affects what object receive light.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants