Terrain displacement - what am I doing wrong?

Started by Elegy, January 30, 2009, 03:04:27 PM

Previous topic - Next topic

Elegy

How do I get this raised patch to drop down in a more random fashion? At the moment, it's so uniform. I've tried plugging in a power fractal set to lateral only displacement into the child node of the main surface layer but absolutely nothing happens. I've tried plugging it into the displacement layer and nothing happens yet again. What am I doing wrong?

Kevin F

feed the compute normal into the power fractal. When you select lateral only in displacement, it does tell you that it it requires a compute normal.

Elegy

#2
Thanks for the advice but again, absolutely nothing is happening. The raised layer drops off perfectly evenly just as before.

Knowing me, I've made a silly mistake somewhere and am missing out something glaringly obvious but I'm not sure. I've only started really playing with TG2 recently.

Kevin F

Don't really know what your trying to achieve here but is this what you want?
I've disabled the distance shader as I don't know what it's doing.
All I've done really is generate the heightfield after the mods have been made. (generate now button, which can be switched auto generate).
Why are you using a heightfield anyway? just add a powerfractal terrain in the terrain tab and use the resulting procedural terrain.
Hope this helps.

Elegy

Well what I'm eventually trying to do is get something like this: http://forums.planetside.co.uk/index.php?topic=753.0

Basically, I want to create realistic thick snow. The distance shader is there so I can easily and quickly check the fall off for the snow. Ideally once I've understood everything and got what I need, I'll generate a power fractal terrain and stick the snow layer on with max-slope limits.

Thanks for the help though. I didn't realise the compute normal doesn't require an input. I'll continue playing around but it is getting frustrating since nothing I'm doing seems to make the snow drop off more unevenly.

Tangled-Universe

You mean something like this?

http://forums.planetside.co.uk/index.php?topic=5632.0

You don't need a distanceshader and that also causes the problem I think because the masking can be "too bright".
The distance shader is convenient for masking purposes as you try to do now, but in my own experience it is not really suitable for testing intersect underlying features.

Martin

Elegy

Oh I see, I'll try changing some settings. Thanks for the advice. I'm curious though, what I'm trying to do specifically is this:

1. Get a certain patch of snow (in this case, just a circle).
2. Raise that patch of snow by an arbitrary amount (ie depth).
3. Add some lateral displacement along the edges of that raised patch to simulate falling.

I'd have thought this would be possible regardless of the masking used? Even if the fall off was a 90 degree drop, I thought you could still add lateral displacement to it (like you would to the edge of a canyon say) to make it more scraggly and random? Isn't there a way of doing this regardless of the shape of the masking?

Tangled-Universe

What you want to do sounds quite logical, though I've never tried it myself.

You should keep in mind that although you have a vertical layer of snow you won't need lateral displacement-settings.
On vertical slopes the normal is pointing horizontally already (so in a lateral sense for the eyes). If you displace along the normal using a redirect shader on the x- and z-axis it should work. You may need a compute normal anyway to offer the layer an accurate input of the normals. Be careful with the patch-size, don't increase it too much (loss of accuracy) and don't decrease too much either (increase in rendertimes).
Like I said, I have never tried this before myself.

Martin

Elegy

Sorry for the constant stream of questions but how do I use the redirect shader?

Tangled-Universe

Quote from: Elegy on February 02, 2009, 05:25:49 AM
Sorry for the constant stream of questions but how do I use the redirect shader?

That's no problem at all. Just keep asking, that's what we're here for ;) and I always like to help.

In your case you would have to connect the redirect shader as a childlayer to your snow-surfacelayer.
The redirect shader has 4 input ports. The 2nd 3rd and 4th are for the x-, y- and z-axis respectively.
You can displace features along each axis seperately by connecting a powerfractal to the input port of the redirect shader.
In your case this would be the x- and z-axes. You can connect the same powerfractal to both ports of course.
Stupid to say, but don't forget to enable displacement in the displacement tab of the powerfractal.

This is how the redirectshader works in general. As I said before I don't know how this will behave on surfaces with intersect underlying features being enabled.
Please let me know.

Martin

Elegy

Thanks again. I'm getting some results now but now I'm faced with a new problem. There seem to be strange black markings on the snow which I'm gathering are caused by distortions of some kind (see picture attached, and the node clip file).

I'm going to try limiting the redirect shader to operate only up until 99% of the height of the snow, which should hopefully remove the problem. I just need to find out how to do this and I'll be set.

Intersect Underlying isn't enabled by the way, not for this test. I've just upped the displacement offset on one of the child surface layers to simulate the depth.

Tangled-Universe

I'll take a look at it tonight when I'm back from work etc.
The reason there isn't color is probably because you're using an offset.
Using intersect underlying in the proper way will avoid this.
What is the patch size of the compute normal/terrain?
You might lower it to increase the accuracy.