Jump to content
  • Advertisement
Sign in to follow this  
Aiursrage2k

Rendering Primatives

This topic is 4799 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 have a rather simple world, composed of basic shapes: quads and cubes. Each shape has a texture and a material. When I render the shapes I do so indivually, when a shape is rendered:its streams its source, changes its FVF, texture,etc... Would it be better/faster to take all the shapes, add them to some type of Cache (building a large index buffer --sort them) then rendering the caches. The question then is how slow is SetStreamSource and DrawPrimitive. Is it significantly better to render large chunks of data then rendering the same number of verticies but more render calls... enough to warrant the constant building of the sorted lists? *** I was doing a bit of experimentation and in my world found that changing the render states does not really have an impact.

Share this post


Link to post
Share on other sites
Advertisement
Before I get into the specifics, it is very important to realise that trying to predict performance characteristics of D3D applications is very hit-or-miss. There are so many possible variables and factors that whilst there are some common observations/optimizations it's never guaranteed. You might want to dig up a copy of "PIX for Windows" to do some hardcore profiling - only with instrumentation are you likely to know if A is faster than B [smile]

Quote:
Original post by Aiursrage2k
When I render the shapes I do so indivually, when a shape is rendered:its streams its source, changes its FVF, texture,etc...

How many objects are we talking about here? 10, 20, 100, 5000?

Quote:
Original post by Aiursrage2k
Would it be better/faster to take all the shapes, add them to some type of Cache (building a large index buffer --sort them) then rendering the caches.

Conventional wisdom is that "batching" (the common term for what you're describing) greatly improves performance.

Quote:
Original post by Aiursrage2k
I was doing a bit of experimentation and in my world found that changing the render states does not really have an impact.

It's possible that with a reasonably simple scene, like you've described, that you're just not getting anywhere near the limits of your hardware such that the changes you're making aren't really important. In your instance, it might well be that the extra code/effort you expend implementing these algorithms just won't pay off.

For a more "real-world" like scene/system, the batching process (large chunks of data in few(er) draw calls) is often essential to good performance.

hth
Jack

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!