POV-Ray : Newsgroups : povray.general : render depth/normal map with povray? : Re: render depth/normal map with povray? Server Time
31 Jul 2024 04:23:08 EDT (-0400)
  Re: render depth/normal map with povray?  
From: Alain
Date: 15 Nov 2007 11:48:01
Message: <473c7841@news.povray.org>
sirhenjo nous apporta ses lumieres en ce 2007/11/15 08:55:
> I am wondering if it's possible to render a depth and/or normal map using
> povray, instead of a regular scene render.
> 
> The depth map can be generated by measuring the depth from a reference plane
> (bounding box for example) and cast rays to the surface of the objects.
> 
> Is this possible?
> I know there are other platforms that can do this, just wondering if POV-Ray can
> be setup to generate such maps.
> 
> 
For the depth map:
1 - remove all textures and pigments.
2 - bind everything but the camera in one union.
3 - apply a gradient pattern to your big union scaled to it's depth. Have the 
gradient perpendicular to the camera axis.
4 - remove all light_source and use ambient 1 diffuse 0.

For the normal map:
Do the same, but replace the gradient by a slope pattern.

Both are easier with a camera on an axis looking as the origin, but you can have 
the camera set at any possible location.

-- 
Alain
-------------------------------------------------
You know you've been raytracing too long when your idea of a complete computer 
is a fast CPU, lots of RAM, and a means of running POVray.
Aaron Gage a.k.a Slartibartfast


Post a reply to this message

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