Archived

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

How to access vertex position w/out locking the VertexBuffer

This topic is 5511 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

Hi, I want to make a per-polygon collision engine but I don''t know how to access the polygon''s vertices coordinates w/out locking the vertex buffer, cause if I need to lock and unlock the VertexBuffer everytime I need to test a collision I would lose a lot of performance... Does anyone knows how to do this ???? Kamikaze

Share this post


Link to post
Share on other sites
why not just keep a non-VB copy of the vertex positions? the copy could contain only positions (ie. no tex coords, etc.)

Also, you could keep a lower res copy of the vertices in your collision copy - there is no reason your collision test has to be on exactly the same vertices...

Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces"

Share this post


Link to post
Share on other sites
Because I don''t want to waste memory...
If I had a mesh with a high polygon count I would waste
AGP memory and System memory... But I already made it
using VB->Lock(), and it doesn''t appear to make a slowdown
as I used the flag D3DLOCK_READONLY.
And I''m detecting collisions well now

And to answer your question:
If I make a copy of the VB to the Sys Memory
everytime I make a change to the mesh, like a
deformation I would have to refresh the VB in
the Sys Memory.

Kamikaze

Share this post


Link to post
Share on other sites