Jump to content
  • Advertisement
Sign in to follow this  
n3Xus

[DX10] Applying transformation to only some vertices in a super vertex buffer

This topic is 3588 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 hope I used the correct terms.. Anyway, I read some people suggest to join more vertex and index buffers into one big vertex and index buffer to prevent too many draw calls and buffer changing. How would I then apply, for example, the rotation transformation to only some vertices in that big vertex buffer?

Share this post


Link to post
Share on other sites
Advertisement
Your request it's too many generic.
How have you organized your large vertex buffer? Are you using a subsets system? How about a your subset structure?

If you need to rotate only subset 1, you can simply write a for statement and make your updates...

Share this post


Link to post
Share on other sites
Well right now I haven't even organized anything.
I'm not sure what exactly you mean by a subset system-you mean the one in the dx mesh? I don't use it, I use my own model format.

I also don't know how exactly to organize it. I was thinking that I would 1st create all buffers from many objects and then join them into one big one.

Share this post


Link to post
Share on other sites
Yes you can pack several objects to a single vertex buffer.
You can then use the buffer offset to draw only subsets of it, whereby you always set the transformation matrix you want, usually you will need some other unique material parameters too. You still save switching the buffer then. However, afaik state changes are not that expensive with DirectX 10.

Another way would be to add a matrix index or something like that to the vertices. The you can select the correct matrix from an array.

Share this post


Link to post
Share on other sites
Thanks Lui, that would be one way of doing it.

XVincentX, what exactly do you mean by organizing large vertex buffers by state changes?

Share this post


Link to post
Share on other sites
I think he means that it would be better to first group everything by shared states and put it ordered by that in the vertex buffer somehow.
So if you are packing stuff, because you want to get better performance, that should be the best way.

From my experience it is mostly sufficient to just sort by material/shader, that would be the most expensive to switch.

If you tell us more about your application, we could give you more specific advice.

Share this post


Link to post
Share on other sites
Ah, yes, now I understand. I think I'm gonna try the indexed matrices method and sort them by shaders.

Thanks for your help.

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!