Rendering Primatives

Started by
0 comments, last by jollyjeffers 18 years, 9 months ago
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.
Insufficent Information: we need more infromationhttp://staff.samods.org/aiursrage2k/
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

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

This topic is closed to new replies.

Advertisement