GithubHelp home page GithubHelp logo

arieleo / hair-physics Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rhemsuda/hair-physics

0.0 1.0 0.0 77.62 MB

Realistic simulation of hair physics optimized for virtual reality (120FPS) using Unity Engine. Leverages spring physics and geometry/compute shaders to create hair strands that respond to movement.

ASP 20.67% C# 77.76% ShaderLab 0.94% HLSL 0.63%

hair-physics's Introduction

hair-physics

Realistic simulation of hair physics optimized for virtual reality (120FPS). Leverages spring physics and geometry/compute shaders to create hair strands that respond to movement.

How to run

  1. Open the Build folder
  2. Click on HairSimulator.exe

Description

This simulator was a huge learning experience for me and turned out to be a great research assignment along with its success. My goal was to create hair that could be interacted with on a strand by strand level. This project was to be optimized for VR as it was a side-project of the NDI EM-VR project.

Keeping up with the 90fps minimum requirement while using Unity game engine was the most difficult part of this project. Because Unity does a lot of things for you, it has a lot of overhead. Unity could only handle about 1000 springs before it became too laggy, and with their built in support for Rigid-bodies it was even slower. Thus, a custom physics body needed to be created along with custom spring physics.

I did some research into this and managed to put together a working strand of springs. The spring calculations were then done on the compute shader, and over 500,000 points could be computed at once without affecting performance. (Only restriction at this point was Unity’s professional mode for access to more GPU cores) I knew I was on the right track but still drawing these points using the Unity Gizmos was slowing down performance. The next step was to instead create a strand geometrically based on the outputs from the compute shader. So I passed in the compute buffer into a series of vertex, geometry, and pixel shaders to generate a ‘noodle’ hair around each of the points, each frame.

hair-physics's People

Contributors

rhemsuda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.