POV-Ray : Newsgroups : povray.programming : Determine reflectivity : Re: Determine reflectivity Server Time
6 May 2024 12:38:38 EDT (-0400)
  Re: Determine reflectivity  
From: Trevor G Quayle
Date: 8 Feb 2008 11:25:00
Message: <web.47ac821c3a69c762c150d4c10@news.povray.org>
"Pfingstei" <Pfi### [at] gmxde> wrote:
> Hello POV Ray community;
>
> I have a question concerning the function "determine_reflectivity" (contained in
> lighting.cpp) which computes the reflectivity factors for a secondary ray.
>
> As input we need the scalar product between the ray vector and the surface
> normal = cosine of the angle between the two vectors (variable: cos_angle).
>
> In the function "determine_reflectivity" the proceeding is as follows:
>
> 1.) Compute variable Reflection_frac
>
> Reflection_Frac = pow(1.0 - cos_angle, Reflection_Falloff);
>
> 2.) Compute reflectivity by linear combination
>
> CRGBLinComb2(reflectivity, Reflection_Frac, Reflection_Max, (1 -
> Reflection_Frac), Reflection_Min);
>
> Pseudocode: reflectivity = Reflection_Frac * Reflection_Max +
> (1-Reflection_Frac)*Reflection_Min
>
>
>
> Some considerations:
>
> If the ray hits the surface perpendicular (i.e. direction of ray vector = -
> direction of surface normal), cos_angle finally becomes 1, since the angle
> between the two vectors is zero.
>
> What follows is, that the variable Reflection_Frac gets zero in function
> "determine_reflectivity".
>
> In the end, the linear combination becomes shorter:
>
> Pseudocode: reflectivity = 0 * Reflection_Max + (1-0)*Reflection_Min =
> Reflection_Min
>
> Same for an angle of 90 degrees (and falloff 1):
> - Reflection_Frac gets 1
> - reflectivity = Reflection_Max
>
> My problem is: if I illuminate a surface with rays perpendicular to the surface,
> I would not expect a reflectivity equal to the minimum threshold. I would expect
> Reflection_Max! Same for an angle of 90 degrees between ray and surface normal:
> I would expect Reflection_Min, not Reflection_Max!
>
> Has anyone an idea to solve the problem? Where's my error in reasoning? It would
> be very helpful for me.
>
> Thank you very much!

Variable reflection in POV is not a realistic implementation,  but rather an
artistic interpretation.  Max simply corresponds to 90deg, min to 0deg.  There
is nothing that limits max to be greater than min.  But, in the end, this
simply a linear (or whatever the exponent is) variable reflection.

Fresnel reflection is a little more realistic, as it is based on ior and does
give higher reflectivity at the shallow angles and steeper angles as you are
expecting.  It still isn't an exact simulation of real-life, but much closer.
Real fresnel and refraction has two components a real and imaginary, POV only
uses the real component which corresponds to the IOR.

-tgq


Post a reply to this message

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