Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Karl G

Best Way to Render?

This topic is 5305 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''ve read a lot of different opinions on this, but I wanted to ask the users of the most updated version of DX what they think. What''s the most efficient way to render many objects that use the same exact mesh but with different textures/materials/matrices? The best way that I''ve come up with is to copy all vertex data into a single buffer when the program starts, then copy all index data into a corresponding buffer. When it''s time to set up objects sort them first by their texture, then by type, then just iterate through and set the matrices/materials for each one. Any better ideas?

Share this post


Link to post
Share on other sites
Advertisement
Using an index buffer is always a Good Thing (unless you''re abusing it be writing to it every frame..), so I''d copy all the data for that one mesh into a VB/IB, then sort the objects to be rendered by render target, shader / texture (interchangeable, depends on needs of app), then matrices (which is usually taken care of by the scenegraph). I don''t think there''s any much better way of doing it..

Share this post


Link to post
Share on other sites
See that''s the thing...if you have 100 objects in the scene that''s 100 calls to DIP each frame. I guess there isn''t much of a better way to do it but I was just wondering if there were any tricks out there...

Share this post


Link to post
Share on other sites
Do you really have 100 different textures and materials? There really shouldn''t be so many objects rendered on-screen at the same time for a real-time program in the first place so maybe you could combine several into the same material/texture? A description of why you need to render the same mesh multiple times might be helpful too
If it''s not too much of a difference, many times the material can be done through textures instead (e.g. different diffuse colors) and so the meshes could be combined as a single mesh in a modeling program and if the textures are mapped correctly (i.e. different textures put into one and mapped) then that will help the rendering speed I''d think.
Also, you might be doing this already but having your data all sorted beforehand by materials will help too. Good luck!

Share this post


Link to post
Share on other sites
Check the thread: "Optimizing Character Rendering In DX9" on DIRECTXDEV. John Ratcliff - Planetside lead programmer - explains some techniques he used to be able to display large numbers of character meshes at the same time.

quote:
Do you really have 100 different textures and materials? There really shouldn''t be so many objects rendered on-screen at the same time for a real-time program in the first place

MMOGs like planetside require having so many objects on-screen.

Muhammad Haggag,
Optimize
Bitwise account: MHaggag -

Share this post


Link to post
Share on other sites

  • 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!