Giter Site home page Giter Site logo

snow's Introduction

Snow Simulation

This is an implementation of "A Material Point Method for Snow Simulation" (Stomakhin et al., 2013). There is a 2D version for OpenGL and a 3D version for Houdini.

Demo video is on YouTube:

Demo video

2D Simulator

You may need to modify the project build settings for it to work. Build dependencies:

Prebuilt versions of these libraries are included for debian based systems (x86-64).

Controls

  • Click: adds a point for a snow shape
  • Enter: finishes previous snow shape and starts a new one
  • C: allows you to create a circle shape (first click sets origin, second click sets radius)
  • F12: converts snow shapes to particles and starts the simulation
  • ESC: stops the simulation and removes all snow

3D Simulator

A Houdini digital asset, ramshorn_fx_mpm_snow_otl_stable.otl has been created for simulation and rendering setup. You'll need to install this otl as well as the snow solver node plugin. Source code is in SIM_SnowSolver.c. Run setup.sh to build the plugin (Note: you may need to modify setup.sh to point to your houdini installation directory). See tutorial.txt and tutorial.hipnc for a basic setup.

snow's People

Contributors

azmisov avatar jmoborn avatar melissaedge avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

snow's Issues

3D version crash for Houdini on macOS Big Sur

I just built the Houndini 14.x plugin on my macOS Big Sur, I fixed a lot of building error with some ugly hacks for C++ headers.

Finally, I built the plugin, but Houdini just crash after importing the otl file.

I just can't do anything to it, just head to here for help, if the author of this plugin can take time to build the plugin with the newest Houdini and fixed some error for us?

I searched GitHub for MPM snow simulation implementations, but this project is the best solution. So It would be awesome to run the plugin and understand the code.

Any help?

BTW, This is the error while installing the plugin without building SIM_SnowSolver.c in the latest Houdini 18. I think this is the problem of otl file and the latest Houdini.

Screen Shot 2021-07-17 at 9 06 07 PM

3D version snow tend to fall apart ?

Hi, guys
This solver is very inspiring.
But 3D houdini version snow always tend to fall apart like sand.
It can not produce chunky parts like original paper or 2d version.

What's the "Houdini install directiory" on MacOSX?

Hi, I read tutorial.txt in SnowHoudini and I don't know how to install SIM_SnowSolver.c
My OS is : OS X EI Capitan 10.11.6

And I found some possible directories:

"/Applications/Houdini 15.5.673" : Houdini can be opened from Houdini.app in this directory.

"/Library/Frameworks/Houdini.framework" : I see folders named Headers, Libraries etc. here. But *.h files are actually at /opt/local/include

So, what directory should I use to install SIM_SnowSolver.c?

Built plugin crashes 13.0.582

I can build the Houdini plugin without any problems (lots of warnings, but no errors), but when I try to run, it crashes. Houdini immediately crashes when I try to load the mpm_setup.hipnc, but will load mpm.hipnc; the crash happens when I play, to simulate.

I tried setting HOUDINI_DSO_ERROR to 5, and I didn't see any errors related to this node, but it's still crashing for some reason.

Any ideas? I'm on Linux Mint 17, btw. What are you building under?

Thanks

Crash report from chris; Houdini FX Version 13.0.582 [linux-x86_64-gcc4.6]
Traceback from Wed Nov 12 21:41:04 2014
Caught signal 11

AP_Interface::coreDumpChaser(UTsignalHandlerArg) <libHoudiniUI.so>
AP_Interface::si_CrashHandler::chaser(UTsignalHandlerArg) <libHoudiniUI.so>
signalCallback(UTsignalHandlerArg) <libHoudiniUT.so>
UT_Signal::UT_ComboSignalHandler::operator()(int, siginfo*, void*) const <libHoudiniUT.so>
UT_Signal::processSignal(int, siginfo*, void*) <libHoudiniUT.so>
killpg <libc.so.6>
SIM_SnowSolver::solveGasSubclass(SIM_Engine&, SIM_Object*, SIM_Time, SIM_Time) <SIM_SnowSolver.so>
GAS_SubSolver::solveGas(SIM_Engine&, SIM_Object*, SIM_Time, SIM_Time) <libHoudiniSIM.so>
GAS_SubSolver::solveObjectsSubclass(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
SIM_Solver::solveObjects(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
GAS_SubStep::solveObjectsSubclass(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
SIM_Solver::solveObjects(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
SIM_SolverMulti::solveObjectsSubclass(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
SIM_Solver::solveObjects(SIM_Engine&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_ObjectArray&, SIM_Time const&) <libHoudiniSIM.so>
SIM_Engine::doSimulationStepForMetaObject(SIM_MetaObject&, SIM_Time const&) <libHoudiniSIM.so>
SIM_Engine::doSimulationStep(bool) <libHoudiniSIM.so>
SIM_Engine::setSimulationTime(SIM_Time const&, bool, bool, bool) <libHoudiniSIM.so>
DOP_Parent::setDOPTimeSubclass(SIM_Time const&) <libHoudiniOP1.so>
OBJ_DopNet::setDOPTimeSubclass(SIM_Time const&) <libHoudiniOP3.so>
DOP_Parent::setDOPTime(SIM_Time const&) <libHoudiniOP1.so>
JEDI_View::opuiUpdateNodeInfo(OH_NodeInfo*) <libHoudiniAPPS3.so>
OH_OpHandler::opuiUpdateData() <libHoudiniUI.so>
OP3D_View::doUpdate() <libHoudiniAPPS3.so>
JEDI_View::opuiUpdateData() <libHoudiniAPPS3.so>
OH_OpHandler::trigger() <libHoudiniUI.so>
UI_Queue::processNextEvent() <libHoudiniUI.so>
UI_Queue::drain() <libHoudiniUI.so>
UI_Queue::eventLoop() <libHoudiniUI.so>
main <libHoudiniUI.so>
__libc_start_main <libc.so.6>
_start <houdinifx-bin>

Need some basic math explanation about the code

Hi, Your code is easy to understand in engineering point of view, it's well coded. And I almost went over all part of the 2d version, but there is one place I can not understand due to lack of some mathematics background (I think so):

Particle::energyDerivative() below

const Matrix2f Particle::energyDerivative(){
	//Adjust lame parameters to account for hardening
	float harden = exp(HARDENING*(1-def_plastic.determinant())),
		Je = svd_e.product();
	//This is the co-rotational term
	Matrix2f temp = 2*mu*(def_elastic - svd_w*svd_v.transpose())*def_elastic.transpose();
	//Add in the primary contour term
	temp.diag_sum(lambda*Je*(Je-1));
	//Add hardening and volume
	return volume * harden * temp;
}

I can not find anything about this derivative on the original paper, but I think this does what the equation (6) suppose to do in the original paper.

And I reviewed a lot of time between the paper and this method, but still can not understand why you calculate equation (6) in this way, can you give me some hints on why you did in this way?

Thank you very much for taking time for this issue.

P.S. Of course I skipped all implicit solver parts which are a lot more harder to understand by now :P
[*] Note: This is the first time I encounter to calculate partial derivative in computer language, it's so interesting to figure out how to.

How you generate the initial snow (Particles)

I am trying to generate the initial snow (with particles) in Blender, but the result is bad, so I wonder what algorithm you use to generate the snow particles in Houdini? I want the result from your video.

Screen Shot 2021-08-11 at 5 03 07 PM

Here is my result in Blender:

Screen Shot 2021-08-11 at 5 38 46 PM

Do you have any suggestions? Thank you for taking your time to read my issue.

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.