non-uniform scaling and lighting calculations in object space
Hi,
To reduce the amount of calculations required in my shaders I prefer to perform my lighting calculations in object space. The camera position, light position and direction are transformed from world space to object space only once and passed to the shader instead of transforming the object normal / tangents every time in the shader using the world transform matrix.
When lighting a non-uniformly scaled object in world space the default technique is to transform the normal from object space to world space using the transpose of the inverse of the world transform matrix. This works perfectly.
Is there a similar way to transform the camera position, light position and light direction into object space so I can do correct lighting on my non-uniformly scaled objects in object space ?
I've been trying but I don't seem to be able to get it to work.
Regards,
EBrarian
[Edited by - ebrarian on August 1, 2008 8:07:48 AM]
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement