POV-Ray : Newsgroups : povray.binaries.images : SpectralRender/ior.inc dispersion mismatches Server Time: 29 Jun 2017 12:26:25 GMT
  SpectralRender/ior.inc dispersion mismatches (Message 1 to 4 of 4)  
From: Cousin Ricky
Subject: SpectralRender/ior.inc dispersion mismatches
Date: 13 Apr 2017 02:45:17
Message: <58eee63d@news.povray.org>
I am working on a diamond cut.  A while ago, in comparing ior.inc 
dispersion with Lilysoft's SpectralRender ("Native dispersion v. 
spectral render" in p.b.i), I noticed a discrepancy in the apparent 
index of refraction of BK7 glass between the two renders.  So, just to 
make sure that wasn't a fluke, I tested both methods with a diamond prism.

The images are of a glowing rod viewed through the prism.  I used black 
body 6504 for the SpectralRender runs because the black body curve is 
smoother in the violet area than D65; but I used rgb 1 (equivalent to 
D65) for the native POV-Ray runs, because POV-Ray's dispersion algorithm 
alters the hues of wavelengths for colored lights.  The two whites are 
very similar, but D65 has less violet.  The SpectralRender output is 
gamut-mapped to preserve hues.  The environment for all renders was 
centralized in an include file to guarantee consistency.

Image thru-pbi-diamond1.png shows my initial set of test runs.  The 
leftmost spectrum uses the dispersion value from consts.inc, and the 
rightmost uses the dispersion value from ior.inc.  I have not shown a 
render of the IOR from consts.inc, because I've long considered that 
value a typo, but if SpectralRender's detailed wavelength data are the 
benchmark, it is clear that const.inc's dispersion value is not accurate 
either.

But there is still a difference between ior.inc and SpectralRender in 
the overall amount of refraction.

I took a look at their respective values for n.  They are:

   ior.inc   SpectralRender
   -------   --------------
   2.4170    2.4176

The SpectralRender value is that of spline S_IOR_Diamond at wavelength D.

That difference is too small to account for the discrepancy between the 
renders.  My next thought was, what if POV-Ray's dispersion algorithm 
assumes that n is at a more central wavelength, say 550 mn?  I tried ior 
S_IOR_Diamond(550), and the result is the leftmost spectrum of image 
thru-pbi-diamond2.png.  But I had to take it down even further, to ior 
S_IOR_Diamond(515), for a comparable match.  That render is the 
rightmost spectrum.

It didn't take long browsing ior.inc to find in the notes that n is 
assumed to be at wavelength D.  I am no expert at any of this, and my 
ability to concentrate on *anything* (e.g., math, physics, SDL code) has 
waned sharply since my days as a young tech nerd, so I was at a loss as 
to what was going on.

But then I belatedly got the idea to render an image with no dispersion. 
  The result is the center panel of image thru-pbi-diamond3.png. The rod 
does indeed match the center of the ior.inc spectrum (to the left) and 
the D wavelength of the SpectralRender spectrum (to the right).  It 
appears the dispersion algorithm does assume that the IOR is for a 
central wavelength, rather than for D.  As for why I needed to go 
shorter than 550 for a good visual match, my guess is the non-linear 
correlation between refraction and wavelength.


Post a reply to this message


Attachments:
Download 'thru-pbi-diamond1.png' (47 KB)
Download 'thru-pbi-diamond2.png' (42 KB)
Download 'thru-pbi-diamond3.png' (32 KB)

Preview of image 'thru-pbi-diamond1.png'
thru-pbi-diamond1.png

Preview of image 'thru-pbi-diamond2.png'
thru-pbi-diamond2.png

Preview of image 'thru-pbi-diamond3.png'
thru-pbi-diamond3.png


 

From: Cousin Ricky
Subject: Re: SpectralRender/ior.inc dispersion mismatches
Date: 13 Apr 2017 02:56:25
Message: <58eee8d9@news.povray.org>
On 2017-04-12 10:45 PM (-4), Cousin Ricky wrote:
> I am working on a diamond cut.  A while ago, in comparing ior.inc
> dispersion with Lilysoft's SpectralRender ("Native dispersion v.
> spectral render" in p.b.i), I noticed a discrepancy in the apparent
> index of refraction of BK7 glass between the two renders.  So, just to
> make sure that wasn't a fluke, I tested both methods with a diamond prism.

Besides diamond, there are 8 other materials that ior.inc and 
SpectralRender have in common.  Attached are experiments for all of them 
except sapphire.  I omitted sapphire because it is basically the same 
material as ruby (corundum), and the 380 nm value in SpectralRender's 
sapphire spline looks suspicious to me.  Each material had its own setup 
include file (with its own prism shape, camera, and rod diameter), so 
spectra from different materials should not be compared.

The left spectrum for each material uses the IOR and dispersion values 
from ior.inc.  The middle image uses the IOR from ior.inc with no 
dispersion.  The right spectrum uses SpectralRender.

The values for n are:

               ior.inc   SpectralRender
   Material    (3.7.1)   (wavelength D)
   --------    -------   --------------
   BK7 glass   1.51673   1.5167
   F2 glass    1.61989   1.6199
   Acrylic     1.4905    1.4913
   Amethyst    1.5485    1.5500
   Emerald     1.5800    1.5894
   Ruby        1.7660    1.7600
   Topaz       1.6250    1.6300

For materials where ior.inc and SpectralRender agree on n, the rod 
matches the D wavelength of the SpectralRender panel.


Post a reply to this message


Attachments:
Download 'thru-pbi-glassbk7.png' (34 KB)
Download 'thru-pbi-glassf2.png' (34 KB)
Download 'thru-pbi-acrylic.png' (40 KB)
Download 'thru-pbi-amethyst.png' (41 KB)
Download 'thru-pbi-emerald.png' (28 KB)
Download 'thru-pbi-ruby.png' (36 KB)
Download 'thru-pbi-topaz.png' (34 KB)

Preview of image 'thru-pbi-glassbk7.png'
thru-pbi-glassbk7.png

Preview of image 'thru-pbi-glassf2.png'
thru-pbi-glassf2.png

Preview of image 'thru-pbi-acrylic.png'
thru-pbi-acrylic.png

Preview of image 'thru-pbi-amethyst.png'
thru-pbi-amethyst.png

Preview of image 'thru-pbi-emerald.png'
thru-pbi-emerald.png

Preview of image 'thru-pbi-ruby.png'
thru-pbi-ruby.png

Preview of image 'thru-pbi-topaz.png'
thru-pbi-topaz.png


 

From: clipka
Subject: Re: SpectralRender/ior.inc dispersion mismatches
Date: 13 Apr 2017 06:10:46
Message: <58ef1666@news.povray.org>
Am 13.04.2017 um 04:56 schrieb Cousin Ricky:
> On 2017-04-12 10:45 PM (-4), Cousin Ricky wrote:
>> I am working on a diamond cut.  A while ago, in comparing ior.inc
>> dispersion with Lilysoft's SpectralRender ("Native dispersion v.
>> spectral render" in p.b.i), I noticed a discrepancy in the apparent
>> index of refraction of BK7 glass between the two renders.  So, just to
>> make sure that wasn't a fluke, I tested both methods with a diamond
>> prism.

The `ior.inc` include file isn't perfect, and it can't be, for
fundamental reasons:

The `ior` parameter is computed so that when used without dispersion,
you get the correct refraction angle at what is typically the peak
brightness (yellow, about spectral line D) (1).

The `dispersion` parameter is computed so that you get the right
difference in refraction angles between the red and violet ends of the
spectrum (2).

POV-Ray, on the other hand, naively presumes that the refractive index
of dispersive materials is a linear function of wavelength varying from
IOR-CONST to IOR+CONST, implying that IOR is specified at the wavelength
halfway between red and blue, meaning you can't get both properties (1)
and (2) at the same time.

To fix that, POV-Ray itself would have to be amended. But that would
still be a kludge, since refractive indices typically aren't a linear
function of wavelength anyway.


Another reason for `ior.inc` values differing from SpectralRender may be
that some materials exhibit a rather wide variation in refractive index.
To my knowledge, SpectralRender's dispersion is based on measurements of
individual samples, while the data for `ior.inc` was taken from
literature, which can be presumed to represent average values for the
corresponding materials.


Post a reply to this message

From: Cousin Ricky
Subject: Re: SpectralRender/ior.inc dispersion mismatches
Date: 13 Apr 2017 23:19:09
Message: <58f0076d$1@news.povray.org>
On 2017-04-13 02:10 AM (-4), clipka wrote:
> The `ior` parameter is computed so that when used without dispersion,
> you get the correct refraction angle at what is typically the peak
> brightness (yellow, about spectral line D) (1).
>
> The `dispersion` parameter is computed so that you get the right
> difference in refraction angles between the red and violet ends of the
> spectrum (2).
>
> POV-Ray, on the other hand, naively presumes that the refractive index
> of dispersive materials is a linear function of wavelength varying from
> IOR-CONST to IOR+CONST, implying that IOR is specified at the wavelength
> halfway between red and blue, meaning you can't get both properties (1)
> and (2) at the same time.

This is very helpful to know.  Thanks!


Post a reply to this message

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