5
$\begingroup$

I am trying to implement a physically based renderer, in OpenGL. I was planning to implement the Cook-Torrance BRDF. I read about radiance cubemaps (for reflections), like the one discussed here, for example. I a bit confused however. My test environment is Sponza with some other models thrown in, where you can move the camera around freely. How would an environmental cubemap work with a scene like that, where there are arcades or similar architectural pieces, and other things in the way? Would there need be multiple cubemaps?

$\endgroup$

1 Answer 1

5
$\begingroup$

Your confusion comes from fact that in some basic tutorials like one you point cubemap which is used for applying lighting is global and static - it does not come from actual geometry but from infite sky box which moves with camera position so it is valid everywhere.

And there is nothing mentioned about second type - local cubemaps which are actually computed using local geometry and are valid only in point of their placement.

This can be approached using multiple local cubemaps and connecting them with local objects situated around them but what is problematic is that it generates seams between them especially for high frequency reflections, which you probably would like to test.

For now you can generate few local cubemaps - each one centered at one of your small objects and used on it. They would move with objects if you plan to change their position. They would take into account your local geometry and, if you render it, your global skybox or skydome. You can precompute these cubemaps each time you change the position of your objects or do it every frame.

If you want to make your whole sponza reflective with high frequency, that's harder problem but one idea is to voxelize whole sponza with different mipmap voxel levels and then ray trace it as in voxel cone tracing technique. Voxelization could be done as precomputation but it is generally memory intensive.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.