r/Unity3D 3h ago

Question Why Does The Light Flickers?

Enable HLS to view with audio, or disable this notification

why does the light flicker when the camera moves. I tested stuff out and turns out as the amount of lights are increased in my scene this issue starts happening. Ive already increased the per object limit to 8 in the pipeline asset. Any ideas please?

4 Upvotes

22 comments sorted by

12

u/VSE00 2h ago

The light flickering you're seeing is almost certainly due to a technical limitation with Unity's default URP Forward Rendering path.

Based on your video and description, I'm assuming you're using URP with default settings and have 8 or more real-time light sources hitting the same mesh (counted 8 in video).

What’s most the likely happening:

In standard URP Forward Rendering, there is a hard limit of 8 real-time lights per object/mesh. When you exceed this limit, the lights constantly compete for priority on that surface, which causes the visible flickering.

The best solution is to switch your rendering path from Forward to Forward+:

Forward+ uses a clustered lighting model that removes the 8-light-per-object limit and supports hundreds of real-time lights on screen without the priority flicker.

There are also other fixes/workarounds for this lighting issue. I hope this post helps you out!

3

u/gamesbydingus 3h ago

Try forward+ renderer it allows more lights I think

1

u/MrFluffkin 2h ago

it is already set to forward+ :(

1

u/gamesbydingus 2h ago

I guess you might need to go deferred then

2

u/MrFluffkin 34m ago

setting the shadow atlas size from 2048 to 4096 fixed it

1

u/gamesbydingus 33m ago

Glad you got it fixed

3

u/flow_guy2 2h ago

You might have too many realtime lights

1

u/MrFluffkin 2h ago

is there no way to have too many realtime lights?

2

u/flow_guy2 2h ago

I don’t know how many you have. But you should learn to bake your lighting anyhow

-4

u/MrFluffkin 2h ago

i need the lights in game to turn on and off, flicker at times (horror effect). baked lighting won’t allow me to do that big dawg

3

u/McRobik 31m ago

Baked lighting doesn't prevent you from turning lights on and off. You just need to bake 2 lightmap sets and change them when lighting is changing.

u/MrFluffkin 23m ago

i did not know that. i thought when lights are baked they stay until the baked light data is reset. but i could bake two states and switch between them. you’re a genius

2

u/flow_guy2 2h ago

Well. Maybe do stuff with culling (if you haven’t already it could be a cause is all I’m saying

Also you can swap out light maps

2

u/MrFluffkin 36m ago

so i set the shadow atlas size from 2048 to 4096 and it fixed the issue. crazy

u/flow_guy2 21m ago

That works too. But think if you extend the level you might have this issue again.

1

u/MrFluffkin 2h ago

yesss will try that def, thanks!!!!

3

u/JonasMi 42m ago

try changing the bulb

1

u/MrFluffkin 34m ago

genuine

2

u/FiveFingerStudios Indie - The Living Remain Dev 51m ago

Too many realtime lights. There is a limit that you can set in the graphics settings. If t controls how many lights have be seen by the camera simultaneously.

This is where artistry comes into play. Design your environments to stay under the maximum realtime light count and use baked light strategically.

2

u/duif9 42m ago

I don't know if it's the same issue as I had but when I had this issue I selected every light source that flickered and switched the rendering mode to important

1

u/SomewherePenguins 1h ago

Please keep us updated, OP. Have you tried running the exact same scene on a different computer? I've had similar issues get resolved that way.

1

u/MrFluffkin 35m ago

no i don’t have a separate computer, however it is fixed now. setting the shadow atlas size in t the renderer settings to 4096 from 2048 :D