mental ray Wiki

The folks over at mymentalray.com has launched a mental ray Wiki.

It's almost completely empty at the moment, but together we could load it up with a lot of mental ray info!



Max 9: Converting other materials to "Arch & Design"

If you want to have some cool tools for handling the Arch & Design material in Max 9 (including converting other materials - including vRay materials - into Arch & Design) you can use this script.

Save the file to your 3dsmax/scripts folder, and run it from the "MaxScript" menu.

Then go into the "Customize" menu and choose "Customize User Interface".

Go to "Menus", and on the left side open up the "mental ray" category.

On the right side, open up, say, the "Tools" menu (or any other of your choice).

Drag-and-Drop the "mr Arch Design Tools" to some cool place on that menu.

Voila - you have installed this nifty little add-on.

Note: A much simpler version of this script exists on the max 9 DVD in the sample scripts folder, but this variant is updated.

Enjoy! ;)



Clouds with mental ray sky

I keep getting requests from people saying things like "I saw you at SigGraph showing of the mental ray sky and it had clouds in it. How did you do that?".

To which I twirl my moustache and say, 'tis a deep secret....

....just kidding.

Here's the thing. The mia_physicalsky shader uses a 'haze' value to derive a sky color based on the sun position/angle. So a 'hazier' sky is more white/yellowish and a less 'hazy' sky is deeper blue. Okay fine, weather control, you say, but that's not clouds, is it?

Well... actually... it is... if you modulate the haze value across the sky!

Observe this video that I made... it's basically a collection of all test animations done during the development of the sun&sky. Some are bad, some are worse, some are nice, some has bugs in them, some use very low anti aliasing, and none is a peice of art. However they do demonstrate the cloud feature...

What I did was use this texture map (which is a slightly modified version of one I found from some old CD-ROM with public domain sky textures) as a spherical environment map plugged into the haze parameter of mia_physicalsky. That's basically it!

In Maya or XSI you can do this directly, in Max you need to drag&drop your "mr Physical Sky" from your environment dialog into the material editor, uncheck the "Inherit from Sky" and apply the map there.

What is important - though - is this; This is a normal run-of-the-mill LDRI .jpg image, which means it causes a "variation" in the range 0.0-1.0 ... this is way too little for being visible as "clouds" in the sky (the haze has a range of 0 to 15)

So to see results, you need to multiply the level of the texture. How you do this differs between the applications (in Maya you can use the Gain, in Max you use the Output rollout and turn up the RGB Level, etc etc) but setting it somewhere between 5 and 10 tends to look nifty.

Note that this is not a "physically correct" effect in any way, notably because it doesn't actually scatter light, or block light, or create any shadows, or anything like that. But it does simulate "light" cloud coverage very nicely (like high altitude cirrus clouds), and the cool thing is that the clouds coloring automagically follows the sun angle, making very nice sunsets possible....



Gnomon Workshop Skin Shader Tutorial

I just saw that the this very cool tutorial about my mental ray skin shader (good old misss_fast_skin), which I enjoyed very much, and I wholeheartedly recommend as a good tutorial on how to use the shaders.

Alex Alvarez has made an over two hours long video tutorial in three parts which can be downloaded from the Gnomon Workshop webpage. It's very informative and teaches many cool tricks.

A couple of details about the tutorial, though, that I thought was worth nothing:

Radii stuff

The tutorial started out by "trial and error" to find the various scattering radii. While this may be "good" as a "understand what does what" thing, I really missed my "rules of thumb" from my written SSS tutorial (available here) about the various values for the scatter radii (i.e. that the subdermal should be "about an inch" and the epidermal "about a third of an inch"). The defaults that are there are actually good if your scene is in millimeters.

Color mapping stuff

Generally, colors are not mapped in the "overall" unless you "know" what you are doing. Yes - as Alex finds out, doing it may make more intuitive sense, and may appear more "predictable" if one expects the "final color" to "look" as the "texture color".

However, the whole intended workflow of the shader is actually not to do that!

Because a lot of the "red tone" of skin should actually come from the subdermal and epidermal layers and actually hardly be present in the color map at all.

I.e. when the shader is "fully" utilized, the color map shouldn't "look" like skin at all; it should look like the skin would look if you peeled it off it's fleshy underpinning (yuck!).

It is true that some highly pigmented areas such as skin "moles" or the lip colors indeed map better in the "overall"... this is because they are a layer "on top" of the rest of the skin and actually "filter" the underlying light (blocking it) and for the lips or for skin moles, mapping "overall_color" indeed makes sense.

I fully understand that this "intended" workflow is very counter-intuitive to the lay person, but skin is such a complex substance with a lot of interaction of light between flesh, blood and the actual epidermal skin layer, it can't be as simple as "map a color map to a Blinn".

Bump stuff

I reall missed any mention about that the "appearance" of the bumps is strongly defined by the "balance" between the "diffuse" and "epidermal" layers... because the bump only applies to the unscattered "diffuse" layer, and the "epidermal" layer looks very similar to the diffuse layer, but slightly scattered and without bumps - hence one of the most important "look development" tools for the skin is to balance these two. I would actually want to see more of that rather than Alex's attempt to "blur" the bumpmap, which I do not think one should do.


Oh, I hate to break it to Alex, but fresnel is pronounced "frenell" [fre…™ 'nel] - 'tis the name of a french dude. ;)


The fact that Alex used something other than the build in reflectivity I can understand... but I pity the choice of the standard Maya "Blinn". I wholeheartedly suggest to use the mia_material for the reflectivity layer of skin, especially utilizing the "refl_hl_only" flag for superfast "skinny" reflections - more on that in a future post here.

I also strongly suggest to have a high "edge" reflectivity at all times, and generally let the specularity levels "follow" the levels of reflections (after all, "specularity" is really only just reflections of light sources...)


The reason the skin shader has 2 layers of specularity isn't really to support different "areas" of skin, it's actually to change the shape of the specular "lobe". The traditional "phong" model with it's "cosine-raised-to-a-power" shaped lobe isn't really very suitable for skin, but by blending a couple of such lobes you can get a combined effect that is.

But all this whiny nit-picking aside, the tutorial is a fantastic piece of work, and I'm impressed with the time Alex took to make it (it's over two hours long!). It's well worth a download for anyone into skin shading in mental ray!

Thanks Alex for making it, and I hope you take my comments in a constructive manner!