Another river-creating question

Started by mrwho, August 25, 2008, 01:46:23 PM

Previous topic - Next topic

mrwho

How do I get the riverbed and terrain to appear? I've attached the TGD and image mask. thanks!

Tangled-Universe

Hi Ryan,

I hope you didn't spend too much time solving this...
The reason the terrain doesn't show up is because the camera is placed almost completely outside the heighthfield, see picture.
Simply move the camera into the heighthfield to get your terrain or increase the size of the heighthfield so you won't have to re-adjust the position of the maskprojection-camera.

If you simply move the camera into the heighthfield, then calculate the difference in coordinates and add/subtract these as well for your maskprojection-camera so the relation won't be lost.

Martin

mrwho

weird.... before I made the original post, I was able to get terrain just fine. The camera was pointing where I wanted it. Now I can't even open the file or the backup of the the TGD..........

Tangled-Universe

Well, this is what showed up when opening the tgd you posted here :)

But if your terrain showed up before posting this, what was the problem then?

mrwho

I wanted both the terrain and riverbed to show at the same time, I could only get the riverbed if I used the mask. Since I had to invert it to get the displacement going down, I couldn't use the same mask to get the rest of the terrain to appear normally where the river didn't exist. I tried using another image mask, but it didn't work.

mrwho

weird, I can open the TGD file now.... Anyways, here's 2 screenshots (rez reduced to get them both on here) of what I get when I have the image mask enabled, then disabled

Tangled-Universe

You mean this?


mrwho

#7
:glares at his computer:

I see terrain in your screenshot, but when I open the file up all I can see is the riverbed. I can't ever recall having these kinds of issues with terrains before

Tangled-Universe

Sorry to ask this stupid question but you didn't forgot to press "generate terrain" ?

mrwho

#9
no, I pressed that little button  :D

Although, should I have to? I wanted to used the Fractal Terrain, not the heightfield

Tangled-Universe

Aside from your peculiar setup I don't seem to have problems with your file...strange...

The peculiar thing is that your mask is b&w and that the river should appear where the white of the mask is. Yes, that works, but you're using a positive value for displacement which is the opposite of what you should use normally. Somehow this whole thing/principle seems to be inverted, but it works...weird ;D

mrwho

yeah, don't ask. I don't normally do things like that, but it didn't work right the other way. I should just try a different method for the river, any suggestions?

Oshyan

Are you using it as a Blend Shader? Blend Shader essentially acts like an alpha, so it will mask out your power fractal terrain so it only shows where the white (river) is. What you should probably do is just put the Image Map shader after the Power Fractal in the terrain network, before Compute Terrain, turn off Apply Color and turn on Apply Displacement, then adjust to negative displacement. That ought to work.

- Oshyan

bigben

The image map is outside the primary terrain. This is probably just because the terrain is positioned by lower left. Change it to "position centre" and the terrain will coincide with your image map, after you generate it...  ;)

Now for the river... back soon (it matches something I'm working on at the moment anyway)

bigben

#14
OK... here's one possible approach based on comments from Matt if my memory serves me correctly..

Normally I work with DEM data and place rivers where they exist in real life so that the terrain surface should be reasonably smooth where the river should be.

1: Create a duplicate terrain node and connect your terrain to an "adjust vertical" node. Set the adjust vertical node to a small negative number and feed the result into your water shader. This represents your "water table"

2: After the original terrain insert a displacement shader with a larger negative displacement than the adjust vertical value above.  Use the image map node as the displacement function. This creates your river bed, lowering the terrain below the lake object.

With fractal terrains it gets a bit trickier as it's much harder to create a realistic mask, and the surface of the river is invariably quite rough.  Further displacement of the terrain can also cause problems by lowerin other parts of the terrain below the water table.  There are of course other ways to do this.  If you have an even altitude drop along the river, a carefully positioned plane object would also serve as a useful river surface.