Please, function gurus, can I have some help!

Started by mhaze, December 10, 2009, 07:56:52 AM

Previous topic - Next topic

mhaze

Hi

As part of my exploration of nodes I've created a scene from the attached tgd using combinations of function nodes to achieve a simple landscape. My problem is how to give the different parts different colours.

Say brown for the voroni displaced rocks green for the mounds and blue for the flat areas. I have tried all sorts of ways of doing this but I always either geta blend or a mess of colours that don't fit the landscape.

Any help or guidence gratefully recieved.

Thanks

Mick

Henry Blewer

I just downloaded the file. I think it all depends on how the nodes are connected. It may take me a day or two to figure this out... Stay tuned...
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Henry Blewer

Here is what I was able to manage.
I made a few new surface layers and gave each an obnoxious color. Next I grabbed the output of various sections of your terrain setup and plugged these into separate surface shaders. The connections from the terrain nodes go into the child connectors of the surface shaders. This gives each terrain node group a color.
Please remember that each surface layer is covered by the next surface layer down the chain. You can probably add mixing functions like you did in the terrain section. This would give more control over the color distribution. Let us know how this works out.
http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

mhaze

Thanks but, sorry, that's not even close to what I want. I've tried using surface layers already!

I'll keep on playing ???

Mick

Hetzen

Masks is the simple answer.

Each part of your function tree adds to your displacment system before the compute terrain. Compute terrain gives that displacement it's geometry position and UV. The problem now is, if you just take an output from some of your perlin functions to use as a blend mask in say a surface layer, the perlin noise will have another value where the displacement has been offset and now calculated in that tree.

Have a go with just using the x and z co-ordinates from the Get Position node (using convert x/z to scaler, then use build vector, leaving the y at zero), and displace vertically only. What this will do is create a flat noise pattern, ie it will be the same all the way through y, which you can then use as blending masks. Adjust Colour will be helpfull here too, to bring down the white levels of your perlin function to make distinct black and white shapes corresponding to your displacments, so your colour changes wont just fade from the top to the sides of your bumps.

Kadri

Hetzen , can you make a very basic example.tgd for us , please ?  :)

Cheers.

Kadri.

mhaze

#6
I think I get what you're saying! a tgd would help but.....

I'll play

Thanks

Mick

mhaze

#7
Problem almost solved, will post details after shower!

mhaze

#8
Thanks to Hetzen I've found a solution. I've attached the tgdof the solution. It was necessary to creat X and Y to scalar nodes and then use build vector to feed into the various noise nodes. I coluld then use the outputs from the noise nodes thruogh gain nodes and into col inputs of surface layers. I then use a merge shader set to difference to get the various colours.

Mick

Henry Blewer

http://flickr.com/photos/njeneb/
Forget Tuesday; It's just Monday spelled with a T

Hetzen

Cool. Sorry I couldn't do it for you, quite busy here. :P But looks like you've managed it, and more importantly, by yourself with a few pointers. I'll be asking you advice in a few months.

mhaze

Wish that were true, Hetzen, but my maths skills impose severe limits on what I can achieve.

Hetzen

I can't say my math is that great either. It's more logic and experimenting, and getting to know the limits of the program by pushing what you want to do with it. Like your example above.

mhaze

Yeah, but when you want to create a conic mountain with a road spiralling up it, maths comes in kinda handy(still struggling with that one!)

Mr_Lamppost

I came in to post a solution and see that you have found a way but here's mine anyhow.  I have generated masks for the surface layers from your Perlin functions.  The divide between the land and sea is easy but there are a couple of tricks to masking the rocks.

1: As the mask for the rocks is applied after the compute terrain the pattern will no line up with the displaced rocks as these are calculated before the terrain is computed.  A copy of the perlin function is used where the Get Position input is clamped to zero altitude.

2: The mask for the rocks is multiplied by the mask for the land to prevent rock coloured patches appearing in the sea.
Smoke me a kipper I'll be back for breakfast.