# "Valve ambient cube"

This topic is 1876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a question about the [url="http://www.valvesoftware.com/publications/2006/SIGGRAPH06_Course_ShadingInValvesSourceEngine.pdf"]"Valve ambient cube[/url]" and what it actually stores. In my implementation I store the average of one 90 degree fov image per (pixel-)face of the ambient cube (weighted by solid angle). According to the formula, axis aligned vectors will look up exactly on face of the cube which means, that I don't cover the entire hemisphere with my sample.
Is that by design or do I actually need different values in my ambient cube, so that each face is the average of the entire hemisphere around that side? Which doesn't really make sense to me, because than the cube would store too much energy so to speak. Edited by B_old

##### Share on other sites
For some function defined about a sphere, the ambient cube will store the value of that function in the direction of the 6 major axis directions. So if you're storing irradiance, then you want to store the irradiance about a hemisphere oriented about +X, then -X, then +Y, and so on. This is not "storing too much energy", because when you "look up" an irradiance value from your ambient cube at runtime your value will be the linear combination of 3 values, where the sum of the weights is <= 1. This way if your normal is exactly oriented, you get the exact irradiance value for that direction. Then if the normal is in between the major axis directions, you approximate the value there by blending the "nearby" samples.

##### Share on other sites
Thanks for the explanation!

##### Share on other sites

This topic is 1876 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account or sign in to comment

You need to be a member in order to leave a comment

## Create an account

Sign up for a new account in our community. It's easy!

Register a new account