All Projects → voxell-tech → GPUClothSimulationInUnity

voxell-tech / GPUClothSimulationInUnity

Licence: GPL-3.0 License
Trying to replicate what this legend did: https://youtu.be/kCGHXlLR3l8

Programming Languages

C#
18002 projects
HLSL
714 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to GPUClothSimulationInUnity

csb
A cloth and soft body simulation library, using position based dynamics.
Stars: ✭ 29 (-72.9%)
Mutual labels:  cloth, position-based-dynamics
ComputeShaderFlocking
3D Flocking in Unity with the Compute Shader
Stars: ✭ 19 (-82.24%)
Mutual labels:  compute-shader, compute-shaders
unity-cloth-simulation
A mass-spring-damper based real-time cloth simulation I wrote for a class project.
Stars: ✭ 42 (-60.75%)
Mutual labels:  cloth, cloth-simulation
aer-engine
♒ An OpenGL 4.3 / C++ 11 rendering engine oriented towards animation.
Stars: ✭ 26 (-75.7%)
Mutual labels:  gpu-computing
gpu-cluster-config
How to Configure a GPU Cluster Running Ubuntu Linux
Stars: ✭ 45 (-57.94%)
Mutual labels:  gpu-computing
tinker9
Tinker9: Next Generation of Tinker with GPU Support
Stars: ✭ 31 (-71.03%)
Mutual labels:  gpu-computing
GOSH
An ultra-fast, GPU-based large graph embedding algorithm utilizing a novel coarsening algorithm requiring not more than a single GPU.
Stars: ✭ 12 (-88.79%)
Mutual labels:  gpu-computing
compute-shader-101
Sample code for compute shader 101 training
Stars: ✭ 323 (+201.87%)
Mutual labels:  gpu-computing
HeCBench
software.intel.com/content/www/us/en/develop/articles/repo-evaluating-performance-productivity-oneapi.html
Stars: ✭ 85 (-20.56%)
Mutual labels:  gpu-computing
ICON
ICON: Implicit Clothed humans Obtained from Normals (CVPR 2022)
Stars: ✭ 641 (+499.07%)
Mutual labels:  cloth-simulation
sph opengl
SPH simulation in OpenGL compute shader.
Stars: ✭ 57 (-46.73%)
Mutual labels:  compute-shader
kompute
General purpose GPU compute framework built on Vulkan to support 1000s of cross vendor graphics cards (AMD, Qualcomm, NVIDIA & friends). Blazing fast, mobile-enabled, asynchronous and optimized for advanced GPU data processing usecases. Backed by the Linux Foundation.
Stars: ✭ 872 (+714.95%)
Mutual labels:  gpu-computing
OpenPH
Parallel reduction of boundary matrices for Persistent Homology with CUDA
Stars: ✭ 14 (-86.92%)
Mutual labels:  gpu-computing
Etaler
A flexable HTM (Hierarchical Temporal Memory) framework with full GPU support.
Stars: ✭ 79 (-26.17%)
Mutual labels:  gpu-computing
GooFit
Code repository for the massively-parallel framework for maximum-likelihood fits, implemented in CUDA/OpenMP
Stars: ✭ 112 (+4.67%)
Mutual labels:  gpu-computing
ShaderBoiler
Aimed to eliminate preprocessor hell in shaders and kernels.
Stars: ✭ 30 (-71.96%)
Mutual labels:  compute-shader
Crystal-Caustics
💎 Approximated crystal caustics effect in Unity.
Stars: ✭ 60 (-43.93%)
Mutual labels:  compute-shader
OceanFFT
OpenGL Demo: Simulating Ocean Waves with FFT
Stars: ✭ 60 (-43.93%)
Mutual labels:  compute-shader
taichi pt
progressive path tracer written in taichi
Stars: ✭ 20 (-81.31%)
Mutual labels:  gpu-computing
GPU-Cloth-Simulation
GPU Mass-Spring Simulation Cloth in Unity
Stars: ✭ 133 (+24.3%)
Mutual labels:  cloth-simulation

GPU Cloth Simulation For Real-time Application

This repository is still currently under development, so everything is still in testing mode. A lot of things will break, download at your own risk :/

Disclaimer: This project is in a paused state so there won't be more updates. In the future, if there are any changes to this project, I will post an issue update on this repository. Stay tune!

My goal is to replicate what this legend did: https://youtu.be/kCGHXlLR3l8 (A smooth and interactive cloth simulation)

Currently, my cloth simulation uses Postion Based Dynamics and supports:

  • Distance Constraint
  • Bending Constraint
  • Point Triangle Distance Constraint (Self Collision)
  • Aerodynamics (Wind Effect)

Features comming soon:

  • Vivace Gauss Seidel Method for optimization on GPU (random graph coloring)
  • Primitive Shape Collision (Sphere, Box and Capsule)

Check out my YouTube Playlist where I record my journey on how I approach this problem!

Support me on Patreon so that I can allocate more time to work on this project!

How to use?

*Note: The GPU version is not fully developed yet, this tutorial section will not work for the GPU version.

  1. Create a mesh in Blender that you want to simulate.
  2. Use my custom Blender Addon - Blender Mesh to JSON to transform your mesh into PBD form and export it into your Unity's StreamingAssets folder.
  3. Create an empty GameObject in Unity.
  4. Drag and drop CPUClothSimulation.cs or GPUClothSimulation.cs script onto the GameObject. (Check Cloth Configurations for more cloth parameters' information.)
  5. Select the correct JSON file that the Blender Cloth Exporter Tool exports using the button - Select JSON File.
  6. Press the button - Load Data from JSON.
  7. Put in your Front Material and Back Material.
  8. Press Build Mesh to build the mesh that you have modeled in Blender.
  9. Press Create Back Side to build the other side of the mesh.
  10. Press Apply Materials to apply materials on both sides.

Cloth Configurations

These are the similar parameters in both CPU and GPU Cloth Simulation:

Materials

This determines the front material and back material for the cloth.

ClothSimParam

Tweak these parameters to change the behaviour for the cloth.

  1. Gravity: Constant acceleration.
  2. Compression Stiffness: Coefficient for distance constraint when 2 particles are too close together.
  3. Stretch Stiffness: Coefficient for distance constraint when 2 particles are too far away.
  4. Bending Stiffness: Coefficient for bending constraint when 2 neighbor triangles are not at their rest angle.
  5. Thickness: Cloth thickness for all collisions.
  6. Damping: Multiplier of velocity for every simulation to reduce velocity (as air resistance).

Simulation

Tweak these parameters to balance between accuracy and performance.

  1. Iteration Steps: Number of iterations to solve constraints for every simulation.
  2. Delta Time Step: Time pass between 2 simulations.
  3. Start Simulation On Play: Choose if you want to start the simulation once you enter play mode.

License

This project is under the GNU Public License, Version 3.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].