POV-Ray : Newsgroups : povray.advanced-users : Diamond material Server Time
29 Jul 2024 06:13:51 EDT (-0400)
  Diamond material (Message 5 to 14 of 14)  
<<< Previous 4 Messages Goto Initial 10 Messages
From: Matti Karnaattu
Subject: Re: Diamond material
Date: 10 Apr 2003 04:05:04
Message: <web.3e9524dc87eb1c75572284940@news.povray.org>
>>  interior {
>>    ior 2.418
>>    dispersion 1.044

>Since the ior's range from about 2.407 to 2.452 (different charts have
>different ranges), the ior should be set to (2.407+2.452)/2, or about
>2.429, with a dispersion of (2.452/2.407), or about 1.0187.  If you're not
>as picky about the precision, try 2.43 and 1.019.

Hmm.. I think that I should set more correct iors and dispersions to some of
my materials. I didn't compare my charts and dispersion value isn't
calculated. It was taken from chart. Because material ior depends on light
wavelength it can't be calculated averaging two ior values. I should take
many ior values with known light wavelength and weight them with human
luminance response curve to calculate exact value. Formula to calculate
material dispersion is different than (max_ior/min_ior). I don't remember
correct formula now.

Matti


Post a reply to this message

From: Retsam
Subject: Re: Diamond material
Date: 10 Apr 2003 15:05:07
Message: <web.3e95c02987eb1c752a3ff2e70@news.povray.org>
Matti Karnaattu wrote:
>Formula to calculate
>material dispersion is different than (max_ior/min_ior). I don't remember
>correct formula now.

Actually, if I read the source code for POV-Ray correctly, (max_ior/min_ior)
is the dispersion.  When POV-Ray calculates the dispersion, it starts with:
        ior = ior /sqrt(disp);
        ior_mult = pow(disp, 1.0/(disp_nelems-1));

Then, in the dispersion loop, it does this:

          ior *= ior_mult;

The net result is that the IOR will range from ior/sqrt(disp) to
ior*sqrt(disp).

Assuming max_ior = ior*sqrt(disp), min_ior = ior/sqrt(disp), then
max_ior/min_ior = ior*sqrt(disp) / (ior/sqrt(disp)) = sqrt(disp)*sqrt(disp)
= disp

It's not the most realistic, because dispersion for many substances tends to
be lower in the red-yellow range, then increase significantly in the
green-violet range.  I liked the MegaPov patch, because you could specify a
dispersion palette.  This way, you could keep the red-yellow range narrow
and bright, and the green-violet range wide and dimmer, for more realism.


Post a reply to this message

From: Matti Karnaattu
Subject: Re: Diamond material
Date: 15 Apr 2003 08:45:05
Message: <web.3e9bf89987eb1c75572284940@news.povray.org>
>Actually, if I read the source code for POV-Ray correctly, (max_ior/min_ior)
>is the dispersion.  When POV-Ray calculates the dispersion, it starts with:
>        ior = ior /sqrt(disp);
>        ior_mult = pow(disp, 1.0/(disp_nelems-1));

>Then, in the dispersion loop, it does this:
>
>          ior *= ior_mult;
>
>The net result is that the IOR will range from ior/sqrt(disp) to
>ior*sqrt(disp).

This is correct.

>Assuming max_ior = ior*sqrt(disp), min_ior = ior/sqrt(disp), then
>max_ior/min_ior = ior*sqrt(disp) / (ior/sqrt(disp)) = sqrt(disp)*sqrt(disp)
>= disp

And this is not. You forgot the light wavelenghts. Pov-Ray dispersion
calculation make simple rainbow for light which ior will range from
ior/sqrt(disp) to ior*sqrt(disp). To calculate correct dispersion value we
need several ior values and the light wavelenghts used to measure ior
values to approximate dispersion value.

Matti


Post a reply to this message

From: Ken
Subject: Re: Diamond material
Date: 15 Apr 2003 09:21:14
Message: <3E9C0759.5250B2D4@pacbell.net>
Matti Karnaattu wrote:

> And this is not. You forgot the light wavelenghts. Pov-Ray dispersion
> calculation make simple rainbow for light which ior will range from
> ior/sqrt(disp) to ior*sqrt(disp). To calculate correct dispersion value we
> need several ior values and the light wavelenghts used to measure ior
> values to approximate dispersion value.

It should be noted that the dipersion feature in POV-Ray is merely an
approximation and was not designed or intended to offer a scientifically
valid method of light visualization.

-- 
Ken Tyler


Post a reply to this message

From: Retsam
Subject: Re: Diamond material
Date: 21 Apr 2003 17:20:14
Message: <web.3ea45f5987eb1c7534dff4bb0@news.povray.org>
>And this is not. You forgot the light wavelenghts. Pov-Ray dispersion
>calculation make simple rainbow for light which ior will range from
>ior/sqrt(disp) to ior*sqrt(disp). To calculate correct dispersion value we
>need several ior values and the light wavelenghts used to measure ior
>values to approximate dispersion value.
>
>Matti
>

One problem.  POV-Ray 3.5 doesn't support that.  You simply specify an IOR
and a dispersion.  And as I said, and as you conceded, ior will range from
ior/sqrt(disp) to ior*sqrt(disp), which means disp = max_ior/min_ior.

If you want something more accurate, you have to either do multiple renders
with hand-tweaked iors/palettes, or you have to use something like MegaPOV.
 The last time I used MegaPOV was version 0.4, and it supported a
hand-configured palette for dispersion.


Post a reply to this message

From: Matti Karnaattu
Subject: Re: Diamond material
Date: 22 Apr 2003 11:35:11
Message: <web.3ea560dd87eb1c75bef0bd7d0@news.povray.org>
>>To calculate correct dispersion value we need several ior values and the
>>light wavelenghts used to measure ior values to approximate dispersion value.

>One problem.  POV-Ray 3.5 doesn't support that.

I know. But that doesn't take out wavelengths from Dispersion approximation.
Only calculation is more complex.

>You simply specify an IOR and a dispersion. And as I said, and as you
>conceded, ior will range from ior/sqrt(disp) to ior*sqrt(disp), which means
>disp = max_ior/min_ior.

No. What is max_ior? and what is min_ior? Is it infrared or what? POV-Ray
dispersion draws colors between ~400nm to ~800nm, so we must know IOR
values wavelengths to approximate dispersion and base ior values.

Correct way to do this is set base ior to 555nm because human eye is most
sensitive 555nm light. To approximate dispersion, we need two other known
IOR values to approximate shape of light spectrum. IOR at red light (700nm)
and IOR at blue light (435.8nm). Now we have to solve dispersion value
where red and blue light are near as possible their real position when
POV-Ray draws spectrum. The formula is:

  D = (3*I555^4 - 3*(IRed*I555)^2 + 4*(IBlue*IRed)^2) / (4*(IRed*I555)^2)

Where

D     = Dispersion value
I555  = Material IOR at 555nm light
IRed  = Material IOR at 700nm light
IBlue = Material IOR at 435.8nm light

This formula uses IOR 555nm as green light and this is approximation.
Problem is that it's very difficult to transform rgb values to wavelengths.
Green light (546nm) is very near 555nm so the formula is still usable.

Matti


Post a reply to this message

From: Retsam
Subject: Re: Diamond material
Date: 26 Apr 2003 00:45:04
Message: <web.3eaa0e4a87eb1c7534dff4bb0@news.povray.org>
Matti Karnaattu wrote:

>No. What is max_ior? and what is min_ior? Is it infrared or what? POV-Ray
>dispersion draws colors between ~400nm to ~800nm, so we must know IOR
>values wavelengths to approximate dispersion and base ior values.

Hey, you brought up max_ior and min_ior:
>Formula to calculate material dispersion is different than (max_ior/min_ior).

I was assuming you meant the maximum and minimum ior values that POV-Ray
would use, since we are discussing POV-Ray settings.  And as a matter of
fact, in POV-Ray, the value of the dispersion IS the maximum IOR used
divided by the minimum IOR used, and as we've discussed, those values range
from ior/sqrt(disp) to ior*sqrt(disp).


>Correct way to do this is set base ior to 555nm because human eye is most
>sensitive 555nm light. To approximate dispersion, we need two other known
>IOR values to approximate shape of light spectrum. IOR at red light (700nm)
>and IOR at blue light (435.8nm). Now we have to solve dispersion value
>where red and blue light are near as possible their real position when
>POV-Ray draws spectrum. The formula is:
>
>  D = (3*I555^4 - 3*(IRed*I555)^2 + 4*(IBlue*IRed)^2) / (4*(IRed*I555)^2)
>
>Where
>
>D     = Dispersion value
>I555  = Material IOR at 555nm light
>IRed  = Material IOR at 700nm light
>IBlue = Material IOR at 435.8nm light
>
>This formula uses IOR 555nm as green light and this is approximation.
>Problem is that it's very difficult to transform rgb values to wavelengths.
>Green light (546nm) is very near 555nm so the formula is still usable.
>
>Matti
>

Okay, we agree to some extent here.  The ior-wavelength relationship is not
linear, so we need to do a best fit.  I did not take this into account.
But your value of 1.044 for the dispersion is WAY off.  You might want to
throw in a square root, since you've effectively squared the IORs in that
formula.  That would give you a more realistic dispersion of about 1.022
(although I calculated something closer to 1.036 using your formula, not
1.044, so that would reduce to about 1.018, which is pretty close to what I
suggested in the first place).

Using 2.418 as the ior, and 1.044 as dispersion, that would give an IOR of
2.418*sqrt(1.044), or 2.471, for violet, and an IOR of 2.418/sqrt(1.044),
or 2.366, for red.  Both of those values aren't even close.  If you want to
minimize the discrepancies, you would want to do a best linear fit of all
three points: red, gree, and blue.  If you set green to its correct value,
and try to minimize the errors in red and blue, you will get a poorer
result than if you try to reduce the errors in all three.  I won't bother
to figure out a precise answer, but a good shot from the hip would suggest
an ior of about 2.423, with 2.401 for red and 2.445 for violet, which gives
a dispersion of 2.445/2.401 = 1.0183.  Let's compare those numbers to
Tolkowski's.  I'll use your 2.418 for green instead of 2.417 for yellow,
and I added it to the chart for comparison:

          Index of
  Colour  Refraction   Source Line    Wavelength

  Red       2.407      Solar  B-line   687   nm
  Yellow    2.417      Sodium D-line   589.3 nm
  Green     2.418      ???             555   nm
  Violet    2.452      Solar  G-line   431   nm

Using these numbers, red is off by 2.407-2.401 = 0.006, yellow/green is off
by 2.418-2.423 = -0.005, and violet is off by 2.452-2.445 = 0.007.  That's
about as good as you're going to get.

IOR = 2.423
Dispersion = 1.0183


Post a reply to this message

From: Matti Karnaattu
Subject: Re: Diamond material
Date: 29 Apr 2003 16:20:04
Message: <web.3eaeddea87eb1c75bef0bd7d0@news.povray.org>
>But your value of 1.044 for the dispersion is WAY off.

I know. I pick that from charts because I create formula after you wrote how
POV-Ray calculate dispersion.

>          Index of
>  Colour  Refraction   Source Line    Wavelength
>
>  Red       2.407      Solar  B-line   687   nm
>  Yellow    2.417      Sodium D-line   589.3 nm
>  Violet    2.452      Solar  G-line   431   nm

Great chart! Is this full chart of diamond IORs? I really like to know all
values if you have to get more accurate values.

Using spline I can approximate IORs to formula from chart:

700nm   = ~2.407000000000000
555nm   = ~2.422824598862933
435.8nm = ~2.450762660918041

Using these values in my formula I get dispersion 1.03308938613443. At base
IOR 555nm approximated reflection is 0.401889.

Can you write all material IORs from the source you get those diamond IORs?
At least all gemstones?

I'm now working with material library with physically accurate materials and
I like to get more values to get perfect approximation. My aim is to get
the material library to part of POV-Ray distribution because large part of
POV-Ray original textures are outdated and useless in radiosity and HDR
scenes. Please help me to make POV-Ray better :)

Matti


Post a reply to this message

From: Ken
Subject: Re: Diamond material
Date: 29 Apr 2003 21:02:54
Message: <3EAF208B.65CB33DE@pacbell.net>
Matti Karnaattu wrote:

> Can you write all material IORs from the source you get those diamond IORs?
> At least all gemstones?

See - http://news.povray.org/povray.text.scene-files/16348/

-- 
Ken Tyler


Post a reply to this message

From: Ken
Subject: Re: Diamond material
Date: 29 Apr 2003 21:05:10
Message: <3EAF2113.67BE0DCF@pacbell.net>
Ken wrote:
> 
> Matti Karnaattu wrote:
> 
> > Can you write all material IORs from the source you get those diamond IORs?
> > At least all gemstones?
> 
> See - http://news.povray.org/povray.text.scene-files/16348/

Ooops, try this instead - http://news.povray.org/povray.binaries.utilities/15709/

-- 
Ken Tyler


Post a reply to this message

<<< Previous 4 Messages Goto Initial 10 Messages

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