Mental Mill

Update – MatCap (litsphere) shading in Softimage 2013

A discussion about Mudbox and Zbrush-style shading arose on the Softimage mailing list. Their signature look comes from “MatCap” shaders (originally known as lit-spheres.) It’s a popular way to achieve a custom lighting solution from a texture, in realtime, which is particularly useful when modeling – you can get a nice clay or sculpy “look” to geometry in realtime. It’s also useful for creating nonphotorealistic (NPR) looks in realtime, toon shading etc.

As mentioned in an earlier post, the grey-ball shader in mental ray can render litsphere textures, and a user suggested that in the high quality viewport you can get the desired result by plugging the metaSL node “Map_ball” into the environment channel. The problem with this is the result (on my machine, at least) appears in world space. A proper litsphere should be in view space.

But it called my attention to something important – almost all of the metaSL nodes used in Mental Mill are now accessible in the render tree and can be used similarly – meaning for most intents and purposes all softimage users now have Mental Mill. Which is awesome.

But we still needed a solution for matcap functionality in the high quality viewport. So I bit the bullet and wrote a metaSL shader which seems to do the trick. It can be used for both realtime performance in the high quality viewport as well as full renders in mental ray (and any other platform supporting metaSL.)

Update: Daniel Brassard kindly fixed some bugs, the new version is now available below. Thanks Daniel!

Here’s the shader (MetaSL ~2kb): litsphere_v1_1

More examples of the shader:

Mental Mill and Softimage

If you are already an experienced shader writer, Mental Mill doesn’t have much to offer, auto-generated code won’t appeal. But for TDs who haven’t the experience or time needed to get a shader going, it’s a huge boon. It’s also a way to get a feel for shader code, letting you experiment and see how the code changes as a concept is changed.

Here’s the mental mill blog, with some info for softimage users.

What’s important for everyone to know about Mental Mill is that the same “tree” can be used to generate code for multiple rendering types – with a few caveats, you can create a shader for Mental Ray, a matching realtime shader, and a renderman compliant shader all in one go (ummm, Arnold? Oh well). For softimage users, this can give you custom solutions you can see in both the viewport and at render time. Here’s a video which covers creation of a realtime shader, for instance…

[youtube]http://www.youtube.com/watch?v=E3biGBm2mkM&feature=youtube_gdata_player[/youtube]

CGFX shaders

I’ve been playing around with CGFX realtime shaders and mental mill. Here are some basic first shaders. Mental mill makes creating this kind of stuff pretty fast, and you can edit the generated code by hand once you’re in the ballpark.

A simple realtime toon shader for XSI and Maya viewports.