POV-Ray : Newsgroups : povray.advanced-users : Obtaining Depth-map using POVRay 3.7 : Re: Obtaining Depth-map using POVRay 3.7 Server Time
25 Jun 2024 20:58:10 EDT (-0400)
  Re: Obtaining Depth-map using POVRay 3.7  
From: Roman Reiner
Date: 4 Jul 2011 17:10:01
Message: <web.4e122b4b325bf6c840005e750@news.povray.org>
Try something like

#declare depthMapTexture = texture {
  pigment {
    spherical
    color_map {
      [0.0 rgb 0]
      [DISTANCE_NEAR/DISTANCE_FAR rgb 0]
      [1.0 rgb 1]
    }
    scale DISTANCE_FAR
    translate CAMERA_POSITION
  }
  finish {
    ambient 1
  }
}

union {
  // the whole scene
  texture { depthMapTexture }
}

where DISTANCE_NEAR and DISTANCE_FAR specify the black and white points of the
depth map (minimum and maximum distance) and CAMERA_POSITION is, obviously, the
camera position.

Regards Roman



"handos" <han### [at] gmailcom> wrote:
> Hi everyone,
>
> I have been using POVRay and Megapov for rendering images and obtaining depth
> maps using Megapov's post-processing tool available here at
> http://megapov.inetart.net/manual-1.2.1/global_settings.html#post_processing.
> I'm rendering the publicly available office room scene from Jaime's website
> http://www.ignorancia.org/en/index.php?page=The_office.
>
> However, my main problem is that it takes almost 2.5 hours to render the scene
> using POVRay 3.6. I'm having to use MegaPOV for only depth and MegaPOV is not
> available linked with POVRay 3.7 which is parallelisable (where my scene is
> rendered in couple of minutes). I would like to use the benefits of POVRay 3.7
> but I don't know how difficult is it to obtain depth map using POVRay 3.7. If
> anyone has ever tried obtaining depth maps using POVRay 3.7 for such complicated
> scenes like this, I'd be very grateful to have your feedback and suggestions on
> that!
>
> Kind Regards,
> Ankur Handa


Post a reply to this message

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