Closed iljah closed 5 years ago
You can use a pigment that varies with distance to the camera location, and set the finish to "ambient 0 emission 1 diffuse 0".
Make sure to put all objects in a global union and assign the pigment to that one, so you don't ruin the distance-from-camera thing by transformations of the individual objects.
You'll be able to find more support on this and other topics on our newsgroups, at https://news.povray.org or news://news.povray.org.
Summary
Is it possible to have povray render a scene but instead (or additionally) output a gray scale image in which each pixel corresponds to the distance from camera to first/closest object visible at that position in regular image? Or could this be emulated with render/scene/lighting/camera/etc settings? If not, how easy would something like this be to add?
For example in below scene center of sphere would be e.g. whitest while background would be black since rays missing the sphere wouldn't really hit anything.
Environment
POV-Ray version: POV-Ray 3.7.0.8.unofficial (Fedora 28)
Scene