Jump to content
  • Advertisement
Sign in to follow this  
noatom

1 buffer per mesh or multiple meshes per buffer?

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

Advertisement

Which is better for performance?

 

This does totally depend on so many factors, that one can't give you a simple eigther - or answer to this. But I'll give you a few pointers:

 

- Usually you would want one large buffer for your static meshes. Fewer buffer switches still results in slightly better performance, if not for that fact that it takes fewer API-calls. Switching buffers isn't really that bad though, but it saves time, which accumulates up.

 

- For your dynamic meshes (moveable, NPCs, etc...), you probably want multiple buffers. It makes handling them a little easier, plus you will end up with lesser buffers locks and having to resize buffers less often, since if you where to use one large buffer for all dynamic meshes, you would have to recreate it every time you add one e.g.

 

So rule of thumb is, one buffer for truly static meshes, one mesh per buffer for dynamic (though I belive some people with a lot more experience might have one or two things to add here)...

Edited by Juliean

Share this post


Link to post
Share on other sites

That depends on so many factors...

 

To add to the "multiple buffers" theory, some say it's better for shadow casters: Put the position in one stream, and the rest in other streams. Hence when doing the shadow caster pass, the bandwidth and caches are exclusively and cleanly used for the only element in use (mostly DX10+ apis).

 

While DX9 API likes it better when there is just one stream.

Opinions diverge too much because there's no definitive answer

Share this post


Link to post
Share on other sites


To add to the "multiple buffers" theory, some say it's better for shadow casters: Put the position in one stream, and the rest in other streams. Hence when doing the shadow caster pass, the bandwidth and caches are exclusively and cleanly used for the only element in use (mostly DX10+ apis).

 

Have you seen any performance comparisons? I did some shadow rendering tests with simpler vertex format, but I couldn't see any performance difference, although I could have been fill rate limited. 

 

Also, you may also need texture coordinates for shadow rendering since some materials could have transparency.

 

Cheers!

Share this post


Link to post
Share on other sites

That depends on so many factors...

 

To add to the "multiple buffers" theory, some say it's better for shadow casters: Put the position in one stream, and the rest in other streams. Hence when doing the shadow caster pass, the bandwidth and caches are exclusively and cleanly used for the only element in use (mostly DX10+ apis).

 

While DX9 API likes it better when there is just one stream.

Opinions diverge too much because there's no definitive answer

 

How do you split data into streams in DX10/11? I can't find anything on the subject.

Share this post


Link to post
Share on other sites

How do you split data into streams in DX10/11? I can't find anything on the subject.

 

Instead of creating one buffer for a mesh, you create multiple ones. Each buffer only gets part of the information, like one for position, one for texture coordinates, and the last one for normal/binormal/tangent. You then assign each buffer a different stream number (from 0-X), and thats pretty much it. Now you can only pick the elements you really need, and save valuable bandwidth.

 


Have you seen any performance comparisons? I did some shadow rendering tests with simpler vertex format, but I couldn't see any performance difference, although I could have been fill rate limited.

 

How did you test performance? If you choose many, complex shadow casters, you should definately see a difference, otherwise you most likely will be limited by fillrate...

Edited by Juliean

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!