View Full Version : mia_material - light diffraction effect in diamonds
I'm trying to reproduce Zap's "workflow" (http://mentalraytips.blogspot.com/) on rendering diffraction effects in refractions using maya (he does it in max).
so this is where I'm right now:
the original render (IOR 2.42)
and the composing:
what did I done yet:
1) modeled a brilliant cut and kicked mia_mat with slightly modified (close to zap's magic) solid glas preset.
2) rendered 3 passes with different IORs: 2.39,2.42 and 2.44
3) in fusion I extracted the red channel from the 2.44 pass, green channel from the 2.42 pass and the blue channel from the 2.39 pass.
4) merged red -> green -> blue in a screen mode.
5) + a little softglow and highlight
ok. I've been told that a jeweller trys to remove the diffraction effect as much as possible. as there's a huge difference in the effect between zap's render and mine (his one is much more evident) there might be two reasons:
a) zap's jeweller was a little off the mark
b) I screwed up - in the case of the way much to low photon energy for sure. have to fix that.
actually, I rendered 6 different IOR passes fron 2.39 to 2.44 by 0.01 steps. but I didn't manage to add them together to my likin'. I connected them in the order:
magenta -> blue -> cyan -> green -> yellow -> red and 2.39 to 2.44 in screen mode. no, that was not good (it got much toooo bright).
how I colorized the passes?
loader -> colorcorrection node -> adjusted the gain of the appropriate channel to 0.
magenta: green = 0, red and blue = 1
yellow: blue = 0, red and green = 1
cyan: red = 0, green and blue = 1
I would appreciate any hint or idea about that very much. Master Zap? Are you there?
The technique we will be using here is a very low-tech one - we simply render the scene multiple times with slightly different IOR's, colorize each of the renderings based roughly on the "color" of that wavelength, and combine the result.
what do you mean by "slightly"? 0.01? 0.05?
what wavelength? do you just pic 3 colors between the blue (0,0,255), green (0,255,0) and red (255,0,0)?
and what is your way of combinig the 6 chanel version?
once again - I would be very gratefull for any comment.
12-02-2009, 09:11 PM
While I think you're making progress with this method, I find that all that work seems a bit heavy for the task at hand. Until someone writes some shaders to access the spectral rendering features of MR 1.7, I suggest trying to link a prism shader with your mia_material_x instead...
Prism Photon (http://www.creativecrash.com/maya/downloads/shaders/c/prism_photon--2)
I've used this shader successfully in animations in the past, in conjunction with the mia_material_x. You can adjust the effects and increase/decrease them to suit your needs of course; by itself it makes a rather absurd diamond!
Just an idea. With this shader, you would only need one render pass, and no extra compositing. It's obviously not "physically accurate", but it does have a lot of control over your color refraction output, and also it works wonders with caustics.
I don't really see any caustic effects in your render; did you set the refraction to "transparent shadow" perhaps? I see the light shapes, but no traditional refraction effects really... Probably working on the actual diamond itself first, I imagine?
Also, I believe you can set the photon energy to "Automatic" in Maya 2009 and beyond, which wasn't the case in previous versions. This may or may not be helpful.
as far as I can tell - prism photon is only 32bit version. sorry, my bad, i didn't tell about my system: win 7, 64bit. maya 2010.
the light patterns on the floor are caustics effects - refractive and reflective... my guess, or my farmers logic says, that you would not see a strong diffractive effect in reflected caustics at all, but refractive.
and yes, it is barely visible at the most right small stone (the big spot on the left side of that stone, showes diffractions - the energy is too low to make it more visible... I'll try to make it stronger.
maybe I have use a wider range of IOR to boost it... but I'm not certain about that.
photon energy automatic? could you please tell me, where this is hidden?
photon energy from 80000 to 95000.
12-02-2009, 11:19 PM
Ah, I see that they are working, just not as extreme as Master Zap's examples.
Here's an example of the difference, which is why I thought you might not be using "Refractive Caustic":
With caustics (in the mia_material_x, "refractive caustic" setting) -
Without caustics (in the mia_material_x, "transparent shadow" setting) -
Those don't look great, just tossing ideas out hoping one of 'em helps. I don't think I was correct about Automatic Photon Energy; upon searching, I could only find this option with the sun/sky setup. Nowhere on physical_light shader or anything.
That is tragic about the prism photon being only 32-bit; I've long since migrated to x64 as well, and hadn't tried using it for a few years. Sorry to send you in a wrong direction.
ok, I c what you mean by the "shadows".. no, no prob here
to my lighting
HDRI as texture in rayswitch_environment shader as anvironment.
1 spot light - turned into an area in the mental ray slot with a disc shape. a phys light is in the lightshader. I figured out, that it renders much faster with the phys_light shader, than without... don't ask me why :D :D :D
the spot emits photons of course.
I don't use mia_mat in the shadow shader slot, but the transparent_shadows shader.
to make it all clear - I enlarged the IOR range by 0.03 units (compared to the setting before). so its 2.33 - 2.42 - 2.47 - but thats definitely toooo much. I guess all the amsterdam diamonds guys are spinning in their graves... :D :D :D :D
12-03-2009, 12:32 PM
I know I'm probably asking for too much, but I would like to take a look at the scene. A screenshot at least. What I'm interested in is: a) light position vs. scale vs. scene scale and b) the light and mental ray light shader settings.
Well, I know, I'm just a grain of sand on the beach.... but I still didn't gave up the hope mr. andersson stumbles over here and take a peek at my questions above.
Would be really nice.
thx a lot.
01-21-2010, 08:39 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.