POV-Ray : Newsgroups : povray.general : Reflection of light due to difference in the index of refraction Server Time
23 Dec 2024 09:02:58 EST (-0500)
  Reflection of light due to difference in the index of refraction (Message 1 to 8 of 8)  
From: hjkqed
Subject: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 03:05:00
Message: <web.5c35aac4892c9dda5e43241e0@news.povray.org>
Hello.

I've been trying to simulate a rather simple phenomenon in physics wherein some
light will be reflected and transmitted when passing through two media of
different indices of refraction, where the intensities of the
reflection/transmission depend on the how much the difference is. (pg. 405,
Introduction to Electrodynamics, Griffiths. Fourth Edition).

So, technically, if we have a glass box placed in air with an ior != 1 (say, ior
= 2) then, when we shine light on the box, we should get some reflection of
light.

I've been trying to recreate this phenomenon using the source code below, but I
could not get any sort of reflection. Could anyone please help me why it doesn't
work? Thank you so much in advance.

--- code ---
#include "colors.inc"
#include "Glass.inc"
#include "textures.inc"

global_settings {
 assumed_gamma 1.0
 photons
  { count 2000 }
}

camera {location <0,0,-9> look_at <0,0,1> }
light_source {
 <0,0,-10>
 color White
}
background { Black }

box {
 <-3,-3,0>, <3,3,3>
 pigment { Col_Glass_Clear } interior {ior 2}
 finish { reflection { fresnel on }}
 photons { target reflection on refraction on}
}

box {
 <-3,-3,3>, <3,3,6>
 pigment { Col_Glass_Clear } interior {ior 1}
 finish { reflection { fresnel on }}
 photons { target reflection on refraction on}
}


Post a reply to this message

From: Jim Holsenback
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 04:59:59
Message: <5c35c61f$1@news.povray.org>
On 1/9/19 3:04 AM, hjkqed wrote:
> Hello.
> 
> I've been trying to simulate a rather simple phenomenon in physics wherein some
> light will be reflected and transmitted when passing through two media of
> different indices of refraction, where the intensities of the
> reflection/transmission depend on the how much the difference is. (pg. 405,
> Introduction to Electrodynamics, Griffiths. Fourth Edition).
> 
> So, technically, if we have a glass box placed in air with an ior != 1 (say, ior
> = 2) then, when we shine light on the box, we should get some reflection of
> light.
> 
> I've been trying to recreate this phenomenon using the source code below, but I
> could not get any sort of reflection. Could anyone please help me why it doesn't
> work? Thank you so much in advance.
> 
> --- code ---
> #include "colors.inc"
> #include "Glass.inc"
> #include "textures.inc"
> 
> global_settings {
>   assumed_gamma 1.0
>   photons
>    { count 2000 }
> }
> 
> camera {location <0,0,-9> look_at <0,0,1> }
> light_source {
>   <0,0,-10>
>   color White
> }
> background { Black }
> 
> box {
>   <-3,-3,0>, <3,3,3>
>   pigment { Col_Glass_Clear } interior {ior 2}
>   finish { reflection { fresnel on }}
>   photons { target reflection on refraction on}
> }
> 
> box {
>   <-3,-3,3>, <3,3,6>
>   pigment { Col_Glass_Clear } interior {ior 1}
>   finish { reflection { fresnel on }}
>   photons { target reflection on refraction on}
> }
> 
> 
> 
well i see at /least/ two issues ... no value for reflection and hollow 
is missing from the boxes

http://wiki.povray.org/content/Reference:Finish#Specular_Reflection
http://wiki.povray.org/content/Reference:Hollow_Object_Modifier


Post a reply to this message

From: jr
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 06:05:01
Message: <web.5c35d506ad35376448892b50@news.povray.org>
hi,

"hjkqed" <nomail@nomail> wrote:
> I've been trying to simulate a rather simple phenomenon in physics wherein some
> light will be reflected and transmitted when passing through two media of
> different indices of refraction, ...
> I've been trying to recreate this phenomenon using the source code below, but
> I could not get any sort of reflection. Could anyone please help me why it doesn't
> work? Thank you so much in advance.

after adding the '#version' and lowercasing "Glass.inc" in your code, all I get
is black/nothing displayed.


regards, jr.


Post a reply to this message

From: Bald Eagle
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 07:30:00
Message: <web.5c35e825ad353764765e06870@news.povray.org>
"jr" <cre### [at] gmailcom> wrote:
> hi,
>
> "hjkqed" <nomail@nomail> wrote:
> > I've been trying to simulate a rather simple phenomenon in physics wherein some
> > light will be reflected and transmitted when passing through two media of
> > different indices of refraction, ...
> > I've been trying to recreate this phenomenon using the source code below, but
> > I could not get any sort of reflection. Could anyone please help me why it doesn't
> > work? Thank you so much in advance.
>
> after adding the '#version' and lowercasing "Glass.inc" in your code, all I get
> is black/nothing displayed.
>
>
> regards, jr.

Because there's no light source?


Post a reply to this message

From: clipka
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 10:36:23
Message: <5c3614f7$1@news.povray.org>
Am 09.01.2019 um 09:04 schrieb hjkqed:

> I've been trying to recreate this phenomenon using the source code below, but I
> could not get any sort of reflection. Could anyone please help me why it doesn't
> work? Thank you so much in advance.

You need something to reflect.

This may sound trivial at first, but there's a catch: Light sources 
don't show up directly in the image (unless you assign a `looks_like` 
object), nor do they show up as reflections via the `reflection` 
mechanism (or as refractions, for that matter).

The mechanism by which reflections of light sources are made visible is 
via the specular highlights (`specular` and/or `phong`) mechanisms.

To better control the magnitude of specular highlights, I recommend 
using the `albedo` keyword to get the same scale as the `reflection` 
setting (otherwise the brightness is difficult to control and depends on 
the tightness of the highlights, i.e. the `roughness` and/or 
`phong_size` parameters). To make them conform to the Fresnel law you 
need to specify `fresnel on` right in the `finish` block (as opposed to 
the `reflection` block). (Requires POV-Ray v3.8.)

I recommend `specular` (being the more realistic model) with a very low 
`roughness` setting.


Post a reply to this message

From: Alain
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 11:03:25
Message: <5c361b4d@news.povray.org>
Le 19-01-09 à 03:04, hjkqed a écrit :
> Hello.
> 
> I've been trying to simulate a rather simple phenomenon in physics wherein some
> light will be reflected and transmitted when passing through two media of
> different indices of refraction, where the intensities of the
> reflection/transmission depend on the how much the difference is. (pg. 405,
> Introduction to Electrodynamics, Griffiths. Fourth Edition).
> 
> So, technically, if we have a glass box placed in air with an ior != 1 (say, ior
> = 2) then, when we shine light on the box, we should get some reflection of
> light.
> 
> I've been trying to recreate this phenomenon using the source code below, but I
> could not get any sort of reflection. Could anyone please help me why it doesn't
> work? Thank you so much in advance.
> 
> --- code ---
> #include "colors.inc"
> #include "Glass.inc"
> #include "textures.inc"
> 
> global_settings {
>   assumed_gamma 1.0
>   photons
>    { count 2000 }
> }
> 
> camera {location <0,0,-9> look_at <0,0,1> }
> light_source {
>   <0,0,-10>
>   color White
> }
> background { Black }
> 
> box {
>   <-3,-3,0>, <3,3,3>
>   pigment { Col_Glass_Clear } interior {ior 2}
>   finish { reflection { fresnel on }}
>   photons { target reflection on refraction on}
> }
> 
> box {
>   <-3,-3,3>, <3,3,6>
>   pigment { Col_Glass_Clear } interior {ior 1}
>   finish { reflection { fresnel on }}
>   photons { target reflection on refraction on}
> }
> 
> 
> 

As Clipka said, plus, the camera can never directly see the photons.
When using photons, you need some surface for them to show on.
To «see» the light, the finish need to have highlights enabled using 
specular or phong. Using a looks_like or associating some object with 
the light_source using an union is also an option.

finish { reflection { fresnel on }} mean finish{reflection{ 0 fresnel}}
It need to be : finish { reflection{ 1  fresnel}}
The «on» is optional. Default to «off» when fresnel is absent, and to 
«on» when present.

There is no need to use the hollow option. Here, it don't affect 
anything. It's only use is to make an object able to contain some media. 
Nothing else.

In the current sample, you don't need to include glass.inc and 
texture.inc as you use nothing from those.

The box with an IOR of 1 can be removed as it's invisible and have no 
effect at all. The whole environment have an IOR of 1 by default.


Post a reply to this message

From: jr
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 13:50:01
Message: <web.5c36412ead35376448892b50@news.povray.org>
hi,

"Bald Eagle" <cre### [at] netscapenet> wrote:
> "jr" <cre### [at] gmailcom> wrote:
> > ... is black/nothing displayed.
>
> Because there's no light source?

it was a quick look just before RL activity, but reading subsequent posts,
likely, I'd have been stumped at that point anyway.  :-)


regards, jr.


Post a reply to this message

From: hjkqed
Subject: Re: Reflection of light due to difference in the index of refraction
Date: 9 Jan 2019 16:35:00
Message: <web.5c3668e8ad3537645e43241e0@news.povray.org>
Alain <kua### [at] videotronca> wrote:
> Le 19-01-09 à 03:04, hjkqed a écrit :
> > Hello.
> >
> > I've been trying to simulate a rather simple phenomenon in physics wherein some
> > light will be reflected and transmitted when passing through two media of
> > different indices of refraction, where the intensities of the
> > reflection/transmission depend on the how much the difference is. (pg. 405,
> > Introduction to Electrodynamics, Griffiths. Fourth Edition).
> >
> > So, technically, if we have a glass box placed in air with an ior != 1 (say, ior
> > = 2) then, when we shine light on the box, we should get some reflection of
> > light.
> >
> > I've been trying to recreate this phenomenon using the source code below, but I
> > could not get any sort of reflection. Could anyone please help me why it doesn't
> > work? Thank you so much in advance.
> >
> > --- code ---
> > #include "colors.inc"
> > #include "Glass.inc"
> > #include "textures.inc"
> >
> > global_settings {
> >   assumed_gamma 1.0
> >   photons
> >    { count 2000 }
> > }
> >
> > camera {location <0,0,-9> look_at <0,0,1> }
> > light_source {
> >   <0,0,-10>
> >   color White
> > }
> > background { Black }
> >
> > box {
> >   <-3,-3,0>, <3,3,3>
> >   pigment { Col_Glass_Clear } interior {ior 2}
> >   finish { reflection { fresnel on }}
> >   photons { target reflection on refraction on}
> > }
> >
> > box {
> >   <-3,-3,3>, <3,3,6>
> >   pigment { Col_Glass_Clear } interior {ior 1}
> >   finish { reflection { fresnel on }}
> >   photons { target reflection on refraction on}
> > }
> >
> >
> >
>
> As Clipka said, plus, the camera can never directly see the photons.
> When using photons, you need some surface for them to show on.
> To «see» the light, the finish need to have highlights enabled using
> specular or phong. Using a looks_like or associating some object with
> the light_source using an union is also an option.
>
> finish { reflection { fresnel on }} mean finish{reflection{ 0 fresnel}}
> It need to be : finish { reflection{ 1  fresnel}}
> The «on» is optional. Default to «off» when fresnel is absent, and to
> «on» when present.
>
> There is no need to use the hollow option. Here, it don't affect
> anything. It's only use is to make an object able to contain some media.
> Nothing else.
>
> In the current sample, you don't need to include glass.inc and
> texture.inc as you use nothing from those.
>
> The box with an IOR of 1 can be removed as it's invisible and have no
> effect at all. The whole environment have an IOR of 1 by default.

Thank you so much! I have fixed it as you've suggested and it works!


Post a reply to this message

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