Forward+ (Plus) Rendering in Unity URP 14+ - Shine Your Lights!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so you want to make a game where you have tens hundreds of real-time lights good luck with that my friend no I'm joking you don't need black you need knowledge so at some point when you are a game developer you might want to make a game or your boss will tell you to make a game that has a lot of lights like look at this scene that I have in front of you of me you have tons of lights right spotlights in this case and they're all real time how do we accomplish this as you know we have mainly three pipelines right built-in we also have Erp and it's CRP hdrp let's use this very sharing which is top for this type of sequence lenses where you need unlimited amount of Lights but then in urp you are stuck with forward rendering right aren't you are you really let's have a look because maybe four watts is not the only thing that you have so when we are in European when you target forward rendering the forward rendering pipeline okay so if I go here to settings and you will see here the rendering path you normally have the rendering path here as a list and you can a combo box I forgot how this is called whatever you can choose here the render pipeline normally traditionally it's been obvious forward rendering which means that every time that you draw an object for example this floor that you see here you send it to the GPU and it goes from zero to finish sequentially follows several steps it goes for what in the GPU pipeline all of that it goes forward the issue with this is that performance is really good when you have little amount of lights but when you go over a certain amount of Lights complexity and performance explodes in forward running for example you have a limit of eight lights that may affect at any time one object if you see this I have a lot of lights but how many do I see not as many okay I have possibly well over 30 not as many there's a limit to this because we cannot afford pay the price of rendering more lights in the forward rendering path in urp if you want to learn more about that and why that's the case I elaborate a lot on this in my membership in the performance task force I'm not going to do that here because I want to keep this video short so what can you do when you reach this limit first you can just make it work somehow just really use a number of lights or fake the lights and maybe you just Implement your own shaders or your own systems that does the lighting that you want without using the unit internals or maybe you can bake more lights so they are not real time whatever you can just make it work maybe with forward but no you say no I want to make this game like Quake where everybody like you know we have 20 players all of them can shoot rockets and all Rockets are illuminated and they illuminate the floor so we have I don't know 40 lights affecting the floor okay so what do we do there option one is to go for the third setting which is not really a viable option for mobile for tiles based renderers again I explain more of this in the membership you can still make it work though there are some games high quality games made with that but you need to be a professional and an expert on performance option two use the new toy coming with unity 2020 2.2 beta and Europe 14 whatever don't care the numbers will change eventually and we'll render this video obsolete so whatever use a new toy called for what plus right when you have this version of unity and all of that for example here I am 2023 Alpha you can just go to your asset and say for what plus and that's it magic now the limits of eight lights per object is not 8 anymore it is it depends like it may be 16 and maybe 32 it may be 256 depending on your target platform on your target API but you have a much higher limit to the number of objects that are hitting your floor in this case one object is it a good idea yes or not well it depends you just need to understand how forward plus Works compared to forward I'll explain that everything in the membership again I don't want to spam you with that but that's true if you're interested in that just go there or research yourself I don't care but the forward plus basically our group groups or Aggregates all the slight information into clusters so that in the fragment Shader you just need to iterate or iterate over these clusters and then it becomes super easy and fast to do the let's calculations of the fragment Shader okay so basically instead of iterating over every light we just iterate over clusters so reducing the data set that we have to access in memory on the GPU so try that this is a sweet spot that I have found by testing on this one which is if you need more than six lights real-time lights per object then it might be a good idea to go with follow Plus and if not you might be maybe better off sticking to forward anyway that's uh not set in stone I encourage you to understand how this works and then do your own research okay because there are many options other than just blindly following the advice of a random guy on the internet that being me in this case I just want to make this video so that you are aware that there is more than the traditional and boring for what pipeline that's it if you want to see more staff or more numbers or more explanation and more technical background and all of that you know where to go to my membership I hope you have a good day and uh Happy game developing okay make sure to make your players happy with nice visuals take care
Info
Channel: The Gamedev Guru | Unity Performance Expertise
Views: 2,249
Rating: undefined out of 5
Keywords: unity, unity3d, the gamedev guru, thegamedevguru, unity tutorial, unity csharp tutorial, unity c#, unity csharp, unity optimization tips, game optimization unity, unity 3d, unity game engine, csharp, urp
Id: AIUyNLc0Boc
Channel Id: undefined
Length: 6min 51sec (411 seconds)
Published: Sat Apr 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.