POV-Ray : Newsgroups : povray.newusers : Fresnel Reflection Server Time
31 Oct 2024 22:21:57 EDT (-0400)
  Fresnel Reflection (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Crippso
Subject: Fresnel Reflection
Date: 29 Mar 2012 18:55:01
Message: <web.4f74e7b1541dd2f6130037650@news.povray.org>
Hi, I'm still struggling to correctly draw simple scenes using fresnel
reflection and photons (code below). Any idea why this code doesnt show the box?
with ior = 5 I expected to see the box being about 0.44 intensity

thanks
Stu


#default {finish {ambient 0 diffuse 0}}

global_settings{assumed_gamma 1 max_trace_level 50 photons{spacing 0.001}}
camera{orthographic location <0,0,1> look_at <0,0,0> angle 90}
light_source{<0,0,2>,1 parallel point_at 0}
box{<-.5,-.5,0.1> <.5,.5,0> pigment{rgb 1} finish{reflection{0,1 fresnel}
conserve_energy} interior{ior 5.0} photons{target reflection on refraction on}}


Post a reply to this message

From: clipka
Subject: Re: Fresnel Reflection
Date: 30 Mar 2012 10:31:46
Message: <4f75c3d2@news.povray.org>
Am 30.03.2012 00:52, schrieb Crippso:
> Hi, I'm still struggling to correctly draw simple scenes using fresnel
> reflection and photons (code below). Any idea why this code doesnt show the box?
> with ior = 5 I expected to see the box being about 0.44 intensity

It seems to me that you have a severe misconception about what POV-Ray's 
"photons" feature does.

POV-Ray's "photons" feature is a way to model light rays that first 
reflect off a mirror, or get refracted, and then get scattered off a 
diffuse surface into the camere.

It does /not/ model light rays that reflect off a mirror directly into 
the camera. Those are accounted for by the "specular" or "phong" feature 
instead.

(Unfortunately, "specular" and "phong" will not help you either, as they 
currently do not model fresnel falloff. You might be able to pull off 
some stunt with the "aoi" pattern, to blend between textures with 
different "specular" or "phong" parameters, but you'll have to implement 
the fresnel formula yourself in that case.)


Post a reply to this message

From: Crippso
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 08:00:01
Message: <web.4f7842d3b367ce55130037650@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 30.03.2012 00:52, schrieb Crippso:
> > Hi, I'm still struggling to correctly draw simple scenes using fresnel
> > reflection and photons (code below). Any idea why this code doesnt show the box?
> > with ior = 5 I expected to see the box being about 0.44 intensity
>
> It seems to me that you have a severe misconception about what POV-Ray's
> "photons" feature does.
>
> POV-Ray's "photons" feature is a way to model light rays that first
> reflect off a mirror, or get refracted, and then get scattered off a
> diffuse surface into the camere.
>
> It does /not/ model light rays that reflect off a mirror directly into
> the camera. Those are accounted for by the "specular" or "phong" feature
> instead.
>
> (Unfortunately, "specular" and "phong" will not help you either, as they
> currently do not model fresnel falloff. You might be able to pull off
> some stunt with the "aoi" pattern, to blend between textures with
> different "specular" or "phong" parameters, but you'll have to implement
> the fresnel formula yourself in that case.)

thanks Clipka, ok so I try the code below to try and see the fresnel reflected
light from the mirror onto a diffuse disc but it still doesnt work. Am i doing
something wrong?

#local p_start  = 0.1;
#local p_end_final = 0.05;

#local final_eb  = 0.5;
#local final_count = 50000;


#default {finish {ambient 0 diffuse 0}}

global_settings{assumed_gamma 1 max_trace_level 50 photons{count 575000}
radiosity
{
    pretrace_start p_start
    pretrace_end   p_end_final
    count final_count
    low_error_factor .05
    nearest_count 1
    error_bound final_eb
    recursion_limit 3
    minimum_reuse 0.001
    gray_threshold 0.0
    normal on
    }
}

camera{orthographic location <0,0,1> look_at <0,0,-1> angle 90}
light_source{<0,0,1.5>,1.0 parallel point_at <0,0,2>}
box{<-0.5,-0.5,2> <0.5,0.5,3> pigment{rgbt <1,1,1,1>} finish{reflection{0,1
fresnel} conserve_energy}  interior{ior 1.5} photons{target reflection on
refraction on collect on}}
disc{<0,0,-1> <0,0,1> 1 pigment{rgb 1} finish{diffuse 1.0} photons{target
reflection on refraction on collect on}}


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 09:22:58
Message: <4f7856b2@news.povray.org>
Crippso wrote:

> thanks Clipka, ok so I try the code below to try and see the fresnel reflected
> light from the mirror onto a diffuse disc but it still doesnt work. Am i doing
> something wrong?

shooting photons perpependicular to the mirror surface as
in your setup is precisely where fresnel reflection is 0.
I moved the mirror and light and get a rectangle on the
disc that is the reflected image of the box.

Also note that the diffuse surface does not require
a photon block as it should not be a target, and collect
is on by default. Also you'll get a more interesting
reflection if you remove parallel and point_at.


#local p_start  = 0.1;
#local p_end_final = 0.05;

#local final_eb  = 0.5;
#local final_count = 50000;


#default {finish {ambient 0 diffuse 0}}

global_settings
{
   assumed_gamma 1
   max_trace_level 50 photons{count 575000}
}


camera
{
   orthographic
   location <0,0,1>
   look_at  <0,0,-1>
   angle 90
}

light_source{<10,0,-1>, 1 parallel point_at <5,0,2>}

box
{
   <-0.5,-0.5,2> <0.5,0.5,3>
   pigment{rgbt 1}
   finish
   {
     reflection{0,1 fresnel}
     conserve_energy
   }
   interior{ior 1.5}
   photons
   {
     target
     reflection on
     refraction on
     collect off
   }
   translate 5*x
}


disc
{
   <0,0,-1> <0,0,1> 1
   pigment{rgb 1}
   finish{diffuse 1.0}
}


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 09:53:24
Message: <4f785dd4$1@news.povray.org>
Christian Froeschlin wrote:

> I moved the mirror and light and get a rectangle on the
> disc that is the reflected image of the box.

although I have to confess I don't quite understand the effect.
I found the light was actually from multiple refractions / reflections.
With an opaque pigment I no longer get any light until the angle gets
well below 45 degrees or so.

It reminds me of total internal reflection although it seems to be
the wrong way around. Or is it valid because fresnel reflection occurs
in the transparent glaze and gets trapped by TIR on the way out? In this
case the reason glass in real world gives me reflections at steeper
angles is due to transparency, refraction, and multiple reflections?


Post a reply to this message

From: clipka
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 10:03:29
Message: <4f786031$1@news.povray.org>
Am 01.04.2012 13:58, schrieb Crippso:

> thanks Clipka, ok so I try the code below to try and see the fresnel reflected
> light from the mirror onto a diffuse disc but it still doesnt work. Am i doing
> something wrong?

Aside from what Christian already mentioned, you should be ok now - 
theoretically. Unfortunately, in POV-Ray 3.7 release candidates RC4 and 
RC5, photons reflection doesn't work properly due to a stupid bug, 
behaving always as if "reflection off" was specified; so you're 
currently limited to exploring the effects of refraction. (See thread 
"Photons not working as expected?" in povray.beta-test)


Post a reply to this message

From: clipka
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 10:13:54
Message: <4f7862a2@news.povray.org>
Am 01.04.2012 15:53, schrieb Christian Froeschlin:
> Christian Froeschlin wrote:
>
>> I moved the mirror and light and get a rectangle on the
>> disc that is the reflected image of the box.
>
> although I have to confess I don't quite understand the effect.
> I found the light was actually from multiple refractions / reflections.
> With an opaque pigment I no longer get any light until the angle gets
> well below 45 degrees or so.

You're probably using RC4 or RC5 as well, so what you see is the result 
of the bug I just mentioned. It seems that it doesn't harm total 
internal reflection though, which may be the reason that you still see 
any reflections at all with the transparent pigment.


Post a reply to this message

From: Crippso
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 10:20:01
Message: <web.4f78637db367ce55130037650@news.povray.org>
Christian Froeschlin <chr### [at] chrfrde> wrote:
> Crippso wrote:
>
> > thanks Clipka, ok so I try the code below to try and see the fresnel reflected
> > light from the mirror onto a diffuse disc but it still doesnt work. Am i doing
> > something wrong?
>
> shooting photons perpependicular to the mirror surface as
> in your setup is precisely where fresnel reflection is 0.
> I moved the mirror and light and get a rectangle on the
> disc that is the reflected image of the box.
>
> Also note that the diffuse surface does not require
> a photon block as it should not be a target, and collect
> is on by default. Also you'll get a more interesting
> reflection if you remove parallel and point_at.
>
>
> #local p_start  = 0.1;
> #local p_end_final = 0.05;
>
> #local final_eb  = 0.5;
> #local final_count = 50000;
>
>
> #default {finish {ambient 0 diffuse 0}}
>
> global_settings
> {
>    assumed_gamma 1
>    max_trace_level 50 photons{count 575000}
> }
>
>
> camera
> {
>    orthographic
>    location <0,0,1>
>    look_at  <0,0,-1>
>    angle 90
> }
>
> light_source{<10,0,-1>, 1 parallel point_at <5,0,2>}
>
> box
> {
>    <-0.5,-0.5,2> <0.5,0.5,3>
>    pigment{rgbt 1}
>    finish
>    {
>      reflection{0,1 fresnel}
>      conserve_energy
>    }
>    interior{ior 1.5}
>    photons
>    {
>      target
>      reflection on
>      refraction on
>      collect off
>    }
>    translate 5*x
> }
>
>
> disc
> {
>    <0,0,-1> <0,0,1> 1
>    pigment{rgb 1}
>    finish{diffuse 1.0}
> }

Thanks for the reply - but i notice you say that when the photons are
perpendicular to the surface the fresnel reflection will be precisely 0. Is this
really true in povray? In the real world the fresnel reflection would be 2 times
((1.5-1)/(1.5+1))^2 = 0.08.


Post a reply to this message

From: Christian Froeschlin
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 10:52:10
Message: <4f786b9a$1@news.povray.org>
Crippso wrote:

> Thanks for the reply - but i notice you say that when the photons are
> perpendicular to the surface the fresnel reflection will be precisely 0. Is this
> really true in povray? In the real world the fresnel reflection would be 2 times
> ((1.5-1)/(1.5+1))^2 = 0.08.

good point. The documentation does not mention the details, and
since RC5 is broken its difficult to experiment with 3.7 behavior.
It's possible that even with fresnel the results are interpolated
between the min and max reflection values for artistic license. At
least in 3.6 changing the min value from 0 to 0.1 had an effect.
Depending on the implementation it could also be that reflections
for photons behave differently from normal tracing.

Apart from that as I already posted I found that the actual first
reflection seemed to be 0 up to some very large angle (3.6 also showed
this behavior so it's not related to the RC5 bug). It seems to me like
that may be a bug in the fresnel handling for photons ... basically
the following shows a hard fresnel reflection cutoff in 3.6 near


#default {finish {ambient 0 diffuse 0}}

global_settings
{
   assumed_gamma 1
   max_trace_level 10
   photons{count 500000}
}


camera
{
   orthographic
   location <0,0,1>
   look_at  <0,0,-1>
   angle 90
}

light_source{<10,0,-1>, 10}

box
{
   <-0.5,-0.5,3> <0.5,0.5,4>
   pigment{rgb 1}
   finish
   {
     reflection{0,1 fresnel}
   }
   interior{ior 1.5}
   photons
   {
     target
     reflection on
     refraction on
     collect off
   }
   translate 5*x
}

disc
{
   <0,0,-1> <0,0,1> 1
   pigment{rgb 1}
   finish{diffuse 1.0}
}


Post a reply to this message

From: clipka
Subject: Re: Fresnel Reflection
Date: 1 Apr 2012 11:37:18
Message: <4f78762e@news.povray.org>
Am 01.04.2012 16:17, schrieb Crippso:

> Thanks for the reply - but i notice you say that when the photons are
> perpendicular to the surface the fresnel reflection will be precisely 0. Is this
> really true in povray? In the real world the fresnel reflection would be 2 times
> ((1.5-1)/(1.5+1))^2 = 0.08.

That's also what POV-Ray will compute - provided you set adc_bailout low 
enough. (I'm a bit puzzled though why adc_bailout needs to be as low as 
0.0015 for this to work; I'd have expected anything below 0.08 to be ok.)


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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