Jump to content
  • Advertisement
Sign in to follow this  

non-uniform scaling and lighting calculations in object space

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

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]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!