Archive for 3D Graphics
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:
This scene shows how ICE can be used to display custom information about aspects of a scene. In this case, the cone of a spotlight is displayed, with an option to display a projection of the spotlight on the surface of geometry. A second example shows how the same setup can be used for a near and far attenuation display.
One great thing about ICE is how easy it is to re-use and re-task your “code.” In this example, it is simple to save the null containing the ICE operator as a model. Any time you need this display, import the model and give it your spotlight’s name, and you’re done. Or better, write a script which does this for you so all you have to do is pick the light. – AM
Here’s the file (softimage 2013, 276kb): ICEspotlightDisplay
Petr Zloty sent me a useful tip… when you place the ICE operator on an empty pointcloud rather than a null, the results display properly in any viewport. This is an important realization which is really good to know. In fact, the problem with ICE display attributes on nulls only appearing with wireframes is an annoyance which I’ve bumped against more than once. Thanks Petr!
Rob Chapman posted a cool whirlpool deformer to the “Resource Dump” on SI-Community here. Since I had been doing a lot with logarithmic spirals recently I decided to make one from scratch and compare the two. Here’s the result.
Instead of using Rob’s wave deformer, since it’s fun to share it out there’s a “ridged turbulence” compound in there. Here’s what it looks like when used as a deformer:
And here’s the file (softimage 2013 ~160kb): alt_whirlpool
The most common email I get from people who have visited this blog is inquiries about the dark color of the background in the screenshots. No it’s not a custom UI, I just have a custom menu with a bunch of stuff including two ridiculously simple scripts… one which cycles the background color in all viewports and one which sets them to this dark grey.
I chose this color for a couple of reasons.
- With a darker color, particles are much more visible, meaning I can display them as single pixels.
- The color is dark but just light enough to easily see black wireframes.
- Have you ever opened Softimage in a dark room full of people using Maya and Nuke? It’s like switching on a searchlight. The light grey color scheme of the Softimage UI is waaaay to bright.
These two little scripts go a long way towards my personal enjoyment of the software. I won’t bother to display them in the post (wordpress kills the formatting), but here’s a file for each…
Since we’re on the topic… Softimage needs a new UI. It’s elegant and functional in many ways, but dated. The light grey is glaring, the huge arrow button looks absurd to new artists, (they’re right) and I have a strong suspicion that it’s a major factor which keeps new artists from Softimage. Just my $0.02.
Unlike most of the examples, I built this specifically to show how a deformer can be constructed with simple visual guides. So the good news is that it’s all nicely commented. This example shows the structure of a deformation, some tricks for making viewport guides, and the taper function itself (originally published by Alan Barr, it’s quite simple).
The down side is that I didn’t want to get into matrix transforms for the example, so this implementation is only on the object’s local Y axis. This limits it’s production value (not that there’s a great need for another taper deformer.) It’s an example, not a tool – adding in the transforms to make the taper axis arbitrary isn’t too difficult, but as I was making this I realized it was going to make the entire thing unreadable and that I was out of time – I have paying work I need to get to. ^_^ So here it is, as-is. Cheers – AM
File (softimage 2013 ~270kb): Example_TaperDeform
Had a little time and I hated leaving this in a state that wasn’t that useful, so I added in the additional kinds of control I usually have in production compounds (in this case, mainly the optional ability to deform on an arbitrary axis as supplied by a control object like a null, and minor cosmetics.)
A taper deformer isn’t high-tech feeling and exciting, but it’s useful in everyday practice, and more to the point this is a structure that can be used for many useful kinds of deformations. For instance, once I had the taper structure it was pretty simple to replace the internal “taper” formula with one to do a twist:
I’ll share out the twist version eventually, in the meantime here’s the full taper compound (if you look inside you’ll see what I was getting at by the arbitrary axis adding a lot of seeming complexity, but it’s really not complex, ICE just tends to look that way when there are a lot of different things all connected.)
File (softimage 2013, 379kb): example_TaperDeform2
Been playing with Vray. I like it. This is an “out of box” render of some strands, no effort on my part to properly light it, which really is a requirement for fine strands/hair etc. Still, not bad, they have a nice hair shader. I’m less interested in character hair than in fine detail fibers as VFX elements, so I’ll have to see what other looks I can coax out.
This amount of strands doesn’t even come close to taxing Softimage, it’s still interactive on my box…but rendering it at 2k took about 20 minutes, without any optimization. I’d guess that with some effort adjusting some settings I could get a better look at about 2x the speed, which isn’t bad, considering this is a GI render.
It’s a bit splotchy and the exposure is meh – chalk that up to me being a Vray noob. Looks like I was a bit too aggressive with the jpeg compression, too… The full render is much cleaner, and of course this is just a beauty pass, no passes or color correction. A decent lighter no doubt could take this to another level. Hey, I’m a VFX guy I hardly ever get to render stuff.
I’d like to get a feel for how much impact more strands will have on render time. I may have to try a “stress test” over the weekend to see what the reasonable limit for a single machine is in terms of numbers of strands I can get into a 2k half float render while still maintaining this look as a minimum quality…
There is an awesome thread on the softimage list where the small pipeline enhancements softimage users tend to accumulate in their personal collections are being discussed. In it I vowed to share mine to the community as a whole over time on this blog. So here’s the first one… a little python script I keep in a custom menu, which writes a log (as an anotation in the explorer) of distances between objects.
File (<1kb): LogDistances.py
# Log Distances between 2 objects
# 2011 A Moorer
xsi = Application
xsiRoot = xsi.ActiveSceneRoot
lm = xsi.LogMessage
root = xsi.ActiveSceneRoot
sel = xsi.Selection
if sel.Count <= 1:
lm(“Select two objects.”,4)
if sel.Count >= 3:
lm(“More than two objects selected.”,4)
#Distance Between Centers
def ctr_dist( objA, objB ):
from math import sqrt,pow
# Thx to Alan F for this function
Ax, Ay, Az = objA.Kinematics.Global.Transform.GetTranslationValues2()
Bx, By, Bz = objB.Kinematics.Global.Transform.GetTranslationValues2()
return sqrt( pow(Ax-Bx,2) + pow(Ay-By,2) + pow(Az-Bz,2) )
def annotate( nDist ):
prevText = xsi.getValue(str(root.Properties["MeasuredDistances"])+”.text”)
lm(“Logging new distance measurement…\n”,32)
xsi.SetValue(str(root.Properties["MeasuredDistances"])+”.text”, str(prevText)+nDist, “”)
oSet = root.AddProperty(“Annotation”,0,”MeasuredDistances”)
xsi.SetValue(str(oSet)+”.text”, “Distance Measurement Log\r”+”\r ————————————-\n\r” + nDist, “”)
fromObj, toObj = xsi.Selection(0), xsi.Selection(1)
newDist = “\r\nDistance between <”+fromObj.FullName+”> to <”+toObj.FullName+”> is: ” +str( ctr_dist(fromObj, toObj))
lm (“\n——-\nDistance Script Error.”,4)
#Call the function -
There you go… I hope it proves helpful to some of you. :)
I considered sharing my personal workgroup in it’s entirety, but there’s a lot of trash in there I wouldn’t want to burden people with, plus a considerable amount of stuff which Isn’t mine to share. So until I make a “clean” workgroup I’ll just have to post bits and pieces…
I am a big fan of Polynoid. Ever since their first images of cybernetic snails came out I’ve been hooked on their often-dark blend of art-meets-tech imagery.
Fabian Pross of Polynoid was, for a while, maintaining a very cool blog (come on Fabian, post new stuff!) One post in particular puts into words a critical concept I and many others often try to get across to newer artists – the importance of avoiding simulation where possible.
Simulations usually don’t quite achieve what you want them to, visually. The trap people fall into is to try to force a behavior out of a simulation. You end up making endless iterations while the setup you’re using grows more and more bloated and slow. A single directoral change becomes a nightmare. You lose control and the limitations of your setup starts to dictate the look.
The solution is to create what I think of as “deterministic” solutions – setups which change over time, but in very strict ways you specify. That’s one of the things I was trying to get at with the “post simulation” tutorials, the benefit of offloading much of the look outside of what is simulated.
Even skilled vfx artists fall into this trap with some regularity. I can’t say how many times I’ve seen production scenes which have grown bloated to the point of containing hundreds of forces and collision objects just to try to achieve a simple effect. You can’t afford it. A simple directoral change blows the whole thing apart. Stop. Take a deep breath. Don’t go over that cliff. Simulate judiciously, in small doses, only where you have to.
Simple simulation + deterministic stuff for a complex look = control.
And control is what makes a VFX artist, in my mind. Anyone can pull levers until they get a nice result out of fumeFX. But to achieve brilliant results which are new or spot-on to what is needed in prodution, you have to have control – be it in fumeFX, ICE, Realflow, Houdini or whatever. And one of the best ways to achieve control is to only simulate where you have to, and keep it simple when you do.
Fabian puts this idea into words better in this post. Even if the techniques he uses here are specific to ICE, the underlying message and workflow is the same everywhere – avoid simulation to gain control and speed.
Even when you use simulation, who says that you have to stop there? Bake it and use it as an element you shape further or build on. This concept is really powerful. A good example of this idea in practice is demonstrated by a little DCC-agnostic tool called Sparta. Simulate, then shape the results.
In the “postSim” tutorial we made shapes out of strands by constructing arrays of point positions. Many ICE users, myself included, forget that there are a bunch of shapes provided already which can be used in this fashion. They are in the “Debugging” section, because arrays like these can also be used with ICE attribute display properties to create onscreen widgets (hint: …or to add points to a pointCloud…)
I’ve found the factory nodes to be quite handy for a number of things, but I wanted some other shapes of my own (such as a star and spiral) - so I made them, as well as made some adjustments to what was already available (with some digging) to suit my personal preferences. Here is a scene with a number of them, each packaged as a compound.
And here’s the file (softimage 2013 322kb): ICE Debug Elements
While experimenting around with these elements as display objects, I made a “protractor” compound.
It’s of limited production use because of a current problem with how softimage displays these elements in a shaded or hidden line view, and because it wasn’t particularly designed as a tool… it just evolved while I messed around. But it serves as an example of how you can use the “Debug” nodes to create visual feedback (another good example of these debug elements is the factory “bend” deformer in ICE.)
Judicious use of these display attributes can make a packaged compound much more useful, as well as act as a handy jumping off point to make interesting shapes with strands etc. Enjoy! – AM
File (softimage 2013 270kb): example_ICE_protractor
The spiral compound plus the postsim tutorial makes a nice basis for a “cloud chamber” like wallpaper… :)
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.)