I am making shooter similar to doom/quake/unreal tournament and I just decided to add point light to my projectiles just to make it prettier. And as expected, I reached the limit of 8 pixel lights very fast.
If you look at Unreal Tournament (game from 1999), then you can see that projectiles were emiting light. And since its multiplayer game, there could be hundreds of those lights and the game had no problems at all.
Now, over 20 years later I am limited by 8 real time lights which I really donāt understand as my knowledge about rendering is very basic.
So could someone please explain to me why is that ? Maybe these are not actual lights but just some kind of a āfakeā lights since it has to be very performant ?? But since it actually enlightens dark areas I am very confusedā¦
I am using URP with forward rendering and I would love to achieve similar effect without being limited to 8 lights.
In URPās defense UT wasnāt doing PBR and I think I remember it mostly used vertex lighting instead of pixel lights. However, you are totally right about the light limit being too low. They should at least make that configurable for the forward renderer.
That said I donāt think the light limit will really change anytime soon unless their deferred renderer doesnāt share that limitation. For the forward renderer to scale well they would need to do something like tiled forward or cluster shading instead of the brute force loop they do at this point. I also donāt recall URP being able to mix vertex and pixel lighting either like built-in can do once you have too many pixel lights. So at this point if the deferred renderer canāt get around this then I donāt think you can do anything about it with vanilla URP.
Hey!
For many small lights (like in your example) it definitely makes sense to use deferred rendering.
This is soon to be released for URP. Actually you can try it out on the Unity-Technologies/Graphics master branch right now if youād like.
This gif running the deferred renderer hopefully shows that what you want is possible:
Hi @Jonas-Mortensen - Iāve upgraded my 2021.1 project to URP 12 from Master.
I tried to create a new Deferred Renderer Data to assign to a URP Assetās Renderer List, but when I click Create->Rendering->Universal Rendering Pipeline-> it only lists Forward Renderer. Is that because thereās no such thing as Deferred Renderer Data and weāre just supposed to use Forward Renderer Data asset? If I just switch to Deferred Lighting in that I get warnings in the URP Asset about both OpenGLES2 and OpenGLES3 not being supported. Does this mean WebGL isnāt capable of it? Which Graphics APIs are supported (or will be)? Thanks !
We also have a forward+ renderer in progress, which is adding a novel form of light tiling to our existing forward renderer. This will allow you to go well beyond the 8 light per object limit with the forward renderer without the inherent limitations of deferred rendering (deferred renderers do not support msaa and we also need to fallback to the forward renderer for transparent complex lit materials): https://portal.productboard.com/unity/1-unity-graphics/c/261-forward-renderer-support
The reason there is currently an 8 light limit per object is because of performance considerations. Ideally, light data should fit entirely into constant buffers, because they are consistently fast universally across all platforms, whereas structured buffers are a lot slower on a lot of platforms. Without tiled/clustered lighting, there is a per object classification for the forward renderer, as we need to loop over all lights over all objects O(num_objects*num_lights), but with forward+, the performance will only be relative to the number of visible lights within each tile.
We are considering making the light limit configurable, but this would require us to use the slow structured buffer path, which will potentially keep your games from being able to run on lower tier hardware. We are making URP as fast as possible across all hardware, but every new feature requested adds complexity to the existing renderer, so we are working very closely with all hardware vendors to define a universal fast path.
We just recently finished our own version of a cluster shading forward renderer in URP and I can say it has been invaluable to have. We donāt have to worry about old devices so I think the work was much simpler but this is something you guys should have in the near future. I look forward to it!
To enable deferred renderer in project, after adding packages to local package folder, you need to add Scripting Define Symble āENABLE_RENDERING_PATH_UIā in project settings player. After that rendering mode will appear in Forward Renderer Dataās UI, and there you go.
Itās now available to select - thanks! Iāll see if I can get the unlimited-ish point lights feature running in my project this weekend for a glance at compatibility/performance implications. I might have to wait on Forward+ but itās worth a look either way. WebGL 2.0 is currently my baseline platform and I havenāt heard back yet from @nigeljw_unity
great news on Forward+ thatās really beneficial for stylized projects that canāt rely on the deferred gbuffer but want more lights.
Is there a specific branch on the graphics github or is it still early compared to Deferred?
Did you get the unlimited point lights to work? I did choose the deferred option but it actually did not change anything. Did you follow a specific step that I missed? It still just turns on 8 lights a time.
I think URP has an 8 lights limit on the number of lights in front of the camera
Why do you need more than 8 lights in front of the camera at the same time durin play mode ?
The lights are generally fixed and use a light shaft and projector for real-time light simulation in other multiplayer playersā¦
The difference between a projector and real light is in casting shadows
The use of too many lights is a sign of weakness in the design