<p>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. </p>

<p>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. </p>

<p>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. </p>

<p>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.</p>

<p>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.</p>

CC BY-SA 3.0
2017-01-15T12:23:22.520Z
2017-01-15T13:27:00.043Z
2017-01-15T13:27:00.043Z
mdkdy
<p>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 <a href="http://www.codinglabs.net/article_physically_based_rendering.aspx">here</a>, 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? </p>

<opengl><rendering><brdf><physically-based>
Trying to understand environmental cubemaps
MKII
# Trying to understand environmental cubemaps

(Asked by: username_0 on 2017-01-15)

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](http://www.codinglabs.net/article_physically_based_rendering.aspx), 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?

**Tags:** opengl, rendering, brdf, physically-based


---

## 1 answers

### Answer by username_1 on 2017-01-15. Score: 5 | Accepted answer

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.


---

