Planetside Software Forums

General => Terragen Discussion => Topic started by: mhaze on January 01, 2014, 07:31:25 AM

Title: masking problem
Post by: mhaze on January 01, 2014, 07:31:25 AM
Hi All

I have come across a problem with TG3 which involves displacement and it's consequences for masking.  Take the following simple node network

[attachimg=1]

The output from a SSS is redirected and warped to give a canyon, the same output is taken as a mask for a surface shader.  Now look at the following outputs.

Firstly at -10 displacement

[attachimg=2]

Looks good just what you would expect.

Now at -50 displacement

[attachimg=3]

some mismatch begins to appear.

[attachimg=4]

-100 the mismatch is now severe and increases as displacement increases.

I've noticed this before but it's only now that I've been working on a canyon with big displacements that the problem shows up.

Notes:

1) You can replace the compute terrain with a compute normal ( or even do away with it!)but this has a major effect on lateral displacements and on altitude distribution settings in the surface shader.  It seems the input to the compute terrain and the output in terms of displacement are different.

2)Using the internal displacement of the SSS makes no difference , nor do any of the other settings in the SSS

3) I've tried using a compute normal and vertical only displacement but this has no effect either.

4) The real problems start when you try and mask populations using the mismatched output from the compute terrain and the SSS


I have spent several days on this and as far as I can see, there is no real solution to this, so any input gratefully received but I think there is an internal problem with the program that needs sorting.  But knowing how stupid I can get it could just be me!

Mick
Title: Re: masking problem
Post by: mhaze on January 01, 2014, 07:51:14 AM
I've just tried with an image map shader and there is no similar problem so it seems to be related to either the redirect/warp or the SSS
Title: Re: masking problem
Post by: Dune on January 01, 2014, 10:28:36 AM
Feed the line to the surface shader through a compute XYZ node and see if that helps. Small patch size in compute also helps. And stretching the Y of a displacement fractal also helps. Depends on what you do.
Title: Re: masking problem
Post by: mhaze on January 01, 2014, 11:06:12 AM
And where might I find a compute XYZ node?  Stretching the PF driving the redirect does the trick and I even understand why! Cheers Dune.
Title: Re: masking problem
Post by: Dune on January 02, 2014, 05:57:36 AM
At your service. (I meant 'tex coords from XYZ').
Title: Re: masking problem
Post by: Hetzen on January 02, 2014, 02:01:08 PM
I think the reason why the fill looks wrong at lower depths is down to the PF also changing it's shape through Y. ie the initial pattern at y=0 will change as y changes. So when you displace the land down, you are then calling the same pattern to mask your river at a new texture position than was used to displace.

If you put a large value in the Y scale of the PF feeding the redirect, that will help minimise the distortion. Alternitively, you could re warp the SSS (hate that :/) with the same PF, but add a - what ever your displacement to the y of a new redirect. That should push the PF pattern down to the base of your river/canyon.
Title: Re: masking problem
Post by: Matt on January 02, 2014, 10:06:03 PM
Quote from: Hetzen on January 02, 2014, 02:01:08 PM
I think the reason why the fill looks wrong at lower depths is down to the PF also changing it's shape through Y. ie the initial pattern at y=0 will change as y changes. So when you displace the land down, you are then calling the same pattern to mask your river at a new texture position than was used to displace.

Yes, that is the reason. You could solve this by moving the move the Compute Terrain before the displacement. Dune's suggestion of stretching the Y by a large number should also work if you need the Compute Terrain where it is.

Matt
Title: Re: masking problem
Post by: bobbystahr on January 03, 2014, 12:19:43 AM
wow..one of the best threads lately...
Title: Re: masking problem
Post by: Dune on January 03, 2014, 03:23:58 AM
I use the stretched Y all the time when warping stuff, like roads.