CGFX

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:

Setting up a realtime litsphere shader in Maya

In an earlier post I discussed and shared a litSphere (or Matcap) shader for maya (which also works in Softimage.) Back when I made one for a place I worked I also made this artist’s guide for coworkers, which I just found while sorting through my hard drive.

The shader I made available here is not the one I made (it’s no longer mine to share) but one in the public domain – happily this little guide still applies.

So here it is…

There are quite a few litsphere maps out there, do a little googling and you’ll find plenty. They are also easy to make in photoshop. If you want to simulate lighting from a render, you can place your advanced/non-realtime material on a sphere, render it out, and use that as your litsphere… this is great for previs and layout, you can see in your viewport a realtime approximation of your shaders. And since it works out-of-box it’s a useful trick for studios which don’t have the resources for a more advanced realtime visualization system.

 

Your results will vary depending on your graphics card. Softimage users, I’m not much of a shader guy but it shouldn’t be too difficult to set up a good solution for the high quality viewport (which, by the way, hasn’t gotten the attention it deserves – sure it needs work but its a huge step in the right direction.) If I get a chance I’ll see what I can come up with, it would be nice to be able to model in a viewport with shading looking similar to Zbrush etc. I’d also like to have a simple solution for lit sphere shading in Arnold and Vray. Any shader gurus out there who are interested in the idea contact me and I’ll share what I have (for what it’s worth.)

“LitSphere” aka MatCap Materials in Softimage and Maya

It had been a while since I wrote anything technique-specific for softimage, so I decided to come up with a rendertree setup for “lit sphere” rendering and share it on this blog. I would talk about normals and angles of incidence and it would be completely cool. Well, it’s still cool, but no need for much in the way of discussion…  it turned out to be ridiculously simple.

Have you ever used mudbox or zBrush and noticed how nice their realtime clay-like materials are? That’s what we’re talking about.

A “lit sphere”, or what zBrush users might recognize as a “MatCap” material, is a technique first described (as far as I know) by Bruce and Amy Gooch, Peter Sloan and William Martin in their 2001 paper  “The Lit Sphere – A model for Capturing NPR shading from Art.”

The basic idea is simple: a spherical image can act as a stand-in for the lighting of a more complex surface, by mapping the angle of the surface normal  (as seen from the camera) to XY coordinates of an image, such that the center of the image relates to a surface facing the camera and every other angle of incidence maps to an X (horizontal angles) and Y (vertical) coordinate on the texture.

The result is “lighting” defined for every possible normal via a simple texture, and what’s really cool is that the result can easily approximate various painterly, sketchy or waxy surfaces. Since everything derives from a texture, it’s fast enough for realtime shaders and easy to change and edit.

Ok, so how do we get this result in realtime, and how do we get it in Mental Ray? Well, realtime requires a realtime shader. It’s easy to make a HLSL shader in Mental Mill without any shader programming expertise at all. Here’s an admittedly junky one for use in Maya, which works in Softimage as well.

But if you don’t want realtime display in your viewport, it’s just as simple to render litspheres in Mental Ray, regardless of what package you’re using. Just use the mip_Gray_Ball shader, and feed it a “litsphere” texture. That’s it. Done.

So, while this topic didn’t prove to be a basis for a insightful tour through the rendertree, at least it’s cool in the sense that you just can’t get a more powerful shading tool any simpler than this. If you are looking for an interesting approach to NPR or “Painterly” rendering styles, you want to specifically mimic a sketchy or painterly style of a traditional artist, or you want a good realtime material to model with that has the same feel of lighting you get in mudbox, now you’re set.  Enjoy.

ICE getting stronger and stronger.

Rumors persist about ICE being expanded into Maya. 2011 introduces ice kinematics. And Hybride and Thiago Costa blow people away with ICE simulations for the feature film Predators. Thiago’s Lagoa engine teaser has gone viral, so I’m going to add myself to the tons of people wowing over it…here it is:

[vimeo]http://vimeo.com/13457383[/vimeo]

Wow indeed!

XSI toon shader

Did some more work on a basic realtime toon shader for XSI (and maya, it’s CGFX.) Here’s a sample…

Me. Me me me. Me too.
It's Agent Smith(s), toon style.

Functionality is pretty basic at the moment: Ink threshold, 2 levels of paint and a hard spec hilight, overall color control, a single point light source. I still need to introduce diffusion and spec mapping, possibly some reflections and bump/normal. Remember, if you see an agent, run.

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.