Advertisement Jump to content
Sign in to follow this  

OpenGL Cg Tutorial questions..

This topic is 4767 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
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. 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!