POV-Ray : Newsgroups : povray.unofficial.patches : POVRay 3.7 with depth-map unofficial patch release : Re: POVRay 3.7 with depth-map unofficial patch release Server Time
21 Jan 2022 09:16:09 EST (-0500)
  Re: POVRay 3.7 with depth-map unofficial patch release  
From: William F Pokorny
Date: 28 Oct 2017 11:53:06
Message: <59f4a7e2$1@news.povray.org>
On 10/28/2017 07:14 AM, clipka wrote:
> Am 28.10.2017 um 02:40 schrieb cjaramillo:
> 
...
> 
> So far, official POV-Ray does not have any such feature.
> 
> You /can/ create depth maps "out of the box" though, provided you have
> control over the scene's textures.
> 
> To do that, use `finish { diffuse 0 specular 0 phong 0 ambient 0
> emission 1 }`, and a gradient pigment rotated and translated in such a
> way that it aligns with the camera.
> 
> Make sure to render to a 16-bit image format or OpenEXR, or your depth
> map precision will be pretty low.
> 

Also doable "out of the 3.7 box," I've played with storing and 
retrieving +-64bit values in df3 files and there is a small, 
orthographic depth map example using the technique at:

http://wiki.povray.org/content/User:Wfpokorny/DensityFile/DepthMap64BitDf3RsltStoreExample

which also needs parts of the arraycoupleddf3s.inc file at:

http://wiki.povray.org/content/User:Wfpokorny/DensityFile/arraycoupleddf3s

While you do have to create a union of all objects you want as part of 
the depth map to pass to trace(), the approach doesn't require any 
special texture set up. Further because the 'depth value df3' can be 
wrapped in a function the +-64bit values can be used in later renders.

As SDL code using trace() and executed by the parser the approach is not 
fast(1) and be a little paranoid using the related include file macros. 
While I think the df3 value storage/retrieval code OK, and it worked in 
one real project of mine, it has not been much used in practice.

Bill P.

(1) With some planning and care you can run more than one povray-parser 
at a time when creating data for later use.


Post a reply to this message

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