Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Setting dx9 shader constants

This topic is 5477 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

ok, does dx9 do strange things to shader constants now? im still getting used to dx9s shader system, but i tried sending in an light direction to a shader that was transformed by the inverse world matrix, like you would do in dx8. i kept getting the wrong lighting. i sent in the light direction as it was and the lighting was correct? did dx9 transform this constant behind my back? or what just happened? Get busy livin'' or get busy dyin''... - Shawshank Redemption If a man is talking in the forest, and no woman is around to hear him, is he still wrong? - Unknown Fulcrum

Share this post

Link to post
Share on other sites
"Light direction in object space (== multiplied by invWorld matrix) -> Wrong lighting
Light direction in world space -> Correct lighting"?

Seems like you're doing the lighting (dot-product and stuff) on world-space vertices, so make sure that you've not multiplied the vertex by the world matrix before the lighting compuation.

Muhammad Haggag


[edited by - Coder on November 17, 2003 12:37:05 AM]

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!