Planetside Software Forums

General => Terragen Discussion => Topic started by: N-drju on January 26, 2018, 04:42:16 AM

Title: Lateral displacement - I beg you...
Post by: N-drju on January 26, 2018, 04:42:16 AM
I can't seem to grasp the idea of lateral displacement, no matter how hard I try...

Let's say for example that I would like to displace and deform an otherwise featureless wall of that mesa right there on the picture. Not by using the traditional strata shader though. But by using a laterally displacing power fractal. Compute normal that is "required" for that option does nothing, no matter where I put it and what values I enter:

[attach=1]

How? >:(
Title: Re: Lateral displacement - I beg you...
Post by: luvsmuzik on January 26, 2018, 07:13:24 AM
I still suggest dissecting shared files.
You can try lateral displacement in a surface layer shader hooking a power fractal to the displacement input of same. Sometimes it works as a mask also. Many of the columnar or blockish type displacements use blue node scalar noise functions that direct the terrain .....
Title: Re: Lateral displacement - I beg you...
Post by: Dune on January 26, 2018, 07:14:38 AM
You need a compute terrain, or compute normal+ XYZ shader, of appropriate patch size. And after that, you can displace laterally.
Title: Re: Lateral displacement - I beg you...
Post by: cyphyr on January 26, 2018, 07:57:51 AM
The compute terrain, compute normal and/or XYZ shader goes BEFORE  the lateral displacement.
Try the attached. and note the effect of having the compute terrain, compute normal and/or XYZ shader working together and seperately.
Also note the more compute terrain and compute normals you have the slower the render will be. The XYZ shader seems to have the least impact on render times.
Title: Re: Lateral displacement - I beg you...
Post by: KlausK on January 26, 2018, 09:16:49 AM
Hey, I`ve got a more common (newbie-ish) approach to this, I think (less controllable in the end, for sure).
Lots of variations by changing the Power Fractal and the Fractal Warp.
CHeers, Klaus
Title: Re: Lateral displacement - I beg you...
Post by: bobbystahr on January 27, 2018, 12:16:03 PM
Cool stuff, thanks for the files guys..
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 02, 2018, 01:47:10 PM
Sorry to bring this topic back to the top again, but I am completely fed up with this lateral displacement nonsense!  >:( >:(

It seems no matter what I add and how I connect stuff, the terrain just won't displace laterally like even the Planetside's wiki shows!

I have no idea how to achieve this. If anyone is willing to provide a step-by-step, moron-level tutorial for me on how to make a chunk of land stick out horizontally out of another chunk of land, I am all ears...

Please help me. I am tired, severely upset and completely broken... How can such a dumb thing still elude my comprehension...

It seems all of your clipfiles and suggestions work by themselves. But they stop working the instant I try to transfer these solutions into actual projects...

[attach=1]
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 02, 2018, 01:50:57 PM
One more thing - whenever I have a setup that I believe should work, and I switch to "lateral only", a displacement just disappears and that's it.
Title: Re: Lateral displacement - I beg you...
Post by: bobbystahr on October 02, 2018, 02:23:49 PM
Quote from: N-drju on October 02, 2018, 01:50:57 PM
One more thing - whenever I have a setup that I believe should work, and I switch to "lateral only", a displacement just disappears and that's it.

Maybe upload your .tgd so we can have a look see...It maybe a really simple fix and the wizards have already done what they can without seeing the problem you're having.
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 02, 2018, 03:54:48 PM
Be my guest. I can give you this setup that I made a very long time ago and which has been used for that picture above. However, I cannot export it as a .tgd because it has no assets. It's just a landscape.

Just connect the whole damn thing to the default "compute terrain". I doubt you can fix it. This is a god damned lost cause... :-[
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 02, 2018, 04:47:12 PM
Bingo!

[attach=1]

This is exactly the way I want the displacement to behave! One step forward!

However, now I need to figure out how to put fractal displacements in place of SSS. Also, I don't know yet how I could mask these areas. For some reason, "smooth step" settings in the SSS does not seem to work in this setup... :-\
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 02, 2018, 05:14:26 PM
Damn! Needs refinement, but looks very promising!

[attach=1]

And it was so #&!*% simple!
Title: Re: Lateral displacement - I beg you...
Post by: Oshyan on October 02, 2018, 07:06:38 PM
Confusing, you can just save a .tgd the same as you can a clip file (.tgc). It doesn't need to have "assets". Can you explain what you mean by that and possibly where you got the info that you needed assets to save as .tgd?

As for your setup, I think the biggest part of your issue is that you are trying to add lateral displacement on a surface *before* the original displacement happens. You can't displace laterally if your lateral displacement comes first! You need the base shape *first*, then you displace laterally (after computing normals of course) off of the already-displaced surface. Does that make sense?

I have attached a working TGD.

- Oshyan
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 03, 2018, 02:36:06 AM
Morning Oshyan and thanks for chiming in.

Well, it's hard to tell now if it makes sense, considering that what I wanted was not precisely a lateral displacement after all! The image above is just "along normal" displacement that is added downstream from the compute terrain node... And this is exactly the displacement behavior that I wanted.

In other words, I wanted to have the displacement grow like that...

[attachimg=1]

Rather then that...

[attachimg=2]

Like most peaks and mountains appear once you add a PF.

My only concern now, is that when I get some populations onto this terrain, the populator will only read the terrain shapes that come before the compute terrain, rather than terrain section plus additional displacement... And of course, both items need to be taken into account...
__________________________________

EDIT: D'oh!!! Of course I can save a .tgd! My brain shut down due to emotional stress yesterday and I tried to gather the project rather than just upload a saved file..................
::)
Title: Re: Lateral displacement - I beg you...
Post by: Dune on October 03, 2018, 03:05:10 AM
Pull a line from the last node for the pop to sit on, and in case it doesn't work quite correctly, just add another compute terrain there, it will not slow stuff, as it's just between last node and pop.
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 03, 2018, 03:29:57 AM
Quote from: Dune on October 03, 2018, 03:05:10 AM
Pull a line from the last node for the pop to sit on, and in case it doesn't work quite correctly, just add another compute terrain there, it will not slow stuff, as it's just between last node and pop.

Thanks for that tip. Might be molto useful when it comes down to things.
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 03, 2018, 01:20:08 PM
Plugging the last terrain item into the "terrain shader" input is enough to have the populator reacting to both the computed terrain group and the displaceable section. The only disadvantage is that some of the objects are being populated underneath overhang terrain features and stuck in impossible places. But it should be easy enough to paint them out or even delete the mismatched instances manually.

[attach=1]
Title: Re: Lateral displacement - I beg you...
Post by: WAS on October 03, 2018, 01:51:38 PM
Quote from: N-drju on October 03, 2018, 01:20:08 PM
Plugging the last terrain item into the "terrain shader" input is enough to have the populator reacting to both the computed terrain group and the displaceable section. The only disadvantage is that some of the objects are being populated underneath overhang terrain features and stuck in impossible places. But it should be easy enough to paint them out or even delete the mismatched instances manually.

[attach=1]


You could also play with slope limitations.
Title: Re: Lateral displacement - I beg you...
Post by: N-drju on October 03, 2018, 04:01:48 PM
Not sure if this is going to work, as distribution shader also needs terrain information which is fed by "compute terrain". If I add a terrain feature coming after the "compute terrain", a "distribution shader" will not see the extra displacement, just like the populator didn't.
Title: Re: Lateral displacement - I beg you...
Post by: WAS on October 03, 2018, 04:46:15 PM
Quote from: N-drju on October 03, 2018, 04:01:48 PM
Not sure if this is going to work, as distribution shader also needs terrain information which is fed by "compute terrain". If I add a terrain feature coming after the "compute terrain", a "distribution shader" will not see the extra displacement, just like the populator didn't.

Texture Coordinates from XYZ will provide this without the actual computation of the terrain. I believe.