Archived

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

doctorsixstring

DX8 - VB Transformations

Recommended Posts

I apologize in advance if this question has been asked a lot. Right now I have a 2-D rendering engine using the ID3DXSprite interface of DX8. I want to try using a vertex buffer to render textured quads, instead of using the ID3DXSprite. I can render one quad on the screen so far, but I''m not sure how to go about rendering multiple sprites (thousands, actually) without locking/unlocking the buffer at least once per frame. I have played around with transforming the world matrix, but that doesn''t seem to be what I want. I am unsure as to how to proceed. Does anyone have any tips/example code/links to useful threads? Thanks, Mike

Share this post


Link to post
Share on other sites
I believe that if you don''t want to lock the vertex buffer at all, you only choices are to just rerender each object with a different world transform applied (which it sounds like you tried) or to use a vertex shader that applies the transform.. bu that requires at least a geforce3, and some knowledge of writing shaders.

I can'' think of any other way, but then again, I''m new to this too.

-andy

Share this post


Link to post
Share on other sites
What do all of you people have with dynamic VBs? They are just fine, ya know!

So my suggestion is to learn to use dynamic VBs ( to which you rewrite everything every frame ). There''s a lot on that on nVidia developer site: developer.nvidia.com.

Because really, it''s a lot more optimal than drawing 4 triangles in a call using matrices and static VBs. A LOT more.


Uttar

Share this post


Link to post
Share on other sites
So how much of a performance loss would I incur for locking/unlocking the VB once each frame? That would be sufficient for what I want to do. Is that what you are referring to when you say dynamic VBs, Uttar?

My goal is to get my game to run well on a Voodoo3. I''m not sure if that will be possible, but right now I''m assuming it is (so no vertex shaders, etc.).

-Mike

Share this post


Link to post
Share on other sites