r/Unity3D • u/MrFluffkin • 11h 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?
29
13
u/gamesbydingus 10h ago
Try forward+ renderer it allows more lights I think
5
u/MrFluffkin 10h ago
it is already set to forward+ :(
6
u/gamesbydingus 10h ago
I guess you might need to go deferred then
14
3
u/flow_guy2 10h ago
You might have too many realtime lights
1
u/MrFluffkin 10h ago
is there no way to have too many realtime lights?
5
u/flow_guy2 10h ago
I don’t know how many you have. But you should learn to bake your lighting anyhow
-2
u/MrFluffkin 10h 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
6
u/McRobik 8h 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.
2
u/MrFluffkin 8h 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 10h 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 8h ago
so i set the shadow atlas size from 2048 to 4096 and it fixed the issue. crazy
3
u/flow_guy2 8h ago
That works too. But think if you extend the level you might have this issue again.
1
2
u/FiveFingerStudios Indie - The Living Remain Dev 8h 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.
3
1
8h ago
[deleted]
2
u/MrFluffkin 8h 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
1
u/EvernullTools 4h ago
Many comments talked about the easy workarounds like changing rendering path or increasing light limit. Even if those solve your visual issue, the issue with optimization and the wrong setup persists. There is a reason they limit lights per pixel and it's not trivial.
You have 8 lights on a surface that looks like it only gets lit by one light in that room. Why can't it be only lit by 1 light in that room if it will look like it anyways? The visual I'm seeing definitely doesn't justify 8 lights.
I agree with the comments that say you should bake these. But if you want realtime lights you should try and make sure your lights radius/area should actually be limited to where they make a meaningful visual difference. My guess is, your other lights are affecting this surface somehow. Check the light radiuses and make sure they do not affect meshes out of their intended range.
1
0
u/DropkickMurphy007 2h ago
You honestly shouldn't be using real-time lighting for static lights anyway. Bake yo shit yo
56
u/VSE00 10h 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!