POV-Ray : Newsgroups : povray.advanced-users : Travelled distance rays Server Time
29 Apr 2024 16:26:12 EDT (-0400)
  Travelled distance rays (Message 1 to 4 of 4)  
From: eelcovv
Subject: Travelled distance rays
Date: 20 Feb 2015 10:20:00
Message: <web.54e7500efb0988fd4c84688d0@news.povray.org>
Dear Povray experts

For my application of POV-ray I need to extract the travelled distance for all
rays falling in the camera. I have tried to extract the distance by making use
of the attenuation equation given in the manual as

Attenuation = 1 / (1 + (distance/fade_distance)^fade_power)

My idea was to take a blue and a red light source, one without any fading and
the other with a fade_power and fade_distance

The ratio between Red and Blue intensity should give me the attenuation, from
which I can then derive the travelled distance of each ray.

This work wonderfully well in case the fade_distance is equal to the look_to
point of the camera. However, for all shorter and longer distances the trick
does not work and does not give good results.

My question is: is there an other way to get the distance from the travelled
rays? Can I extract the distance variable for instance ? It should be there
because the attenuation euqation makes use of it.

any hints appreciated.

Many thinks
Eelco


Post a reply to this message

From: scott
Subject: Re: Travelled distance rays
Date: 20 Feb 2015 10:33:22
Message: <54e753c2$1@news.povray.org>
> My idea was to take a blue and a red light source, one without any fading and
> the other with a fade_power and fade_distance
>
> The ratio between Red and Blue intensity should give me the attenuation, from
> which I can then derive the travelled distance of each ray.
>
> This work wonderfully well in case the fade_distance is equal to the look_to
> point of the camera. However, for all shorter and longer distances the trick
> does not work and does not give good results.

You might get better results by rendering with a white light - once 
without attentuation and another render with attenuation. The reason 
being that HDR formats (I assume you are outputing to an HDR image 
format for better precision) IIRC only store a "magnitude" for each 
pixel, so if red and green are vastly different trying to calculate the 
ratio will have a large error.


Post a reply to this message

From: clipka
Subject: Re: Travelled distance rays
Date: 22 Feb 2015 08:28:59
Message: <54e9d99b$1@news.povray.org>
Am 20.02.2015 um 16:32 schrieb scott:

> You might get better results by rendering with a white light - once
> without attentuation and another render with attenuation. The reason
> being that HDR formats (I assume you are outputing to an HDR image
> format for better precision) IIRC only store a "magnitude" for each
> pixel, so if red and green are vastly different trying to calculate the
> ratio will have a large error.

You're right as far as the Radiance HDR file format is concerned; not so 
OpenEXR though: It uses three separate 16-bit ("half precision") 
floating point values per pixel.


Post a reply to this message

From: clipka
Subject: Re: Travelled distance rays
Date: 22 Feb 2015 08:47:23
Message: <54e9ddeb$1@news.povray.org>
Am 20.02.2015 um 16:17 schrieb eelcovv:
> Dear Povray experts
>
> For my application of POV-ray I need to extract the travelled distance for all
> rays falling in the camera. I have tried to extract the distance by making use
> of the attenuation equation given in the manual as
>
> Attenuation = 1 / (1 + (distance/fade_distance)^fade_power)
>
> My idea was to take a blue and a red light source, one without any fading and
> the other with a fade_power and fade_distance
>
> The ratio between Red and Blue intensity should give me the attenuation, from
> which I can then derive the travelled distance of each ray.
>
> This work wonderfully well in case the fade_distance is equal to the look_to
> point of the camera. However, for all shorter and longer distances the trick
> does not work and does not give good results.

That's a bit odd, and maybe just coincidence: The fade_power / 
fade_distance mechanism is entirely separate from the camera look_at 
mechanism.

Can you be more specific in what way the trick "does not work" and "does 
not give good results"?

Also note that the fade_power / fade_distance mechanism only affects the 
rays from the light source to the first object surface, not those 
between the object and the camera.

> My question is: is there an other way to get the distance from the travelled
> rays? Can I extract the distance variable for instance ? It should be there
> because the attenuation euqation makes use of it.

MegaPOV provided a postprocessing mechanism that you could use to access 
the distance from the camera to the object surface (the first one hit, 
if reflection or refraction is involved).

The same can be achieved by assigning an emission-only finish to all 
objects, with a spherical pigment pattern varying in brightness with 
distance from the camera.

If you need information about the entire distance from light source via 
object surface to camera, try media instead of distance-based light 
attenuation; absorbing media follows a straightforward exponential rule, 
and should be easy enough to compute.

Also, you might want to use "brilliance 0" in the finish; this causes 
illuminated surfaces to appear equally bright regardless of the angle of 
incidence, which saves you the hassle of setting up one colour channel 
for reference.


Post a reply to this message

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