Depth Maps

Ok so today i experimented with depth maps, and got myself all confused :(
So i have two things. 
I seem to find that their are 2 different types of maps.  Their are colorful ones and greyscale ones.  What is the difference?  I do have a lineup of photos that show the differences but i cant tell why.
Inside the linked folder their are groups of 2 photos.  The depth map, then the layer after it was adjusted.
Another question i have is why all the lines?  It seems especially on the greyscale map of a chess board (test 2) that their are too many lines in it!  I cant seem to smooth them out!
Also i understand that the effect works with lights, but is their a way to make it work with a 3d camera? Kinda like this?
Heres the images.


  • Triem23Triem23 Moderator
    edited August 2014
    I'm assuming you're talking about using an image to add apparent extrusion to a layer? Usually this is called a "Height Map" or a "Bump Map." Usually a "Depth Map" is generated based on the distance of an object from a camera and is used for occlusion compositing.
    Depending on how software interprets the map, different color channels do different things--using Hitfilm's displacement effects as an example, you can map the RED channel (for example) to vertical displacement and the GREEN channel (for example) to horizontal.
    Another possibility is making an image in "color" to use a single image for three different maps--let's say I want to use the same graphic image as a map for parallax AND displacement. I might go ahead and but the displace information for the vertical in the red channel, the displace information for the horizontal in the green channel and my parallax height in the blue channel. This gives me a "color" image holding three channels of "grey" information I can use to do different things.
    ANOTHER possibility is that the color maps you're seeing are "normal" maps. Remember, a "normal" is a line perpendicular to the surface of a plane and is used by lights to set the direction of a polygon. Normal maps are usually used in game programming--if you take a high resolution polygon model and save a normal map out then reduce the model to low-poly and feed it the normal map, then you are basically holding a low-reolution model in memory, but feeding it the lighting information from the high-res model so you get smoother shading from fewer polys.
    In your lion example, it looks like the BLUE channel is driving the gross z-depth--how far things protrude--while the red and green are being used for some x/y displacement to make the wrinkles.
    If you're working in Hitfilm, I'm assuming you're using the "Parallax" effect, which is basically a height/bump map filter. Parallax is a "2d" effect linked to a 3D point, like Atomic. You should be able to move the camera around it? I'm not in Hitfilm right now, so I'm not certain. You might need to apply the parallax to a 3D layer to move the camera around it? (For fun some time, put parallax on a 3D model and see what happens. I've done it. It's neat.)
    The thing about these maps is that they are limited by how many values a channel can hold--if you're using a 24-bit image (8-bits per channel, RGB with channel values of 0-255), then you only have 256 hard levels from black to white. Picture it as you're building something from Legos for a minute. So the "lines" you're seeing in your test render are the edges of each grey level--each level of grey is one Lego block high and you can't use a half-block or put a block half-way between two blocks. So there's a "cliff" between each grey level.
    Try putting Hitfilm in 16-bit mode (This is in the preferences for the project) and drawing your depth map in a 48-bit mode (16 bits per RGB channel). This will increase the grey levels from 256 to 65,536 and should smooth things out for you.
    Did that make sense?
  • Yes thanks!
  • Amazing explanation... lot of thing to try now!
  • Not directly relevant to this specific example, but in terms of greyscale versus colorful height maps, you may also encounter normal maps when dealing with 3D stuff. Normal maps provide a greater fidelity but are harder to create, in that they need to be generated based on a high resolution original 3D model surface. Basic bump maps, meanwhile, can be drawn by hand, if you want (a bit like creating a quick and dirty specular texture).

Sign in to comment