Jump to content
  • Advertisement
Sign in to follow this  
giugio

[c++ dx10]shader or link buffers

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

Hy. I have a collection of classes(CMesh)that have a draw method that exactly draw the mesh with a shader. For you is better to have a shader ready to draw(with all the required resources ,vertex and index buffer) in each object of this class or dinamically bind the buffer and the resources in a single shader that cyclically draw all meshes of the same type in a collection ? In the first case is more fast ? or ... it is not worth the candle Can i have some problem in the first mode of band with or so one? thanks.

Share this post


Link to post
Share on other sites
Advertisement
Vertex and Index buffer are not part of shader-stage, they own to Input Assembly Stage

However, even with multiple shaders, using D3DX10FX framework, the Apply method makes a complete shaders and bound resources replacement, so from this point of view it's useless have got more equal shaders for more objects. (Load it more times???)

Anyway, D3D10 device can't support multiple shader bound to the pipeline.

The best advice i can give to you it's to add a shader pointer to your draw function in order to select a shader for rendering. If that pointer == NULL, leave current shader and draw simply the object.

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.

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!