Recommended HDRP lighting setup for an open-world game

Hi there, I’ve read tons of forum posts and documentation and tutorials and whatnot but I am still absolutely perplexed by what is going on with HDRP. It is very difficult to get something basic working without all kinds of bizarre lighting artifacts. So I’d like to ask those with more experience for a recommended setup for my game.

I’m targeting PC and current-gen consoles. The graphical style probably won’t be super detailed but will be PBR.

My game is an open-world, third-person game. Similar in setup to a GTA, Horizon, Assassin’s Creed, Red Dead, etc. I’m expecting to have about a 2x2 km world with indoor and outdoor areas.

My requirements are:

  • Seamless transitions between indoor and outdoor
  • HDR rendering
  • Physical light units
  • Nice looking shadows
  • Some level of dynamic lighting - characters will open and close doors for stealth sequences, for example, so a completely baked setup won’t work. But most of the game can be static geometry.

Nice-to-have would be:

  • Dynamic day-night cycle. If this is too hard to pull off or requires compromising the look too much, I could eliminate it. Maybe a middle option would be to have multiple baked times of day that I can switch between via a scripted event.
  • Global illumination as much as possible

I’d like to find the simplest workflow to let me get up and running.

I’ve been very puzzled trying to get this to work because there are so many lighting modes, and it’s not well documented how to properly place reflection probes, light probes, etc. Or even if or when I need them depending on the lighting mode.

Any recommendations (or links to resources) here would be helpful. I’ve tried to research this as much as I can but I’m coming up a bit short. Thanks!

What kind of fidelity and framerate?

30fps gives you a lot more leeway in choosing the right strategy. But lets assume 2080 ish GPU with a decent 6-8 core CPU targeting 60.

I would recommend that you go for the performant or performance profile from the templates, and get used to FSR / DLSS - will need those for sure. For some reason the initial settings are 100% res, so reduce to around 50 for lowest.

With that established, make sure format for buffers is R11G11B10.

Then your main perf hit is going to mainly be CPU, shadows, things like that. The lights themselves will mostly be the usual strategy for a deferred pipeline. Try to keep them minimal, use bloom to fake it in the distance.

You might want to look into using SSGI - and you can still achieve 60fps with that given 2080 or equivalent console, along with APV but that’s currently experimental. You still need to be updating reflection probes lazily as the time of day progresses.

APV is probably the higher quality / performance answer for local GI along with SSGI. The framerates can be achieved with decent 4K upscaling but getting the visual quality you want, and how much you want to tweak it will take some time / depend on Unity version.

My idea is just to pick an average baseline for current consoles. It should run at 60-120fps on an Xbox Series X or PS5 at 4K. I’m not quite sure how that translates to current PC hardware (I have a 3080 Ti and a 6K display so I sort of figure if it runs at 6K 60FPS on that I should be OK.) Basically the average PC should be able to hit 1440p@60. I’m also open to suggestions here, I know this is kind of loose.

Though my concern here is mostly lighting strategy – would this have to be all real time lighting or is there a mixed lighting strategy that would be possible? There seems to be some confusion if Precomputed Realtime GI still exists in HDRP etc. I know my question here is kinda broad I’m just trying to unstick myself so I can get something workable up and running and actually build out the game with something kinda in the right direction.

Did a bunch more testing and research today. I think I won’t be able to bake anything (except maybe precomputed realtime GI? But that is being removed and it’s hard to figure out what’s happening there.) But I think maybe I can do a day-night cycle and have occasionally-updated reflection probes for indoor settings.

I don’t fully understand the techniques for making fully-realtime indoor-outdoor lighting look good, but I think that’s the right track?

Right now, with everything real-time, I’m in a situation where my interiors are too bright. This is because they have little-to-no direct lighting from the sun and therefore pull their lighting data from, I think, the skybox via the “Static Lighting Sky”. However, since that is an outdoor skybox it means that the sky (and therefore the interior ambient light) is thousands and thousands of times brighter than any physically correct interior light values. It seems like I need to somehow use the outdoor ambient sky information only for outdoor geometry. I’m fine manually doing it somehow, but I’m not sure if this is possible.

You could try setting a separate volume for inside, and adjust things like exposure, of the sky itself.

Exposure control is a must for time of day, or it will always look wrong. HDRP is based on the idea of a camera, and it is not optional to ignore exposure. For time of day you will probably want 4-6 settings / scriptable objects that will be for each point in the time of day. I have written one but don’t have the machine to hand.

So for each setting, you can define the sun position, the moon position, the exposure for each point in the 24 hour cycle, and when to switch shadows from sun to moon etc.

The main thing is the exposure though, as Qleenie mentioned.

Do not skip a single thing in this video:

As for baking, you only need to bake if you use APV or reflection probes, and these can also be baked for each of the time of day settings (I recommend 4-6 settings). Those will be lerped as the time of day progresses.

This is how it’s done in games like Horizon Zero Dawn, and there’s a few materials for that and other games on GDC.

In Unity there are many strategies but you won’t be able to avoid having some settings to lerp to for multiple points, even if it’s for the exposure. I recommend using real world lighting values because the HDRP UI will hint to you what exposure to use for what light. Both will have icons you can match up on the UI.

Watch the video, a few times.

Unfortunately you can’t have seamless transition from a sunny scene to a dark interior.
You can get close with careful exposure management, and light baking, but usually it will still look off. The issues that pop are one, or multiple of the following:

While in the dark interior, the exterior becomes far too bright.
Vice versa, while outside, interior looks darker then it should be.

You can also place local volumes around your interiors, if you’d rather use fixed exposure.
Unity doesn’t have local tone mapping, so it’s a tough challenge.
Although if you’re not using aces tone mapping, but something like neutral without increasing the contrast, this becomes somewhat easier to achieve.

indoor scenes:
I know this is against your requirements, but thought I’d mention it for other users
Another idea is to hide all your interiors in different scenes behind doors, you can make it so they’re always loaded, and so when the player clicks on the door it will almost instantly transition to the interior without any loading wait times.
doing a slow(1s~)screen transition to black and then transition back to the world, just to hide the player teleportation/scene change.

Exiting will also be instant. Only issue is it’s not really seamless anymore, maybe less immersion and slightly different level design. You can still fake windows with some tricks though, but it won’t look as good as actual windows.
A bonus is it’ll be easy to lightmap, and you won’t have to design correct building interiors

Light baking & time of day:
Your only chance of correct lighting with a time of day system is either enlighten, or APV.
Enlighten could be an issue if your map is big.

APV gives alright results, It’s gotten a lot better and you should at minimum use 2022.2 for APV, most likely will receive more improvements in 2023, so it could be very viable as full baked lighting replacement but currently there are some challenges:

for static small props it does very well – but if you want it to replace all objects, and make it act as a lightmapper replacement there will be some issues.

First is possible noise on big objects, things like walls could sometimes be problematic. It’s also in general not as clean as a lightmap, there can be some noise on the ground sometimes for example.

Second is light leaking, this has also gotten a lot better in 2022 thanks to many new improvements & anti-leak features, but it’s still not perfect, on the plus side you can use custom APV volumes to manually remove light leaking so this might not be a big issue depending on your project.

Third is GI/occlusion quality, it’s not up to lightmap standards, as a light probe system it’s good but as a lightmap replacement It struggles a bit.

APV isn’t intended as a lightmap replacement as stated by the developers, but maybe 2023 improvements will be a game changer :smile:

And currently it does a far better job than the old light probe system, not even comparable.
I think the lerp system for APV landed in 2022.2 but I’m not 100% sure about that.

One cool thing is you can have different APV volumes scattered around, so for your exterior world you can have very few probes, but have a bunch of APV volumes around buildings/interiors with a lot more probes, more dense for better quality. Otherwise it would be a challenge to get good enough quality.


If you break away from realistic lighting values, you can get interesting results with a fixed exposure. (fixed exposure set to 0)
They’ll be magical numbers, not based on real lighting values (similar to URP/built-in), you’ll have to do a good amount of experimentation but the positive is you won’t have exposure transitions at all, which can sometimes (to me) can be annoying.

3 Likes

Anything that you can pre-compute especially for building or prefab placement in some cases you can get away with 2-3 indirect bakes too.

With a time of day system, the major issue is handling the entire lighting and reflection pipeline, this being a balance of lighting, gi, shadow and reflection updates, that are enough to fill and interpolate between the massive lighting range, more often than not like hippo mentions 4-6 bakes of this can be enough, your timing of these change though, you’ll find are not uniform, but mostly vary since all lighting is different and we just can’t account for everything.

if you’re taking a typical day to night with no weather specifics though, you’ll find more updates occur between the~20 mins of transitions from sunset/rise to night.

but you can pick your core ToDs and go from there, looking and each lighting stage you need and what is required to see the visual fidelity you’re after, smaller sample cases can really help judging the end visual fidelities viability here too.

The more realistic you want to go, like looking at a typical high-fidelity baked indoor scene, the massively more resources you’ll need for an outdoor scene ( including bakes on multiple machines and baketime in general), so just keep taking steps each day/session and monitor/profile your lighting updates frequently, so you can keep validating it

Have you tried enviro?