Planetside Software Forums

General => Terragen Discussion => Topic started by: reck on March 26, 2009, 04:50:27 AM

Title: Corrupted/Exploding/fan looking fake stones...
Post by: reck on March 26, 2009, 04:50:27 AM
...or whatever you want to call them. Anyone who has used the fake stone shader for a while will have seen them. It's a problem that's been around for a long time now and is something that occurs by just using the shader, it's not some obscure bug that hardly anyone has seen and only happens under unusual circumstances.

Has this been fixed for the final release?

Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Seth on March 26, 2009, 11:48:50 AM
I am not sure it is a bug...
it looks like bad value on powerfractal shaders (bad scale or bad dsiplacement)
The only bad looking stones i got these days are flat ones, but it's been a while i didn't get exploding ones...
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on March 26, 2009, 12:26:50 PM
Really! I get this problem a lot so if I know its user error and I can fix it myself without affecting the look of the 99.9% "good" stones I'll be a happy person. But if I have to alter the values that I've entered into the scale/displacement etc to fix 1 bad stone while altering the look of the good stones it's not really a good fix.

In the past I've fixed it by randomly hitting the seed button (without altering the scale/displacement values) until I get stones that don't suffer from this issue. The problem is that if you get a nice distribution/look of stones you lose this when you hit the seed button.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Seth on March 26, 2009, 12:51:56 PM
IMHO it really is user's wrong values.
check some of my renders with a lot of fake stones... no exploding ones...
maybe it's luck but i checked hitting random seed button on one of them more than 10 times and doing preview renders each times and, as i already said, the only issue i get is one or two flat stones sometimes.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: MF_Erwan on March 26, 2009, 01:11:58 PM
Me I have a question: how do you guess the good values to put for displacement on fake stones? ;D

Erwan
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: cyphyr on March 26, 2009, 01:56:31 PM
VERY small values together with HIGH contrast make exploding stones. Try lowering the contrast of your displacing fractal and making its scale a little bigger. Also if you happy with the displacement on most of your stones try putting a transform shader after your displacement fractal and simply move the fractal to a place where you cant see any exploded stones.
:)
richard
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Seth on March 26, 2009, 03:15:22 PM
Quote from: elegac on March 26, 2009, 01:11:58 PM
Me I have a question: how do you guess the good values to put for displacement on fake stones? ;D

Erwan

I'll do a little something about Fake Stones as soon as I will have some free time ;)
but basically I use the same scale value for my powerfractal than the stone's scale, then my displacement is usually smaller let's say maximum 80% of the powerfractal value...
And i play a lot with the colours (contrast, offset, roughness) to have smooth displacement and avoid bright white spots...
let's say that's the beginning of my way to achieve fake stones...
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: MF_Erwan on March 26, 2009, 03:21:41 PM
Quote from: cyphyr on March 26, 2009, 01:56:31 PMTry lowering the contrast
Correct me if I'm wrong, but won't decreasing the "displacement multiplier" make the same thing?

Erwan
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: cyphyr on March 26, 2009, 03:48:25 PM
Sure, if your going through a default shader :)
richard
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Oshyan on March 30, 2009, 01:32:54 PM
I don't think this is technically considered a "bug". It is basically due to a coincidental alignment of particularly strong displacement, likely with a small "fake stone" or one whose shape is not conducive to being displaced in that way. One possible approach to fixing it would be to use a painted shader to mask out the area where the "exploding" stone is from the displacement being applied.

- Oshyan
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on March 30, 2009, 04:44:45 PM
OK so it sounds like I need to spend some more time on tweaking my settings. I've never touched contrast/offset/rougness before when creating fake stones.

Even though not technically a bug I see this problem a lot, not only with my renders but with other peoples renders that I see on here and over at Ashundar.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 22, 2009, 03:28:29 PM
I've been spending the last few days trying to understand what makes fake stones explode. I've read what was posted on this thread and spent a lot of time with the power fractal which is used as the fake stones surface shader, changing different values. I've changed the scale, displacement values, the roughness and the contrast, none of these make any difference. Then I realised that none of these things are causing the stones to explode, in fact it's got nothing to do with the surface shader/powerfractal at all. The reason I know this is because I deleted the surface shader so i'm left with just the fake stones and the exploding stones are still there! If you look at the node network you can see the only two nodes i've added to the standard node network is the fake stone shader and a distribution shader to restrict the stones to flat surfaces. 

So the exploding stone problem is related to some setting in the fake stone or the distribution shader. The distribution shader restricts the stones based on angle, i've made sure not to use really low values and in this render it was set to 15 metres for the max slope and 20 metres for the fuzzy zone. The fake stone shader has 8 for the stone scale and 0.5 for the stone density. These values don't seem extreme to me and seeing as i'm not using any power fractals I don't know what's causing this problem. All I do know is I always get exploding stones, I wish I had the same luck as Seth in this regard as his images seem great.

Any idea?

Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: rcallicotte on April 22, 2009, 04:01:07 PM
What happens when you remove the distribution shader?
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 22, 2009, 06:24:20 PM
I get a lot of white blobs everywhere  :D

But looking around the landscape I don't see any exploding rocks, so why is the distribution shader blowing them up I wonder?

I really only wanted a 5 metre fuzzy zone but I increased it to 15 in case this was the cause of the problem. I still get the exploding rocks and the rocks go higher than I would like now so maybe I will lower it back down to 5.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Oshyan on April 22, 2009, 06:32:17 PM
I don't know for sure, but this sounds like the maybe the "exploding" stones in this case are actually *cut off* stones, from the distribution shader, and it's just that the cut-off is sharper than you want it to be when it intersects a "stone". I'm not sure if this is a limitation of the Fake Stones shader, or of your setup. Unfortunately it's a difficult time to get input from the rest of the team but I'll try to have this thread revisited in the near future.

- Oshyan
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: FrankB on April 23, 2009, 12:18:43 PM
on that note, I have recently been able to eliminate all exploded (cut-off) stones by just removing their distribution shader. So Oshyan's guess is correct.

However, being able to use a distribution shader is vital for convincing stone fields. I suggest that planetside have a look at optimizing how the fake stone shader works with distribution shaders.

Regards,
Frank
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Ironshirt on April 23, 2009, 01:19:09 PM
Using a 'disribution shader' with high displacement values as a blending shader for fake stones, often leads to such results.  I imagine this like a boolean operation in 3D modelling somehow...    one 3D model gets substracted by another. In TG2 I guess its similar - the black and white (greystep) values of one shader will be mixed/substracted by another. And with high displacements (and also high contrast) this may lead to those sharp - *cut off* edges Oshyan mentioned before.


If distribution of fake stones is what you want, maybe it is helpful to use a different setup.

This is the way I use the fake stones shader most of the time:

Regards,
Michael

Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 23, 2009, 03:30:58 PM
Quote from: FrankB on April 23, 2009, 12:18:43 PM
on that note, I have recently been able to eliminate all exploded (cut-off) stones by just removing their distribution shader. So Oshyan's guess is correct.

However, being able to use a distribution shader is vital for convincing stone fields. I suggest that planetside have a look at optimizing how the fake stone shader works with distribution shaders.

Regards,
Frank

Yeah I always use a distribution shader with fake rocks. Maybe this is why i've been having so many problems with them. Most people, including me, assumed it was all down to the power fractal used as a surface shader but all along it was down to the distribution shader.

I think this should be a high priority fix because being able to use the distribution shader with fake stones is crucial. Maybe the painter shader can be used in the mean time but it's not the same as using a distribution shader.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Zylot on April 23, 2009, 03:51:35 PM
I use distributions, and never have this problem, I think cause they always have softer edges.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Goms on April 23, 2009, 04:15:20 PM
There could be two problems.
the first is simply, that the power fractal shader is displacing not only in "positive" directions along the normal of the stones, but also in negative direction. You can see this effect when you add a power fractal as terrain and check the altitudes. when the displacement is set to 1000, it will be like around -500 and +500.
The way around this is to use the powerfractal for as input-shader for a displacement shader. in this case it will only displace positive.
the second problem might be the slope-settings of the distribution shader. it has to be setted to "terrain normal", and _not_ final normal. in "final normal", the slope of the stones that matches the maximum slope of the distribution shader and above, will not be affected by the surface shader of the fake stones.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 24, 2009, 02:15:13 PM
Hi Goms, I didn't use a powerfractal. This is just a fake stone shader controlled by a distribution shader. I also checked and it's set to terrain normal so unfortunately that is not the problem.

The good news however is that Ironshirt has solved the problem. The issue is with the distribution shader so if you replace it with a surface shader the exploded stones disappear. I rendered the same scene twice, firstly controlling the rock placement with a distribution shader and then with a surface shader. With the distribution shader I get a few exploded rocks as normal, use a surface shader and the exploded rocks disappear. It's obvious to see the difference it makes when you quickly switch between the two renders, all the rocks look pretty much the same apart from the "faulty" exploded stones disappear with the surface shader. There does seem to be some problem/bug with the distribution shader.

I always assumed that underneath both the surface and distribution shaders worked the same to control altitude and slope but there is obviously some problem with the code in the distribution shader that is not present in the surface shader.

Any chance of a fix?
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Matt on April 25, 2009, 05:45:53 PM
The sharp cutoff might be due to "blend as density", which uses the blend shader as a probability factor rather than a multiplier for displacement. It's supposed to apply to the whole stone, but maybe there is a bug. (Apparently only a problem with some blend shaders from what I've read in this thread.)

If you uncheck that setting it will apply in the same way as blend shaders for any other shader - i.e. by simply multiplying the displacement by the blend amount.

Matt
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 27, 2009, 05:03:52 PM
Just to be clear when you say "blend as density" are you referring to the "Blend as stone density" option found within the fake stones shader? and your suggesting to uncheck this option and try to render again using the distribution shader to see if this fixes the exploding rocks?
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Matt on April 27, 2009, 08:11:52 PM
Yes, that's right. Although if you can make "blend by stone density" work with the Surface Layer that might be better.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 28, 2009, 05:28:49 PM
OK I rendered a fake rock scene again. Firstly using my normal method which is to use a distribution shader to control placement with the default "blend as stone density" setting turned on. With this setting I get some rocks that have exploded as to be expected. I then went back and turned the "blend as stone density" setting off and re-rendered. This time I didn't see any exploded rocks. I then went back and rendered the scene again but this time I controlled the rock placement with a surface shader and got rid of the distribution shader completely. Again the scene rendered with no exploding rocks that I could see.

So it looks like we have a choice, use the distribution shader but with the "blend as stone density" turned off or use a surface shader. Looking at the rendered images I think the rocks look better when using the surface shader so for now on i'm going to forget about the distribution shader and stick with the surface shader for fake rocks.

This first image uses a distribution shader with the "blend as stone density" turned on, still explodes the rocks.

The next image shows the same scene but with no exploded rocks, the left image uses the distribution shader with the "blend as stone density" setting turned off and the right image uses a surface shader.

Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: reck on April 28, 2009, 05:53:47 PM
What does the "blend as stone density" setting do? Also as a related question what does the "Fit blendshader to this" setting do?
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: FrankB on April 28, 2009, 06:05:00 PM
to the best of my knowledge, "fit blendshader to this" is trying to convert the blend input to something that the shader can consume. That allows you to plug in almost anything as a blendshader, when internally the shader would only take greyscales, for example. The shader will try to convert your blend input to something greyscale.

"Blend as stone density" - I think - is a probability function, not a simple mask. I could be mistaken here, though.

Frank
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: Oshyan on April 29, 2009, 01:14:54 AM
Blend As Density will control "density" (placement) of fake stone displacements, instead of modulating the displacement strength for the stones. Fake Stones responds to Blend as Density by cutting off stones that would be outside of the blend shader, whereas with this setting disabled, it will simply control the level of displacement. So unless the blend shader is extremely high contrast you will not get cut-offs with Blend as Density disabled.

As best I recall "Fit blend shader to this" is actually intended to scale the blend shader input to the same scale or area as the blended shader. I don't think it's a very often needed setting, but for example it might be useful when using an image map (covering a finite area) as  blend shader, whereas a procedural input to another procedural as blend shader shouldn't need it. Again that's the best of my understanding. Data type conversion is usually handled automatically in TG2.

- Oshyan
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: efflux on April 29, 2009, 04:56:46 AM
Thanks for the explanation of blend as density. So in essence the stones thin out at the blend instead of reducing in displacement? Reducing in displacement is of course quite natural looking in many circumstances.

Or in a more technical understanding of how something similar could be achieved without using the fake stones - the stone function values could be reduced by the blend shader and then clamped out before they are displaced? This would also lead to smaller stones at the blend but not squashed.

Anything to do with stones interests me at the moment. I'm working through my own stone functions.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: rcallicotte on April 29, 2009, 07:22:50 AM
...and we would like to see these...   ;D

Quote from: efflux on April 29, 2009, 04:56:46 AM

Anything to do with stones interests me at the moment. I'm working through my own stone functions.
Title: Re: Corrupted/Exploding/fan looking fake stones...
Post by: efflux on April 30, 2009, 09:38:51 AM
It may be some time. I am currently experimenting with scanning slides and negatives. This job is going to be a long process.

Anyway, about stones. This is going a bit off topic but I always thought this photo was very TG2 like with the stones. Even the mountains are like Alpine fractal:

http://www.writedesignonline.com/resources/design/rules/AnselAdams-rocks.jpg

Ansel Adams was the best landscape photographer in my opinion.