PDA

View Full Version : Computing radiance in world space, object space or view space?



shapeare
07-25-2013, 11:55 AM
What's the most convenient coordinate space to evaluate a shading model, say the Phong shading model in the shader program. Personally, the world space is the easiest, but people often do that in the view(eye) space.

Dark Photon
07-25-2013, 06:22 PM
What's the most convenient coordinate space to evaluate a shading model, say the Phong shading model in the shader program. Personally, the world space is the easiest, but people often do that in the view(eye) space.

If your "world" is tiny, you probably don't care. Plenty of 32-bit float precision to go around.

If it isn't, then world space is a poor choice, and you begin to see the benefits of doing this in eye space.

They're both orthonormal spaces, and computing lighting/shading in each is functionally equivalent. You're going to get the same results subject to floating-point precision/accuracy (and that's the catch). Do what you want here.