minShaders

min­Shaders is a col­lec­tion of shaders I devel­oped to facil­i­tate my work as a shad­ing and light­ing artist. Some of these shaders reach as far back as 2003 but remain use­ful even today.

The shaders range from sim­ple util­ity nodes to one-​​off tools for unique prob­lems and con­ve­nient helpers in every­day pro­duc­tion sit­u­a­tions. My more com­plex all-​​round solu­tions for toon shad­ing, ran­dom­iza­tion and phys­i­cally cor­rect shad­ing have been divided into sep­a­rate col­lec­tions for clarity.

Please note that unless there is an obvi­ous down­load link, the shaders are not pub­licly available.


The min­Shaders library cur­rently con­sists of the fol­low­ing shaders:

  1. minLenspass

    This lens shader offers an extremely simply way of rendering passes including normal pass, UV pass, Object ID pass and Material ID pass.

  2. minLight

    This flexible light shader lets you control light color and falloff via gradient ramp controls.

  3. 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.

  4. minMatcap — Free Download!

    This material shader mimics the look of ZBrush’s Matcap material.

  5. 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.

  6. minBevel

    Low poly objects can be given a richer appearance through minBevel's fake corners and bevels.

  7. 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.

  8. 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.

  9. minWetness

    This versatile shader can create wet areas on absorptive materials or add small refractive droplets of water.

  10. minFileTexture

    minFileTexture is a replacement for Maya's file texture node that offers basic color and gamma correction.

  11. 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.

  12. PainterMan

    This set of shaders renders arbitrary geometry in various non-photorealistic styles.

minLenspass

This lens shader offers an extremely sim­ply way of ren­der­ing passes includ­ing nor­mals, UVs, Object ID and Mate­r­ial ID pass.

minLenspassminLenspassminLenspassminLenspassminLenspass

Some­times you just want to ren­der out a spe­cific pass with­out re-​​rendering the entire scene or fid­dling with a com­pli­cated shad­ing net­work.
min­LensPass ren­ders out lots of extra infor­ma­tion about your scene that may be use­ful for com­posit­ing pur­poses, includ­ing nor­mals, UVs, Object ID, Mate­r­ial ID, depth, posi­tion, CPU time and alpha.
Many of these passes are par­tic­u­larly use­ful when used in com­bi­na­tion with my After Effects plug-​​in Nor­mal­ity. Or, in the case of visu­al­iz­ing CPU time, they can help you opti­mize your scene.

Usage

min­LensPass is sim­ply applied to your camera’s lens slot. Select your pass and hit ren­der! The shader requires no fur­ther setup — it just works.

minLight

This flex­i­ble light shader allows the user to con­trol a light’s color and falloff via gra­di­ent con­trols.
Unlike real­is­tic light shaders, min­Light is designed to give the user full con­trol over the color and falloff of a light source by pro­vid­ing ramp con­trols.

minLightminLightminLightminLight

A color gra­di­ent con­trols the light’s falloff, so you could have a light that is white near the source and fades to blue as the dis­tance increases. This can be very use­ful when design­ing a spe­cific look for a scene, even though it is not nec­es­sar­ily a pho­to­re­al­is­tic effect.

min­Light also allows you to con­trol the shadow color with a ramp that works inde­pen­dently of the light’s color ramp.

Usage

Sim­ply plug min­Light into your shader’s light slot, choose a pleas­ing com­bi­na­tion of col­ors and hit render!

minObjectID

My lat­est shader assigns each object in a scene a dis­tinct, ran­domly selected color, the so called Object ID. I have decided to offer this shader as a free down­load to the men­tal ray com­mu­nity.

minObjectIDminObjectID

An Object ID pass isn’t exactly pretty, but it is incred­i­bly use­ful because a com­posit­ing artist can apply effects or cor­rec­tions to indi­vid­ual objects or spe­cific areas with­out the need to ren­der sep­a­rate masks or even paint masks by hand.
My approach to this shader is some­what naïve in that it ran­domly assigns a color to each object with­out regard for adja­cent object’s col­ors or pos­si­ble rep­e­ti­tions. How­ever, the chances of the same color being picked twice by the algo­rithm are so small as to be neg­li­gi­ble for all intents and purposes.

Down­load

Down­load
minOb­jec­tID is a free shader for men­tal ray (Win­dows x86/​x64 and Mac OS X)

Usage

Once minOb­jec­tID is assigned to your objects just hit ren­der and you’ll have a ran­dom color on each and every object — no need to man­u­ally spec­ify object– or label IDs.

Note that this shader’s out­put is not com­pat­i­ble with Nuke’s or Fusion’s Objec­tID for­mat as it does not save to an inte­ger buffer in OpenEXR files.

minMatcap

This sim­ple mate­r­ial shader mim­ics the look of ZBrush’s Mat­cap mate­r­ial. It derives shad­ing and color entirely from a bitmap tex­ture of a spher­i­cal shader ball — these may also be referred to as “lit spheres”. As such this shader does not react to any lights in the scene.

minMatcapminMatcapminMatcapminMatcapminMatcap

Ver­sion 2 also sup­ports bump map­ping and allows the user to choose between camera-​​oriented shad­ing and fixed world– or object-​​space shad­ing.  It is also pos­si­ble to off­set the tex­tur­ing and con­trol  the shad­ing of back­sided faces.
You can even use min­Mat­cap as a light shader, which may be use­ful to add a lit­tle ambiance into a scene.

Down­load

Down­load
min­Mat­cap is a free shader for men­tal ray (Win­dows x86/​x64 and Mac OS X)

Usage

The scene’s lights do not affect this shader as it relies solely on the spec­i­fied shader ball. It is best suited to present mod­els with­out the need to cre­ate an intri­cate light­ing setup.
Depend­ing on the shader ball tex­ture min­Mat­cap may be used to sim­u­late reflec­tion map­ping, sub­sur­face scat­ter­ing and var­i­ous other high-​​end effects.

minGrime

The min­Grime shader is an exten­sion of the min­RAO shader and fea­tures addi­tional meth­ods to eas­ily add grime, dirt, stains and other weath­er­ing effects to 3D mod­els.

minGrime

min­Grime works by sam­pling the sur­face of your object in a spe­cific direc­tion, look­ing for holes and ledges and by detect­ing a surface’s cur­va­ture to mark areas of increased wear by usage and aging.

Usage

With min­Grime a shader artist can use any 2D/​3D noise func­tion or bitmap tex­ture to add dirt, mold or other aging effects for exam­ple to the areas under­neath of bal­conies, win­dows and vents on build­ings, which nat­u­rally attract dirt.
Or one could cre­ate a thick layer of dust on a pile of old objects and let the shader make sure to empha­size areas that nat­u­rally gather the most dust.

While the same effect could be achieved using tex­tures alone, min­Grime does not require prop­erly laid out UV maps and can be applied over entire mod­els or even scenes at once.

minBevel

min­Bevel is sim­i­lar in con­cept and func­tion­al­ity to men­tal ray’s mia_​roundcorners shader but takes the idea one step fur­ther. With min­Bevel an artist can choose from sev­eral dif­fer­ent types of bevel to auto­mat­i­cally apply to hard cor­ners and edges at render-​​time.

minBevelminBevelminBevelminBevelminBevel

Usage

Low poly objects can be given a higher qual­ity appear­ance through these fake bevels.

Per­haps even more use­ful is the abil­ity to apply a sec­ondary bump map that affects only beveled areas, thereby for exam­ple cre­at­ing chis­eled or rough worn edges and cor­ners with­out the need for high-​​poly mod­el­ing or texturing.

minRAO (Reverse Ambient Occlusion)

Reverse ambi­ent occlu­sion is a novel tech­nique that can be used to improve tex­ture paint­ing or to mask spe­cific areas in a lay­ered shader.

minRAOminRAO

This shader works like an ambi­ent occlu­sion shader but offers the option to sam­ple the inte­rior of objects as well as the outside.

Usage

min­RAO may be used to gen­er­ate areas of wear, dust and dirt for exam­ple to help cre­ate wear and dirt around edges and cor­ners. It works well as an alpha mask with baked tex­tures or in com­bi­na­tion with the min­Layer shader.

minRelief

As the name sug­gests, min­Re­lief is an imple­men­ta­tion of relief map­ping for men­tal ray and Ren­der­Man. This shader sim­u­lates the effects of dis­place­ment map­ping with­out actu­ally affect­ing the model.

minReliefminRelief

In our tests the shad­ing model was about 2-​​3x faster than ren­der­ing true dis­place­ments in high qual­ity set­tings with very lit­tle visual dis­par­ity. More­over, there’s no need to apply sur­face approx­i­ma­tion nodes to your mod­els for this shader to do its work.

Usage

We use min­Re­lief in sit­u­a­tions where dis­place­ment map­ping is overkill but sim­ple bump or nor­mal map­ping doesn’t pro­vide enough depth.

minWetness

min­Wet­ness deals with the sim­u­la­tion of wet mate­ri­als. This ver­sa­tile shader can cre­ate wet areas on absorp­tive mate­ri­als or add small refrac­tive droplets of water.

minWetnessminWetness

Usage

Use min­Wet­ness to auto­mat­i­cally cre­ate spills, pud­dles, droplets, or wet areas on a model. The base mate­r­ial auto­mat­i­cally dark­ens in wet areas depend­ing on its absorp­tive strength. The shader allows full con­trol of the liq­uid mate­r­ial includ­ing reflec­tions, refrac­tions and sur­face thickness.

This shader is ideal to sim­u­late wet areas on any sur­face. Real­is­tic pud­dles on a street, water droplets from con­den­sa­tion, spills of blood…

minFileTexture

Unlike Maya’s file tex­ture node, min­File­Tex­ture offers basic color and gamma cor­rec­tion. These can be used to sim­plify lin­ear work­flows and to quickly adjust textures.

Usage

Use min­File­Tex­ture as a replace­ment for Maya’s reg­u­lar file tex­ture node.

This shader is designed for men­tal ray for Maya on Win­dows (x86, x64), Mac OS X and Linux (x86, x64).

minLayers

This opti­mized layer shader allows up to 8 lay­ers of shaders and tex­tures to be stacked in order to cre­ate a vari­ety of effects using the 20 avail­able blend modes.
In addi­tion, min­Lay­ers accepts a bump map which is applied to all layers.

The shader auto­mat­i­cally opti­mizes itself for max­i­mum per­for­mance by only cal­cu­lat­ing sam­ples from lay­ers that will actu­ally con­tribute to the final shad­ing: Shad­ing from obscured lay­ers or lay­ers with an area of 0 alpha will not be eval­u­ated, result­ing in poten­tially immensely decreased render-​​times.

Usage

Stun­ning effects can be achieved by com­bin­ing var­i­ous stock shaders using min­Lay­ers.
By adding a reflec­tive layer one can cre­ate the look of a wet mate­r­ial. Cre­ate wear on old objects by adding a layer of grime and mod­u­late the alpha chan­nel. Com­bine sev­eral tex­tures of grass and dirt to cre­ate huge ground planes with­out appar­ent tiling effects.

PainterMan

This set of ver­sa­tile sur­face shaders ren­ders arbi­trary geom­e­try in var­i­ous non-​​photorealistic styles.

Usage

As the name sug­gests, Painter­Man is intended to sim­u­late painterly ren­der­ing effects, such as tra­di­tional oils, water­col­ors or Japan­ese ink brushes.

A stripped down ver­sion of Painter­Man is inte­grated into my After Effects plug-​​in Normality.