POV-Ray : Newsgroups : povray.general : Re: Overlapping multiple generated scenes : Re: Overlapping multiple generated scenes Server Time
29 Jul 2024 08:23:44 EDT (-0400)
  Re: Overlapping multiple generated scenes  
From: sic2
Date: 23 Apr 2012 15:55:01
Message: <web.4f95b36761b138fc9a9b32670@news.povray.org>
> If all you want is a depth map, a much easier, faster and qualitatively
> superior approach is to simply use a corresponding texture.
>
> Comment out any textures already applied to your objects (or use an
> "#if...#end" construct). Place all your objects into a single union, and
> equip that one with a texture having an "emission 1 ambient 0 diffuse 0
> specular 0 phong 0" finish (in POV-Ray 3.6, use "ambient 1" instead of
> "emission 1 ambient 0"), and a gradient or planar pigment fading from
> white (near the camera) to black (far away from the camera).


This is what I got:

union {
 sphere {
  <-2, 0, -6>, 0.5
 }

 box {
  <-1, -2, -5>, < 1,  2,  3>
  rotate <0, -20, 0>
 }
 pigment {
  gradient x
  pigment_map {
   [ -10 White]
   [ 100 Black ]
  }
 }
 finish {
  ambient 1
  diffuse 0
  specular 0
  phong 0
 }

}  // end union

However, the transition between Black and White is not very homogeneous.
What do I do wrong?
Also do you know if it's possible to create a gray map of just depth Z lets say
(or from depth Z_1 to Z_2) ? I need an answer for the second question for post
processing the image later.
Thank you again.


Post a reply to this message

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