Editor River Extension

I’ve been working on something for a personal project and am wondering if anyone would have any interest in this as a possible asset. Its a river creation extension for unity default terrain. It has two modes, painting water (in the video) and creating from a spline path (not shown). I’ve started to write 2 flow shaders, one toony (shown), and one realistic like unity’s built in water.

I’m still working on the flow mapping, but the concept is there.

5 Likes

I would be interested. It would great to use with some of the terrain modifying assets. I just saw this now, so hope you haven’t given up. :slight_smile:

I know quite a few folks who might like this.

How do you get the water texture to move around the path? I’ve seen this a few times and can’t figure out how people are doing it.

Well, its a bit complicted. There are a couple of different methods. One, that many people use is to just make the mesh’s uvs tile so the water just follows the mesh. Its a good method, but it didn’t really give me the results that I wanted.

The method I used is a modified flowmap. Basically, the “river” is a grid of cells and each cell has a flow direction. The flow directions get averaged together with their neighbors so the flow is smooth. I make a single mesh from all of the cells and the flow direction is stored in vertex color. Then I animate the UVs based on the direction stored in the vertex colors. This method has a drawback in that the seams can be visible if your textures tile harshly because each cell can flow at a different rate of speed/direction. I get around this by using 3 textures. A base surface texture, and two flow textures, and then adjusting the “mix” of the textures so the seams are not visible.

here is a visualization of the flow direction grid. The arrows indicate the flow at any given point.
2171491--143700--FlowDirection.PNG

And this is an example of the same region in game, with test waterfall particles (i apologize for the quality, i recorded it smaller so it would upload quicker):

https://www.youtube.com/watch?v=nAQMzFaIq5M

3 Likes

I haven’t given up. I’m working out a few finalizations, and adding a physics script so objects in the water follow the flow of the river. Currently I’m working on automatic smoothing of terrain. As you can see in the images above, the water seams are visible where I’m smoothing the terrain, and I’m trying to work that out so people don’t have to manually smooth the terrain border after painting the river.

1 Like

Before using Unity, we spent some time with T3d. This was several years ago. They had a great river system, with physics as well. You could fall into the water and get washed off the edge of the world, something every one of our testers tried. :slight_smile:

They used splines to create the rivers. Their textures were nice as well. I will admit that is the one thing I miss…along with the ability to place vegetation based on texture.

I am definitely interested in this.

i’l follow this, your approach sounds interesting…
your vectors look wrong, speaking of flows…
altough speed vectors could help us making good shaders with turbulence effects

How do you mean?

flow speed vectors depend on the flow deflection/slope /obstacle…and bernoulli’s laws
but you are on the good way

I think the vectors are only made for direction atm, so they are not really flow speed vectors at all.
Would be a nice addition though : )

hope it will lead somewhere, i do miss a freshwater tool

Correct. I’m only handling flow direction. Things like eddies and current are out of scope. I’ll need a different flowmap shader for that or the texture tiling would be terrible when things move with large speed differences. I will look into it, because it would be pretty cool.

You could use particle effects to resemble eddies and splashes.

After a brief 100 paragon level diablo 3 vacation, I finally got around to adding buoyancy and physics. Here’s a video of all of the current features. I just need to figure out editor undo stuff now.

6 Likes

Looks great!! :slight_smile:

Looking pretty good keep up the good work.

Nice work! Any idea what price you would put on this?

Awesome

No higher than $25.

1 Like

And a webplayer showing the mostly finished product.

https://dl.dropboxusercontent.com/s/aw9y39y5xiw1toz/WebPlayer.html

3 Likes