Does the Unity's Cloth Component use GPU?

793 views Asked by At

I 'd like to know if Unity's Cloth Component uses GPU for calculations?

The Unity Docs does not provide any information about how cloths are managed behind the different physics libraries.

1

There are 1 answers

0
loic.lopez On

From: docs.unity3d.com/Manual/PhysicsSection.html

Built-in physics engines for object-oriented projects

If your project is object-oriented, use the Unity’s built-in physics engine that corresponds to your needs:

  • Built-in 3D physics (Nvidia PhysX engine integration)
  • Built-in 2D physics (Box2D engine integration)

And From Nvidia docs: Cloth — NVIDIA PhysX SDK Documentation

Cloth can be simulated on a CUDA or DirectCompute enabled GPU, by setting one of the corresponding flags

Unfortunately I did not find more information about the implementation of the Nvidia PhysX bundled in Unity.

So I will assume (for 3D objects) if you have an Nvidia card it will use the GPU to calculate cloths and if you have an AMD card it will be done on the CPU.

But I could be wrong because Compute Shader are programs that run on the graphics card.

Source: docs.unity3d.com/Manual/class-ComputeShader.html

Compute shaders are programs that run on the graphics card, outside of the normal rendering pipeline. They can be used for massively parallel GPGPU algorithms, or to accelerate parts of game rendering. In order to efficiently use them, an in-depth knowledge of GPU architectures and parallel algorithms is often needed; as well as knowledge of DirectCompute, OpenGL Compute, CUDA, or OpenCL.