Cloth loading and unloading. Memory issues

atsakir

09-07-2008 10:20:14

Hi all, I know that not many here have experience with cloth objects and even Betajaen has forgotten most of the things regarding cloths, however I need to ask none the less. :)

Here's the problem. Creating any type of body other than cloth, deleting it from the scene and reloading it again right away has no problem whatsoever.

On the other hand when I try to do that with multiple cloth objects (since no scaling of a cloth object is possible once the cloth simulation starts) and I delete my cloth objects and then load the same cloths with different scale I get various results. Sometimes the loading works ok, sometimes the system gives me a hardware buffer error both with the DX and OpenGl renderers, sometimes some parts will load and some won't.

My guess is that sometimes the unloading hasn't really cleared all cloth parameters (mesh, vertex buffer etc.) before trying to load the same object again so there is a name clash or the vertex buffer is still locked or in unstable state.

How can I make sure that all cloth objects have been unloaded before I try to re-load them? I try to introduce a delay but although it improved behavour somewhat it is not fulproof either

betajaen

09-07-2008 10:25:53

I haven't forgotten.

I'm adapting "Mesh" and Flour to handle and create Cloth for Bleeding '22 as we speak - No code on the rendering part yet, I'm afraid. But once I get into the "rendering" mood, I'm sure I'll come up with an answer and possibly a solution. But first I need to make sure the mesh and cloth framework is complete though.

atsakir

09-07-2008 10:40:18

thanks for the quick reply betajaen. Looking forward to '22 then :) since I found you can I ask one more question?

is there any way I can poll all the cloth vertices for per vertex force and/or tension? (i.e getForce() per cloth vertex. There is a method to set the force applied to a vertex index but not one to get the current force applied.

I want to change vertex colour based on how much force is applied on each vertex (to show the pressure in colour grading) I looked in the Ageia docs as well and I couldn't find something relevant

betajaen

09-07-2008 10:50:01

I don't really know. If there is nothing in the documentation then probably not. But you could ask them over at the nVidia forums.