Giter VIP home page Giter VIP logo

nvcloth's People

Contributors

mtamis-nv avatar sschirm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nvcloth's Issues

Some questions about setCapsules()

Yesterday I met a crash when I called cloth->removeCollisionCapsules() in PhysX-3.3.
And then I find some similar code in NvCloth.
When I call cloth->setCapsules(nv::cloth::Range<uint32_t>(), 0, 1) , is srcIndices null ?
If srcIndices is null, is dstIndices[i] = srcIndices[i - first] valid?
default

I Get Trouble About Wind Computation

image
Hi,I get trouble about understanding the wind computation. Everything is fine, but why end the function, apply the impulse to the particle by the subtraction.? Thanks a lot.

Fix NvCloth compatibility issues with PhysX

Hello,

I have recently been working on integrating PhysX 4.1 and NvCloth 1.1.6 to an engine.
I noticed that these 2 libraries have compatibility issues.
There are indeed a few minor incompatibilities that can be easily fixed, however I've encountered a crash that was quite intriguing.

Symptoms:
When I enable the CctCharacterController (more precisely a CctCapsuleController), I fall and as soon as there is a collision with some shapes (box/height field/...) it crashes, with a heap corruption error.
Note that this happens only in release and profile, debug and checked targets work fine.

Investigation and fix:
As I debugged, I saw that the crash was happening when PhysX tries to add elements to an array.
First element is added, but not the second one. Actually, what it does is quite simple, if it doesn't have enough memory in the array, then it allocates a new, bigger array, copies the previous one into the new one and deletes the previous one. However, in that case, it doesn't manage to delete the previous one.
Here is why :
(in c++ it's in
PsArray.h
PX_NOINLINE T& Array<T, Alloc>::growAndPushBack(const T& a)
see
T* newData = allocate(capacity);
the following asm code is a part of what the allocate function does )

00007FFDF9E3E168 test rdx,rdx
00007FFDF9E3E16B je physx::shdfnd::ReflectionAllocator::allocate+4Eh (07FFDF9E3E19Eh)
00007FFDF9E3E16D call qword ptr [__imp_GetNvClothAllocator (07FFDF9F0D458h)]
00007FFDF9E3E173 mov r9,rsi
00007FFDF9E3E176 mov dword ptr [rsp+20h],edi

as you can see, somehow, PhysX asks NvCloth to allocate memory. But it cannot free that memory since it belongs to another heap.
To fix it, I didn't touch PhysX, but in NvCloth I've renamed ReflectionAllocator to NvClothReflectionAllocator (and NonTrackingAllocator to NvClothNonTrackingAllocator, to be sure).
I understand that the compiler got confused because these functions have the same name, are in classes that have the same name, and are in namespaces that also have the same name.

compiler used : MSVC 14
hope that helps

Clothing Tool ? / APX format support / specs ?

Hi,

I miss the D3D9 ClothingTool from APEX 1.3
Its missing in APEX 1.4 and in nvCloth I did not find any .apx importer. Only always a plane mesh.
So how to create custom cloth based on another mesh?

Btw, is the.APX file format compatible with all APEX versions?
If the .apx file version must match the version of the used PhysX, how to create Clothing .apx files for APEX 1.4 without Maya/3DsMax?
Yet I use Blender and there I wrote my own Python exporter for exporting data.
Is there a Public File Specification of the APX file format? So that I can write my own exporter?
(I don't yet use UE4)

NvCloth plugin for Maya on Linux?

Previously, with PhysX Cloth, there was a plugin for creating .apx files in Maya, available on Windows.
Can the source code for this plugin be shared?
Would like to compile the same for Linux, for use in VFX.
thanks

Cloths with cloths collisions.

Hi.

How do the collisions work when a cloth collides with another cloth ? No collision primitives are created in this case, so I am a little confused. Can you please clarify ?

Thank you and best regards !

Simulation problem.

I meet a trouble when using nvcloth to simulation. My mesh's bounding box is about 0.30.30.3, it's a very tiny mesh. Everything is fine, but only the effect of the simulation is very strange, it looks like a Jelly, not a cloth. Anyone have an idea about this, it bothers me a few days, many thanks. By the way, I can provide a short video capture to your email.

DX solver function accelerateParticles looks wrong

The CUDA version of that function updates a float per thread so threads 0,1,2,3 would update floats X,Y,Z,W of particle 0.
The DX version looks like a straight port of that but is using float4 so threads 0,1,2,3 will read/update/write all of XYZW for the same particle at the same time. Since thread 3 has a zero value for sqrIterDt you've got 4 threads writing different values back to the same location.

Should probably change sqrIterDt to
float4 sqrIterDt = float4(gFrameData.mIterDt * gFrameData.mIterDt, gFrameData.mIterDt * gFrameData.mIterDt, gFrameData.mIterDt * gFrameData.mIterDt, 0.0f);
and remove all the "*4" and "/4" calculations to leave it as one thread per particle. To make it one thread per float would require additional get/set operators for curParticles.

How to create a mesh collider more than 500 triangles in NvCloth?

I am working on cloth simulation using NvCloth and I found out that NvCloth Does not support the mesh collider
contains more than 500 triangles:
in the file CuCloth.cpp:

"clamp to 500 triangles (1500 vertices) to prevent running out of shared memory"

Does anybody know how to deal with this? I want to increase the shared memory and increase triangle numbers in my mesh collider.

Best

[Feature Request] Collision with signed distance fields

Is there any plan on including other kinds of collider objects, such as signed distance fields? Or perhaps increasing the limit on the number of sphere or capsule colliders, so that you could approximate a non-trivial object with the union of spheres.

Compiler error when disabling USE_SELF_COLLISION_SORT in DX solver

There are multible Compiler Errors when Setting USE_SELF_COLLISION_SORT to 0.

#define USE_SELF_COLLISION_SORT 1

undeclared identifier 'i'

for (i = threadIdx; i < numParticles; i += blockDim)

undeclared identifier 'cdistSq'

if (distSqr > cdistSq)

undeclared identifier 'cellStartOffset'

bSelfCollisionData[cellStartOffset + key] = -1;

collision detect

I ask for help that how NvCloth to implement collision detect either for intercollision and selfcollision?
I find collision() just need particle for pram,which cofuse me.
Thanks

Maybe bug on Android

In NvCloth\src\SwSolver.cpp
image
This line
image

If there is any possible that I compile for armv7 with neon, however, the cpu not supported. It will end up to this function
image

It will enter the if body, and use "Scalar4" type, but the "Sim4fTyped" defined as "Sim4f" in the front.
image

Is this some kind of bug or not?

Need NvCloth for iOS

NvCloth 1.1.3 Release has ios.toolchain.cmake, but how to compile NvCloth for iOS?

[Question] PhysX and NvCloth interaction

Hi,

I'm a newbie when it comes to physics. I recently started working with PhysX 4.1 and once I got the hang of it I wanted to try adding some cloth to my simulation. After realizing that there was no "PhysX Cloth" in the code that I downloaded (turns out I was reading the documentation of PhysX 3.4, which does seem to include it) I noticed that it was deprecated in favor of NvCloth.

On the main github page it says "PhysX / PxShared compatibility" which made me think that I could merge NvCloth seamlessly into my PhysX simulation but from what I gather it seems that that's not the case. If I understand this correctly I'm supposed to create mirror capsules/spheres from my PhysX simulation and keep that updated on the solver simulation so that PhysX and NvCloth will look like they're working together. Is that correct?

Also, does this mean that it's not possible to create a, for example, horizontal piece of cloth that's hanging from 4 anchor points and then drop spheres on top so those spheres eventually gather on top of the cloth (cloth affecting physx instead of only the other way around)? Is there any other PhysX/nVidia API that will allow for something like that?

Thanks, and sorry if this is not the proper place to ask this (I'll gladly move this conversation somewhere else if pointed to the right location).

Build Failure on iOS/Mac

Hi,
I am trying to use GenerateProjectsOsx.sh/GenerateProjectsIOS.sh but hit the same error as follows

[NvCloth]cmake/common CMAKE_MODULE_PATH = /Users/xxx/Downloads/NvCloth-master/NvCloth/../..//sw/physx/tools/CMakeModules
CMake Error at /Users/xxx/Downloads/NvCloth-master/NvCloth/compiler/cmake/common/CMakeLists.txt:25 (MESSAGE):
Could not find CMakeModules at
/Users/xxx/Downloads/NvCloth-master/NvCloth/../..//sw/physx/tools/CMakeModules

I didn't find folder like sw/physx/tools/CMakeModules, did I miss anything in my workspace? (e.g. build Physx first?)

I am on High Sierra/Xcode 10

Thanks,
Reuben

Motion constraint between particles of different Cloth objects

In order to enhance cloth appearance it would be nice to have the possibility of "stitching" two Cloth objects together (i.e.: apply some sort motion constraint between some particles from cloth "a" with some particles from cloth "b", so that they are always together during the simulation).

Are there any chances to have such a feature?

Error code 1 while compiling in VS 2017

Hi,
I was trying to run NvCloth tool but when I'm compiling this project in VS, cmd.exe is keeping stopped by error 1 in 171 line. How can I solve this issue? Every tip is welcomed.

Mechanical properties #1

Hello.

I am trying to simulate the following mesh:

screenshot_2018-07-12_16-00-31

I want to preserve the original shape of the cloth, but I have got something like this (despite trying to change different parameters):

screenshot_2018-07-12_16-00-07

Can you please suggest a workaround to this problem ?

build failed on Mac os

System info: 10.13.5

After I run BuildProjectOsx.sh, got this error:

Processing project file 'scripts/packman/packages/cmake.packman.xml'
Package 'cmake-mac-x86_64' at version '3.7.2' is missing from local storage.

I tried add log in Python script, found this:

image

It seems that can't download cmake 3.7.2 from cloudfront.net, include .7z, .zip

I have cmake 3.12.0 already, why nvCloth can't read it and download a new one?

Cloth not moving

I have successfully initialized factory, fabric, cloth, solver, and set properties according to the User Guide, the cloth can be rendered by my own renderer, but when I call the function Solver->simulateChunk(idx), the position of the cloth doesn't change and sometimes became Nan, I wonder what mistake could I possibly make.

Why dose the application crash at cloth1->removeCollisionCapsule( 1 )

I use the Physx-3.3 and the cloth1 is a PxCloth*
Why dose the application crash at cloth1->removeCollisionCapsule( 1 )
(T_T)

cloth1->addCollisionSphere( PxClothCollisionSphere( PxVec3(2.0f, 0.0f, 0.0f), 1.0f ) );
cloth1->addCollisionSphere( PxClothCollisionSphere( PxVec3(0.0f, 2.0f, 0.0f), 1.0f ) );
cloth1->addCollisionSphere( PxClothCollisionSphere( PxVec3(-2.0f, 0.0f, 0.0f), 1.0f ) );
cloth1->addCollisionSphere( PxClothCollisionSphere( PxVec3(0.0f, -2.0f, 0.0f), 1.0f ) );

cloth1->addCollisionCapsule( 0, 1 );
cloth1->addCollisionCapsule( 1, 2 );
cloth1->addCollisionCapsule( 2, 3 );
cloth1->addCollisionCapsule( 3, 1 );

cloth1->removeCollisionCapsule( 1 );

Compiling 32 bit

I'm not able to compile 32 bit NvCloth DLL with Visual Studio 2013.

I run CmakeGenerateProjects.bat to create vc12win32-cmake, compiling the solution at the beginning VS show the error 'cmd.exe exit with code 3'
bat

I also tried to made makelist by hand with, VS takes a while, but end with error C2220 and some warnings.

Compiling 32 bit

I'm not able to compile 32 bit NvCloth DLL with Visual Studio 2013.

I run CmakeGenerateProjects.bat to create vc12win32-cmake, compiling the solution at the beginning VS show the error 'cmd.exe exit with code 3'
bat

I also tried to made makelist by hand with, VS takes a while, but end with error C2220 and some warnings.
cmke_byhand

Can you help me?

what is the right way to do cloth-body animation?

I'm trying to use NvCloth for a cloth-body animation, where a cloth with 1k vertices will interact a deformable human model with about 10k faces, the triangle collision seems to be far too slow, does NvCloth support this kind of simulation? if it doesn't, is there any alternative method?

efficiency of nvcloth on Andorid

I have test a same example both on IOS and Android
IOS(IPhone 7) : run 10000 points cloth simulation still can get 30 fps
Android(Goole Pixel 2XL) : run a simple flag without skinning abount 600 simulation point seem to be very slow, the fps is 50 when cloth is off and the fps is 6 when enable cloth simulation
I had checked the android lib compile, the neon is enabled and the compile use - O2 option
Is that situation normal?
It seems that nvcloth on andorid is very slowly....

clampTriangleCount

Hi.

there's a restriction In the CuCloth.cpp ~ cloth::CuCloth::clampTriangleCount:

cloth::Range<const PxVec3> cloth::CuCloth::clampTriangleCount(Range<const PxVec3> range, uint32_t replaceSize)
{
	// clamp to 500 triangles (1500 vertices) to prevent running out of shared memory
	uint32_t removedSize = mStartCollisionTriangles.size() - replaceSize;
	const PxVec3* clamp = range.begin() + 500 * 3 - removedSize;

	if (range.end() > clamp)
	{
		NV_CLOTH_LOG_WARNING("Too many collision triangles specified for cloth, dropping all but first 500 * 3.\n");
	}

	return Range<const PxVec3>(range.begin(), std::min(range.end(), clamp));
}

How to create more collision triangles ?
Or how to remove this restriction without causing consequent crushes?

Thank you.

PS.
Two additional questions.

As far as I understand, the shared memory on the GPU is limited. So what if more complicated cloth is composed from the primitive cloth-objects having 500 collision triangles each ?

What is an alternative way instead of using shared memory ?

can't generate project in ubuntu

g++ version 7 >= 4.7
Processing project file 'scripts/packman/packages/cmake.packman.xml'
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
[NvCloth]cmake/linux/CMakeList.txt
[NvCloth]cmake/common/CMakeList.txt
[NvCloth]cmake/common CMAKE_MODULE_PATH = /home/gugu/project/nvidia/NvCloth/NvCloth/..//Externals/CMakeModules
NvCloth Build Platform: linux
Using CXX Compiler: /usr/bin/c++
Appending config to output names
[NvCloth]cmake/common/CMakeList.txt END
-- Found PxShared: /home/gugu/project/nvidia/NvCloth/PxShared
CMake Error at CMakeLists.txt:50 (ADD_SUBDIRECTORY):
add_subdirectory given source
"/home/gugu/project/nvidia/NvCloth/PxShared/src/compiler/cmake/linux" which
is not an existing directory.

[NvCloth]cmake/linux/NvCloth.cmake
NV_CLOTH_ENABLE_CUDA = 0
[NvCloth]cmake/common/NvCloth.cmake
[NvCloth]cmake/common/NvCloth.cmake END
[NvCloth]cmake/linux/NvCloth.cmake END
-- Configuring incomplete, errors occurred!
See also "/home/gugu/project/nvidia/NvCloth/NvCloth/compiler/linux64-debug-cmake/CMakeFiles/CMakeOutput.log".

Xcode Scenekit iOS integration

Is it posssible to integrate the cloth solver in Xcode Scenekit?

If yes, is there any “artist friendly” tutorial or documentation?

Thanks

SIMD crash

I'm a game engine beginner.
image
I found crash on win32 release.
image
It seems like mClothData.mCurParticles is not
128-bit alignment. How can I fix it. It's ok on android x86,arm arch and win x64.

How recover simulation when cloth disappear.

Hi, recently I make an editor for nvCloth. I give a very strong wind to the cloth, and the cloth disappears. Then I shut down the wind, and I want to reset the cloth back, so I set cloth particle's positions to animation position preposition, clearParticleAccelerations(),clearInterpolation(),clearInertia(),clearMotionConstraints(),clearSeparationConstraints(). But it not works. So is there any method to reset the cloth particle to the normal simulation state. And any method I can detect this at runtime (I want to auto reset cloth if this happens).

ClothMeshData::InitializeFromData

Hi.

I am using this function in order to initialize a custom mesh:

template<typename PositionType, typename IndexType>
bool ClothMeshData::InitializeFromData(nv::cloth::BoundedData positions, nv::cloth::BoundedData indices, physx::PxMat44 transform)

This is the usage code of InitializeFromData:

    std::vector<float> vrt;
    for (int i=0; i < mesh.vertices.size(); i++)
    {
        vrt.push_back(float(mesh.vertices[i].Position.x));
        vrt.push_back(float(mesh.vertices[i].Position.y));
        vrt.push_back(float(mesh.vertices[i].Position.z));
    }
    
    std::vector<uint32_t> ind;
    for (int i=0; i < mesh.indices.size(); i++)
    {
        ind.push_back(uint32_t(mesh.indices[i]));
    }
    
       
    bool success = clothMesh.InitializeFromData<float, uint32_t>(ClothMeshData::ToBoundedData(vrt), ClothMeshData::ToBoundedData(ind), transform);
    if (!success)
    {
        std::cout << "Failed to initialize cloth" << std::endl;
        exit(0);
    }

I have such behavior:

screenshot_2018-06-26_15-48-37

When I use ClothMeshData::GeneratePlaneCloth then it works fine but when I use ClothMeshData::InitializeFromData it looks like there are no constraints between the particles.

Can you please advice how to resolve the issue ?

Thanks.

PS.

I have a guess that the provided mesh is not correctly defined for simulation.

Trouble some about setTriangle interface

Hi,
It's me again _
I'm trying to make cloth can collide with the scene object. And I make it work with PhysX. I wrap the cloth's bounding box as a PxBoxGeometry. And then use the box to collect all triangles nearby, store it into std::vector TriangleList, and use the setTriangles to make collision detection work.
And now I found a strange phenomenon, I have two box model each one can work well with the cloth, but if I put them both, the cloth will disappear. I check my code over and over but found nothing wrong. Do I have any misunderstanding about him? NvCloth's API?
Many many thanks.

No CmakeGenerateAll.bat

there is no CmakeGenerateAll.bat , when i'm trying use "CmakeGenerateProjects" to generate, the error happen.

Error_builld

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.