POV-Ray : Newsgroups : povray.unix : Confusion about the index of refraction Server Time
30 Dec 2024 12:05:42 EST (-0500)
  Confusion about the index of refraction (Message 1 to 10 of 11)  
Goto Latest 10 Messages Next 1 Messages >>>
From: Chaanakya
Subject: Confusion about the index of refraction
Date: 17 Jul 2012 08:55:02
Message: <web.500560817fd5a6c37f523b7e0@news.povray.org>
I've been trying to figure this out for a while.  Let's say one specifies an ior
of 1.5 (in the interior {} block).  Can't POV-Ray automatically calculate the
reflectance and transmittance?  It knows the angle of the incident light and the
index of refraction of the two media.  Even with the fresnel keyword, however,
POV-Ray still requires me to manually calculate and plug in the reflectance and
transmittance.  Am I missing something?

Sincerely,

Chaanakya


Post a reply to this message

From: clipka
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 11:13:45
Message: <50058129$1@news.povray.org>
Am 17.07.2012 14:54, schrieb Chaanakya:
> I've been trying to figure this out for a while.  Let's say one specifies an ior
> of 1.5 (in the interior {} block).  Can't POV-Ray automatically calculate the
> reflectance and transmittance?  It knows the angle of the incident light and the
> index of refraction of the two media.  Even with the fresnel keyword, however,
> POV-Ray still requires me to manually calculate and plug in the reflectance and
> transmittance.  Am I missing something?

(1) Historical reasons; early versions didn't have the fresnel keyword, 
and instead required you to tweak various parameters until the result 
looked reasonably ok. The parameters are still there.

(2) The fresnel formulae for reflectance and transmittance are correct 
for ideal, perfectly smooth surfaces, but real surfaces aren't that way; 
a surface with plenty of microscopic scratches, for instance, will 
exhibit a mix of specular reflection (from light rays that hit undamaged 
areas) and lamtertian diffuse reflection (from rays that hit a scratch). 
Lambertian law would also imply that in order to reduce the specular 
reflections on LCD displays you'd have to blur them, but researchers 
recently developed a surface microstructure (at below-wavelength scale) 
that will actually /suppress/ reflections.

(3) The fresnel formulae are correct for single interfaces, but real 
surfaces frequently involve some coating, making it a stack of multiple 
interfaces; it is much easier (in terms of geometric modelling and/or 
computational effort) to handle such surfaces with a tweaked 
single-interface model, rather than simulate the interactions between 
the material layers.

(4) Manually calculating reflectance and transmittance for an ideal 
surface shouldn't be necessary if you use both fresnel and conserve_energy.


(BTW, is there any reason you ask this in the unix-specific newsgroup?)


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 12:10:00
Message: <web.50058e423f1594627f523b7e0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 17.07.2012 14:54, schrieb Chaanakya:
> > I've been trying to figure this out for a while.  Let's say one specifies an ior
> > of 1.5 (in the interior {} block).  Can't POV-Ray automatically calculate the
> > reflectance and transmittance?  It knows the angle of the incident light and the
> > index of refraction of the two media.  Even with the fresnel keyword, however,
> > POV-Ray still requires me to manually calculate and plug in the reflectance and
> > transmittance.  Am I missing something?
>
> (1) Historical reasons; early versions didn't have the fresnel keyword,
> and instead required you to tweak various parameters until the result
> looked reasonably ok. The parameters are still there.
>
> (2) The fresnel formulae for reflectance and transmittance are correct
> for ideal, perfectly smooth surfaces, but real surfaces aren't that way;
> a surface with plenty of microscopic scratches, for instance, will
> exhibit a mix of specular reflection (from light rays that hit undamaged
> areas) and lamtertian diffuse reflection (from rays that hit a scratch).
> Lambertian law would also imply that in order to reduce the specular
> reflections on LCD displays you'd have to blur them, but researchers
> recently developed a surface microstructure (at below-wavelength scale)
> that will actually /suppress/ reflections.
>
> (3) The fresnel formulae are correct for single interfaces, but real
> surfaces frequently involve some coating, making it a stack of multiple
> interfaces; it is much easier (in terms of geometric modelling and/or
> computational effort) to handle such surfaces with a tweaked
> single-interface model, rather than simulate the interactions between
> the material layers.
>
> (4) Manually calculating reflectance and transmittance for an ideal
> surface shouldn't be necessary if you use both fresnel and conserve_energy.
>
>
> (BTW, is there any reason you ask this in the unix-specific newsgroup?)

1) Okay. I understand

2) For my application, I'm assuming that the surface is perfectly smooth, so as
long as POV-Ray uses the fresnel equations, that's fine by me.

3) I am again assuming that there is no coating on those interfaces and am
layering slabs in order to force computation of interactions between the layers,
so this is also fine.

4) I have found that if I only specify the IOR, conserve_energy, and fresnel
(with no pigment { transmit N.N } block), the object looks black.  This is the
one thing I don't understand.

Also, no, there is no specific reason - I just have gotten pretty good responses
from the folks over here, so I decided to post here :)

Sincerely,

Chaanakya


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 12:20:00
Message: <web.5005900d3f1594627f523b7e0@news.povray.org>
"Chaanakya" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 17.07.2012 14:54, schrieb Chaanakya:
> > > I've been trying to figure this out for a while.  Let's say one specifies an ior
> > > of 1.5 (in the interior {} block).  Can't POV-Ray automatically calculate the
> > > reflectance and transmittance?  It knows the angle of the incident light and the
> > > index of refraction of the two media.  Even with the fresnel keyword, however,
> > > POV-Ray still requires me to manually calculate and plug in the reflectance and
> > > transmittance.  Am I missing something?
> >
> > (1) Historical reasons; early versions didn't have the fresnel keyword,
> > and instead required you to tweak various parameters until the result
> > looked reasonably ok. The parameters are still there.
> >
> > (2) The fresnel formulae for reflectance and transmittance are correct
> > for ideal, perfectly smooth surfaces, but real surfaces aren't that way;
> > a surface with plenty of microscopic scratches, for instance, will
> > exhibit a mix of specular reflection (from light rays that hit undamaged
> > areas) and lamtertian diffuse reflection (from rays that hit a scratch).
> > Lambertian law would also imply that in order to reduce the specular
> > reflections on LCD displays you'd have to blur them, but researchers
> > recently developed a surface microstructure (at below-wavelength scale)
> > that will actually /suppress/ reflections.
> >
> > (3) The fresnel formulae are correct for single interfaces, but real
> > surfaces frequently involve some coating, making it a stack of multiple
> > interfaces; it is much easier (in terms of geometric modelling and/or
> > computational effort) to handle such surfaces with a tweaked
> > single-interface model, rather than simulate the interactions between
> > the material layers.
> >
> > (4) Manually calculating reflectance and transmittance for an ideal
> > surface shouldn't be necessary if you use both fresnel and conserve_energy.
> >
> >
> > (BTW, is there any reason you ask this in the unix-specific newsgroup?)
>
> 1) Okay. I understand
>
> 2) For my application, I'm assuming that the surface is perfectly smooth, so as
> long as POV-Ray uses the fresnel equations, that's fine by me.
>
> 3) I am again assuming that there is no coating on those interfaces and am
> layering slabs in order to force computation of interactions between the layers,
> so this is also fine.
>
> 4) I have found that if I only specify the IOR, conserve_energy, and fresnel
> (with no pigment { transmit N.N } block), the object looks black.  This is the
> one thing I don't understand.
>
> Also, no, there is no specific reason - I just have gotten pretty good responses
> from the folks over here, so I decided to post here :)
>
> Sincerely,
>
> Chaanakya

For example, take this block of code:

#version 3.6;
#include "colors.inc"

global_settings {
  max_trace_level 256
  ambient_light White
  assumed_gamma 1.0
}

camera {
  location <0,5,0>
  look_at <0,0,0>
}

light_source {
  <0,1000,0>
  color Red
}

plane {
  y, -10
  pigment { hexagon Green, White, Blue }
}

box {
  <-1,-1,-1>,<1,1,1>
  finish {
    ambient 0
    diffuse 0
    conserve_energy
    reflection { fresnel on }
    specular 0
    roughness 0.001
  }
  interior {
    ior 1.5
  }
}

This should render as (essentially) a glass cube.  However, it comes out black.

- Chaanakya


Post a reply to this message

From: clipka
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 12:44:34
Message: <50059672$1@news.povray.org>
Am 17.07.2012 18:09, schrieb Chaanakya:

> 4) I have found that if I only specify the IOR, conserve_energy, and fresnel
> (with no pigment { transmit N.N } block), the object looks black.  This is the
> one thing I don't understand.

Specify "transmit 1.0"; with conserve_energy, AFAIK you should be fine.

POV-Ray doesn't automatically do that for you because some people 
/might/ want to model non-transparent reflective materials, you know ;-)

You might argue that specifying an ior should automatically imply 
transparency, but this is not so: Real life opaque surfaces (or rather, 
surfaces of opaque materials) obey fresnel's law as well, so for best 
realism you need to use "fresnel on" and specify an ior for those as 
well, and even top it off with "conserve_energy" to modulate the diffuse 
reflection accordingly.

(All non-metallic "opaque" materials are actually transparent with very 
strong absorption and/or scattering effects; it would be too complex to 
model them as such though, hence the shortcut with a "surface color".)

If you have a scene with plenty of transparent stuff, you might want to 
specify "default { pigment { rgbt 1 } }" at the beginning of your scene 
file to save you a bit of typing.


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 13:15:00
Message: <web.50059d573f1594627f523b7e0@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 17.07.2012 18:09, schrieb Chaanakya:
>
> > 4) I have found that if I only specify the IOR, conserve_energy, and fresnel
> > (with no pigment { transmit N.N } block), the object looks black.  This is the
> > one thing I don't understand.
>
> Specify "transmit 1.0"; with conserve_energy, AFAIK you should be fine.
>
> POV-Ray doesn't automatically do that for you because some people
> /might/ want to model non-transparent reflective materials, you know ;-)
>
> You might argue that specifying an ior should automatically imply
> transparency, but this is not so: Real life opaque surfaces (or rather,
> surfaces of opaque materials) obey fresnel's law as well, so for best
> realism you need to use "fresnel on" and specify an ior for those as
> well, and even top it off with "conserve_energy" to modulate the diffuse
> reflection accordingly.
>
> (All non-metallic "opaque" materials are actually transparent with very
> strong absorption and/or scattering effects; it would be too complex to
> model them as such though, hence the shortcut with a "surface color".)
>
> If you have a scene with plenty of transparent stuff, you might want to
> specify "default { pigment { rgbt 1 } }" at the beginning of your scene
> file to save you a bit of typing.

Something's not working correctly - if I make a cube with an IOR of 1.5
(essentially a glass cube), I don't see a reflection.  There should be a
reflection at some point of the cube, but I don't see that.  I should see a
difference with conserve_energy toggled, but I'm not seeing that.  I think
there's something else that needs to be done, but I'm not sure what.

- Chaanakya


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 14:35:00
Message: <web.5005afc03f1594627f523b7e0@news.povray.org>
"Chaanakya" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 17.07.2012 18:09, schrieb Chaanakya:
> >
> > > 4) I have found that if I only specify the IOR, conserve_energy, and fresnel
> > > (with no pigment { transmit N.N } block), the object looks black.  This is the
> > > one thing I don't understand.
> >
> > Specify "transmit 1.0"; with conserve_energy, AFAIK you should be fine.
> >
> > POV-Ray doesn't automatically do that for you because some people
> > /might/ want to model non-transparent reflective materials, you know ;-)
> >
> > You might argue that specifying an ior should automatically imply
> > transparency, but this is not so: Real life opaque surfaces (or rather,
> > surfaces of opaque materials) obey fresnel's law as well, so for best
> > realism you need to use "fresnel on" and specify an ior for those as
> > well, and even top it off with "conserve_energy" to modulate the diffuse
> > reflection accordingly.
> >
> > (All non-metallic "opaque" materials are actually transparent with very
> > strong absorption and/or scattering effects; it would be too complex to
> > model them as such though, hence the shortcut with a "surface color".)
> >
> > If you have a scene with plenty of transparent stuff, you might want to
> > specify "default { pigment { rgbt 1 } }" at the beginning of your scene
> > file to save you a bit of typing.
>
> Something's not working correctly - if I make a cube with an IOR of 1.5
> (essentially a glass cube), I don't see a reflection.  There should be a
> reflection at some point of the cube, but I don't see that.  I should see a
> difference with conserve_energy toggled, but I'm not seeing that.  I think
> there's something else that needs to be done, but I'm not sure what.
>
> - Chaanakya

Also, the example given in this thread should work with this method and it
doesn't:
http://news.povray.org/povray.beta-test/message/%3Cweb.500469a1adf6cd217f523b7e0%40news.povray.org%3E/#%3Cweb.500469a1a
df6cd217f523b7e0%40news.povray.org%3E


Post a reply to this message

From: clipka
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 16:34:27
Message: <5005cc53$1@news.povray.org>
Am 17.07.2012 19:13, schrieb Chaanakya:

>> If you have a scene with plenty of transparent stuff, you might want to
>> specify "default { pigment { rgbt 1 } }" at the beginning of your scene
>> file to save you a bit of typing.
>
> Something's not working correctly - if I make a cube with an IOR of 1.5
> (essentially a glass cube), I don't see a reflection.  There should be a
> reflection at some point of the cube, but I don't see that.

Uh... yes, you should /definitely/ see a reflection. You do have some 
surroundings to reflect in the cube, don't you?

And I'm presuming you did specify "finish { reflection { 1.0 fresnel } }".


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 20:45:01
Message: <web.5006065a3f159462b8fe1f630@news.povray.org>
clipka <ano### [at] anonymousorg> wrote:
> Am 17.07.2012 19:13, schrieb Chaanakya:
>
> >> If you have a scene with plenty of transparent stuff, you might want to
> >> specify "default { pigment { rgbt 1 } }" at the beginning of your scene
> >> file to save you a bit of typing.
> >
> > Something's not working correctly - if I make a cube with an IOR of 1.5
> > (essentially a glass cube), I don't see a reflection.  There should be a
> > reflection at some point of the cube, but I don't see that.
>
> Uh... yes, you should /definitely/ see a reflection. You do have some
> surroundings to reflect in the cube, don't you?
>
> And I'm presuming you did specify "finish { reflection { 1.0 fresnel } }".

Does this look like a glass cube?

#version 3.6;
#include "colors.inc"
#include "CIE.inc"

global_settings {
  max_trace_level 1024
  ambient_light White
  assumed_gamma 1.0
}

camera {
  location <3.5,3.5,0>
  //rotate <0,-clock*360,0>
  look_at <0,0,0>
}

light_source {
  <1000, 1000, 0>
  color White
}

plane {
  y, -10.0
  pigment { checker Green, White }
}

box {
  <-1,-1,-1>,<1,1,1>
  pigment {
    transmit 1
  }
  finish {
    ambient 0
    diffuse 0
    conserve_energy
    reflection {
      1.0
      fresnel on
    }
    specular 0
    roughness 0.001
  }
  interior {
    ior 1.5
  }
}

As I said, something doesn't look right here.  Thank you so much for your help!

- Chaanakya


Post a reply to this message

From: Chaanakya
Subject: Re: Confusion about the index of refraction
Date: 17 Jul 2012 22:05:00
Message: <web.5006192a3f159462b8fe1f630@news.povray.org>
"Chaanakya" <nomail@nomail> wrote:
> clipka <ano### [at] anonymousorg> wrote:
> > Am 17.07.2012 19:13, schrieb Chaanakya:
> >
> > >> If you have a scene with plenty of transparent stuff, you might want to
> > >> specify "default { pigment { rgbt 1 } }" at the beginning of your scene
> > >> file to save you a bit of typing.
> > >
> > > Something's not working correctly - if I make a cube with an IOR of 1.5
> > > (essentially a glass cube), I don't see a reflection.  There should be a
> > > reflection at some point of the cube, but I don't see that.
> >
> > Uh... yes, you should /definitely/ see a reflection. You do have some
> > surroundings to reflect in the cube, don't you?
> >
> > And I'm presuming you did specify "finish { reflection { 1.0 fresnel } }".
>
> Does this look like a glass cube?
>
> #version 3.6;
> #include "colors.inc"
> #include "CIE.inc"
>
> global_settings {
>   max_trace_level 1024
>   ambient_light White
>   assumed_gamma 1.0
> }
>
> camera {
>   location <3.5,3.5,0>
>   //rotate <0,-clock*360,0>
>   look_at <0,0,0>
> }
>
> light_source {
>   <1000, 1000, 0>
>   color White
> }
>
> plane {
>   y, -10.0
>   pigment { checker Green, White }
> }
>
> box {
>   <-1,-1,-1>,<1,1,1>
>   pigment {
>     transmit 1
>   }
>   finish {
>     ambient 0
>     diffuse 0
>     conserve_energy
>     reflection {
>       1.0
>       fresnel on
>     }
>     specular 0
>     roughness 0.001
>   }
>   interior {
>     ior 1.5
>   }
> }
>
> As I said, something doesn't look right here.  Thank you so much for your help!
>
> - Chaanakya

Never mind....when I rerendered the 1/sqrt(2) IOR (mentioned in the thread I
linked to above), I got the expected result.  Hence, this problem has been
solved.  Thank you very much for bearing with me :D

Sincerely,

- Chaanakya


Post a reply to this message

Goto Latest 10 Messages Next 1 Messages >>>

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