1
\$\begingroup\$

My engine has support for IBL by using pre-obtained HDRIs. It looks fine, but...

  • I want the environment map to match the scene that is currently being rendered
  • I want the environment map to take the shadowing of the scene into consideration

To account for this, I wanted to implement something [that I think it is] similar to Unity's reflection probes. My main idea is that instead of using custom HDRIs, I would set some probes in my scene and bake the environment maps myself. This way I could use the baked environment maps for IBL in the real-time rendering.

I think this is feasible, but I could not find any good resource explaining how to properly implement such scheme, so I currently have some broad doubts in my mind such as:

  • How to capture the light? I think it should be as simple as placing a cube in the probe, rendering the scene 6x for each face and generating the environment map
  • How to account for the fact that we are interested in the radiance and not the final pixel color? Maybe using floating point framebuffers and account for that in the shading?
  • Should I implement a raytracing scheme? Since I will be baking the environment maps, I thought that raytracing would be the correct approach here, but I am not sure...
  • For open environments, how to properly simulate the sky? For IBL, it is important that the sky as a whole has a big radiance, so the object will be properly lit. However, if I simulate the sun as a point-directional light, for example, there will be no shading in the rest of the sky as it is 'empty'... So how to properly simulate the atmosphere?

I know that the question is broad, but I need a first guidance to start implementing and playing with it. Any help is appreciated, as well as tutorials/resources. Thanks!

\$\endgroup\$
1
  • 2
    \$\begingroup\$ It sounds like you have the right idea: render HDR cube maps from your probe positions. You DO care about pixel colour, because that's how you get coloured light and shadow. Try it without raytracing and see if the quality is sufficient for your goals before you add more complexity. "How to simulate sky" is a completely separate question for which you can find lots of published answers. \$\endgroup\$ – DMGregory Feb 18 at 17:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.