2007-01-21

Tricks and Tips for the mia_material (Arch&Design): Volume #1

Aaah, finally; my latest handywork is finally out on all major platforms!

The material known in 3ds max as "Arch & Design" is actually a shader from the architectural.dll library known internally as the "mia_material". ("mia" is a prefix for "mental images architectural"). It is now available in XSI 6 and Maya 8.5, known as "ArchitecturalMaterial" and "mia_material" respectively.

Photobucket - Video and Image Hosting

I had to wait writing tips about this material until now, because the shader hasn't been available to everyone (at least not "officially" ;) ), but now all that is history.

So what is this thing already?

As noted by the documentation, the shader is primarily "intended" for "product design" and "architectural" renderings. By this I mean that it, basically, tries to mimic "reality" of hard surfaced... well... stuff. Nobody is stopping anyone from using it in their next feature film... just because the DLL is called "architectural" doesn't really mean much... it's a general purpose material, no more, no less.

The shader has some cool features, and some "quirks" that can be worth knowing. This post is the first in a series of Tricks&Tips which may be useful when using it.


For example, the feature to disable reflections on the "inside" of objects was intentionally intended as a performance optimization to "quickly" render glass. I'm sort of kicking myself for defaulting that to "on", because:
- it doesn't actually help performance that much
- it causes some side-effects that may be... surprising.

I simply suggest... turn it off. The importance driven ray rejection takes pretty well care of removing truly "unimportant" rays anyway, so the feature is somewhat redundant. Secondly, while it's intent is to remove the "inside" reflections, it actually kills reflection on any flipped face (because, well, the side being hit is.. uh... the "inside"!). So if you have a scene imported from a troublesome CAD system (those LOVE flipping random triangles for no reason whatsoever... it's like it's a secret evil plot... oh no... you're only gonna get 75% of your triangles flipped correctly... ha ha... ) you could suddenly get NO reflections on some of them, which looks really weird... without any "transparency" being involved anywhere! Why? Because the "wrong" triangles are showing their "inside"... and hence.... no reflections... as per the option!

Thousand apologies for this "misfeature" ;)

More to follow, but let me drop a hint; Have you tried combining the SSS shaders with the mia_material's reflection feature?

Also, check out the refl_hl_only flag, and do read the docs there.... it's NOT simply a "highlights only" flag. If you use FG, it's a "super-quick fast fake for the ultra-mega-blurry reflections". Like those of... say... skin.

Stay tuned.



/Z

2006-12-08

Stuff you never even knew about mental ray 3.5

One of the coolest features of mental ray 3.5 is the way the final gathering feature works.

It may deceptively seem to work the same way as before, but it doesn't. One really important point is that each FG point stored isn't just a color, it's a whole set of colors - with directional information (for the tech heads: think spherical harmonics).

What does this mean? It means a lot for bump-mapping!!

In earlier version of mental ray, bumps basically had to be resolved by the adaptivity of the final gathering, causing an extreme density of final gather points due to the variation in the bumps.

But in mr 3.5 it works completely differently; the final gathering is actually calculated on the un-bumped normal vector, and the result is stored including directional data... and then at render time, data is looked up into this directional data.

The result is:


  • Much lower density of final gather points needed, the existance of bump maps does not increase the density!
  • Very high quality of directional effects of indirect light on the bump maps, at levels previously impossible.


This makes bumpy surfaces render faster, and resolve in much greater detail, causing details in the bump maps in "dark" areas, i.e. areas only lit by bounce lights or other forms of indirect light such as photons.

The catch:

Some earlier shaders out in the wild intentionally tried to work around this problem. These workaround can potentially interfere with the "correctness" of the new method.

The good stuff:

The cool stuff is that due to this new FG storage format, it is possible to do directional lookups into the FG map. This is how the "Highlights Only" mode in the Arch&Design material works, which can give a very good "visual simulation" of extremely glossy reflections, without actually shooting a ton of rays and taking almost no extra render time!

/Z

2006-12-07

RSS Feed added.....



An RSS feed has been added so you can plug this blog in your RSS catcher thingamabob. Enjoy. Or not. ;)

/Z

2006-12-01

Public shader sources has been updated

The public shader source code available at the mental images FTP site has been updated as of today to the level of the shaders as-shipped with mental ray 3.5 - enjoy.

The public shader sources are available at
ftp://ftp.mental.com/pub/shaders/public-shaders-35.zip

/Z

2006-11-29

Who took my "temporal contrast"?

I've received some questions about the "temporal contrast" option and who stole it from the 3ds max 9 UI.

Here's the deal:

In mental ray 2.1 and earlier, it actually used a temporal contrast, which worked very similar to the overal adaptive sampling contrast. However, this actually yeilds suboptimal motion blur.

So mental ray 3.0 or newer actually takes a fixed number of temporal samples for each spatial sample.

However, the parameter, as exposed in the .mi file format still is "temporal contrast" and is an RGBA color. However, this color isn't actually interpreted neither as a color nor as a contrast at all!

What happens is that a number of temporal samples is calculated from this color as such:

samples = 1.o / min(temporal_contrast)

So this means a "temporal contrast" of 0.2 0.2 0.2 0.2 really only means "5 temporal samples". Nothing else. There is no "contrast" comparisions being done between temporal samples at all!

So... since mental ray does this internally, this was propagated to the max 9 UI as a temporal samples spinner, rather than the old "temporal contrast".

It most likely will be changed in the .mi file format in a future version to a "time samples" instead of "time contrast" keyword.

Hope this is clear as mud... ;)

/Z

2006-11-17

DOF and Sun & Sky issue

There is a known issue when using the Sun & Sky in max 9 together with depth of field. Objects turn out like odd wireframe-looking... things.

The cause for this is actually the long list of lens shaders that gets added by the "Aerial Pespective" feature built into Sun & Sky.

For now there is a workaround.

Proceed as follows:

  1. Create a Sun & Sky system as normal, by creating a daylight system and choosing "mr Sun" and "mr Sky", affirming the pop up question of "do you want to ad a 'mr Physical Sky' environment" with a resounding YES.
  2. Then, change the skylight option from "mr Sky" to "Skylight"
  3. Change the Skylights option to "Use Scene Environment"
Now a nearly identical rendering (but without any Aerial Perspective) will result, since the standard mad Skylight will pick up the "mr Physical Sky" environment shader for the lighting. The net result is nearly identical to the normal rendering using a "mr Sky" and the depth of field will now work.

The difference is that now one needs to do any "tweaks" to the sky strictly in the "mr Physical Sky" shader, and to do this, one needs to "drag-and-drop" it (as an "instance") from the "Environment" dialog into a free slot of the material editor, then tweak away.

/Z

2006-11-09

mymentalray.com

A new site has opened, www.mymentalray.com

It is not an "official" site in any way, but run by enthusiasts, but indeed contains a lot of information or links to "the best" info out there. (Which means lots of links to lamrug.org ;) )

/Z

2006-11-08

mental ray sun&sky and rapid motion blur

There is an issue in the initially released version of max 9 (the one with mental ray 3.5.2.6) which makes the sun&sky system not behave with rapid scanline motion blur.

The workaround is to turn of the "Aerial perspective". Go to the "mr Sky" light and uncheck the "Aerial Perspective", and you will find the rapid scanline motion blur working fine.

/Z

2006-11-06

Swedish Max/Maya launch

Tomorrow (Nov 7:th 2006) will be the launch event for 3ds max 9 and Maya 8 in Sweden. It'll be in Gothemburg (Chalmers) and I'll be there speaking about mental ray and...stuff.

So anyone around wanting to say hi, well, I'm the blonde swedish guy. Uhm. Which may not be so easy to find among all the other blond swedes. Well, I'm the only one that is mental.

/Z

2006-11-02

Welcome to this new blog

This blog is a place for me to store "frequently asked questions" about mental ray and shaders; instead of having to reply to it multiple times, I create a blog post.....

...well that's the idea, anyway.

/Z