Using Distribution Shader On Displacements?

Started by RichTwo, January 15, 2011, 10:00:57 AM

Previous topic - Next topic

RichTwo

I am attempting to control the altitude of a particular displacement so that I will have relatively smooth lower areas.  I have attached a Distribution shader to the node set-up and have set the minimum altitude to where I estimated the displacement should end.  It didn't work.  I even entered an extreme setting, and I still couldn't get any kind of result.  It's as if the Distribution shader is disabled.  Or I'm using the wrong shader - I don't know.

I'm probably missing something crucial and obvious and will once again bash my head on the keyboard when it's pointed out to me.  But if any TG2 genius out there wants to have a stab at it, I've attached the clip.  Sorry, you'll have to hook it up yourself.

Thanks for any help!

   
They're all wasted!

inkydigit

Hi Rich, I changed your clip a bit, used a surface layer to restrict height/slope etc, set displacements as a child layer....see attached, I hope this helps
cheers
Jason
:)

RichTwo

#2
 Thanks, Jason - I tried it out but I'm afraid that it works about the same as the Distribution shader.  If I check any constraint setting, it completely cancels the displacement.  I've adjusted slope and altitude, and the fuzzy zones on both to all extremes and it's no use.  It shouldn't be so difficult to get this to work.   I'm wondering now if two shaders aren't meant to handle displacements. 
They're all wasted!

inkydigit

oh ok, it kind of worked, I am stumped also, it seems if it is either on or off??
anyone else got any ideas??

Henry Blewer

I use a redirect shader with power fractals. You can control the distribution of the power fractal/s by putting the distribution shader in the Blend by shader input. You have to check the Fit Blendshader to this.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Dune

It'll work if you add the line into the child input of the distribution shader, I figure, but you can also use a surface shader (uncheck color), blend it by your distribution shader, and add the line into the surface shaders child input.

RichTwo

I guess I don't fully understand or I'm doing something wrong again.  Still getting zero results, even with the doubled-up distribution / surface layer combo as Dune suggested.  Could I impose upon someone, anyone to donate a clip so I can try it out?  Thanks!
They're all wasted!

Tangled-Universe

Hi Rich,
Here you go, this file works.

I think there's often a general misunderstanding on how to approach/using constraints and the conditions which should be met in order to use those.

What I did in this file is first create an inverted crater to test your displacement function on. I computed this crater terrain first with a compute terrain node.
The compute terrain calculates the normals, which allow me to restrict for slope. It also calculates texture coordinates which allow me to restrict for altitude.
A compute normal node doesn't compute texture coordinates and a Tex coords from XYZ node doesn't calculate normals.
So in a nutshell, these are the most important things to consider before applying restriction for slope and/or altitude: you first need to calculate normals and/or texture coordinates.

After computing the crater shader I applied your neg displacement. You don't need the merge shader, this would also make it unnecessarily complicated.
I fed the output of the displacement shader as a child-function of the distribution shader. This distribution shader now controls the slope and height-restrictions.
As you can see I changed the values to fit my crater. Just experiment a bit with it to see that it works and then port this to your project.

A small side note is that I didn't expect a powerfractal to work as input for a Voronoi 3D diff scalar, but it seems it does :)
Normally I would use a "get position from texture" for the input and use a constant scalar (or a powerfractal may be, though I never did that) as seed input.

I hope things are a bit more clear now.

Cheers,
Martin

Tangled-Universe


RichTwo

Thank you Martin, and my apologies for not replying sooner.  I just took a break from Terragen - seems there are more important things to do in my life (but not much more... ;)).  I think I have found out my problem: I have a multitude of displacements going on in my current project and somehow have managed to get them crisscrossed to make them do something I don't want.  So now, it's back to square one.  I will have to completely retool what I've put together and pretty much start over.  But yes, your set-up worked, and so will Ulco's and Jason's once I strip down the nodes to the basics.  Thanks again to all for the help - this is a great community!     
They're all wasted!

bobbystahr

something borrowed,
something Blue.
Ring out the Old.
Bring in the New
Bobby Stahr, Paracosmologist

Tangled-Universe

:)

No worries Rich.
Clean up your network-mess first and then see how it goes.
Keep my suggestion in mind in regard to how to use the compute nodes and everything should work out well.
Just let us know how it went.

Martin

Volker Harun

Quote from: Tangled-Universe on January 16, 2011, 07:35:34 AM
A small side note is that I didn't expect a powerfractal to work as input for a Voronoi 3D diff scalar, but it seems it does :)
Normally I would use a "get position from texture" for the input and use a constant scalar (or a powerfractal may be, though I never did that) as seed input.

Using a PF as input for a Noise gives you more control up to regular, but distorted, pattern. Using a PF for the scale of a Noise is a very good idea, too. But do not dare to use a PF for the seed ... else I will reach out for you in your worst nightmares ,-) ... Well give it a try, but don't be dissapointed :) ;) ;D

Tangled-Universe

I'm not sure what you mean by "control up to regular, but distorted, pattern".

I think I know the reason why a PF would work as input, because the PF itself can provide information about the "position".
If you do not have a compute node attached to the PF it will automatically use some computation as far as I know.
Which specific part of the computed network, I do not know.

Volker Harun

Quote from: Tangled-Universe on January 19, 2011, 10:55:09 AM
I'm not sure what you mean by "control up to regular, but distorted, pattern".

You can see it there: http://forums.planetside.co.uk/index.php?topic=10826.msg111579#msg111579


Sample:


Quote from: Tangled-Universe on January 19, 2011, 10:55:09 AM
I think I know the reason why a PF would work as input, because the PF itself can provide information about the "position".
The position defines the colour output of the PF. If you have a Voronoi noise scaled 100 and you have a PF for the input which has a colour range from 0 to 1 will give you a boredom of an almost uni-coloured noise.
A colour range from -200 to 200 gives you a reasonale pattern.
Where TG2 shows the noise from the coordinates (-200,-200,-200) to (200,200,200). :)

Volker