PDA

View Full Version : CIORs (Complex Index Of Refraction)


joie
12-19-2011, 09:59 AM
Hi there people;

Based on the list shown here (http://refractiveindex.info/), I can see that metals do have something called "Complex Index of Refraction".

So I can see, for example, that aluminium has an IOR of 0.11945. But it has also an Extinction Coeficient of 2.2653e+0.

Well, since MiaX materials don't deal with complex indexes of refraction, the next question should be: How can I convert CIOR (Complex Index Of Refraction) data into standard IOR?.

There is also another question though, Is or will be MAYA be able to handle CIORs anytime?.

Thank you in advance.

Kzin
12-19-2011, 12:53 PM
you cant convert them.
the t2 illumination had this function, i think there was a maya version. but the shader dont work very well with the actual mr version, needs an update.
in the mia shader you have a coefficient of 1 if you would have a value for this, tryed this some time ago with t2 shader inside xsi. i also miss this function.

Ekenryd
12-19-2011, 02:52 PM
Interesting site. It would be even more interesting if anyone here with a science degree or something could explain how one could use as much as possible of this for material creation in maya :)

For example, the reflection calculator looks cool, and as it has values for 0-90* I guess one could interpret that to maya reflection ior values.

dmeyer
12-20-2011, 02:32 PM
Maxwell Render plugs into Maya and supports this. Others may as well.

StrayCat
12-20-2011, 03:23 PM
Simple way to use that site for everyday purposes is to check the graph at the bottom of that page after you select your material, and just roughly simulate the brdf curve shown there in Maya.

Redsand1080
12-20-2011, 06:41 PM
This topic is a pretty big one. But if you really want to understand it and don't mind spending some money, fxphd has a class that explains this in depth. You'll be able to understand it from a science point of view (for the most part) and learn how to implement the concepts with the mia_materials as best we can. The class is: MYA214. I took it and I highly recommend it. Learned a ton of stuff about shading metal.

Hope that helps!

-Justin

Hamburger
12-21-2011, 01:24 AM
This is interesting (for metals)

http://mentalraytips.blogspot.com/2007/10/making-better-metal-with-miamaterial.html

Well, then we try the fresnel mode.

"What" I hear you yell, "Fresnel" is for dielectrics... transparent stuff... like water, glass and such. It is based on the Index Of Refraction. Metals aren't transparent, they can't refract stuff! O'le Zap's gone completely bonkers now!

Well... actually... no. Metals are indeed not refractive, and are indeed not dielectrics (meaning, electrical insulators). They are Conductors, and for some baroque reason these are also considered to have an "Index of Refraction".

Now, don't ask me how on earth someone came up with the idea of refractive metals or how this is actually calculated... I didn't write the laws of Physics (I just abuse them) so just trust me it's there.... and these values are high. Not your average "1.3" ish like for water, but values like "25" or "50".

So, if you turn on the Fresnel reflection mode and put in an IOR of 50 you get something like this (Again UI from 3ds Max coz it has the neat curve):

Then looking on the site linked to in the OP are values are around 1-5??

InfernalDarkness
12-21-2011, 09:07 PM
In essence, the higher IOR for metals attempts to simulate surface dispersion of light. It generally works really well, but at the same time...

Metals can be a real struggle. You'll think you've got it nailed then you end up with crap like this:

http://img269.imageshack.us/img269/4452/tuttlekitchenmr9sinklam.jpg

Geo's clean, sink maybe sloppy but here's a Blinn:

http://img17.imageshack.us/img17/9851/tuttlekitchenmr9sinkmay.jpg

Sink is a wreck, but that doesn't explain the mess when using a mia_mat_x here:

http://img32.imageshack.us/img32/5947/tuttlekitchenmr9sinkmia.jpg

In this scene, I really struggled with metal. Checked all my normals, etc. No matter what I couldn't get it right, so I eventually just dulled it all down with a flat gray Blinn (fixed the sink) and made do.

Another part of the same scene, please ignore the crap geometry and low-res granite map. Here, the pot filler turned out okay, but why?

http://img46.imageshack.us/img46/5738/tuttlekitchenmr10stovep.jpg

Sometimes metals are a breeze, but at other times I just can't seem to nail them at all.

Kzin
12-21-2011, 09:51 PM
Sink is a wreck, but that doesn't explain the mess when using a mia_mat_x here:

http://img32.imageshack.us/img32/5947/tuttlekitchenmr9sinkmia.jpg

In this scene, I really struggled with metal. Checked all my normals, etc. No matter what I couldn't get it right, so I eventually just dulled it all down with a flat gray Blinn (fixed the sink) and made do.



it looks like your zero degree reflection value is to low.
or there is nothing which reflects, or perhaps try to increase the reflection raydepth.

if i have problems like this, i isolate the object and render it with a nice contrasty hdr map to check if its a shaderproblem or a reflection problem because of the surrounding objects.

InfernalDarkness
12-21-2011, 10:22 PM
it looks like your zero degree reflection value is to low.
or there is nothing which reflects, or perhaps try to increase the reflection raydepth.

if i have problems like this, i isolate the object and render it with a nice contrasty hdr map to check if its a shaderproblem or a reflection problem because of the surrounding objects.

Thanks for the response, fortunately this client already signed and I don't have to trog through the 26th revision on this kitchen mess... Wish my bosses would realize 3 revisions is plenty, and any more should be new charges/change orders, but alas... You can't fix stupid.

The objects' geometry is fine, it's merely the shader, and I tried a score of variations to no avail. Fortunately the client didn't actually need a close up of my crappy sink, I only rendered it to try to diagnose why it looked so horrible. And failed, I might add! One would think (and hope) that since it'a all a digital medium, any problem can be diagnosed. But as a scene's complexity rises, often I'm left "screwed" - it would take more time to diagnose this mess than to create a new scene from scratch, or close enough that diagnostics are completely pointless.

So the key would be: how do I avoid such catastrophes in the future? Is there anywhere that stores mia_mat_x settings for people to share, so that we know certain metals will look a certain way? I'll admit this production example is rather unscientific...

Jozvex
12-22-2011, 05:39 AM
You should check out mr materials.com (http://www.mrmaterials.com/). It has a Maya section and they have a standard scene that people submit shaders in so that it's reasonably consistent etc. They use the Mia material.

Shading and lighting metals is hard because metals rely SO heavily on reflections as opposed to actual 'lighting'. It's also harder the more flat surfaces you have, such as with your stove/oven in your last render because instead of catching highlights along curves and bevels you have to try and get sheens across a vast flat area. Things like area/portal lights, the mia_lightSurface shader and actual geometry 'reflectors' are good tools for creating highlights and reflections for metals.

I was working for about 2 years for Rotor Studios (http://www.rotorstudios.com/) who mainly work on cars and other vehicles, using almost exclusively the Mia and Carpaint shaders. It's tough! All about reflections and area light sources (whether actual area lights or not). They have lots in their online gallery.

In order get consistent results from car to car and from one project to another we had to build up a huge library of materials, using a few different methods. There are so many different (yet very similar) plastics/metals/leathers in cars it's quite intimidating haha.

:thumbsup:

InfernalDarkness
12-22-2011, 06:01 AM
Thanks for the vote of confidence and reassurance, Jozvex! I really didn't intend to hijack this thread, but to point out to the Original Poster, Joie, that IOR isn't as effective as one would hope. It's certainly not a quick fix for otherwise crappy shaders or in the case of that oven/stove, crappy modeling.

But using that stove as an example, in a scene where you can only use real lights (as in, the bulbs/fixtures/tubes that are going to exist in the actual, physical scene, which is an actual, physical kitchen I measured and photographed to make this scene), I suppose it would really come down to modeling. The stove is a real quicky, I think I may have even just swapped some crap over from Chief Architect at the time. As such it has poor topography at best and nary a beveled edge, corner, or anything like that. So perhaps it's the modeling itself in that case.

But the faucet fixtures and (note) the pot pourer above the stove are all modeled rather painstakingly in Rhino, by myself. And back to the sink faucets... How is it possible for a metal to even look like that, in the mia_material one? I swear I tried 50 different ways to make metal work, including some of my own presets which have worked in other scenes just fine.

Anyway, perhaps we'll have to set up a clean scene to actually test some of this stuff. That scene is a wreck, I was posting it mostly as an example of utter metal failure, trying to use IOR to save the day didn't help in my case. Trying to use it wrong, most likely!

joie
12-22-2011, 07:16 AM
Ok, I started this thread because a friend took that FxPhd class and told me about the CIORs. He told me that the teacher was using a pretty big and complex excel sheet to create the magic numbers to feed the mia_x. Even with that, the resulting numbers were aproximated or mia_x were unable to fully incorporate them.

So this is my guess..., I'm pretty sure we can take the standard IOR and add the CIOR to it and get the correct numbers that mia_x is able to understand. That would as simple as make mia_x understand the extintion coeficient, that's all.

Right now I'm using the Maxwell way, this is, low difuse, high gloss, use fresnel and give pretty high IOR, like 20 or so. That makes mia_x metals to look as good as can be (try that InfernalDarkness).

I wrote this thread just because of my disapoinment when talking with my friend and realised that, in fact, there wer CIORs out there! :D

InfernalDarkness
12-22-2011, 07:40 AM
...to create the magic numbers to feed the mia_x.

I saw/read a really nice essay or "paper" on the topic awhile back, and will try to dig it up.

It basically explained protosurface scattering (and thus, the Fresnel effect) "mathematically" in terms of why/how photons collide and bounce and interact with the minute surface deformities on any given object. While in the lab this is sweet as pie, in the real world nobody's actually observed or evidenced photons even existing in the first place thus far, and they remain a construct of a phenomenon, much like gravity. It is understood electrically however, except that "modern science" refuses to pay attention to actual science in this regard.

Thus, Maxwell and Planck and others were quantifying the effects of light, but the actual mechanism was still a mystery to them (and modern consensus science), and as such it gets really, really icky when we try to plug in such math into another simulation (mental ray, Vray, what have you) such as IOR.

By raising the IOR past 2.5 (diamondish), we're attempting to simulate the effects of protosurface scattering caused by the tiny imperfections we see in metal with our eyes, correct? A blatant example would be brushed nickel faucet fixtures, similar to those I was attempting with my previous (mess of a) kitchen example. I was using IORs of 10-50 in my tests, but it didn't help in that case. In other scenes, however, I've had some success using IORs higher than 20.

I'll post up some test renders while I'm at work tomorrow if I can.

joie
12-22-2011, 08:15 AM
@InfernalDarkness, I think there is something going really wierd with your metals because mia_x can do great metals and I do them all the time, see an example here:

http://2.bp.blogspot.com/_UfiJEr5KYPs/TS8zJrD2ABI/AAAAAAAAAuU/ZPT_Ab8PmYs/s1600/StudioNude.jpg

Well, the metals are OK if you don't pay attention to the fact that they are reflecting almost black everywere (and yes, the red metallic paint is mia_x material indeed, no car paints there).

Redsand1080
12-22-2011, 12:52 PM
Hey Joie,

That class is still going on this term. It's a really good one and if you don't mind paying for it and want to understand this stuff I'd highly recommend it. It'll answer all your questions...and then some. Perhaps have you asking a few more questions to boot! :)

-Justin

lostparanoia
12-27-2011, 01:53 PM
mia_material_x is great for metals, I do them all the time. however, you're never going to have a realistic result unless you use some decent textures and decent compositing. You can't just apply a chrome preset mia to a surface and expect it to look photo realistic.


My top reasons why some people's metals don't look right.

1: Lack of textures.
Nothing is perfect. Even a brand new metal item will have imperfections. At least texture your reflection glossiness.

2: lack of glow on highlights.
Perfect lenses do not exist (The eye is also a lens). Therefore strong highlights will produce glow, always. Good lenses create a very subtle glow, but glow nonetheless. Without it, it will look wrong.

3: crappy or just plain wrong environment reflections. well, it's sort of self explanatory I think.

4: DOF: When using a shallow depth of field, blurring with a Zdepth does not blur reflections appropriately. even if your focus is on the metal object itself, the reflections will still be blurred by DoF in reality. Either you use real raytraced DoF or fake it with glossiness where possible.

Hmm, there's probably more, but that's all I can think of for now.
Here's an example of an image I made long ago with the mia_material_x. (the spraycan model is from some tutorial, don't remember which exactly):

EDIT: aah, yes. and also, metals never reflect 100% of the environment, Nothing does, not even mirrors, even if mirrors are pretty close.

joie
12-27-2011, 02:57 PM
You are very right lostparanoia, I do metals all the time with mia_x materials with no problems so far, usually not anisotropic ones because they are very time consuming for animation, but blurry ones are perfect.

This post is about the use of mia_x with complex indexes of refraction, which can't be achieved with them, as you can see.

StrayCat
12-27-2011, 03:20 PM
4: DOF: When using a shallow depth of field, blurring with a Zdepth does not blur reflections appropriately. even if your focus is on the metal object itself, the reflections will still be blurred by DoF in reality. Either you use real raytraced DoF or fake it with glossiness where possible.


Whaaat?! Is this true? I had no idea!
I guess its easy to test out.

cgbeige
12-27-2011, 03:23 PM
ya, Maxwell is the only renderer I've seen that has the extinction coefficient value. This came up in a previous thread about using Fresnel for highly-reflective materials, which is problematic because of the lack of this setting.

joie
12-27-2011, 03:38 PM
Straycat, you can test it easily asking yourself this question: If you are taking a photo of something reflected on a mirror..., ¿You focus the mirror or the subject?. If you focus the subject, the mirror blurs, if you focus the mirror, the subject blurs. :)

StrayCat
12-27-2011, 06:30 PM
Yeah seems completely logical when you think about it. I guess I just never gave it much thought.

lostparanoia
12-28-2011, 08:20 AM
This post is about the use of mia_x with complex indexes of refraction, which can't be achieved with them, as you can see.

Yes, I know. Sorry. I was replying to the highjackers comments earlier. Forgot to quote. :)
Interesting topic btw. I've been looking for an answer to that myself. For now, I think the closest we can come to CIOR is using fresnel reflections with a very high IOR, Like 20-40. Unfortunately maya doesn't display the reflectivity curve like for example 3ds max, so it's a bit of a blind man's trial and error situation. :/

InfernalDarkness
12-28-2011, 08:38 AM
I find your highjacking to be almost as illuminating as mine even if not as relevant. Please continue.

For now, I think the closest we can come to CIOR is using fresnel reflections with a very high IOR, Like 20-40. Unfortunately maya doesn't display the reflectivity curve like for example 3ds max, so it's a bit of a blind man's trial and error situation. :/

Thank you for repeating my prior point, but that doesn't work as well as one would hope. Thus, my initial posts of my crappy sink. I was using a mia_mat_x with Fresnel BRDF and IORs of "like 20-40". I was the blind man trial-and-erroring, and never found a valid solution, just like the original poster. Having every element in common with the original post, it seemed a valid topic for me to comment on. However it is good to know you agree with my methods entirely.

I'll post up the scene if anyone's interested and we can play with it? I'm very open to a more empirical scene too however, but I'm not on a NDA for that project so it's fair game if anyone wants to take a shot at it as a test-bed.

joie
12-28-2011, 08:53 AM
Share that scene InfernalDarkness, I will be checking it in my spare time.

You saw the image I posted earlier (the bike, yeah)?, What rate do you asign to the metals?.

lostparanoia
12-28-2011, 09:11 AM
Thank you for repeating my prior point, but that doesn't work as well as one would hope. Thus, my initial posts of my crappy sink. I was using a mia_mat_x with Fresnel BRDF and IORs of "like 20-40". I was the blind man trial-and-erroring, and never found a valid solution, just like the original poster. Having every element in common with the original post, it seemed a valid topic for me to comment on. However it is good to know you agree with my methods entirely.

Hrm... yes, well... You write such long posts... sometimes I'm too lazy to read the whole thing.
sorry about that. :P

InfernalDarkness
12-28-2011, 09:45 PM
Share that scene InfernalDarkness, I will be checking it in my spare time.

You saw the image I posted earlier (the bike, yeah)?, What rate do you asign to the metals?.

Sure thing, I'll clean it up a bit and compress the textures or something so it'll squeeze across the web, tomorrow when I'm back at work.

I'm not sure what you mean by "rate", however? Metals generally aren't so difficult, but in this particular scene and its accompanying master bathroom scene, I was unable to get good, predictable results for some reason. Trying the IOR technique has worked for me in the past, especially on brushed nickel and stainless steel metals.

Usually the only metal that thwarts me is "oil-rubbed bronze", which pretty much requires texture map-painting to achieve the rubbed-edges effect.


Hrm... yes, well... You write such long posts... sometimes I'm too lazy to read the whole thing.
sorry about that. :P

You'll love or hate this song! Hope you get a laugh out of it anyway, my friend:

http://ticklebooth.com/wp-content/uploads/2007/08/read-a-book.jpg (http://www.youtube.com/watch?v=TgcZNpmOKuk&feature=related)
(clean version, by the way) (http://www.youtube.com/watch?v=TgcZNpmOKuk&feature=related)

SebKaine
12-28-2011, 10:39 PM
well this topic is very interesting ! but as i really don't understand the CIOR concept can someone help me to get the idea.

i will speak as the fool, but when i do metal shader i only use diffuse + specularity/reflection/Anisotropic ppties + nice texture. How does refraction come into the story ? do you guys use refraction for your metal shaders ? i don't see how metal can have a refraction index ?

could you please post some photo of a metal that need CIOR or refraction and that can't be done in mental ray , cause i've never seen that , and i feel like i'm missing something crucial.

Thanks for your help !

cheers !

InfernalDarkness
12-28-2011, 11:39 PM
From Zap's the article on the topic:

Well... actually... no. Metals are indeed not refractive, and are indeed not dielectrics (meaning, electrical insulators). They are Conductors, and for some baroque reason these are also considered to have an "Index of Refraction".

Now, don't ask me how on earth someone came up with the idea of refractive metals or how this is actually calculated... I didn't write the laws of Physics (I just abuse them) so just trust me it's there.... and these values are high. Not your average "1.3" ish like for water, but values like "25" or "50".

Making Better Metal with mia_material (http://mentalraytips.blogspot.com/2007/10/making-better-metal-with-miamaterial.html)

His example render:

http://i51.photobucket.com/albums/f366/MasterZap/gold-in-kitchen.jpg

The theory behind using higher IORs for metal is to simulate or mimic microsurface scattering of highlights, basically. It can add a lot more zazz to your metals with a lot less work.

Edit:

In addition, when one searched "metal index of refraction" and finds some relevant sites, one can find the IORs of each metal type calculated for oneself.

Chromium (http://refractiveindex.info/?group=METALS&material=Chromium) = 3.68
Silver (http://refractiveindex.info/?group=METALS&material=Silver) = .329

That site will also calculate your BRDF curves for you, towards the bottom, if Fresnel isn't helpful for realism.

SebKaine
12-29-2011, 10:01 AM
thanks for the links !

Well i'm not sure i get all the story but for what i understand. he said
- metal are not refractive but
- to get an optimized BRDF curves its better to use fresnel reflections and High indice of refraction to draw the BRDF curves
- But the goal of all this is to control the look of the curves that blend Diffusion/Reflection

In maya you can put all the indice you want you have no preview on your BRDF curves like said previously.

So to do stuff like this i prefer to use
- a facing ratio node
- i remap my facing ratio with a remap value node
- now with the remap value you have full control on the look of your BRDF curves, you draw by hand the exact look of your BRDF curves
- you then plug the out value in your reflectivity attribute
- and you plug the inverse of this value in the diffusion weight attribute

then you get diffusion/reflectivity compensation and you have the full control on How your BRDF curves looks like.

its looks more intuitive to me than using obscur IOR to draw my curves !

cheers !

CGTalk Moderation
12-29-2011, 10:01 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.