pastasfuture / com.hauntedpsx.render-pipelines.psx

A scriptable render pipeline for emulating Playstation-1-style graphics on contemporary hardware.
https://twitter.com/HauntedPs1/
MIT License
383 stars 26 forks source link

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

Open thebeardphantom opened 2 years ago

thebeardphantom commented 2 years ago

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 commented 2 years ago

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 commented 11 months ago

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 commented 11 months ago

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