Multiple Spotlights: One spotlight is turning off when the other is pointing at same object.

Hi im using Unity 2021.3.18f1 with a URP Template for a VR Project (Oculus Quest2).

The problem:
Everything works well as long as the fireplace spotlight is disabled.
When i turn on the fireplace spotlight and point the flashlight towards the fireplace, the spotlight of the fireplace is turned off.

What i have:
I have 2 objects, a flashlight and a fireplace. Both have 1 spotlight.

Demonstration:


What i've tried:
I have tried to work with different 'Render Mode' Settings (Auto/Important) which didn't helped.
I have read that there is and option in 'Edit > ProjectSettings > Quality' which lets you upping the pixel light count. Unfortunatetly i couldn't find this option in my unity version. So i tried it per code which also doesn't helped:

QualitySettings.pixelLightCount = 12;

The Lightcomponents:

Fireplace:
8853709--1207552--upload_2023-3-5_16-58-58.png

Flashlight:
8853709--1207555--upload_2023-3-5_17-5-34.png

It looks like you are running into the per-object light limit under the Forward renderer. I think this could be as low as 4 lights per object on mobile, I can't find the info on this. A quick way to test would be to switch to Deferred rendering, in your Universal Renderer Data.

Then the question is how much does this impact the performance when switching to deffered rendering? I will give it a try after work and let you know. Du you know by any chance where i find the Universal Renderer Data?

Hi, you can have at most 8 lights per object when using Forward rendering path in URP.

[quote=“Akura”, post:1, topic: 911180]
I have read that there is and option in ‘Edit > ProjectSettings > Quality’ which lets you upping the pixel light count.
[/quote]
That’s for Built-in RP. You can find the pixel light limits in the URP asset.
8855401--1207933--URP_Asset.jpg

[quote=“Akura”, post:3, topic: 911180]
Then the question is how much does this impact the performance when switching to deffered rendering?
[/quote]
I don’t suggest switching to deferred path on Oculus Quest2 unless you can reduce the Render Scale. But you can always try and see if the performance is acceptable.

Note: Deferred path in URP doesn’t support OpenGL backend, it’ll fallback to Forward.

You can try the new Forward+ path to have more real-time lights in the scene once VR support is done.
Forward+: no per object light limitation, but at most 32/16 per camera on mobile using Vulkan/GL ES 3.0

You can find the rendering path options in the (active) URP renderer.
8855401--1207933--URP_Asset.jpg

8855401--1207960--URP_Renderer.jpg

Thanks for your answer! I will give it a try when im at home and let you know.

1 Like

Perfect! I just adjusted the "Per Object Limit" from 1 to 2 and everything works! Thank you very much!

1 Like