PDA

View Full Version : Fastest Way To Update VBO Data



CelticDaddio
10-18-2006, 06:27 AM
I have an object file which lists the vertices of my object(s).

I use VBO to download the vert data to the GPU.

I also have a dynamics file which lists the objects position and orientation at various timesteps.

Currently, I update the VBO by calling glMapBufferARB() and updating the vertex data. This seems to me to not be the best way to do this, but I am not sure of a better way, necessarily. Here is one idea I thought of...

1 - Use the dynamics info, pos and ori, which I'll call R(t) and O(t) to calculate the 4x4 3D transformation matrix, T(t), then store this data.

2 - Using GLSL, at each time step, pass T(t) to the vertex shader and use it to transform the current vertex's previous position to the new position.

Does this sound reasonable?

My problem is I am not sure of how to generate T(t).

Each position and orientation is absolute, not an offset from the previous position and orientation.

Any help is greatly appreciated.

Thanks,
CD

qorpse
10-18-2006, 10:18 AM
You probably want to use glBufferSubDataARB() data update vertex attributes.

Btw, if you're just using a typical transformation matrix per object, is there any reason to NOT just use glMultMatrix()?

qorpse
10-18-2006, 10:20 AM
Mind the typing in my post, I *just* woke up.

k_szczech
10-19-2006, 01:15 AM
Hi, I see you're asking the same question for the third time now. The link below have answers you need - did you read them at all?
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001235
glAren gave you a straight answer.

CelticDaddio
10-19-2006, 04:07 AM
If I recall correctly, and I checked, I only asked this particular question twice (and I did read all the replies). It was a restating of a different question, for clarification, though. I reposted this question in the Beginner forum because I did not think it really belonged in the GLSL forum after receiving a few answers. glAren may have given a straight answer, but it wasn't the answer to the question I was asking, or at least trying to ask.



Originally posted by k_szczech:
Hi, I see you're asking the same question for the third time now. The link below have answers you need - did you read them at all?
http://www.opengl.org/discussion_boards/ubb/ultimatebb.php?ubb=get_topic;f=11;t=001235
glAren gave you a straight answer.