All Projects → JUSTIVE → GPU-Cloth-Simulation

JUSTIVE / GPU-Cloth-Simulation

Licence: MIT License
GPU Mass-Spring Simulation Cloth in Unity

Programming Languages

C#
18002 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to GPU-Cloth-Simulation

3d-core-raub
An extensible Node.js 3D core for desktop applications
Stars: ✭ 55 (-58.65%)
Mutual labels:  simulation
OpenGL MPMSnowSimulation2D
2D Implementation of Material Point Method for Snow Simulation
Stars: ✭ 26 (-80.45%)
Mutual labels:  simulation
ert
ERT—Ensemble based Reservoir Tool—is a tool to run ensemble based on reservoir models. ERT was originally devised as tool to do model updating (history matching) with the EnKF method, now the primary method for model updating is the Ensemble Smoother (ES).
Stars: ✭ 57 (-57.14%)
Mutual labels:  simulation
rwloadsim
RWP*Load Simulator - your tool for scripting, simulation and much more. Like having a bit of bash and SQL, a nip of C or Java, a dash of awk, a grain of sed plus drops of secret sauce in one single tool. See https://blogs.oracle.com/database/rwploadsim-oracle-db-performance-simluator for the announcement on the Oracle database blog.
Stars: ✭ 26 (-80.45%)
Mutual labels:  simulation
smart grasping sandbox
A public sandbox for Shadow's Smart Grasping System
Stars: ✭ 69 (-48.12%)
Mutual labels:  simulation
PooPyLab Project
An open source biological wastewater treatment simulation software...
Stars: ✭ 34 (-74.44%)
Mutual labels:  simulation
Robotics-Warehouse
A warehouse environment for robotics simulation in Unity.
Stars: ✭ 17 (-87.22%)
Mutual labels:  simulation
reina-model
Agent-based simulation model for COVID-19 spread in society and patient outcomes
Stars: ✭ 30 (-77.44%)
Mutual labels:  simulation
pluto-gps-sim
PLUTO-GPS-SIM generates a GPS baseband signal IQ data stream, which is then transmitted by the software-defined radio (SDR) platform ADALM-Pluto.
Stars: ✭ 74 (-44.36%)
Mutual labels:  simulation
GAMES103
notes and related materials for GAMES103
Stars: ✭ 21 (-84.21%)
Mutual labels:  simulation
ofxOilPaint
An oil painting simulation addon for openFrameworks
Stars: ✭ 45 (-66.17%)
Mutual labels:  simulation
siconos
Simulation framework for nonsmooth dynamical systems
Stars: ✭ 120 (-9.77%)
Mutual labels:  simulation
CuboidalDrift
A casual, fun, 3D indie game made with Unity
Stars: ✭ 13 (-90.23%)
Mutual labels:  simulation
hybridCentralSolvers
United collection of hybrid Central solvers - one-phase, two-phase and multicomponent versions
Stars: ✭ 42 (-68.42%)
Mutual labels:  simulation
Virtual-Robot-Challenge
How-to on simulating a robot with V-REP and controlling it with ROS
Stars: ✭ 83 (-37.59%)
Mutual labels:  simulation
femio
FEM I/O tool
Stars: ✭ 15 (-88.72%)
Mutual labels:  simulation
mosaic
Eclipse MOSAIC is a Multi-Domain and Multi-Scale Simulation Framework for Automated and Connected Mobility Scenarios.
Stars: ✭ 51 (-61.65%)
Mutual labels:  simulation
Lithography-Simulation
Github repository to share some insights about lithography simulation.
Stars: ✭ 27 (-79.7%)
Mutual labels:  simulation
COMOKIT-Model
A GAMA (http://gama-platform.org) model on the assessment and comparisons of intervention policies against the CoVid19 pandemics
Stars: ✭ 23 (-82.71%)
Mutual labels:  simulation
antares
Digital circuit learning platform
Stars: ✭ 15 (-88.72%)
Mutual labels:  simulation

GPU Cloth Simulation

cloth with force visualization cloth with diffuse render
titleimage titleimage

This repository is about GPU based Mass-Spring Simuation in Unity. Based upon Compute Shader, calculates physics in parallel.

This project is a sub project of ReclothSimulation-master, a private repository, some of features are removed in this repo.

  • Mass Spring System Cloth
  • Inter Object Collision-Response
  • Self Collision-Response
  • Dynamic Collider Generation

Currently Confirmed working on following platforms:

  • Unity Engine version 5.6.1f2 ~ 2018.2.0b10
  • Windows(OpenGL Core)
  • Android(OpenGL Core)

How to use

Create a empty GameObject on hierarchy panel and append ClothSimuation and ClothRenderer scripts on it. Since this simulation calculates with its own system, you'll need special materials and dedicated shaders for rendering. There are two example materials(Face Normal Rendering, Diffuse Rendering).

Attributes

Cloth Simulation

Compute Shaders
attributes description
NodeUpdateComputeShader a compute shader which updates forces, positions, velocities, etc.
TriCollisionResponseComputeShader a compute shader which calculates collision with floor
NormalComputeShader a compute shader which calculates all face normals of the cloth model
Attribute of Cloth
attributes description
VertexColumn numbers of nodes in a Column
VertexRow numbers of nodes in a Row
ClothSize Size of cloth object in Unity world scale
ClothMass Mass of cloth object
Looper amount of looping compute shaders per frame, larger number for precise, slower simulation
Constant for Cloth
attributes description
SpringK spring force from Hooke's Law
Damping damping coefficient for cloth simulation
External Force external forces such as wind, water etc. since it is public member, you can pass from external scripts

Cloth Renderer

attributes description
Mat a material for Cloth Object.
LightGameObject a light-type Gameobject, especially for diffuse rendering. Directional light recommended.
MeshTopology which element to draw Cloth: currently triangles supported, but you can write your own shader for others.

Caveats

Since the simulation is not pretty stable, certain values for the clothSimulation scripts are recommended:

recommended parameters of Attribute of Cloth

attributes values
vertexColumn 8 ~ 64
vertexRow 8 ~ 64
Looper 20 ~ 500, larger values for more stable simulation

recommended parameters of Constant of Cloth

attributes values
SpringK 10000~ 50000, but for a non-elastic behaving typical cloth, values around 35000 is recommeded
Damping 100~200, can be vary by SpringK

recommended parameters of Cloth Renderer

attributes values
Mat requires custom shaders, look at the normalShader and DifwithShadows in shader->render directory.
LightGameObject Directional Light is highly recommended
MeshTopology You can use all of MeshTopology types, but you should write your own shaders. The embedded two shaders use MeshTopology.Triangles.

Performance

Since this project uses Unity engine and GPU computing, it runs on most platforms, even mobile in real-time. But the performance heavily depends on the size of the model's triangles which you want to make it collided

Contact

You can contact Minsang Kim via e-mail([email protected]).

License

This Project is licensed under the MIT License

Copyright (c) 2018 Minsang Kim

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Acknowledge

This work was supported by the National Research Foundation of Korea(NRF) grant funded by the Korea government(Ministry of Science, ICT & Future Planning) (No. 2017R1A2B1005207).

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].