zap's repository of mental ray tips and tricks, frequent questions and their answers, and some smoke and mirror mental ray trickery you may not find elsewhere...
Showing posts with label mia_material. Show all posts
Showing posts with label mia_material. Show all posts
2013-08-26
Movies using mia_material / Arch&Design ?
Hello!
I'm compiling a list of movies that use the mia_material shader (known as "Arch&Design" if you are a 3ds Max user). I need this to present in front of the Sci/Tech Oscars committee on September 19th 2013... so quick answers are better then slow ones :)
Did you work on a feature film?
Let me know in the comment field, or drop me an email, tweet me a DM @MasterZap or... whatever.
Thanks!
/Z
2013-07-19
SIGGRAPH 2013 and Cinefex
Hello everybody! Sorry for the lack of posting.
SIGGRAPH 2013
As usual this time of year, it's time for the SIGGRAPH conference, this year in Anaheim. Yes, I am going, and as a matter of fact I am Speaking. Thursday, before lunch, in the "Physically Plausible Shading in Theory and Practice", I will hold a talk named "Everything you always wanted to know about mia_material * (* but were afraid to ask)", which will explain the story of how the mia_material (Arch&Design to 3ds max users) shader was developed, why it does what it does, why it is so hard to replicate... and a lot of funny anecdotes never ever heard elsewhere (and very very little math).
Show up - enjoy!
If you are attending this year, make sure to get the cool App, where you can see which talks I'm going to by "following" Zap Andersson. That is, if you are interested in hardcore rendering as I am ;)
See you all in Anaheim
HULK SAYS "GIVE ME ALL THE CINEFEX"
I bet nearly everyone reading this blog knows about the magazine Cinefex and is probably a subscriber. But I bet many of us has also looked longingly at the back issues and how many times have we not wanted to hold that issue about E.T. in your hands?
Well... you may be able to... soon... assuming your hands also hold an iPad!
A couple of people I know have gone through the audacious task of licencing all the Cinefex back issues and speant a year scanning every copy, OCR'ed it, marked it up for search.... etc.
Words fail me at describing this task, and I will let them describe it for themsleves, on their Kickstarter page, which you can find HERE:
http://www.kickstarter.com/projects/newscribbler/cinefex-classic-collection
Or watch this video:
If you find this interesting, consider throwing them a $ or more for the effort. I don't even have an iPad and still did it. Just the Blade Runner issue of Cinefex recently went for $250 on eBay. Here you ALL TEH CINEFEXES. That's...a deal.
/Z
SIGGRAPH 2013
As usual this time of year, it's time for the SIGGRAPH conference, this year in Anaheim. Yes, I am going, and as a matter of fact I am Speaking. Thursday, before lunch, in the "Physically Plausible Shading in Theory and Practice", I will hold a talk named "Everything you always wanted to know about mia_material * (* but were afraid to ask)", which will explain the story of how the mia_material (Arch&Design to 3ds max users) shader was developed, why it does what it does, why it is so hard to replicate... and a lot of funny anecdotes never ever heard elsewhere (and very very little math).
Show up - enjoy!
See you all in Anaheim
HULK SAYS "GIVE ME ALL THE CINEFEX"
I bet nearly everyone reading this blog knows about the magazine Cinefex and is probably a subscriber. But I bet many of us has also looked longingly at the back issues and how many times have we not wanted to hold that issue about E.T. in your hands?
Well... you may be able to... soon... assuming your hands also hold an iPad!
A couple of people I know have gone through the audacious task of licencing all the Cinefex back issues and speant a year scanning every copy, OCR'ed it, marked it up for search.... etc.
Words fail me at describing this task, and I will let them describe it for themsleves, on their Kickstarter page, which you can find HERE:
http://www.kickstarter.com/projects/newscribbler/cinefex-classic-collection
Or watch this video:
If you find this interesting, consider throwing them a $ or more for the effort. I don't even have an iPad and still did it. Just the Blade Runner issue of Cinefex recently went for $250 on eBay. Here you ALL TEH CINEFEXES. That's...a deal.
/Z
Labels:
appearances,
Arch&Design,
Cinefex,
me being teh funny,
mia_material,
siggraph,
SIGGRAPH2013
2013-06-20
Speaking at SIGGRAPH 2013
Less than a week to EUE, less than a month to SIGGRAPH 2013
This year, I am speaking in the course "Physically Based Shading - Theory and Practice"
http://s2013.siggraph.org/attendees/courses/events/physically-based-shading-theory-and-practice
and my talk is entitled "Everything You Always Wanted to Know about mia_material (But Were Afraid to Ask)"
It will be a rush through the history and development of good o'le mia_material (Arch&Design in max-speak) and it will be informative and fun. :)
See you all there!
/Z
This year, I am speaking in the course "Physically Based Shading - Theory and Practice"
http://s2013.siggraph.org/attendees/courses/events/physically-based-shading-theory-and-practice
and my talk is entitled "Everything You Always Wanted to Know about mia_material (But Were Afraid to Ask)"
It will be a rush through the history and development of good o'le mia_material (Arch&Design in max-speak) and it will be informative and fun. :)
See you all there!
/Z
2010-03-06
mental ray in Round 6
Check out this awesome short film by Snowball Studios called "Round 6". You may think it is a game cinematic, but it's actually a short film intentionally made in the style of a game cinematic:
This is, of course, mental ray in all it's glory, and what I found most interesting about this is that they have a very cool production blog over at http://round6construction.blogspot.com/ where you can read many more details of the project.
Great work guys!
/Z
Round 6 from Snowball Studios on Vimeo.
This is, of course, mental ray in all it's glory, and what I found most interesting about this is that they have a very cool production blog over at http://round6construction.blogspot.com/ where you can read many more details of the project.
Great work guys!
/Z
Labels:
cinematic,
mental ray,
mia_material,
short film,
sss
2010-02-04
Softimage defaults issue
Hello!
While teaching my FXPHD course, I stumbled upon a problem I have not seen before. The error is in Softimage 2010 and (I guess) all earlier version that has the mia_material (known as "Architectural" in Softimage) integrated.
The bug is in the default values for the Ambient Occlusion settings.
You will find that the defaults for two values are flopped: AO Shadow Color is black, and "AO Ambient" is set to a 20% gray (0.2 0.2 0.2). The proper defaults are the reverse!! Also, the AO detail enhancement is off (0).
If you use the defaults as-shipped in Softimage 2010, you get an undesired 20% ambient contribution, and your AO will only apply to that light - not your indirect bounce light.

Fixing the default will give you the proper result, and not give you a sudden 20% light coming from nowhere in particular which you probably never wanted, AND will let you use the AO to enhance the detail of your indirect illumination, as the Lord* intended.
Hope this helps!
/Z
* = That would be me in this case ;)
While teaching my FXPHD course, I stumbled upon a problem I have not seen before. The error is in Softimage 2010 and (I guess) all earlier version that has the mia_material (known as "Architectural" in Softimage) integrated.
The bug is in the default values for the Ambient Occlusion settings.
You will find that the defaults for two values are flopped: AO Shadow Color is black, and "AO Ambient" is set to a 20% gray (0.2 0.2 0.2). The proper defaults are the reverse!! Also, the AO detail enhancement is off (0).
If you use the defaults as-shipped in Softimage 2010, you get an undesired 20% ambient contribution, and your AO will only apply to that light - not your indirect bounce light.

Fixing the default will give you the proper result, and not give you a sudden 20% light coming from nowhere in particular which you probably never wanted, AND will let you use the AO to enhance the detail of your indirect illumination, as the Lord* intended.
Hope this helps!
/Z
* = That would be me in this case ;)
2009-11-13
Fire and Ice - rendering Diamonds and Gems in mental ray

They say Diamonds are a Girls Best Friend, but they can be a poor rendering guys worst nightmare.
One of the reasons is the characteristic property of fine diamonds known in the gem business as "fire" - the nice "pretty colors".

But even before we get to the actual dispersion part of things, lets try to see what it takes to render realistic gem's without it first.
Setting up a scene for Gem rendering

First, make sure you have your gamma correction enabled, diamonds, like all physical things, should be rendered linearily.

![]() Not gamma corrected - ugly | ![]() Gamma corrected - good |
Now we need some decent lighting. We need to follow physics as much as possible. Especially we want to avoid nonphysical "hacks" like specular-only lights, lights without shadows, and other things. We really want to light this in the same way a real photographer would light his scene, with realistic lights with all their realistic effects.
In 3ds Max the easiest way to do this is to use the Photometric lights. This will become especially important later when we get to the caustics, because the Photometric lights automatically gives us the proper photon energy for free. That is a little bit more work to achieve in Maya or Softimage (XSI) because you have to set the photon energy up manually.

A key point here is that we make them Target Lights (i.e. spotlights). This is so we get the most efficient distribution of photons. If we didn't give them a direction to shine, our photon emission phase would be much slower because so many photons would get lost in empty space. Make sure you aim the lights where they are needed - this is especially true with caustics.
Since we are using photometric lights, this also requires us to use an exposure control. We will be using the mr Photographic Exposure control, and we need to make sure to check the "Process Environment and Background" checkbox:

We also want to make sure they are area lights. This gives us the nice soft shadows and "soft" lighting that you would use for an artsy product render like this:
![]() Point lights - hard shadows | ![]() Area lights - soft shadows |
So we enable area lights:


In Maya and Softimage, the very act of doing this will implicitly light the scene from the environment. This doesn't happen in 3ds Max unless we put in a "Skylight". So we add one of those to the scene, and very importantly, set it's option to "Use Scene Environment".
Now we have a little more light:

We are using a default Arch&Design (mia_material) on the gems.
Let us make it more gem-like by a) turning our diffuse to 0.0,
and b) turning our transpacenty to 1.0:
![]() Diffuse = 0.0 | ![]() Transparency = 1.0 |
The automatic energy conservation of Arch&Design (mia_material) already makes this a decent looking transparent looking thing... transparency is complete, but still "overridden" by reflections, and the reflections do depend on angle, just like on real dielectric materials. However, by default it is not basing it on the index of refraction, but a custom curve. We need to fix that by setting it to IOR mode!

This makes our transparency a bit "clearer":
![]() Curve mode | ![]() IOR mode |
The scene is still looking rather dull with the gray background. Diamonds (like metals) are not so interesting looking in-and-of themselves, but area all about reflections and very very bright "pings" of light. Some people may be tempted to cheat this with a bunch of specular only lights, but why cheat when there is a real reason for such effect - reflections of Bright Things.
And what's the easiest way to get some Bright Things, if not an HDR environment map? Lets slap in some interesting HDR environment map. In 3ds Max you do this by adding a Bitmap to your Environment slot, and make sure to set it to a spherical environment: (Note: When doing this you may need to play with the Physical Scale to avoid having the environment map render dark, see here)

This should give us something much more interesting to look at. And note how the background lighting changed in tone to match the environment? This is because Final Gathering is picking up the new environment and getting it's lighting from there:

Actually FG is even picking up some of the concentrated bright spots and creating a form of "faux caustics". We will get to real caustics later, but for now it is looking pretty.
To make our image look nice, we are using the mr Photographic Exposure control. To make it even nicer we are going to do some modifications.
First, images like this, where we want to focus on some nice center object, always benefit from a bit of vignetting (darkening of edges):

Secondly, since these are diamond renders, and we truly want strong "pings" of light, we should turn up the highlights, to make the really bright bits be really really bright:

These are the knobs we used to do this:

And here comes a final little subtlety. This is really hardly a visible change, but I like it. The model is made with absolutely perfectly sharp edges. And a Jeweller will want to sell you on the idea that his diamond is perfectly flat with totally sharp edges.


...this. Yeah, not such a big difference, I know. It does more on other shaped Gem's than the round Brilliant cut, though, so I still suggest you use it.
Taking a shortcut



The IOR of diamond is 2.42 - so let's change that:



Color Gems
Now these gems look a tad blue. This is because the "Physical Glass" preset introduces some blue. Before we go further with the diamonds, lets discussed coloring our gems for a moment.


This is because it modifies the color of the ray "at the surface" of the object, whereas real colored transparent object modify the color of the ray gradually as it travels through the medium.
Looking at the gems above (rubies, perhaps?), the small ones are just as deeply red as the big one, and the tip of the big one is just as deeply red as the thickest part of it. That doesn't look... correct.
What we need to do is to enable attenuation through the medium instead. To do this we need to set our transparency color back to white (basically, treat the surface itself as completely transparent), and move to the falloff settings within the material:

We can use the same color as before, but we just have to set up a distance; at how thick a piece of material would you expect to see that color? Thinner than this will be less colored, thicker will be more deeply colored.
NOTE: It is important that this color has no component of 100%, and no component of 0%. If you were to set it to 1,0,0 red, it would be just as bad as the nonphysical setting. A better "red" would be something like 0.9,0.1,0.1, meaning, it lets through a lot (but not all) red, and very little (but not zero) of the other colors.
Here is our result:

But ideal diamonds are pretty much completely transparent, so for our excercise we will turn this falloff inside the mateial off completely! Uncheck the "Max Distance" and get:



Caustics
Finally, it is time for those elusive Caustic effects. First we must make sure the material is set up to actually do caustics, since Arch&Design (mia_material) has an explicit option to NOT do that. If we used the "Physical Glass" preset, this will already be set up for us, but lets make sure:


Generally, the Multiplier should always be 1.0, but we can allow ourselves some artistic licence here and turn it up a tad. But in general, since we are using the photometric lights, we should be getting the physically correct caustic brightness out-of-the-box. If they seem to weak, its probably beacuse people intuition of how bright they "should" be tend to be very overestimated.
We get this image:

Notice how the shadows actually became darker? This is because they were previously faked by simply attenuating the light a little bit, bit now the light is properly concentrated in the caustic effect instead. So this is correct.

Both real world cameras and human eyes perceive a "glow" around superbright objects, partially due to scattering in the atmostphere, but actually much more due to scattering in the light path (lenses) and the imaging surface itself (the film, the CCD, or our retina).
When adding the "Glare" output shader, we get the following image:

Notice how it looks much brighter without actually being any brighter at all. That's psycho-optics at work. A white pixel just looks white. A white pixel with a glow around it, and you'll be reaching for your sunglasses.... :)
And now - finally - time for Dispersion
Dispersion is when different wavelengths refract differently. I guess the most obvious case of this is a rainbow.
Real sunlight is a spectra containing basically an infinite number of wavelengths at once, and each of the different wavelengths will refract slightly differently... i.e. when a sunray hits a surface, one would (in principle) need to trace an infinite amount of rays around the scene to get the "real" effect.
Computers aren't very fond of doing an infinite number of things - at least not if you want them to ever finish. So there are several ways to simulate this w. various techniques.
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. Et voila, we have a dispersive render.

Simply put, the script will render your image multiple times, while modifying the IOR of your material. But to do this, it needs to know what "your material" is.
It tries to be clever and find any material named "Diamond", but if it doesn't find it, you will have to click the "pick material" button, and choose the material from the scene that you are using (in Instance mode).
Then you need to set the IOR you want it to use, and how the amount of "dispersion". In gemology "dispersion" is pretty much defined as the change in IOR across the visible spectrum, so I tried to mimic this in the script, but it's a bit hacky and probably not accurate at all, so take it for what it is.
When you are done setting up, you can hit the "Do Dispersion Render" button. (Note: The script does not save the image, you will need to do that yourself from the image window)
The "3 bands" mode does three renders, one each for red, green and blue, and looks like this:

The "6 bands" mode does six renders, for red, yellow, green, cyan, blue and magenta, and is a more subtle effect, but more likely to yeild a "nicer" looking rainbow effect:

And as a final pièce de résistance, we can enabled depth of field on the camera.

You simply set the f-stop of the camera, and you will get the physically correct depth of field assuming that
- your scene units are properly set up, AND
- your Aperture Width (in the render dialog) makes sense.
That will give you this "ultimate" render - and we are pretty much done:

Of course, we can exaggerate the dispersion effect for arts sake (simply turn up "Dispersion" a bit):

Finally, the script also supports a somewhat hacky "chromatic abberation" mode, where it introduces the Lume "Distortion" lens shader, and modifies the pincushion/barrel distortion slightly for each of the colored renders, if you want to go really Crazee. This is one result of that:

Hope this was helpful.
Unfortunately, you can't cash these diamonds in a bank, nor sell them on eBay...
/Z


Labels:
dispersion,
gems,
linear workflow,
mental ray,
mia_material,
photometry
Subscribe to:
Posts (Atom)