Color depending on height.

Discussions regarding Materials, Material-Compounds or Shaders, etc.
Post Reply
Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Color depending on height.

Post by Judicator » 08 Jan 2014, 14:42

Hi, guys.

Maybe you'll be able to help me. I need to create material, which would color the object, depending on it's height in a gradient style.
For example, I have a "mountain" of certain size and it's colored in green. When I make the mountain taller, additional colors start to appear, like yellow (in the middle) and red (on top).
Something like this http://upload.wikimedia.org/wikipedia/c ... ian_2d.png.
Also I should be able to define at which height the color starts to change.

Any idea on how to do this? Any help is appreciated.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: Color depending on height.

Post by caledonian_tartan » 08 Jan 2014, 15:00

this is not the only solution, but works.

create a "color at vertices map" on your mountain and put this on its iceTree
cavheight.jpg

the gradient works from 0 to 1.
so i use the rescale to compress the height into that range.
don't forget to change the Vertex_Color map to "Float (4 bytes)"
SI 2015 @ WIN7-64

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 08 Jan 2014, 15:25

That's exactly what I need.
But I don't seem to have "Color Attribute to CAV" node.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: Color depending on height.

Post by caledonian_tartan » 08 Jan 2014, 16:06

SI 2015 @ WIN7-64

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 08 Jan 2014, 16:32

Thanx, now everything works! :)
Both links work, by the way ;]

Moderator edit: you're right,I removed my post to avoid confusion.
Seems to be a browser specific issue, another browser: no problem - HB

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 08 Jan 2014, 16:47

One more question though. Everything is colored the way I want, but how to make it work, while using Shape Manager? The ICE Tree and Shape Manager don't like each other.
In this project, I'm simply animating few spikes growing from a single grid, using shape manager.

caledonian_tartan
Posts: 253
Joined: 17 Feb 2010, 15:13

Re: Color depending on height.

Post by caledonian_tartan » 08 Jan 2014, 19:36

i guess you need to place the ice tree above the shape operator inside the Operator Stack
SI 2015 @ WIN7-64

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 09 Jan 2014, 09:02

It was already above.
Maybe I'm doing something wrong. How do you animate proportional translation of object's points without using Shape Manager?

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Color depending on height.

Post by NNois » 09 Jan 2014, 09:16

on a side note, you can consider to construct this in the render tree only.
there will be great advantage because he don't rely on the mesh... plus all your problems goes away

-take a "Vector State"(intersection point mode) -> he output a vector who is the position in space ;-)
-you plug that on a vector to scalar node and choose the "Y"
-you plug that on "change range" node it's the equivalent of the "rescale node on ice" the units are SI units
-plug that on a gradient node (the one with a scalar node input)
-done ;-)

tell me if you need a screenshot

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Color depending on height.

Post by NNois » 09 Jan 2014, 10:06

here is one example independant from the topology
Attachments
vectorstate.JPG

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 09 Jan 2014, 10:24

Worked like a charm!!!! Thanx a lot!
And now you can tell me about that "Wireframe" node of yours :D

NNois
Posts: 754
Joined: 09 Jun 2009, 20:33

Re: Color depending on height.

Post by NNois » 09 Jan 2014, 11:00

just the softimage "essential" shader pack http://www.binaryalchemy.de/

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: Color depending on height.

Post by Hirazi Blue » 09 Jan 2014, 11:18

Nice an clean, NNois.
Who would have thought? A non-ICE solution to a problem in this day and age! :D
Stay safe, sane & healthy!

Bullit
Moderator
Posts: 2621
Joined: 24 May 2012, 09:44

Re: Color depending on height.

Post by Bullit » 10 Jan 2014, 17:54

Wouldn't terrain shader work for this?

Judicator
Posts: 39
Joined: 18 Apr 2013, 09:26

Re: Color depending on height.

Post by Judicator » 14 Jan 2014, 10:18

I've tried it, but couldn't get it to work (never used it before). caledonian_tartan's way works just perfect though ;]

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests