POV-Ray : Newsgroups : povray.binaries.images : Dielectric experiments : Re: Dielectric experiments Server Time
2 Nov 2024 10:15:23 EDT (-0400)
  Re: Dielectric experiments  
From: Ive
Date: 10 Feb 2011 16:56:58
Message: <4d545f2a@news.povray.org>
Am 09.02.2011 04:44, schrieb Robert McGregor:
> According to Wikipedia, Mental Ray's *Dielectric Physical Phenomenon* shader
> "uses Fresnel equations to simulate reflectance and transmittance of light
> passing through the dielectric interface, as well as using Snell's law to
> determine the angle of refraction. In addition Beer's law is used to determine
> absorption of rays passing through dielectric materials."
>
> Well, after looking over some basic dielectric equations I came up with this
> simple POV-SDL setup for the following basic dielectric material in POV-Ray. The
> transparency and reflection of the material automatically tune themselves
> according to the material's IOR value:
>

As I had no time this morning here is a more detailed response:


> //------------------------------------------------------------------------------
> // Dielectric Ball
> /------------------------------------------------------------------------------
> global_settings { photons { spacing 0.01 } }
>
> #declare IOR   = 1.33;
> #declare REFL  = pow(((1-IOR)/(1+IOR)), 2);
> #declare TRANS = 1 - REFL;
>
> sphere { 0, 1
>     texture {
>        pigment { rgb 0 transmit TRANS }
>        finish {
>           reflection {0, REFL fresnel on } conserve_energy
>           specular REFL roughness 0.005
>        }
>     }
>     interior { ior IOR }
>     photons {
>        target
>        refraction on
>        reflection on
>        collect off
>     }
> }
>

Sorry, this is pointless. But step by step...

 > #declare REFL  = pow(((1-IOR)/(1+IOR)), 2);

this is the reflectance when seen *parallel* to the surface normal (or 

get 4% reflection and 96% refraction at this angle.
But when seen from a very swallow angle for *every* IOR reflection gets 
close to 100% and refraction to 0%. Again for glass, when seen from an 

refraction only 1.4%.
Everybody can verify this easily by looking at a *very* swallow angle at 
some glass window. The glass becomes an almost perfect mirror.
In POV-Ray-syntax this would be
reflection (REFL, 1) and definitely not reflection (0, REFL)
but it is completely unnecessary to compute the value for REFL because 
for this purpose we have the keyword fresnel.
reflection (0, 1 fresnel on)
already calculates exactly e.g. 4% reflection for a given IOR of 1.5 and 


The keyword transmit is meant to simulate something like light that 
falls through thin paper or through silk or something like this.
To simulate a dielectric it is much better to use filter. It makes 
things like colored glass possible and makes it also possible to take 
conservation of energy into account and therefor we have the 
conserve_energy keyword. So there is no need to calculate something
like
#declare TRANS = 1 - REFL;
especially since the whole point of fresnel reflection is that the 
relation between reflected and refracted (or transmitted as you did put 
it) rays is not constant but depends on the viewing angle.


A dielectric like window glass within POV-Ray is just as simple as this:

material {
   pigment {rgbf 1}
   finish {
     ambient 0  diffuse 0
     reflection {0, 1 fresnel on} conserve_energy
   }
   interior {ior 1.5}
}



A solution for colored dielectric materials within POV-Ray would be this 
macro:

#macro Dielectric (COLOR, IOR)
   material {
     texture {
       pigment {rgb COLOR filter 1}
       finish {
         ambient 0 diffuse 0
         reflection {0 1 fresnel on}  conserve_energy
       }
     }
     interior {
       ior IOR
       fade_power 1001 fade_distance 1/IOR
       fade_color rgb <pow(COLOR.red,3), pow(COLOR.green,3), 
pow(COLOR.blue,3)>
     }
   }
   photons {
     target
     refraction on
     reflection on
     collect off
   }
#end

It should even be possible to model something like porcelain (with some 
quite high IOR value) but dielectrics like this are more problematic as 
light scattering becomes more important.


Attached is a quick dielectric doodle and the source for it.

Note that the environment is (on purpose) quite boring so we have no 
interesting reflections on that thingies.

-Ive


Post a reply to this message


Attachments:
Download 'dielectricthing.jpg' (95 KB) Download 'us-ascii' (5 KB)

Preview of image 'dielectricthing.jpg'
dielectricthing.jpg

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