Archived

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

thedo

MD2 question

Recommended Posts

thedo    124
I have an MD2 class which uses DrawPrimitiveUP at the moment (heavily based on Dr Dobbs article from about 2 years ago). I manually tween frames so I can get any degree of smoothness I want. Now then here''s the question- should i a: set up an array of vertex buffers an use vertex shaders to tween? b: compute my tweened MD2 and copy to a VB before rendering (ie do this every frame) c: keep using drawprimitiveup. Help please. Neil WHATCHA GONNA DO WHEN THE LARGEST ARMS IN THE WORLD RUN WILD ON YOU?!?!

Share this post


Link to post
Share on other sites
thedo    124
No-one?

OK Here''s what i have at the mo - I have an engine which runs at 50 fps with (approx) 75000 triangles on screen at once. This makes about 3.5mtris/sec. This is using a mixture of static and animated MD2 models. I also have a demo with 50 500 triangle MD2 models (nothing else) which runs approx 10fps (therefore around 250,000 tris/sec).

Now I read somewhere elseo n this forum (posted by S1CA i think) that internally DrawPrimitiveUP uses Vertex Buffers. If so would I actually see any benefit of converting to VB''s on a per frame basis? How would a big would a 500 poly array (including 3vertices (float), 3 texcoords (floats) and a diffuse colour)
compared to a 500 poly Vertex Buffer? Obviously there is an overhead because it is an object. This is why i am dubious as to pre-loading 197 VB''s with frames of animation and tweening them using Vertex shaders.

Any Help?

Please.....

Neil

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

Share this post


Link to post
Share on other sites
ryoder    122
Hey I have the same design as you!
I too was thinking the same questions when I coded this.
I keep around 1 vertex buffer that only gets used for rendering.
In my render method, I tween two frames of vertex and normal data and set the u,v coordinates and stuff the result in the one vertex buffer.
Then I render the stuff.

I was thinking of doing what you said, creating a VB for each and every frame but that is a lot of memory.
I am going to run mine with as many tris as you have and see how my performance compares to yours.
I''ll post back later.

Share this post


Link to post
Share on other sites
thedo    124
My performance isn''t great, which is why i''m looking into VB''s. However my time is very limited at the mo and I don''t have time to experimant with them all. If you could let know about your results it would be greatly appreciated.

Many thanks

Neil


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

Share this post


Link to post
Share on other sites
CrazedGenius    156
A. use the shader.

NEVER use the ...UP functions.

You should see a performance increase with VBs because you can create them once and use the shader to process between them. There is no CPU->GPU travel (or at least not as much as ...UP)

See the dolphin sample in the SDK

Share this post


Link to post
Share on other sites
thedo    124
BUT - the dolphin sample only has THREE meshes. I am looking a 197!

My main question isn''t so much IF i should use VB''s, just am i best

1: Preloading 197 at load time
2: calculating it each frame.

Cheers

Neil

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

Share this post


Link to post
Share on other sites