Skip to content

Furkath/DL_Framework-for-PBS-Cloth-Simulation

Repository files navigation

Deep Learning Framework for Physics-based Cloth Simulation

Physics-embedded NN structure for machine learning application in Computer Graphics cloth animation. Direct PBS features are encoded into the model, with functional extensions to integrate extra visual improvements.

Paper available at:

Table of Contents

Demo

Blown-up airbag

This NN Framework

demo1ng demo1np

PBS result

demo2ng demo2np

Hanging cloth with wind

This NN Framework

demo3ng demo3np

PBS result

demo4ng demo4np

Fallen cloth folded on ball

This NN Framework

demo5ng demo5np

PBS result

demo6ng demo6np

Cloth Neural Network

s1

Framework Structure

s2

Features

  • Physics-based cloth simulation: mass-spring system

  • Comprehensive force interaction

    Internal: elastic, damping, and bending

    External: gravity, pressure, friction, and air drag

  • Collision handling and boundary constraints

  • Deep Learning application for specific PDE system

  • CNN representation of spatial correlations

  • Conditional programming with GPU-parallelized boolean tensor

  • ML acceleration for real-time animation and rendering

  • Integrable framework for prevailing AI techniques on folds and wrinkle enhancement

Installation

Requirements

  • python $\approx$ 3.10

  • taichi $\approx$ 1.4

  • pytorch $\approx$ 2.1.1

Platforms

Cuda or CPU backends for simulation and learning; Vulkan available for rendering

Usage

PBS

Blown-up airbag

python cloth_press.py

Hanging cloth with wind

python cloth_hang.py

Fallen cloth folded on ball

python cloth_ball.py

Pre-Process

Training-set preparation

python groundTruth_press.py [DATA_SAVE_PATH]

NN

Train

python nn_cloth_train.py [training_data_set.npz]  [MODEL_SAVE_PATH]  [starting_model.pt](Optional)

Infer

python nn_cloth_infer.py [initial_state.npz]  [evaluated_model.pt]  [infered_result_name.npz]

Check

python nn_cloth_check.py [checked_data.npz]

Post-Process

Plot loss curves

python plotloss.py [loss_log]

View model parameters

python viewmodel.py [model.pt]

Rendering for NN predictions

python cloth_view.py [NN_result.npz]

Comparison between PBS and DL

python compare.py [ground_truth.npz] [NN_result.npz]

-some trained models are provided

-logs are provided to check loss track and time consumption

To-do with the Framework

  • Integrate with additional forces by PBS (e.g., turbulent flow).
  • Add self-collision detection and response: Bounding Volume Hierarchy & vertex-triangle, edge-edge detection.
  • Incorporate sub-NN to refine cloth wrinkles under low-reso mesh.

About

A Physics-embedded deep Learning framework for PBS cloth animation (keep updating new features!)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages