Corrupted/Exploding/fan looking fake stones...

Started by reck, March 26, 2009, 04:50:27 AM

Previous topic - Next topic

FrankB

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

Ironshirt

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


reck

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.

Zylot

I use distributions, and never have this problem, I think cause they always have softer edges.

Goms

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.
Quote from: FrankB
you're never going to finish this image ;-)

reck

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?

Matt

#21
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
Just because milk is white doesn't mean that clouds are made of milk.

reck

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?

Matt

Yes, that's right. Although if you can make "blend by stone density" work with the Surface Layer that might be better.
Just because milk is white doesn't mean that clouds are made of milk.

reck

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.


reck

What does the "blend as stone density" setting do? Also as a related question what does the "Fit blendshader to this" setting do?

FrankB

#26
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

Oshyan

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

efflux

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.

rcallicotte

...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.
So this is Disney World.  Can we live here?