ProcessVertices

Started by
4 comments, last by Zorbfish 20 years, 8 months ago
I don''t expect a lot of answers here, seems I like to pick really exotic questions (or at least they seem like it to me). I''m batching my vertices by renderstate and texture so I can draw as many triangles as possible in one DP call. Then I ran into a problem; what if I need a set of vertices in that batch to have a different world transformation (which I do sometimes)? I could create a loop and set each transform and call DP, but that defeats my purpose of making fewer DP calls. Then I read this article on nexe. Processing vertices before rendering? I checked in the sdk and found no documentation other than the function declaration and a vague description of what it does. Neat, so now I can transform my batch of vertices and still make my one call. So here comes my list of questions: 1.) Does anyone really do this? And how? 2.) The sdk docs states that ProcessVertices performs the same process as when DP is called. Is that really true (I know that sounds dumb)? 3.) There''s lots of bad things going on, two buffers, copying, vertex buffer switches, will I really gain anything over just doing more DP calls and SetTransform calls (other than more memory usage )? Thanks for reading, and hopefully this is something that has not been answered of before.
Advertisement
This forum''s search engine finally kicked AFTER I posted. *sigh* Now that I think of it making many DP calls and SetTransform calls wouldn''t matter much if the work load is small (say 10-20 triangles) right?
quote:Original post by Zorbfish
This forum''s search engine finally kicked AFTER I posted. *sigh* Now that I think of it making many DP calls and SetTransform calls wouldn''t matter much if the work load is small (say 10-20 triangles) right?


The only real answer to a question like that: Probably not, but profile it anyways
quote:1.) Does anyone really do this? And how?

It''s usually done using dynamic vertex buffers.
Dynamic vertex buffers are generally used with data extracted from visibility structures (quad/oct/bsp trees...etc)

quote:2.) The sdk docs states that ProcessVertices performs the same process as when DP is called. Is that really true (I know that sounds dumb)?

But it always works in software. It won''t use hardware T&L. So, it''s slower.

quote:3.) There''s lots of bad things going on, two buffers, copying, vertex buffer switches, will I really gain anything over just doing more DP calls and SetTransform calls (other than more memory usage )?

Ehm...Time it and see?
What are you trying to do, exactly (describe the problem rather than what the solution you''re trying, maybe people''d be able to help you more)

Peace,
Muhammad Haggag

I''m trying to optimize my rendering process. I posted about it a few days ago with only one reply. Previous Post
One good reason to use it is multipass rendering - imagine not using it-

1: Draw (and transform vertices) for pass1
2: Draw (and transform vertices) for pass2
3: Draw (and transform vertices) for pass3
.
.
X: Draw (and transform vertices) for passX

Using Process Vertices -
1: Process vertices
2: Draw Using Processed Vertices for pass1
3: Draw Using Processed Vertices for pass2
.
.
X: Draw Using Processed Vertices for pass(X-1)

Since transforming all your vertices is a pretty expensive operation it may be beneficial to do it once and just use those processed vertices over and over again.

On the other hand ProcessVertices uses SW T+L so your lovely Geforce or Radeon is being a little wasted. Plus this would only work in quite limited situations - ie multiple per pixel lights might not work so well (but I''ve not thought too much about it).

Neil



WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!
WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

This topic is closed to new replies.

Advertisement