POV-Ray : Newsgroups : povray.binaries.images : Method. Visible surface at a distance from light source. : Method. Visible surface at a distance from light source. Server Time
6 May 2024 06:07:17 EDT (-0400)
  Method. Visible surface at a distance from light source.  
From: William F Pokorny
Date: 14 Jan 2018 11:55:44
Message: <5a5b8b90@news.povray.org>
There was recently a post to povray.general about getting ray path 
lengths. Less recently, Christoph suggested the idea of using a negative 
spotlight within a positive one which spurred some negative light play 
images. There too have been questions/github patch work for depth maps. 
An idea popped into my head this morning related to those threads.

By using a positive light and a negative light at the same position 
where the fade distance of the negative light is slightly inside the 
positive one, and where both have very high fade powers, we can 'see' 
what non-shadowed surfaces are at a certain distance from the light 
source position.

Unsure if such a 'spherical shell of light at a radius' method really 
useful in practice, but a trick for the bag in any case.

The bright parts of the attached image represent the surfaces both 
visible to the camera position and at 0.8+-0.01 from the light source at 
<0.5,0.5,-0.5>. Example code below.

Bill P.


//------------------ Example ----------------------
#version 3.8;
global_settings { assumed_gamma 1 }
#default { finish {ambient 0.02 diffuse 0.98} }
#declare Grey40 = srgb <0.4,0.4,0.4>;
background { color Grey40 }
#declare Camera00 = camera {
     perspective
     location <2.5,2.5,-2.501>
     sky y
     angle 35
     right x*(image_width/image_height)
     look_at <0,0,0>
}
#declare VarDist = 0.8;
#declare VarDistRes = 0.02;
#declare VarDistPos = VarDist+(VarDistRes/2);
#declare VarDistNeg = VarDist-(VarDistRes/2);
#declare White = srgb <1,1,1>;
#declare Light00 = light_source {
     <0.5,0.5,-0.5>, White
     fade_distance VarDistPos
     fade_power 1000
}
#declare Light01 = light_source {
     <0.5,0.5,-0.5>, White*-1
     fade_distance VarDistNeg
     fade_power 1000
}
#declare Red = srgb <1,0,0>;
#declare CylinderX = cylinder { -x, x, 0.01 pigment { color Red } }
#declare Green = srgb <0,1,0>;
#declare CylinderY = cylinder { -y, y, 0.01 pigment { color Green } }
#declare Blue = srgb <0,0,1>;
#declare CylinderZ = cylinder { -z, z, 0.01 pigment { color Blue } }
#declare Plane00 = plane { y, 0 pigment { color White } }

//--- scene ---
camera { Camera00 }
light_source { Light00 }
light_source { Light01 }
object { Plane00 }
object { CylinderX }
object { CylinderY }
object { CylinderZ }


Post a reply to this message


Attachments:
Download 'the.png' (34 KB)

Preview of image 'the.png'
the.png


 

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