Jump to content
  • Advertisement
Sign in to follow this  
Skiller

OpenGL Direct3D equivalent for glstate in CG

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

I'm trying to figure out the best way to pass the various transform matrices to my shaders, preferably without having to manually create shader parameters for each matrix and setting them in the app. CG under OpenGL has glstate from which I can retrieve most of the matrices I could want in the shader, but is there an equivalent for Direct3D or some other way to have the matrices automatically passed to the shader? I've seen a few example shaders using binding semantics like WORLDVIEWPROJECTION but as far as I can tell the application still needs to set the matrix manually :(

Share this post


Link to post
Share on other sites
Advertisement
Guess no one knows of any way to have it automatic :(. I suppose I can just use binding semantics I'll program into the rendering engine and automatically load the relevant ones into shader parameters that will get set on render calls. Not as automated as I'd hoped for but it should still ensure that I won't need to be creating and setting shader parameters for the matrices manually inside my games which should save development time.

Share this post


Link to post
Share on other sites
The built-in matrices are depricated in GL nowadays anyway, so manually passing them is the right thing to do.

Share this post


Link to post
Share on other sites
I'd been hearing support for alot of the fixed function stuff was being deprecated, didn't realize that the matrices were among the deprecations. Glad I was planning on using a shader only pipeline anyway :).

However I just hit a snag, you can only get a parameter from it's binding semantic when using effects, which I'm not. Looks like I'll be using hard coded names instead :(.

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!