FlexCLI icon indicating copy to clipboard operation
FlexCLI copied to clipboard

flex 1.2

Open digitalwannabe opened this issue 6 years ago • 3 comments

hey, great project and very readable code, thanks for sharing! I'm wondering if there are any plans on supporting the newest flex version (1.2)? I'm trying to share the resulting buffers on the gpu without reading it to the cpu, but I've found that others had problems doing so with 1.1, eg here: https://devtalk.nvidia.com/default/topic/1002238/physx-and-physics-modeling/-flex-direct3d11-get-set-buffer-issues/

Also I wonder if there is a specific reason why this is 64bit only, apart from performance issues?

thank you

digitalwannabe avatar Jun 09 '18 18:06 digitalwannabe

Hello there, thanks a lot. Currently I don't plan to shift to 1.2 as I don't have enough time. I actually never had the issues discussed in the thread you shared. Did you already try reading the buffers? Did it work? I didn't chose x64-only support for a particular reason. I simply thought more people had x64 machines at this point and didn't manage to do both yet. If there's demand I can share an x86 version too. Would you need that? Best Ben

HeinzBenjamin avatar Jul 10 '18 11:07 HeinzBenjamin

hey ben, thanks for coming back to me.

I have tinkered quite a lot with your repo and did get sharing buffers on gpu to work in general- I had to add a second constructor for your Flex class, which accepts a pointer to the context of my app's renderer (I'm using vvvv), so I could create a dx11 buffer on that context, which I then registered with flex using NvFlexRegisterD3DBuffer....I did get back the particle positions, but I didn't try any further, as the original poster in the link above is the guy who has written the vvvv renderer I'm working with- if he didn't succeed, I surely won't. Also, as I found out now, the changelog for 1.2 states "Add support for device NvFlexBuffers on D3D" http://physxinfo.com/news/12866/nvidia-flex-1-2-0-is-released/ - so I assume they are just not fully supported before....

Anyways, in the meantime I've made all the necessary changes to your code to support version 1.2, no implementation of new features, only a port of the existing code; it compiles fine, however, for some reason vvvv doesn't find the new NvFlex....dlls. Not sure what's going on, but I think/hope it's unrelated to the actual code- if you find time you can see if it works for you: https://github.com/digitalwannabe/FlexCLI

here's the minimal changes which would need to be reflected in grasshopper nodes:

Parameters: -no more "isFluid" (set via new featureMode enum, which is not exposed to the user yet) -no more plasticThreshold/plasticCreep, now part of each rigid -no more SortAxis (don't know where it's gone)

plasticThreshold and plasticCreep; 2 more inputs for -RegisterSoftBody -SetRigids -RegisterCustomConstraints

internal changes:

  • new SolverDescription, 2 new values, maxContactsPerParticle and featureMode, set to constant values atm
  • NvFlexUpdateTriangleMesh has been changed to a float4 Buffer as input, I have changed FlexCollisionGeometry accordingly

I have tried to mark all my changes to the original code with //dw

best clemens

digitalwannabe avatar Jul 10 '18 19:07 digitalwannabe

I forgot one more change, I have replaced GetRigidTransforms with GetRigids- it can now give back new rest positions/normals due to plastic deformations, also some other stuff which I believe is not necessary (offset, indices, stiffness, threhold, creep)....best

digitalwannabe avatar Jul 11 '18 13:07 digitalwannabe