|
![](/i/fill.gif) |
"Joan Lavoipierre" <xdz### [at] dial pipex com> writes:
> Does anyone know of a way to output z buffer information along
> with rendered images?
Colour-code it. Render a second image with the same objects for which
the texture is changed to something like:
texture {
pigment {
gradient <grad-vector>
colour_map {
[0/256 1/256 colour rgb 0 colour rgb <0,0,1>]
[1/256 2/256 colour rgb <0,1/255,0> colour rgb <0,1/255,1>]
[2/256 3/256 colour rgb <0,2/255,0> colour rgb <0,2/255,1>]
...
[255/256 256/256 colour rgb <0,255/255,0> colour rgb <0,255/255,1>]
}
}
finish {
ambient 1
diffuse 0
}
}
If <grad-vector> is correctly set to be parallel to your camera
direction, and if you translate your texture a bit, then you get a
colour depending on the distance from the focal plane.
The given example gives 65536 levels of accuracy. If you need more,
you just have to fiddle a bit more and add a colour component on the
red channel. You see the point.
> It needs to be fairly accurate
The last trick gives you 24 bit depth, that is 16 million or so.
Should be enough.
Roland.
--
Roland Mas
Sauvez un arbre, tuez un castor.
Post a reply to this message
|
![](/i/fill.gif) |