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!