Sign in to follow this  
giugio

[c++ dx10]shader or link buffers

Recommended Posts

giugio    246
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
XVincentX    129
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this