Maxwell Render

Maxwell Render Information Repository
It is currently Wed Jun 19, 2013 7:38 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Jul 25, 2006 5:52 pm 
User avatar

Joined: Sat Mar 26, 2005 2:31 am
Posts: 669
Location: France
Using complex ior files and making your own.

I have no background in physics or maths, so, what follow is just what I gathered from various sources. Please, tell me if you spot any mistake.


Why bothering using them?

You can get very nice effects with metals and dielectric using them. Be careful though, complex iors material use dispersion (that’s the point, especially for dielectrics), so, render cost may be high. For colored dielectrics, you can get very nice falloff, and since you can make ior files from ultra precise lab measurements, ior files are an easy way to get very realistic materials. In some cases, it’s easier to use an ior file than too find right transmittance color and attenuation value. Gemstone rendering is the most obvious application of complex iors.


What are they?

Complex ior files store optical properties of materials at different wavelengths. I won’t go into details about the physics behind the concept. A complex refraction index is a complex number where the real part (generally noted n) is the refractive index, and the imaginary part (often noted k) is the extinction coefficient measuring the absorption of the light going trough the material. For our purpose, it’s ok to treat n and k as two independent real numbers.
A Maxwell ior file stores a set of n/k values over a range of evenly spaced wavelengths.
The structure of the file is very simple: it’s a plain ASCII text file with a first line consisting of 4 numbers giving respectively the unit used to indicate the wavelength, energy of frequency, the value of the wavelength, energy of frequency for the first line of the dataset, the value for the last line, and the number of intervals. All subsequent lines are n/k pairs of numbers. The number of n/k pairs is equal to number of intervals + 1.
All values are separated by spaces (any number). Decimal separator is dot. Comma is not allowed.
Example of first line:
4 380 730 69.
In this example, 4 means dataset is in nanometers (1 is eV, 2 is um, 3 is cm-1, 4 is nm), beginning at 380 nm (limit UV/VIS) ending at 730 nm (limit VIS/IR), with 69 intervals (i.e. a measure every 5 nm).


a useful reference before we go further:

Image


How to make complex ior files?

First case, making an ior file from a n/k dataset.
In a few instances, you can find complex ior data. If the dataset spans over the visible spectrum, and if there are enough points to do a decent interpolation, then it's fairly easy to get an ior file. All you need is a math program to perform some interpolation, and your favorite spreadsheet.

Here is the step by step with the Findgraph software (30 day fully functional free demo, 50 Euro licence with VAT: http://www.findgraph.com/ ).

Step 1, getting the data:
For this example, let's have a look at a dataset coming with the Freesnell Software ( http://swiss.csail.mit.edu/~jaffer/FreeSnell/ ). It uses a file format slightly different from the Sopra database, but it's very easy to convert. Unzip the freesnell program and look at the zn-a.nk file (zinc, parallel to C axis: in this instance, perpendicular to C is almost identical).
Rename the file as zn-a.txt.

Step2, getting the data into Findgraph:
Chose: data, add from file, and open zn-a.txt.

Image

You get this window:

Image


As you can see, findgraph correctly interpret the ASCII dataset. The X axis will represent the energy level (in eV), and Y the n part of the complex ior. Z won't be used for now. Chose “fit to data” for both X and Y axis

Image

Step3, interpolating
Right click on your newly created point set in the left part of the interface, and chose interpolate.

Image

In this instance, as there are not so many points, bezier interpolation gives good results. When you are done, right click on the interpolation, and chose trace>tabulate.

Image

We are interested in visible light, so, we'll interpolate from 1.6 to 3 eV, by 0.02 eV steps.
Click on calculate, then copy/paste to your favorite spreadsheet.

Do it all over again for the k values

Step 4, creating the ior file.

Just open notepad.
As here the unit is eV, from 1.6 to 3, with 69 intervals,
type the first line:
1 1.6 3 69
Then, just copy/paste the n/k values from the spreasheet.

Save as zinc.ior,
You're done!

Many more here: http://www.luxpop.com/RefractiveIndexList.html


To be continued....

_________________
Quote:
The journey's FAR from over


LW 9.2 Win XP pro amd64x2 2.2 ghz 4gb ram


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 26, 2006 10:26 am 
User avatar

Joined: Sat Mar 26, 2005 2:31 am
Posts: 669
Location: France
Texturing with a spreadsheet part 2: transparent colored materials

Now comes the fun part: to make ior files for colored transparent materials, you don't really need complete n/k data. Mere absorbance data can do the trick nicely, and the good news is that they are much more easy to get than full complex ior datas.
Here is the general idea: colored transparent materials do absorb a good part of the light spectrum, so, they are very unlikely to show any dispersion. You can get very good results by just making files where you derive the values for k from absorbance data, and kind of guessing plausible values for the n part. Even a constant n value throughout the spectrum will look ok, though we'll see how you can come closer to physical accurateness with little effort.

The first thing you need to do to get good looking material is to make a test scene at the right scale. Indeed, except for materials that have zero absorbance values at some wavelengths, this type of material is very sensitive to the scale. A too big object will more or less render at solid black (you can see this in real life with large gemstones which tend to be much darker than small ones).

...to be continued...

_________________
Quote:
The journey's FAR from over


LW 9.2 Win XP pro amd64x2 2.2 ghz 4gb ram


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 11:14 am 

Joined: Fri Nov 18, 2005 12:42 pm
Posts: 238
could u post ur resultimg file for zinc to compare with the one we obten from ur tutorial?

My one is:


1 1.6 3 69
1.6 1.087
1.62 1.099
1.64 1.109
1.66 1.118
1.68 1.126
1.7 1.133
1.72 1.138
1.74 1.14
1.76 1.138
1.78 1.122
1.8 0.965
1.82 1.443
1.84 1.848
1.86 1.972
1.88 1.666
1.9 1.179
1.92 0.7886
1.94 1.144
1.96 1.167
1.98 1.181
2 1.189
2.02 1.196
2.04 1.201
2.06 1.206
2.08 1.209
2.1 1.213
2.12 1.215
2.14 1.218
2.16 1.219
2.18 1.221
2.2 1.223
2.22 1.224
2.24 1.225
2.26 1.226
2.28 1.226
2.3 1.227
2.32 1.228
2.34 1.228
2.36 1.228
2.38 1.229
2.4 1.229
2.42 1.229
2.44 1.229
2.46 1.229
2.48 1.229
2.5 1.229
2.52 1.229
2.54 1.229
2.56 1.229
2.58 1.228
2.6 1.228
2.62 1.228
2.64 1.228
2.66 1.228
2.68 1.228
2.7 1.228
2.72 1.229
2.74 1.229
2.76 1.23
2.78 1.23
2.8 1.231
2.82 1.232
2.84 1.234
2.86 1.236
2.88 1.24
2.9 1.244
2.92 1.248
2.94 1.253
2.96 1.521
2.98 1.808


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 12:29 pm 
User avatar

Joined: Sat Mar 26, 2005 2:31 am
Posts: 669
Location: France
Hi Toxie,
result is here:
http://www.maxwellrender.com/forum/view ... &start=195
It may be a little different, since I averaged values for perpendicular and parallel to C axis.
HD

_________________
Quote:
The journey's FAR from over


LW 9.2 Win XP pro amd64x2 2.2 ghz 4gb ram


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 3:21 pm 

Joined: Fri Nov 18, 2005 12:42 pm
Posts: 238
Doesnt match with ur ones... but i followed ur tutorial. What did I do wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 5:49 pm 
User avatar

Joined: Sat Mar 26, 2005 2:31 am
Posts: 669
Location: France
Hi,
obviously, your first column is the enegy values in eV, whereas it should be the values for n (refractive index, real part): these values are in the Y column in findgraph. your second column, I have no clue. Normaly, you do the whole thing all over again just changing the Y axis input from column 2 to column 3 in the step 2. I didn't detailed the spreadsheet part, but I will if you have more trouble.
Hope this helps,
HD

_________________
Quote:
The journey's FAR from over


LW 9.2 Win XP pro amd64x2 2.2 ghz 4gb ram


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 04, 2006 11:20 am 

Joined: Fri Nov 18, 2005 12:42 pm
Posts: 238
yep!!!
that will b great, im still being quite lost...;)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 10, 2006 12:13 am 
User avatar

Joined: Sat Jun 18, 2005 5:44 pm
Posts: 5013
Location: Pole Position
Henri, .... really appreciate you putting this together.

It's getting printed and then read and read and read. :lol:

Determined to get this IOR thing down ...... ;)

_________________
Fall WinterSpringSummer


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 10, 2007 6:17 pm 
User avatar

Joined: Sat Feb 24, 2007 11:50 pm
Posts: 7346
Location: Tulsa, Oklahoma
Now I understand why it is called "complex" ior... :lol:

_________________
Brian Looney
Maxwell + RealFlow
http://lunatic-studio.com/
Help! I'm dispersing into a haze of probability!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 10, 2007 6:20 pm 
User avatar

Joined: Tue Jun 07, 2005 8:25 am
Posts: 1144
Location: castellón-spain
Bubbaloo wrote:
Now I understand why it is called "complex" ior... :lol:

haha :P

_________________
En la vida solo hay dos cosas seguras: la muerte y los impuestos.
gallery: viewtopic.php?t=13820
http://www.foto-viva.es/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 10, 2007 6:27 pm 
User avatar

Joined: Sat Jun 18, 2005 5:44 pm
Posts: 5013
Location: Pole Position
:lol:

_________________
Fall WinterSpringSummer


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 10, 2007 6:35 pm 
User avatar

Joined: Sat Feb 24, 2007 11:50 pm
Posts: 7346
Location: Tulsa, Oklahoma
Ok, instead of trying and failing miserably at creating my own ior's, I am going to ask if anyone has any good gemstone ior's that aren't in the standard list. Thanks so much!

_________________
Brian Looney
Maxwell + RealFlow
http://lunatic-studio.com/
Help! I'm dispersing into a haze of probability!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 9:54 am 

Joined: Sun Nov 20, 2005 1:20 pm
Posts: 321
Hi!
what about this??
http://mxmgallery.maxwellrender.com/news_scripts.php#page=1&mode=0&id=1713

_________________
Next Limit Team


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 11, 2007 2:23 pm 
User avatar

Joined: Sat Feb 24, 2007 11:50 pm
Posts: 7346
Location: Tulsa, Oklahoma
Image

_________________
Brian Looney
Maxwell + RealFlow
http://lunatic-studio.com/
Help! I'm dispersing into a haze of probability!


Top
 Profile  
 
 Post subject:
PostPosted: Sat Mar 01, 2008 10:43 pm 
User avatar

Joined: Sat Aug 20, 2005 8:54 pm
Posts: 1516
Location: Back home for once
On a bit of a 'trying to understand Physics' tip today. Can I ask.... why are there only IOR files for dielectrics and metals? From reading this.. 'A complex refraction index is a complex number where the real part (generally noted n) is the refractive index, and the imaginary part (often noted k) is the extinction coefficient measuring the absorption of the light going through the material' I would assume that IOR files are used for transparent/translucent materials because of the k value... but why are they used for metals and not plastics for example (obviously metals aren't transparent so I don't understand where the 'k' comes from here)

Anyway I found this software. It can be used to convert complex IOR data to simple IOR which would maybe speed up render time.

http://www.renderlight.co.uk/files/rgbtonk.rar

Found it from this link (although I dont know if its useful for Maxwell):

http://www.kerkythea.net/phpBB2/viewtopic.php?t=2742

_________________
Product Design
Linkedin


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 17 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group