{"id":13730950,"url":"https://github.com/nixon-voxell/GPUClothSimulationInUnity","last_synced_at":"2025-05-08T03:32:47.696Z","repository":{"id":41206940,"uuid":"269079014","full_name":"nixon-voxell/GPUClothSimulationInUnity","owner":"nixon-voxell","description":"Trying to replicate what this legend did: https://youtu.be/kCGHXlLR3l8","archived":true,"fork":false,"pushed_at":"2022-10-17T05:51:56.000Z","size":210806,"stargazers_count":160,"open_issues_count":3,"forks_count":14,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-05-23T07:55:10.451Z","etag":null,"topics":["cloth","cloth-simulation","compute-shader","compute-shaders","gpu-accelerated-library","gpu-cloth-simulation","gpu-computing","pbd","position-based-dynamics"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nixon-voxell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-03T12:13:08.000Z","updated_at":"2024-05-22T22:58:49.000Z","dependencies_parsed_at":"2023-01-20T00:17:01.739Z","dependency_job_id":null,"html_url":"https://github.com/nixon-voxell/GPUClothSimulationInUnity","commit_stats":null,"previous_names":["nixon-voxell/gpuclothsimulationinunity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixon-voxell%2FGPUClothSimulationInUnity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixon-voxell%2FGPUClothSimulationInUnity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixon-voxell%2FGPUClothSimulationInUnity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nixon-voxell%2FGPUClothSimulationInUnity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nixon-voxell","download_url":"https://codeload.github.com/nixon-voxell/GPUClothSimulationInUnity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224587023,"owners_count":17335952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloth","cloth-simulation","compute-shader","compute-shaders","gpu-accelerated-library","gpu-cloth-simulation","gpu-computing","pbd","position-based-dynamics"],"created_at":"2024-08-03T02:01:21.900Z","updated_at":"2024-11-14T21:32:00.798Z","avatar_url":"https://github.com/nixon-voxell.png","language":"C#","readme":"GPU Cloth Simulation For Real-time Application\n---\n\nThis repository is still currently under development, so everything is still in testing mode. A lot of things will break, download at your own risk :/\n\n\u003e *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!*\n\nMy goal is to replicate what this legend did: https://youtu.be/kCGHXlLR3l8 (A smooth and interactive cloth simulation)\n\nCurrently, my cloth simulation uses Postion Based Dynamics and supports:\n- Distance Constraint\n- Bending Constraint\n- Point Triangle Distance Constraint (Self Collision)\n- Aerodynamics (Wind Effect)\n\nFeatures comming soon:\n- Vivace Gauss Seidel Method for optimization on GPU (random graph coloring)\n- Primitive Shape Collision (Sphere, Box and Capsule)\n\nCheck out my [YouTube Playlist](https://www.youtube.com/playlist?list=PLlnBGPe6GFdP8So9oS0YVoVjqkmJoREI_) where I record my journey on how I approach this problem!\n\nSupport me on [Patreon](https://www.patreon.com/voxelltech) so that I can allocate more time to work on this project!\n\n\nHow to use?\n---\n*Note: The GPU version is not fully developed yet, this tutorial section will not work for the GPU version.\n1. Create a mesh in [Blender](https://blender.org) that you want to simulate.\n2. Use my custom Blender Addon - [Blender Mesh to JSON](https://github.com/voxell-tech/BlenderMeshToJSON) to transform your mesh into PBD form and export it into your Unity's `StreamingAssets` folder.\n3. Create an empty GameObject in Unity.\n4. Drag and drop `CPUClothSimulation.cs` or `GPUClothSimulation.cs` script onto the GameObject. (Check [Cloth Configurations](#cloth-configurations) for more cloth parameters' information.)\n5. Select the correct JSON file that the Blender Cloth Exporter Tool exports using the button - `Select JSON File`.\n6. Press the button - `Load Data from JSON`.\n7. Put in your `Front Material` and `Back Material`.\n8. Press `Build Mesh` to build the mesh that you have modeled in Blender.\n9. Press `Create Back Side` to build the other side of the mesh.\n10. Press `Apply Materials` to apply materials on both sides.\n\n\nCloth Configurations\n---\nThese are the similar parameters in both CPU and GPU Cloth Simulation:\n\n![Materials](./Pictures/materials.PNG)\n\nThis determines the front material and back material for the cloth.\n\n![ClothSimParam](./Pictures/cloth_simulation_parameters.PNG)\n\nTweak these parameters to change the behaviour for the cloth.\n1. Gravity: Constant acceleration.\n2. Compression Stiffness: Coefficient for distance constraint when 2 particles are too close together.\n3. Stretch Stiffness: Coefficient for distance constraint when 2 particles are too far away.\n4. Bending Stiffness: Coefficient for bending constraint when 2 neighbor triangles are not at their rest angle.\n5. Thickness: Cloth thickness for all collisions.\n6. Damping: Multiplier of velocity for every simulation to reduce velocity (as air resistance).\n\n![Simulation](./Pictures/simulation.PNG)\n\nTweak these parameters to balance between accuracy and performance.\n1. Iteration Steps: Number of iterations to solve constraints for every simulation.\n2. Delta Time Step: Time pass between 2 simulations.\n3. Start Simulation On Play: Choose if you want to start the simulation once you enter play mode.\n\nLicense\n---\nThis project is under MIT License.\n","funding_links":["https://www.patreon.com/voxelltech"],"categories":["C#"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixon-voxell%2FGPUClothSimulationInUnity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnixon-voxell%2FGPUClothSimulationInUnity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnixon-voxell%2FGPUClothSimulationInUnity/lists"}