Jump to content
  • Advertisement
Sign in to follow this  
Shaderhacker

OpenGL Cg Tutorial questions..

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

All: I'm reading through this book and learning how to program shaders using the 3d hardware. There are a few quirks to the code in this book and one that I'm particularly stumped with and need to solve. Firstly, I think the book assumes your 3d application is OpenGL (without telling you), but FX Composer uses a Direct3D application. A lot of the vertex/pixel shaders don't work because of the coordinate system differences between OpenGL and Direct3d. One uses a left-handed system and the other right-handed. This makes for some confusing results. Anyway, at the end of the chapter on Lighting, one of the assignments is to convert the world space operations (with calculating lighting) to eye space. I don't know how to get the eye's position from any of the transformation matrix SEMANTICS from FX Composer. I've tried everything and the only valid eye space position that works is the 3rd row of the inverse view transform (which is a world space position). This is very aggrevating as I'd like to be able to transform to any of the 3 spaces for doing lighting calculations but as it stands only world space works. I've verified this with all the example code.. which sure nuff - use world space to perform lighting calculations. -M

Share this post


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

  • 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!