Jump to content
  • Advertisement
Sign in to follow this  
Alkan

OpenGL Shaders

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

Hello

 

I'm new to Direct3D, i come from the OpenGL world and my question is about shaders.

 

With OpenGL, you never bind a vertex shader or a pixel shader. Instead, you link both into a shader program then you bind the program (not the individual shaders). It seems like Direct3D work differently though.

 

So when sorting draw calls, do you sort by vertex shaders then by pixel shader ? Wouldn't it be simpler to sort by pair of vertex/pixel shaders ?

 

I must admit i don't really understand the idea of binding vertex and pixel shaders separately.

 

 

Share this post


Link to post
Share on other sites
Advertisement

I am assuming you are doing some more sorting than just the shader states right, because eliminating state changes in my rendering loop gave me a good performance boost even doing this manually with keeping track of the current ids and just checking against what I would be setting next.

Share this post


Link to post
Share on other sites

I am assuming you are doing some more sorting than just the shader states right, because eliminating state changes in my rendering loop gave me a good performance boost even doing this manually with keeping track of the current ids and just checking against what I would be setting next.

 

Yes, i sort opaque geometry by shader then by texture then by vbo then depth (front to back). Translucent geometry is sorted by depth only back to front.

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!