Planetside Software Forums

General => Terragen Discussion => Topic started by: shadowphile on April 25, 2010, 06:43:30 PM

Title: general advice about perlin artifacts?
Post by: shadowphile on April 25, 2010, 06:43:30 PM
I frequently see lines in my terrain (and posted examples) that is apparently an artifact from perlin noise that looks very artificial.
[attach=1]

what is the general advice for scrubbing these out?
Title: Re: general advice about perlin artifacts?
Post by: Henry Blewer on April 25, 2010, 07:29:34 PM
The surface shader has a smoothing tab. By checking the checkbox this gets turned on. The slider adjusts how much smoothing is applied. Another way to fix this is using the color tab. The color contrast and color roughness work in this case. Lowering the color contrast makes the color blend in with the color/s already in place. I never change the color roughness, so I am not sure what it does.
Title: Re: general advice about perlin artifacts?
Post by: cyphyr on April 25, 2010, 07:32:47 PM
Plugging a lower scale Fractal terrain in to the input of the Terrain fractal may help. For example if your terrain has settings of 5000, 25000, 0.1, 20 and a displacement of 2000 add a new Terrain with settings like 500, 2500, 0.01, 20 and a displacement of 200. You could have several layers like this. In this example I've just dropped all values by a factor of 10, but you could try other proportions, maybe thirds? As regards the actual "reason" for this happening I would not have the math to really know.
:)
Richard
Title: Re: general advice about perlin artifacts?
Post by: shadowphile on April 25, 2010, 08:27:17 PM
thanks njeneb and cyphyr.  I have found since posting that increasing surface roughness will mask out the lines, although I have to live with the result on the existing hills as well.
I had thought of a smoothing function although it might also need a mask to prevent intended hills from also being smoothed.

I found that I can recreate the creases only when there are multiple scales of displacement AND the Noise variation is non-zero AND either the bouyancy or the clumping values are non-zero.  So it's due to the way TG handles the noise variation.
This is certainly a question for the support guys.
Title: Re: general advice about perlin artifacts?
Post by: FrankB on April 26, 2010, 02:37:26 AM
Quote from: njeneb on April 25, 2010, 07:29:34 PM
The surface shader has a smoothing tab. ...

but that's a different thing. From what I understand you would use the smoothing slider to gradually revert the displacement back to the last compute terrain before this shader. ... which is why it s so important for snow, for example.

Frank
Title: Re: general advice about perlin artifacts?
Post by: FrankB on April 26, 2010, 02:40:37 AM
Quote from: shadowphile on April 25, 2010, 06:43:30 PM
I frequently see lines in my terrain (and posted examples) that is apparently an artifact from perlin noise that looks very artificial.
[attach=1]

what is the general advice for scrubbing these out?


My advice is essentially the same as cyphyr's. They key to removing these lines is to provide more octaves of noise, either by increasing the octaves, or by adding a second, third powerfractal with smaller sizes. The noise variation settings have an influence, too, as you found out yourself.

Frank
Title: Re: general advice about perlin artifacts?
Post by: Oshyan on April 26, 2010, 03:23:13 AM
Yes, it's a limitation in the number of noise octaves present there. With fewer octaves of larger scale, the lines between noise components is more distinct. Addition of more, smaller scales (octaves) of noise break up the visibility of those borders.

- Oshyan
Title: Re: general advice about perlin artifacts?
Post by: shadowphile on April 30, 2010, 03:13:08 AM
guess I'm not satisfied with these answers.   :P
The creases are visible in low roughness areas so adding roughness isn't a solution, by definition.  They seem to be an artifact of the noise variation engine, however that works.  My guess is that its taking two low-frequency (unrelated) components and (accidently) creating higher-frequency components by attempting to morph between them.  I would suggest addition of a higher-order derivative matching (thus morphing smoothly wrt surface curvature as well.)

btw, why isn't voronoi one of the main noise options, more than just a function node?  Voronoi is so useful for anything with a more cellular structure.  

oh, and I could really use a function node called 'get curvature', prolly have a 'patch size' parameter.  A complete result would have to have two parameters to account for a 2D surface, ie  a saddleback, or maybe just one result that measures along the fall line.
Title: Re: general advice about perlin artifacts?
Post by: Matt on May 04, 2010, 01:15:27 AM
I'm afraid that what you're seeing is just the shape of the basis function. Roughly speaking, for Perlin Ridges the basis function is -abs(perlin), and for Perlin Billows it is abs(perlin). Mix 1 and Mix 2 use alternations of the above two bases. Perlin is free from these discontinuities. To break up these discontinuities so that they appear like natural ridges you can try warping the shaders (also known as domain distortion) or adding lateral displacement.

Another way they could be smoothed out would be filters that operate in the frequency domain. Two ways to do this in Terragen are 1) use the smoothing setting on a Surface Layer, which basically gives you a "smoother" version of the terrain computed in the last Compute Terrain node but won't completely remove the artefacts, or 2) generate a heightfield from your shaders and use that instead.

Matt
Title: Re: general advice about perlin artifacts?
Post by: Henry Blewer on May 04, 2010, 07:58:28 AM
THat is the best explanation I have seen Matt. Thanks!
Title: Re: general advice about perlin artifacts?
Post by: shadowphile on May 08, 2010, 05:15:25 PM
thanks for the info Matt.  I noticed that Perlin alone is well behaved and did not generate seams/ridges unless I started squashing it around with the variations.  I can also understand why something like abs would cause seams, since you would have a slope discontinuity wherever the function is zero.
thanks again