Dynamic curtains with Wind
hi guys, i am trying to move the curtains with wind but i need to know what is the best way to do that. i saved the vertics of the curtain in a vertex buffer and on each frame i change with the velocity of the wind on each vertex according to the Z axis (up direction) . but i am having a problem that is : i am saving the vertexs in an array of CustomVertex.PositionNormalTextured _verts and i am saving the changes when i apply the velocity to another CustomVertex.PositionNormalTextured _OutVerts then i send the data to my Vertex buffer using VB.setData( _OutVerts , 0 , 0 )
but the problem is that the _verts is also changing although i am not changing it !!!!!!!! can anybody tell me what might be the problem ?? and is there a better way to shake the curtains ???
thanks for any help,
Best Regards,
Jad Salloum
You could create a "vertex-sensitiveness-to-wind" variable and store it in each vertex, then move each vertex directly in a shader updating only a wind velocity variable in the shader. That way you would stay out from locknig amd unlocking your vertex buffer each frame.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement