Sign in to follow this  
jad_salloum

Dynamic curtains with Wind

Recommended Posts

jad_salloum    100
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

Share this post


Link to post
Share on other sites
Dreamy    134
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this