Jump to content

Simulating hydraulic erosion


Recommended Posts

Hi, I'm extremely new to Houdini, but have been in Maya/Python/C#/HLSL for about a decade. So far, I'm really impressed with houdini, but it feels like when I was learning Maya years ago: there's so much to learn, a dozen ways to do anything, some of which are the wrong way and you need to just 'know' the right way.

What I'm trying to do is simulate erosion on a terrain surface. Procedurally, something like this:

Create a plane.

Deform with noise or combination of noises and other math to get a starting shape

Pick a point at random on the surface, generate a random velocity and step it forward.

At each step, evaluate the new direction to move based on gravity, surface slope, current velocity.

Also at each step, accumulate a 'sediment' amount, which will be removed from the height at that point and carried on the particle.

Remove some velocity at each step for 'friction'.

Once the particle has reached zero or near-zero velocity, stop it, and deposit the accumulated 'sediment' there, raising the terrain height at that point.

Repeat many, many times.

At the end of it, I want a texture I can bake out in 0-1 UV-space that represents the eroded height on the plane, as well as component maps from the erosion (one map colored at each point that sediment was removed, sometimes known as a 'flow map', and one map that shows each point where sediment was deposited sometimes known as a 'deposition map').

What's my best plan of attack on this? I've run through a couple of tutorials on wet map generation, and it seems like using particles to transfer and accumulate properties might be a good approach, as long as the particles didn't interact with eachother? I started to read through the hou documentation for python and muck around with a python node, but everything seemed to say that was too slow. Or do I want to use VEX?

Any help, suggestions or thoughts would be welcome.

Link to comment
Share on other sites

Vex is way faster then python, but it has some limitations.

 

A good thing to start with is to get a good understanding of the foreach node in sops or the Solver node in sops.

Both are able to operate on the previous iteration.

 

I don't think i'd go for particles in this case. transferring data to neighboring points might also provide the solution you are looking for.

 

There is also a nodebased version of vex called vops, for some it is easier to use.

Link to comment
Share on other sites

I wouldn't wholly dismiss the particle approach, you can do your attribute transferring and such in a SOP Solver DOP, but use the simulation framework to get the collision detection and friction.

Both approaches can surely be made to work, so no worries there. Doing it all in SOPs would probably give most control in the end, but you would need to build a bit of the simming machinery yourself.

 

A fun and educational project in any case!

Edited by eetu
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...