Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

gradient ramp

gradient ramp

Anonymous
Not applicable
4,295 Views
7 Replies
Message 1 of 8

gradient ramp

Anonymous
Not applicable

Hi,

i'm trying to create a gradient ramp material on my object. The UVW Map is planar, and i want the lowest point of the object be black and the heighest to be white, all inbetween should be the corresponding grayscale. This way I want to create a height map.

But i'm not getting it to work. Tried out lots of stuff and checked the manual at different hits on grade ramp and checked a few youtube videos, but still not getting it how to make a ramp from black to white from lowest to highest point on object.

Pls share.

 

 

Regards,

Frank

0 Likes
Accepted solutions (1)
4,296 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

Here i've tried to get the ramp all over a cube, but it only shows on 1 side yet. How do i get it to follow the plane projection direction of the UVW Map ? 

 

0 Likes
Message 3 of 8

Steve_Curley
Mentor
Mentor
You can't at least not with a single material. Replace the Gradient Ramp with a simple bitmap which makes it easy to determine top from bottom and left from right. Study each of the 6 sides of the box and you'll see that the Tops are not where you might expect them to be.
To do what you want you need to use a Multi SubObject Material, with 6 copies (not instances) of the material you already have in the 1st 6 material slots of the MSO.
You could then use the Angle spinners in the Coordinates of each of the Bitmaps (or gradient ramps) to rotate each one such that they line up how you want them.
The alternative would be to apply UVWMaps (Planar) to each side of the box then rotate the Gizmo of each to align the images. Or if you're feeling adventurous you could do it in an UnwrapUVW.
With both the above you could then use Render to Texture to get a single image which you could apply using a UVWMap set to Box.

Very simple image attached which is just a 256*256 .png with 4 different colours (like a Checker map) - apply that in place of your gradient ramp then look at each side of the box.

Thinking about it, there is a way to do what you really want (for the displacement map) but I can't remember the details offhand. Have a good search around and you should be able to find it - I know it's been discussed here in the past.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 4 of 8

PROH
Advisor
Advisor
Hi. Looking at your pictures, I can see that your UVW is set to Z. You need to project your map from one of the sides, meaning that the UVW should be set to X or Y. If the gradient direction isn't correct, you can either rotate the UVW gizmo, or adjust the W value in the material coordinates (typical 90 or 180).

NB - this works on ordinary mesh geometry, but I'm not sure if there are issues when used on a Box (or other primitives). If so, convert it to a mesh or poly mesh.

Hope it helps
___________________________________________________________________________________________________
3dsMax 4.2 to 2018
AutoCAD 2000 to 2018
Infrastructure Design Suite Premium 2012 to 2018

0 Likes
Message 5 of 8

Anonymous
Not applicable

ok thx. I tried the gizmo and the flipping, but what ever i do, the texture never goes from down black to up white. It always stays a left to right projection.

or when i rotate the gizmo it doesn't fit the object and needs manual scale, but wouldn't bring the grayscale on the model either. Man is this hard to control.

 

 

0 Likes
Message 6 of 8

Steve_Curley
Mentor
Mentor
http://forums.autodesk.com/t5/Shading-Lighting-and-Rendering/vertex-colour-by-elevation/m-p/4266585
I knew I'd seen this somewhere before...
Just apply your material to the box, apply a UVWMap (set to Planar). You WILL have to alter the rotation of the UVWMap Gizmo to align the Gradient in the proper direction, and if your Box is not a Cube you may also have to Scale the Gizmo to make it match the object (once you've rotated it). In the case of your model it should be only just as high and as wide as the model itself.

Note. 2 boxes, 1 material (same on both boxes). Only the UVWMap Gizmos have been changed.

BoxWithGradient.png


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 7 of 8

PROH
Advisor
Advisor
Accepted solution
Hi. In the UVW map modifier, set the alignment axis to Y instead of Z. On both your pictures it's on Z.

Hope it helps

Edit: Just realized that you use "Gradient Ramp" and not "Gradient" (as I wrongly thought), so the UVW may behave slightly different than I describe. Note that if you do use "Gradient" instead of "Gradient Ramp", you can actually see what you're doing directly in the viewport.
___________________________________________________________________________________________________
3dsMax 4.2 to 2018
AutoCAD 2000 to 2018
Infrastructure Design Suite Premium 2012 to 2018

Message 8 of 8

Anonymous
Not applicable

aah now it catches ... thanks a lot !

0 Likes