SLI Zone
NVIDIA.com Developer Home
Last Update: 7/1/2008

NVIDIA Shader Library

With a wide range of shaders including skin, natural effects, metals, post processing effects, and much more, the NVIDIA Shader Library exists to help developers easily find and integrate great shaders into their projects.

All the shaders in this library are provided free of charge for use in derivative works, whether academic, commercial, or personal (Full License).

If you would like to submit a shader, please read our Shader Submission Guidelines.

Select the category to view:

shadow PCSS For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post complements For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

scene deferred For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material shadow DirectX10 textured

image processing color conversion illustration DirectX10 textured

material image processing rendering DirectX10 textured




Perceptually-correct soft shadows. For more information, please see the "Percentage-Closer Soft Shadows" talk from GDC 2005. The talk is available at heres (1 technique/s)

Color space conversion -- takes the existing scene, and polarizes the colors along the color wheel -- colors that are close to the "Guide Color" become more like the guide, while colors closer to its complementary color in that direction. Parameters allow control of how tightly colors "bunch up" and permits the user to turn the effect so that desaturated colors are less affected. In the sample image, an orange tone was chosen -- skin tones are reddish and those have migrated towards the orange guide, while colors near blue (complement of orange) have become bluer. (1 technique/s)

A simple defered-rendering example -- an initial pass renders color, surface normals, and view vectors into multiple render targets (textures). A second pass combines the data in these textures with lighting info to create a final shaded image. (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


post objsAsDisplacements For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

ddGodRays For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post bloom For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

image processing DirectX10 textured

material image processing derivatives texture DirectX10 textured

image processing glow textured




This postprocess uses the values rendered by the previous part of the scene, and re-interprets their values as a 2D displacement map, which it applies to another image. The standard way to use this would be to have all objects export their normals. (1 technique/s)

A "godrays" effect done as a single pass. Make sure the input texture has alpha! It works best on a simple planar card, but go ahead and experiment with all sorts of geometry. The size of the glow is kept constant in screen space by adjustng the rays according to the partial derivates of UV in screenspace x and y -- that is, using ddx(UV) and ddy(UV) (1 technique/s)

Glow/bloom post processing effect -- for "bloom," only the brightest areas are affected. (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


post godrays For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post glowtrail For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post RGB from HSV For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

image processing DirectX10 textured

image processing glow peristence textured

image processing color conversion DirectX10 textured




Based on a radal blur effect, then with the origin image re-composited. (1 technique/s)

Persistence of blurry vision -- this effect uses "ping pong" render targets so that its state persists from frame to frame. Uses FP16 buffers (1 technique/s)

Color space conversion - now with optional color cycling (2 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


relief mapping For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

Toksvig NormalMaps For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post glowBalloon For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material bumpmap DirectX10 textured

DirectX10 textured

material





This material shows and compares results from four popular and advanced schemes for emulating displaement mapping. They are: Relief Mapping, Parallax Mapping, Normal Mapping, and Relief Mapping with Shadows. Original File by Fabio Policarpo. (4 technique/s)

"Toksvig-factor" anti-aliased bump mapping -- eliminate "buzzy" hilights along bump edges. Note use of 16-bit textures (g16r16) for precision with performance A description of the technique can be found at heres (2 technique/s)

Create a transparent "envelope" around any existing model. While implemented as a "post process" effect, this effect is just a second pass on the geometry -- no render-to-texture is needed. Great cheap effect for glows (or deep-sea egg pods) (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


balloon For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post deepMask For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

scene deferred no mrt For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material classic DirectX10

image processing textured

material image processing rendering textured




Amazing inflating teapots! A plastic "balloon" surface (lit from either a point or directional source). Twiddle the "inflate" parameter to change the shape. (1 technique/s)

Application of "Image Enhancement by Unsharp Masking the Depth Buffer" from Siggraph 2006. This version applies the depth enhancement to an existing scene. The scene can be rendered very simply -- in fact it looks great on "flat" render effects like "FlatTexture" but can work with any sort of rendering. The user should choose Near and Far depth values to cover the ranges of depth found in the scene. See the original paper at heres (1 technique/s)

A simple defered-rendering example. Some channels are currently un-used, while the "ViewSampler" could be considered redundant (you COULD calculate it on the fly, if texture-bandwidth limited) (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


pulse23 For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

scene uvds skin For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

shadowSpot For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

pattern material animation DirectX10

textured


DirectX10 textured




Blast from the past (Cg 1 Maya sample shader). Analytic anti-aliasing against an arbitrary function -- in this case pulsing 3D sine waves. (1 technique/s)

A simplified UV-space-diffusion effect for use on character skin. See the chapter in GPU Gems 3 for the full nine yards! This shader further-extends the techniques from "scene_uvd_skin" and "scene_uv_diffusion" by adding shadows. The light and shadow here are unwrapped into a UV-space texture, diffused in surface coordinates and re-applied to the geometry in 3D, mixed with yet more 3D lighting to give both the crisp "immediacy" of the skin surface along with the soft, subsurface-diffused tones of skin's natural translucence. This effect is easy to apply to existing models without requiring any new art assets. (1 technique/s)

Simple shadow map example using HW shadow textures and render ports. Plastic-style shading with quadratic light falloff. Both shadowed full-scene shadow and unshadowed materials provided. (2 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


paint brush For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

ribbonDistort For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

scene uv diffusion For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

image processing paint textured

material animation image processing DirectX10 textured

material image processing textured




An .FX Paint Program. Scene geometry is ignored. Draw with the left mouse button. To clear screen, just make the brush big and paint everything. Resizing the window will mess up your drawing. Brush strokes will change in size and opacity over time, set "FadeTime" to a high value for more even (though less expressive) strokes. (1 technique/s)

This shader assumes the input model is a multi-segment unit square in XY with center at the origin. It distorts this unit square into a disk-like "ring" for use in sword battles etc. (1 technique/s)

UV-space lighting diffusion, as pioneered by George Borshukov in the "Matrix" films. We also use a specal "TexBlender" value, as used in the NVIDIA "Human Head" demo, to control the mix of surface detail in tandem with textured subsurface scattering. Be sure that your object UV coordinates fit within the range 0-1 and have no repeats or overlaps. (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


reflections For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post color clipping For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post kuwahara For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material environment classic DirectX10 textured

image processing textured

image processing color conversion DirectX10 textured




Phong-shaded, metal- and plastic-style surfaces with a mirror term. Plastic or dielectic surfaces have varying reflectivity according to the angle at which a surface is viewed -- this variation is often called "fresnel" reflectance. (2 technique/s)

Clip low and high colors so that the resulting image is within a narrower range, e.g. for TV signals. Two Techniques are provided -- one clips the colors that go outside the specified range between Min and Max, while the other stretches or compresses the total color space to conform to the indicated range. (2 technique/s)

Kuwahara edge enhancement is a staple of image processing. (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


plastic For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

metal For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

lambert For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material classic DirectX10 textured

material classic DirectX10 textured

material classic dirpos DirectX10 textured




A phong-shaded plastic-style surface lit from either a point or directional source. Textured, untextured, quadratic falloff or not (4 technique/s)

A phong-shaded metallic surface lit from either a point or directional source. Textured, untextured, quadratic falloff or not (4 technique/s)

This surface is DULL. A matte, lambert surface lit from either a point or directional source (You can attach either a point light OR a directional source to it). Four techniques are provided: permutations of textured/untextured and quadratic-falloff/constant lighting (4 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


plasticD For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

metalD For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

metalP For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material classic DirectX10 textured

material classic DirectX10 textured

material classic DirectX10 textured




A phong-shaded plastic-style surface lit from a directional source. Textured & untextured versions. (2 technique/s)

A phong-shaded metallic surface lit from a directional source. Textured & untextured versions. (2 technique/s)

A phong-shaded metallic surface lit from a point source. Textured, untextured, quadratic falloff or not (4 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


plasticP For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

DebugSpaces For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

DebugTexCoords For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

material classic DirectX10 textured

material debug virtual machine DirectX10 textured

DirectX10 textured




A phong-shaded plastic-style surface lit from a point source. Textured, untextured, quadratic falloff or not (4 technique/s)

This .fx file uses 3d checker patterns to illustrate a number of important coordinate systems and shading vectors. #define USER_COLORS if you want to use parameters instead of the fixed macro colors. (8 technique/s)

View Object's TEXCOORD Registers (16 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


DebugValues For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

EdgeFuzz For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

BrdfFromTextures For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 4

GeForce 6

GeForce 6

material debug virtual machine bumpmap textured

material organic DirectX10

material brdf texture DirectX10 textured




This effect file uses colors to illustrate a number of shading vectors -- that is, values that are typically important in shading. This effect can often help find bogus parts of models, or be used to explore the contents of a model. (15 technique/s)

Simple edge lighting effect -- the color of the surface shifts when viewed on-edge. Optionally, the light color can also be effected -- the result of both is to create an illusion of the surface being covered by some sort of smooth barely-visible fuzz. (1 technique/s)

Shading via multitexture. Two textures are interpolated over the surface, and their product results in the final specular BDRF. The initial textures supplied approximate a Cook-Torrance model using one set of possible parameters, but different textures can be used to emulate a wide variety of isotropic BRDF models. Try painting some of your own! (2 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


post scratched film For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

pre texture For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post radialBlur For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

image processing animation virtual machine DirectX10 textured

image processing textured

image processing DirectX10 textured




Create a scratched-movie-film look using animated noise (1 technique/s)

Put a simple image texture behind the current scene (1 technique/s)

Radial blur effect. This version allows you to specifiy an arbitrary number of samples. (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper

Video

Download

Whitepaper

Video

Download

Whitepaper

Video

Download


post RGB from CMY For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post RGB to YUV For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

   

post RGB to CMYK For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

GeForce 6

GeForce 6

GeForce 6

image processing color conversion DirectX10 textured

image processing color conversion DirectX10 textured

image processing color conversion DirectX10 textured




Color space conversion (1 technique/s)

Color space conversion (1 technique/s)

Color space conversion (1 technique/s)




HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

HLSL

CgFX

COLLADA

Whitepaper