1
\$\begingroup\$

I finally have a PBR implementation in an engine that I'm writing for a game I'm developing but I'm stuck on how to use IBL in real situations. Most IBL tutorials use it just to show a single mesh or group of spheres but nothing that I can immediately translate to an in-game application.

So I was wondering, in an open world, how would someone go about implementing image based lighting? Different areas will require different environment maps to be generated and then there's the issue of time of day. I guess for that, you could just use values that you would use in your day and night shader to change the colours being sampled from the environment map but you still have the issue of having a large map.

Update: I've read about light probes and perhaps that's how this is achieved? Create probes around the whole map and then sample and interpolate between the probes that are near the camera. Is this how large open-world games achieve image-based lighting? This way you can have one light probe based on the skybox and multiple light probes spread across the scene and inside rooms.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Your light probe discovery is worth posting as an Answer. In my experience, this is how it's done. \$\endgroup\$
    – DMGregory
    Mar 10, 2020 at 11:49

1 Answer 1

1
\$\begingroup\$

You can use deferred rendering.

Deferred rendering pipeline holds several render textures,such as one for storing color sampled from the view,normal color sampled from the view and depth and it goes on.

You can create your custom render textures by targeting your needs.For example you need a time of day effect on your openworld game,so create a pixel shader which only samples texture color of your entire game view and then do your custom calculations to achieve your desired daytime effect.This way you will now have an color data + daytime data stored in one render target already.

By using this technique you will partially eliminate the big map effect and clamp your other shader calculations to a screen space complexity where each shader costs fixed amount of calculation power.Beacause deferred rendering removes to overdraw of the overllaped triangles along the long distances.

If you knew about this stuff then..

Try adding several different level of detail to your meshes and textures(I Guess mipmaps does this automatically)

If the engine you're using supports deferred rendering then you should check it out,if not then you are to implement it yourself (if the engine lets you)

\$\endgroup\$
2
  • \$\begingroup\$ Hey, I'm writing my own engine and it is using deferred rendering. I was wondering since IBL uses diffuse and specular irradiance maps, how would you generate diffuse and specular irradiance maps for an open world? \$\endgroup\$
    – Sammi3
    Feb 9, 2020 at 7:11
  • \$\begingroup\$ Hi,for diffuse light you can create a render target just for that difffuse values.You can create simple shader which calculates only direct light operations.For indirect however its more of vague concept.Usually for a game engine indirect light considered as a only a color applied on a surface like tint value,for some uses reflection and light probes,for some baked lights contribute the indirect(global illumunation) lighting.You should start with creating a render target which uses a single pixel shader which only calculates a daytime tint color depending on the normals of the surface. \$\endgroup\$
    – Roveldo
    Feb 9, 2020 at 10:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .