POV-Ray : Newsgroups : povray.general : Depth map without hacks Server Time
2 Aug 2024 08:17:29 EDT (-0400)
  Depth map without hacks (Message 1 to 4 of 4)  
From: nfm
Subject: Depth map without hacks
Date: 31 Dec 2004 07:50:01
Message: <web.41d54aab7cb7473670d1e38f0@news.povray.org>
Is this possible in POVRAY? A map with the depth of each pixel in the image,
without the need of altering the input file like texture and light
deletion, z-gradients etc. Thanks!


Post a reply to this message

From: Mike Williams
Subject: Re: Depth map without hacks
Date: 31 Dec 2004 08:14:12
Message: <BipDHLAPCV1BFwFJ@econym.demon.co.uk>
Wasn't it nfm who wrote:
>Is this possible in POVRAY? A map with the depth of each pixel in the image,
>without the need of altering the input file like texture and light
>deletion, z-gradients etc. Thanks!

You need to use MEGAPov 1.1 rather than official POVRay. There's a post
processing facility which does it. 

Take a copy of the supplied example file postproc\depth.pov, then make
the following changes:

1. Replace the line that says #include "ppcontent.inc" with one that 
   #includes your original scene file.

2. Set the DepthMin and DepthMax values appropriately for your scene, so 
   that the distances from the camera to the objects you are interested 
   in lie between these values.

Do not make any changes to your original scene file.

This will render your scene in the normal way but then also output a
depth postprocessed version.

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

From: Christoph Hormann
Subject: Re: Depth map without hacks
Date: 31 Dec 2004 08:25:01
Message: <cr3jnp$4tk$1@chho.imagico.de>
nfm wrote:
> Is this possible in POVRAY? A map with the depth of each pixel in the image,
> without the need of altering the input file like texture and light
> deletion, z-gradients etc. Thanks!

Short answer: no.

Long answer: MegaPOV offers access to the distance of the first 
intersection as part of the post processing patch but this requires a 
change in the scene file as well.  This is however no way the 'depth of 
a pixel' - in a raytracer this is not clearly defined at all since the 
contributions to the color of a pixel can come from different distances.

It is however quite convenient to generate a depth image with what you 
call 'hacks' simply using conditionals in SDL.

Christoph

-- 
POV-Ray tutorials, include files, Sim-POV,
HCR-Edit and more: http://www.tu-bs.de/~y0013390/
Last updated 23 Sep. 2004 _____./\/^>_*_<^\/\.______


Post a reply to this message

From: nfm
Subject: Re: Depth map without hacks
Date: 31 Dec 2004 11:15:00
Message: <web.41d579b119a6c2fa70d1e38f0@news.povray.org>
It is very good that the depth map is created paralelly to the rendered
image.

I know that in POVRAY there are transparency/reflections/lensing/depth of
field effects, but what I would need is just a simple first intersection
depth map.

Thanks for the answers!


Post a reply to this message

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