Home Technical Talk

How to make a gradient map and how to use it properly?

polycounter lvl 4
Offline / Send Message
Benjam polycounter lvl 4
Hey guys,

I have just read through the thread about diffuse mapping and optimising their uses by using gradient mapping. In my next environment to create to up my portfolio i was thinking about using gradient mapping instead of standard normals mapping if they are really as awesome as this guy says

http://artisaverb.info/DitchingDiffuse.html

I was just wondering is gradient maps are a multi-coloured image made from your diffuse texture and also when you apply the gradient map would you do it in the bump mapping channel (using Maya) or is it only something you can use in game engines like UDK etc.

Would be cool to show off optimised stuff if this is the case, what do you think?

Cheers guys! x

Replies

  • Swizzle
    Offline / Send Message
    Swizzle polycounter lvl 17
    While I'm not sure about the specifics required regarding implementing gradient mapping in game engines as a shader -- though I can't imagine it'd be terribly complex in something like UDK -- I do know that gradient maps are used primarily for diffuse coloring. Gradient maps aren't useful for normal mapping because the color you get from them is based entirely on where your base pixels lie on a gradient from black to white.

    You can't accurately derive directional info from a heightmap with gradient mapping, and thus gradient mapping isn't useful for generating procedural normal maps.
  • Ashaman73
    Offline / Send Message
    Ashaman73 polycounter lvl 6
    Benjam wrote: »
    I was just wondering is gradient maps are a multi-coloured image made from your diffuse texture ..
    A gradient map is a greyscale texture, often derived in a logical way from the source model/texture.
    I.e. L4D take the color intensity as grey-value and remap this value to a color gradient (saved in a map). That is, the L4D artists have painted a standard diffuse texture, then convert them to a greyscale image (i.e. by taking the value of the color) and remap it in a shader to different colored gradients to archieve some kind of variation. But you can paint it directly, take only the albedo or the highmap or a combination of all this, as long as you have some kind of greyscale image at the end.

    The article you referred combines the diffuse map with the height map, this works great for natural materials where you have different colors at different layers of the material. I.e. stones (greyish) poking out of sand (yellow).
    Benjam wrote: »
    ...you apply the gradient map would you do it in the bump mapping channel (using Maya) or is it only something you can use in game engines like UDK etc.
    You need some kind of shader. As far as I know some tools support it out of the box (photoshop). The shader is really simple and should be no problem in any game engine or modelling tool. I have created a gradient mapping shader in blender and my game, therefore this should be no problem in max/maya/udk/unity/ce.


    Final tip:
    1. From my experiences you should be careful when baking AO into the diffuse map or directly into the greyscale texture. In this case you are darkening the resulting greyscale texture which results in a color shift. IMHO it is better to keep the AO map in a separate channel and combine it on-the-fly in the shader.

    2. Use the layer magic of photoshop or gimp 2.8 to create your final greyscale.
  • arrangemonk
    Offline / Send Message
    arrangemonk polycounter lvl 17
    sends me mentally back to times of palette swapping
  • Eric Chadwick
    The multi-colored image is a combination of 3 separate heightmaps. Each is copied into one of the RGB color channels. The game/shader doesn't look at the combined colorful image, it only cares about each channel independently. So you can ignore the crazy colors... it's the individual channels that count.

    d1ver has a link to his UDK shader, at the bottom of the article. In Maya you should be able to create something similar with Hypershade.

    Some more links here
    http://wiki.polycount.com/Multitexture#Modulation_Blending
  • passerby
Sign In or Register to comment.