POV-Ray : Newsgroups : povray.binaries.images : Fresnel reflection { 0 } vs. Lambertian Server Time
6 Nov 2024 06:24:56 EST (-0500)
  Fresnel reflection { 0 } vs. Lambertian (Message 1 to 3 of 3)  
From: Cousin Ricky
Subject: Fresnel reflection { 0 } vs. Lambertian
Date: 27 Mar 2020 20:52:53
Message: <5e7e9fe5$1@news.povray.org>
I was modeling a floor with varying levels of glossiness, and just as a 
sanity check, I compared a floor of Fresnel reflection 0 to a floor with 
no Fresnel reflection.  To my surprise, the former was darker than the 
latter.  Is this correct?  It seems to me that they should look the same.

The first attached image has only diffuse reflection.  The second has 
finish level Fresnel with reflection { 0 }.  The last, for sake of 
completeness, has full gloss with finish level Fresnel and reflection { 
1 }.  These images were rendered with radiosity, but rendering with 
ambient yields similar results.

(I haven't seen clipka lately.  Wasn't he working on this?)

------------[BEGIN CODE]------------
// +KFF3
#version 3.8;

#ifndef (Rad) #declare Rad = off; #end

#include "screen.inc"

global_settings
{ assumed_gamma 1
   #if (Rad)
     #declare Pixel = 1 / max (image_width, image_height);
     radiosity
     { count 200
       error_bound 0.5
       pretrace_start 32 * Pixel
       pretrace_end 2 * Pixel
       recursion_limit 2
     }
   #end
}

#default { finish { ambient 0.1 diffuse 1.0 emission 0 } }

Set_Camera (<0, 2, -5>, <0, 1, 0>, 30 * image_width / image_height)

//--------------------- ENVIRONMENT ------------------------

#declare RBULB = 0.1;
#declare DIST = 5;
#declare Surface = pow (DIST / RBULB, 2);
light_source
{ <0, 2.5, 5>, rgb (1 + Surface) / 2
   fade_power 2 fade_distance RBULB
   spotlight point_at <0, 1, 0> radius 45 falloff 90
   looks_like
   { sphere
     { 0, RBULB
       pigment { rgb 1 }
       finish { ambient 0 diffuse 0 emission Surface }
       no_radiosity
     }
   }
}

box
{ -1, 1 scale <6, 8, 6>
   hollow
   pigment { rgb 0.6 }
}

//----- things to reflect -------
#declare Sculpture = union
{ cylinder { 0, 1.5 * y, 0.5 }
   sphere { 1.5 * y, 0.5 }
}
object { Sculpture pigment { blue 0.5 } translate <0.6, 0, 5.5> }
object { Sculpture pigment { green 0.5 } translate <1.8, 0, 5.5> }
object { Sculpture pigment { red 0.5 } translate <3.0, 0, 5.5> }

//---------------------- GLOSS TEST ------------------------

plane
{ y, 0
   pigment { checker rgb 0.03 rgb 0.6 }
   #switch (frame_number)
     #case (2)
       #declare s_Case = "fresnel reflection { 0 }"
       finish
       { fresnel
         reflection { 0 }
         conserve_energy
       }
       interior { ior 1.5 }
       #break
     #case (3)
       #declare s_Case = "fresnel reflection { 1 }"
       finish
       { fresnel
         reflection { 1 }
         conserve_energy
       }
       interior { ior 1.5 }
       #break
     #else
       #declare s_Case = "no specular reflection"
   #end
}

//---------------------- ANNOTATION ------------------------

Screen_Object
( union
   { text { ttf "cyrvetic" s_Case 0.001, 0 translate y }
     text
     { ttf "cyrvetic"
       concat ("Radiosity is ", #if (Rad) "on." #else "off." #end)
       0.001, 0
     }
     pigment { rgb 0.7 }
     finish { ambient 0 diffuse 0 emission 1 }
     scale 0.065
   },
   <0, 0.8>, <0.02, 0.02>, yes, 1
)
-------------[END CODE]-------------


Post a reply to this message


Attachments:
Download 'glossy_floor-pbi-rad1.jpg' (16 KB) Download 'glossy_floor-pbi-rad2.jpg' (15 KB) Download 'glossy_floor-pbi-rad3.jpg' (16 KB)

Preview of image 'glossy_floor-pbi-rad1.jpg'
glossy_floor-pbi-rad1.jpg

Preview of image 'glossy_floor-pbi-rad2.jpg'
glossy_floor-pbi-rad2.jpg

Preview of image 'glossy_floor-pbi-rad3.jpg'
glossy_floor-pbi-rad3.jpg


 

From: William F Pokorny
Subject: Re: Fresnel reflection { 0 } vs. Lambertian
Date: 6 May 2020 12:16:24
Message: <5eb2e2d8$1@news.povray.org>
On 3/27/20 8:52 PM, Cousin Ricky wrote:
> I was modeling a floor with varying levels of glossiness, and just as a 
> sanity check, I compared a floor of Fresnel reflection 0 to a floor with 
> no Fresnel reflection.  To my surprise, the former was darker than the 
> latter.  Is this correct?  It seems to me that they should look the same.
> 
> The first attached image has only diffuse reflection.  The second has 
> finish level Fresnel with reflection { 0 }.  The last, for sake of 
> completeness, has full gloss with finish level Fresnel and reflection { 
> 1 }.  These images were rendered with radiosity, but rendering with 
> ambient yields similar results.
> 
> (I haven't seen clipka lately.  Wasn't he working on this?)
> 
...
> //---------------------- GLOSS TEST ------------------------
> 
> plane
> { y, 0
>    pigment { checker rgb 0.03 rgb 0.6 }
>    #switch (frame_number)
>      #case (2)
>        #declare s_Case = "fresnel reflection { 0 }"
>        finish
>        { fresnel
>          reflection { 0 }
>          conserve_energy
>        }
>        interior { ior 1.5 }
>        #break
>      #case (3)
>        #declare s_Case = "fresnel reflection { 1 }"
>        finish
>        { fresnel
>          reflection { 1 }
>          conserve_energy
>        }
>        interior { ior 1.5 }
>        #break
>      #else
>        #declare s_Case = "no specular reflection"
>    #end
> }
> 
...

Saw this post months back. But, I wasn't really following or involved in 
this work so I let it go.

Given nobody has stepped in to answer, I decided to look at the parser 
code quickly today ahead of lunch.

My read of the parser code.
----
It looks like the parser defaults the finish fresnel to 1.0 if no float 
specified so you are turning it on in both cases despite not passing a 
non-zero float - and you have the required ior.

When the reflection block precedes the finish block's fresnel, the 
fresnel keyword in the reflection block is turned on. Otherwise it is 
only on if you specify fresnel in the reflection block yourself.

 From this, I don't think you are getting fresnel 'reflections' in any 
case.

Fresnel is on always though, so it's still doing whatever it does to the 
other finish components - which I suspect explains the darker result. 
The idea of the finish level fresnel wasn't much about the reflection 
block as far as I knew, but about the behavior with respect to other 
finish elements when you know the (surface) IOR.

Disclaimer. This is me complaining about the first base umpires call 
from the top row of the upper most deck (back in the day when we went to 
sporting events...). That said, does this interpretation makes sense 
given what you see? I've not run anything - just a quick look at the 
parser code...

Bill P.


Post a reply to this message

From: Cousin Ricky
Subject: Re: Fresnel reflection { 0 } vs. Lambertian
Date: 23 Jun 2020 23:34:56
Message: <5ef2c9e0$1@news.povray.org>
On 2020-05-06 12:16 PM (-4), William F Pokorny wrote:
> It looks like the parser defaults the finish fresnel to 1.0 if no float 
> specified so you are turning it on in both cases despite not passing a 
> non-zero float - and you have the required ior.
> 
> When the reflection block precedes the finish block's fresnel, the 
> fresnel keyword in the reflection block is turned on. Otherwise it is 
> only on if you specify fresnel in the reflection block yourself.
> 
>  From this, I don't think you are getting fresnel 'reflections' in any 
> case.
> 
> Fresnel is on always though, so it's still doing whatever it does to the 
> other finish components - which I suspect explains the darker result. 
> The idea of the finish level fresnel wasn't much about the reflection 
> block as far as I knew, but about the behavior with respect to other 
> finish elements when you know the (surface) IOR.

This was exactly the situation.  Giving fresnel an argument solved the 
problem.  Thanks!


Post a reply to this message

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