May 2 2009
Shaders for mental ray and RenderMan
minShaders is a collection of shaders I developed to facilitate my work as a shading and lighting artist. Some of these shaders reach as far back as 2003 but remain useful even today.
The shaders range from simple utility nodes to one-off tools for unique problems and convenient helpers in everyday production situations. My more complex all-round solutions for toon shading, randomization and physically correct shading have been divided into separate collections for clarity.
Please note that unless there is an obvious download link, the shaders are not publicly available.
The minShaders library currently consists of the following shaders:
minLenspass
This lens shader offers an extremely simply way of rendering passes including normal pass, UV pass, Object ID pass and Material ID pass.
minLight
This flexible light shader lets you control light color and falloff via gradient ramp controls.
minObjectID — Free Download!
This shader assigns each object in a scene a distinct, randomly selected color in order to be processed as an Object ID pass in a compositing application.
minMatcap — Free Download!
This material shader mimics the look of ZBrush’s Matcap material.
minGrime
The minGrime shader is an extension of the minRAO shader and features additional methods to add grime, dirt, stains and other weathering effects to 3D models.
minBevel
Low poly objects can be given a richer appearance through minBevel's fake corners and bevels.
minRAO (Reverse Ambient Occlusion)
This shader works like an ambient occlusion shader but offers the possibility to sample the interior of objects as well as the outside.
minRelief
minRelief is a fast implementation of relief mapping for mental ray. This shader simulates the effects of displacement mapping without actually affecting the model.
minWetness
This versatile shader can create wet areas on absorptive materials or add small refractive droplets of water.
minFileTexture
minFileTexture is a replacement for Maya's file texture node that offers basic color and gamma correction.
minLayers
This optimized layer shader allows up to 8 layers of shaders and textures to be stacked in order to create a variety of effects using the 20 available blend modes.
PainterMan
This set of shaders renders arbitrary geometry in various non-photorealistic styles.
July 18 2009
minLenspass
This lens shader offers an extremely simply way of rendering passes including normals, UVs, Object ID and Material ID pass.
Sometimes you just want to render out a specific pass without re-rendering the entire scene or fiddling with a complicated shading network.
minLensPass renders out lots of extra information about your scene that may be useful for compositing purposes, including normals, UVs, Object ID, Material ID, depth, position, CPU time and alpha.
Many of these passes are particularly useful when used in combination with my After Effects plug-in Normality. Or, in the case of visualizing CPU time, they can help you optimize your scene.
Usage
minLensPass is simply applied to your camera’s lens slot. Select your pass and hit render! The shader requires no further setup — it just works.
July 12 2009
minLight
This flexible light shader allows the user to control a light’s color and falloff via gradient controls.
Unlike realistic light shaders, minLight is designed to give the user full control over the color and falloff of a light source by providing ramp controls.
A color gradient controls the light’s falloff, so you could have a light that is white near the source and fades to blue as the distance increases. This can be very useful when designing a specific look for a scene, even though it is not necessarily a photorealistic effect.
minLight also allows you to control the shadow color with a ramp that works independently of the light’s color ramp.
Usage
Simply plug minLight into your shader’s light slot, choose a pleasing combination of colors and hit render!
June 19 2009
minObjectID
My latest shader assigns each object in a scene a distinct, randomly selected color, the so called Object ID. I have decided to offer this shader as a free download to the mental ray community.
An Object ID pass isn’t exactly pretty, but it is incredibly useful because a compositing artist can apply effects or corrections to individual objects or specific areas without the need to render separate masks or even paint masks by hand.
My approach to this shader is somewhat naïve in that it randomly assigns a color to each object without regard for adjacent object’s colors or possible repetitions. However, the chances of the same color being picked twice by the algorithm are so small as to be negligible for all intents and purposes.
Download
Download
minObjectID is a free shader for mental ray (Windows x86/x64 and Mac OS X)
Usage
Once minObjectID is assigned to your objects just hit render and you’ll have a random color on each and every object — no need to manually specify object– or label IDs.
Note that this shader’s output is not compatible with Nuke’s or Fusion’s ObjectID format as it does not save to an integer buffer in OpenEXR files.
April 20 2009
minMatcap
This simple material shader mimics the look of ZBrush’s Matcap material. It derives shading and color entirely from a bitmap texture of a spherical shader ball — these may also be referred to as “lit spheres”. As such this shader does not react to any lights in the scene.
Version 2 also supports bump mapping and allows the user to choose between camera-oriented shading and fixed world– or object-space shading. It is also possible to offset the texturing and control the shading of backsided faces.
You can even use minMatcap as a light shader, which may be useful to add a little ambiance into a scene.
Download
Download
minMatcap is a free shader for mental ray (Windows x86/x64 and Mac OS X)
Usage
The scene’s lights do not affect this shader as it relies solely on the specified shader ball. It is best suited to present models without the need to create an intricate lighting setup.
Depending on the shader ball texture minMatcap may be used to simulate reflection mapping, subsurface scattering and various other high-end effects.
April 14 2009
minGrime
The minGrime shader is an extension of the minRAO shader and features additional methods to easily add grime, dirt, stains and other weathering effects to 3D models.
minGrime works by sampling the surface of your object in a specific direction, looking for holes and ledges and by detecting a surface’s curvature to mark areas of increased wear by usage and aging.
Usage
With minGrime a shader artist can use any 2D/3D noise function or bitmap texture to add dirt, mold or other aging effects for example to the areas underneath of balconies, windows and vents on buildings, which naturally attract dirt.
Or one could create a thick layer of dust on a pile of old objects and let the shader make sure to emphasize areas that naturally gather the most dust.
While the same effect could be achieved using textures alone, minGrime does not require properly laid out UV maps and can be applied over entire models or even scenes at once.
April 12 2009
minBevel
minBevel is similar in concept and functionality to mental ray’s mia_roundcorners shader but takes the idea one step further. With minBevel an artist can choose from several different types of bevel to automatically apply to hard corners and edges at render-time.
Usage
Low poly objects can be given a higher quality appearance through these fake bevels.
Perhaps even more useful is the ability to apply a secondary bump map that affects only beveled areas, thereby for example creating chiseled or rough worn edges and corners without the need for high-poly modeling or texturing.
April 2 2009
minRAO (Reverse Ambient Occlusion)
Reverse ambient occlusion is a novel technique that can be used to improve texture painting or to mask specific areas in a layered shader.
This shader works like an ambient occlusion shader but offers the option to sample the interior of objects as well as the outside.
Usage
minRAO may be used to generate areas of wear, dust and dirt for example to help create wear and dirt around edges and corners. It works well as an alpha mask with baked textures or in combination with the minLayer shader.
April 1 2009
minRelief
As the name suggests, minRelief is an implementation of relief mapping for mental ray and RenderMan. This shader simulates the effects of displacement mapping without actually affecting the model.
In our tests the shading model was about 2-3x faster than rendering true displacements in high quality settings with very little visual disparity. Moreover, there’s no need to apply surface approximation nodes to your models for this shader to do its work.
Usage
We use minRelief in situations where displacement mapping is overkill but simple bump or normal mapping doesn’t provide enough depth.
March 25 2009
minWetness
minWetness deals with the simulation of wet materials. This versatile shader can create wet areas on absorptive materials or add small refractive droplets of water.
Usage
Use minWetness to automatically create spills, puddles, droplets, or wet areas on a model. The base material automatically darkens in wet areas depending on its absorptive strength. The shader allows full control of the liquid material including reflections, refractions and surface thickness.
This shader is ideal to simulate wet areas on any surface. Realistic puddles on a street, water droplets from condensation, spills of blood…
March 23 2009
minFileTexture
Unlike Maya’s file texture node, minFileTexture offers basic color and gamma correction. These can be used to simplify linear workflows and to quickly adjust textures.
Usage
Use minFileTexture as a replacement for Maya’s regular file texture node.
This shader is designed for mental ray for Maya on Windows (x86, x64), Mac OS X and Linux (x86, x64).
March 2 2009
minLayers
This optimized layer shader allows up to 8 layers of shaders and textures to be stacked in order to create a variety of effects using the 20 available blend modes.
In addition, minLayers accepts a bump map which is applied to all layers.
The shader automatically optimizes itself for maximum performance by only calculating samples from layers that will actually contribute to the final shading: Shading from obscured layers or layers with an area of 0 alpha will not be evaluated, resulting in potentially immensely decreased render-times.
Usage
Stunning effects can be achieved by combining various stock shaders using minLayers.
By adding a reflective layer one can create the look of a wet material. Create wear on old objects by adding a layer of grime and modulate the alpha channel. Combine several textures of grass and dirt to create huge ground planes without apparent tiling effects.
April 18 2004
PainterMan
This set of versatile surface shaders renders arbitrary geometry in various non-photorealistic styles.
Usage
As the name suggests, PainterMan is intended to simulate painterly rendering effects, such as traditional oils, watercolors or Japanese ink brushes.
A stripped down version of PainterMan is integrated into my After Effects plug-in Normality.