POV-Ray : Newsgroups : povray.programming : z buffer output : Re: z buffer output Server Time
29 Jul 2024 00:34:16 EDT (-0400)
  Re: z buffer output  
From: Nieminen Mika
Date: 16 Feb 1999 12:00:50
Message: <36c9a442.0@news.povray.org>
Joan Lavoipierre <xdz### [at] dialpipexcom> wrote:
:     Does anyone know of a way to output z buffer information along with
: rendered images? It needs to be fairly accurate since another program is
: going to superimpose realtime 3d shapes which need to interact properly with
: the background. Thanks in advance

  Before somebody answers you with the classical answer "make a gradient
pigment from black to white with ambient finish set to 1 and apply it to the
whole scene in the direction of the camera" let me warn you a bit:
  This is one solution, but it's not an easy one. Also you have to be
careful. If you render the image normally, you will get only 256 z-values,
which isn't enough in most cases.
  Why isn't it easy?
  Usually you have all your scene already textured. You would have to comment
out all the texturing before you can apply the gradient texture to the scene.
If the scene is very complex, this may be a pain.
  If you do this, the easiest way to apply the pigment to the whole scene
may be using the #default directive.
  To get higher accuracy (ie. to get more than 256 values) you have to output
to PNG with color resolution of 16 bits per pixel (so you get 65535 z-values).
  The problem here is how do you read the PNG...
  I don't remember if targa supports 16 bits per pixel.

  I know of no other easy way to do this.

-- 
main(i){char*_="BdsyFBThhHFBThhHFRz]NFTITQF|DJIFHQhhF";while(i=
*_++)for(;i>1;printf("%s",i-70?i&1?"[]":" ":(i=0,"\n")),i/=2);} /*- Warp -*/


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.