This is a child page. You can use Parent in the quick nav bar at the top or the bottom of the page to navigate directly back to the parent of this page. Some child pages are more than one level deep, and in that case will require more than one Parent click to reach the outermost document level. |
Either, or both, of MIN and MAX may be an expression. EXP can be any distance from the eyepoint. This statement changes the output of the raytracer from a realistic scene to one that is white where the scene's objects are closer than MIN, black where objects are more distant than MAX, and a grey value in between.
If both MIN and MAX are the same value, then the scene will be analyzed for the minimum and maximum object depth, and the greyscale result will reflect those as the MIN and MAX values. This doesn't work well for animations, because objects that move can change the effective depth of the scene.
Example output:
You can use <depthmap> to create all kinds of depth related effects such as illumination or depth of field. Here's an example using the same object where we have created the illusion of depth of field using a layered image.
The above image shows three layers: original image, blurred image, and a depthmap image. These layers combine to create a master which blends from the blurred image to the original image at a rate controlled by the <depthmap> statement.
Both the original and the blurred copy of the original are in normal mode. The depth map is in Inverted Grey Mask mode and Localstack is on for it so that the masking will only affect the blurred copy. If the unblurred image were higher in the layer stack, you'd want to use Grey Mask mode instead of Inverted Grey Mask. Note the use of Factor set to 200 to increase the effect of the depthmap layer.
In the above example, because the top layer was a blurred copy, the blend occurs between blurred and non-blurred. If instead it had been a copy where you had darkened the image, then the object would get darker, the further it was from the viewpoint. Again, you can apply this to any effect.