5 lighting tricks I use to fake global illumination in a procedural city (Unreal Engine 5)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I'm making an exploration game set in a huge procedural City and lighting has become one of the biggest challenges when it comes to the environment designed for this project naturally a city has lots of light sources of various types and today's gamers are used to beautiful Elite scenes with lots of Bounce lighting and emissive materials this is normally achieved by pre-computing the lighting and saving it into a texture called a light map so most of the gorgeous light and dark gradients you see in a game are pre-rendered but this approach is not suitable for my game as it takes place in a city that is generated at runtime so I cannot pre-render anything the city is also vast and dense with no loading screens besides the initial load so there's just no opportunity to bake any kind of indirect lighting as an added challenge I chose VR as my main target platform which further limits me in ways I can light my scenes for instance I can't use ambient occlusion or any other screen space if effects because they sometimes create slightly different images for different eyes which looks very jarring in VR I also have to mention that I've considered using Lumen Onre engines Dynamic Global illumination system which could be a god sand but unfortunately isn't ready to be used in VR or generally in a project where performance is critical I did experiment with it a bit though and you can see the results over here but in spite of all these challenges I can't have my city looking flat so I had to get creative there are some standard ways to simulate the city lights that I've used for example the lights of distant Windows are just emissive textures most of them are also interior Cube shaders for eded depth and this is pretty much how every game with a city does it I also use baked ambient occlusion on most of the 3D models but I would also like to share some less obvious tricks that I've had to use I know these effects aren't perfect or photo realistic and I would love to be able to use a real Dynamic like computation system like Lumen but this is what I got so far first I realized that my city needed Shadows this is of course not a problem for sunlight that has Dynamic Shadows turned on but it was a big problem for the Interiors especially back when I was working on an old laptop and had to keep all Shadows besides sunlight turned off I have better Hardware now so I did turn on some of the Interior Shadows but it is a setting so I can't rely on them being there so what I did was create a blurry blob which is just a transparent square with a dark blurred Circle texture this is a common and very old technique but apparently still useful and every time I spawn an object in an interior or an exterior I put an instance of that blob underneath and give it an appropriate size I use just one instant static mesh for all of them them so even thousands of these fake Shadows don't affect the performance that much of course I am also taking advantage of all surfaces being flat because I'd have a lot more trouble with this approach on curved terrain but after I added these blurred Shadows I had another problem some of the furniture has emissive materials so it doesn't make much sense to give it Shadows but rather it should be glowing that's why I modified my blurry blobs to accept a light color input I use per instance custom data for it as I want them all to remain instances of one mesh this color when set turns the blob from a shadow into a glow of course this glow doesn't have an accurate shape for every object I put it under but that's something I have to live with once I made the blurry blobs glow I figured I could use them for the street lights as well street lights of course have actual lights in them but they have a limited display range like all lights in the game but I don't want my streets to look dark in the distance so at a certain point I gradually turn on the blurry blob glow underneath the street lights so it looks like they light the ground even though the actual light is already off in this scene for example all the lights are fake and the real ones transition in as the player approaches another lighting problem specific to the interiors that I couldn't solve with blurry blobs was that the floors and walls looked flat in real Interiors large flat surfaces like walls and floors are where bounc lighting is most obvious so I had to fake that I looked at a random picture of a white room and added gradients that looked roughly like that to my wall and floor materials I also input the information about the walls to the floor Shader to make sure the gradient displays correctly for the given wall placement here's what my floors look like on their own the area in the middle is the core of the building where they the Elevator Shaft is so it gets cut out all this created a somewhat realistic looking interior lighting but I felt like I can take it further I like the idea of some Interiors having glowing plants glowing floors or both so I added a material function that simulates bottom lighting by using a DOT product of the normal Vector multiplied by the gradient coming from the bottom that creates a fairly realistic highlight the color and the intensity of this highlight is set by the interior object on all its children so anything that spawns inside an interior that has a glowing floor will have it another fake lighting effect that I've used is the architectural lighting I love the architectural Lighting in real cities so I thought my city needed it as well but putting hundreds of spotlights on every building that would be visible from far away would be extremely computationally expensive so instead I baked the highlights into the wall textures a I've also used the green channel in a material normal map to lighten some parts of the highlights making it look like the light is coming from below and because all the buildings have Dynamic sizes and proportions I use World positions to calculate where to place those highlights there are more little tricks I've used here and there but that about covers most of it there are also parties where glowing items including walls and Floors change color to the beat and the respective highlights have to change color in syn but that's a separate topic and I'll guess I'll make another video on how I did that stay creative
Info
Channel: Vuntra City
Views: 4,241
Rating: undefined out of 5
Keywords: gamedev, unreal engine, global illumination, procedural city, video game environment
Id: kp8y_FPmhi4
Channel Id: undefined
Length: 6min 37sec (397 seconds)
Published: Sat Mar 02 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.