SLI Zone
NVIDIA.com Developer Home

SDK 9.52 Effects

In each release of our SDK you will find hundreds of code samples, effects, whitepapers, and more to help you take advantage of the latest technology from NVIDIA. Check out our SDK Home Page to download the complete SDK, or browse through individual code samples below. You can also click on the video links for a quick preview, or the thumbnail images for a gallery of larger images.

This code is released free of charge for use in derivative works, whether academic, commercial, or personal. (Full License)

Select the category to view:
You will need FX Composer to load these effects projects and view the shader source code.

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

This technique generates soft shadows with penumbrae that harden on contact, giving useful and realistic visual cues. Based on shadow mapping and percentage-closer filtering, percentage-closer soft shadows (PCSS) generate high-quality soft shadows with just a single shadow map, without any pre-processing, post-processing, or other modification to the host application. The only required change is to replace the typical shadow mapping pixel shader with a PCSS shader. This effect requires FX Composer 1.8 or higher.
  Minimum Required GPU

Shadow




Whitepaper
Video
Download


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

gooch_shadow Project
  Minimum Required GPU






Whitepaper

Download


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

dilation Project
  Minimum Required GPU








Download


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

softStencilShadow Project
  Minimum Required GPU






Whitepaper

Download


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

stencilShadow implements vertex-shader shadow-volume extrusion and shows how to set up simple stencil shadowing in FX Composer
  Minimum Required GPU






Whitepaper

Download


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

goochSlicer Project
  Minimum Required GPU








Download


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

psych_bg Project
  Minimum Required GPU








Download


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

bleach_bypass Project
  Minimum Required GPU








Download


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

cmykBloom Project
  Minimum Required GPU








Download


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

drainBamage Project
  Minimum Required GPU








Download


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

duskHolga Project
  Minimum Required GPU








Download


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

lineDraw Project
  Minimum Required GPU








Download


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

optical_distort1 Project
  Minimum Required GPU








Download


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

titleOverlay Project
  Minimum Required GPU








Download


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

point-light shadowing
  Minimum Required GPU

Shadow




Whitepaper

Download


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

paint_brdf lets an artist work directly on BRDF lookup tables using a brush -- and while seeing the live results of the newly-created BRDF on any model, while they design it. Use the pulldown on/off flags to determine which part of the BRDF to paint, and then watch the results on-screen and in the textures panel. Just save the textures as DDS files for final use.
  Minimum Required GPU

BRDF




Whitepaper

Download


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

Anaglyphic stereo view of a tree model -- use red/blue 3D glasses
  Minimum Required GPU

Image Postprocessing





Download


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

Side-scroll animation
  Minimum Required GPU

Image Postprocessing





Download


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

Any image (including your 3D scene), altered to appear as if it was badly printed in CMYK — out-of-register and twisted offset plates
  Minimum Required GPU

Image Postprocessing





Download


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

Shows uvDetective on a very simple model. Try it on any model of your own. UVDetective is a debugging/development shader that displays multiple useful facts about the UV coordinates on a model, and importantly shows the model's UV derivatives -- that is, how much stretching the UV's have in any part of the model. It also can display different exture MIP levels as varying colors. Finally and importantly, it has "TexRes" modes (techniques) that determine best texture resolutions based on a user-specified choice. For example, if the user specifies "256" then the display will show black where that resolution would be optimal, based on the current model and display size. Areas where a higher resolution could be used will be blue, while areas that could accept a lower resolution will be yellow
  Minimum Required GPU

Debug





Video
Download


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

A plastic-like shader with "flatness" — by scaling the surface normals relative to the eye position, the appearance of an object can be flattened, much like a low-relief carving in stone. Untextured, the flat gray appearance recalls "grisaille" drawing and sculptural detailing.
  Minimum Required GPU

BRDF






Download


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

metalReflShip shows the classic "bigship" model in a reflective environment
  Minimum Required GPU








Download


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

bumpGloss shows a typical bumpy glossy material
  Minimum Required GPU








Download


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

lambSkinDusk shows a cheap, fast way to emulate subsurface light scattering effects. The overall image is further enhanced by a sepia-tone pass
  Minimum Required GPU








Download


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

durerDusk shows a non-photo-real shading effect, designed to emulate a style of cross-hatched two-layer pen drawing
  Minimum Required GPU








Download


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

The "duskWood" FXComposer sample shows Dusk's head shaded by a classic "wood" procedure, then the image further processed by an animated "old TV" image shader
  Minimum Required GPU








Download


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

glassUFO shows a reflective and refractive model. the background is generated by shader that can look at cube maps in arbitrary directions
  Minimum Required GPU








Download


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

paint_brush provides simple soft-edged painting in FX Composer. Just draw with the mouse! FX Composer has only simple mouse handling, but using time dynamics and GPU-based texturing, many paint-program effects are easily implemented.
  Minimum Required GPU






Whitepaper

Download


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

paint_liquid is a tool similar to Photoshop's "liquify" command. Read any texture from disk, and then "paint" over it with the mouse — the underlying image can be freely distorted and warped in real time. This shader works best with GPUs that can support 16-bit floating point render targets, but will function on some older GPUs also — the distortion effect comes from painting an unseen extra texture, which is then used to perform a "dependant texture read" on the main input image.
  Minimum Required GPU

Image Postprocessing



Whitepaper
Video
Download


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

The "MrWiggleDot" FXComposer sample combines Vertex Animation and a "halftone" imaging shader
  Minimum Required GPU








Download


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

The "blendLayers' FXComposer sample shows typical material effects, plus imaging "blend modes" (much like those found in programs like Adobe Photoshop™), encapsulated as pixel shaders
  Minimum Required GPU








Download


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

glowTrailFP two simple models with image process sweetening. Be sure to hit the "play" button. These objects leave persistent but fading images behind as the scene moves. The uses persistent render-to-texture for animated effect. Each frame is rendered to a texture, blurred and saved from frame-to-frame. Each frame, the previous blur is faded slightly before being added to the new scene.
  Minimum Required GPU

Image Postprocessing



Whitepaper
Video
Download


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

vbombEdge shows a combination of vertex animation and high-performace image processing effects
  Minimum Required GPU








Download


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

fpShadow displays a simple object with a floating-point texture used for shadowing. The HLSL RenderPort functionality is used to assign appropriate transforms
  Minimum Required GPU






Whitepaper

Download


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

mandelbrotPS3 is a numerically-demanding example of pixel shader dynamic branching. Change the # of iterations at run time for varying precision effects
  Minimum Required GPU








Download


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

The "raytrace" FXComposer sample is a classic spheres-and-plannes raytracer, running entirely in real time in the pixel shader
  Minimum Required GPU








Download


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

tonemap shows high-dynamic-range imaging effects by permitting the user to control the exposure and look of a "deep pixel" image
  Minimum Required GPU

Image Postprocessing




Video
Download


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

spinFX shows accumulation-buffer motion blur. By default a SINGLE motion-blurred frame is drawn. Uncomment the USE_TIMER macro and recompile to enable animation.
Accumulation buffer effects are created by rendering the same object repeatedly, and accumulating the resultant pixels into a deep (FP16) "accumulation buffer." This is therefore a render-to-texture effect. For each subsequent re-rendering, the objects and/or camera are moved or changed slightly. Once the accumulation passes are complete, the resultant floating-point pixels are re-averaged into a viewable and nicely-blurred picture. Controls in the shader determine the balance between render speed (a small number of samples) and blur quality (a large number of samples).
  Minimum Required GPU

Image Postprocessing




Video
Download


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

perf_tutor is described in the FX Composer user guide -- a simple project designed to help you explore some of FX Composer's performance analysis tools (Be sure to accept a local copy of the perf_tutor.fx when you load this project, so that it's freely-editable as you work with this one!).
  Minimum Required GPU








Download


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

A 2D effect that applies a "spotlight" to the entire frame using frame-buffer alpha blending, and then layers it with the "sepia" toning shader.. "post_spot"ontains simple spot and bumpy techniques, while "sepia" allows arbitrary color toning and/or desaturation of any color image.
  Minimum Required GPU






Whitepaper

Download


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

Spotlight with the cone angle defined by the shadow projection. Fast and flexible
  Minimum Required GPU






Whitepaper

Download


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

"oneCycleSkin" combines a photographically-based texture of a single fingertip and the "painted sphere" technique to quickly get a lifelike appearance at a high fill rate
  Minimum Required GPU








Download


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

ToksvigAA shows how to use texturing inside a BRDF, so that the anti-aliasing inherent in the texture engine can be used for arbitrary surface calculations. In this specific case, the specular highlight function is pre-calculated, and its values placed in a table (as a texture). The calculation is done by CPU-side HLSL code, just once before rendering begins. The values in this lookup table are then read as texture inputs by the BRDF. Since the complete shading function is pre-calculated, rather than just a portion, the texture antialiasing covers the entire high-freuqency highlight -- typical bump- or normal-mapping schemes would only antialias one or two terms of the specular function, which would still be high-frequency and would exhibit aliasing. Both AA and non-AA versions of the specular function are provided in the shader, as alternative techniques that can be easily compared in the shaded display.
  Minimum Required GPU

Basic




Whitepaper
Video
Download


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

From Siggraph 2004 - "grisaille" shading permits a simple numeric "flattening" of the overall shading, similar to engraved stone grisaille
  Minimum Required GPU








Download


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

"dusk_gloom" shows tricks you can try yourself, combining image layers by using the "ScriptExecute Sorter" subwindow of the FXComposer Materials pane. The complete effect is created by combining "post_bloom" with two copies of "post_negative": negative->bloom->negative to create "gloom" from the "bloom."
  Minimum Required GPU






Whitepaper

Download


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

"fluid" is an image-processing effect. Be sure to "splash" using the mouse!
  Minimum Required GPU








Download


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

"relief_maps" is a sample from our skilled friend Fabio Policarpo. It uses "relief mapping," an alternative to the usual bump or normal mapping. Not only does relief mapping disturb the surface normals, but also creates realistic geometric displacments in the shading -- and even casts shadows from those displacements.
  Minimum Required GPU

Texture





Video
Download


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

Another great sample project from Fabio Policarpo. This sample uses textre-encoded displacement vectors to create the perspective illusion of displacement mapping without actually altering geometry
  Minimum Required GPU

Texture





Video
Download


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

"hwShadowMap" enables NVIDIA's built-in HW support for shadow-mapping from D24S8 depth textures (format "D24S8_SHADOWMAP") — this shadow mappng is faster than using floating-point surfaces and comes with built-in shadow filtering for top-notch results. The view frustum and render-to-texture tasks are maganed by macros from the header file "shadow_map.fxh" and bind automatically to the scene lamp. Setting the shader and setting the "Textures" source display to "scene" allows you to see the view from the shadow rendering pass, specified by a DXSAS "RenderPort."
  Minimum Required GPU

Shadow




Whitepaper
Video
Download


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

A combination of effects: gradient preprocessing from a dynamically-geneated texture; rim-lit plastic showing subsurface scattering emulation and complex-surface highlight edge effects; an overall unsharp masking effect applied to the entire rendered frame
  Minimum Required GPU








Download


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

shadow_fp_pcf uses a floating-point frame buffer as a shadow map to delive the highest-quality shadow, based on percentage-closer filtering (PCF). Instead of using NVIDIA's built-in PCF function, this effect performs PCF in the pixel shader itself, using shader model 3.0 looping to permit a much larger number of samples and a softer-looking result.
  Minimum Required GPU






Whitepaper

Download


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

paint_blur is a nv4x-class demo of floating point buffers and indirect texture access. The mouse allows you to "liquify" an image in real time, but in this case the "liquified" image is blurred against the original image via an accumulation buffer, creating the complete paint-on motion blur effect
  Minimum Required GPU






Whitepaper

Download


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

paint_HDR is much like a regular simple paint program, but the pixels it uses are based on 16-bit floating-point values. This makes it perfect for touching-up HDR files etc. This paint shader has two controls to manage brightness — one for the brightness of the brush (which can even be negative) and one for the brightness of the overall image exposure or "white level." Bright brush strokes may appear white, but ajusting the exposure can reveal their true colors. Thanks to the developer/artist at NVIDIA's GPU Jackpot who asked for this shader — making it from the existing paint_brush shader took less than an hour, right there at the event!
  Minimum Required GPU






Whitepaper

Download


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

shadowOverlay shows a simple hack to add overlaid shadows to a scene regardless of how it was actually shaded -- mostly to show just how important shadowing is, even to a completely "unlit" model
  Minimum Required GPU






Whitepaper

Download


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

Geometry from NVIDIA's "Time Machine" truck, showing a variety of vertex values and scene coordinate systems encoded as colors and patterns. See the descriptions of the "SeeValues" and "SeeSpaces" HLSL shaders for more details
  Minimum Required GPU








Download


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

Using textures as lighting values
  Minimum Required GPU








Download


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

A simple industrial chain with two shaders, both featuring a cube reflection map. The metal chain links themselves use the fast and simple "metalRefl" shader and are tinted to look like common hardened steel. The chain cover, a flexible plastic tube, uses "BumpGlossed," which incorporates a bumpmap (the pattern gives the simple model complex bending, more like a flexible tube) and a fresnel-attenuated reflectivity (more like real plastic surfaces).
  Minimum Required GPU

BRDF





Video
Download


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

Animated noisy glow effects around each object, "Corona" is an animated extension of "post_halo" and "post_glowTrail" with the simple addition of noise. Objects are rendered into a texture, that texture swizzled and blurred, noise used to repeatedly offset the texels, and over several frames each new frame is tinted, faded, and moved by noise to a new location for a fire-like effect around the edges of each object.
  Minimum Required GPU

Image Postprocessing




Video
Download


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

Animated "goochy" alien showing an animated NVB file generated by 3DStudio Max
  Minimum Required GPU








Download


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

3DPaint on a teapot — functions on GeForce FX, but works even better using blendable FP16 textures on GeForce 6 and higher. Requirement: the input 3D model must have valid, non-overlaping texture coordinates. The technique works by comparing the object's UV coordiates to the corrent paintbrush position. Be sure to be aware of the "Paint Now" toggle that turns active painting on and off.
  Minimum Required GPU






Whitepaper

Download


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

Show vertex-shader texture fetch for displaced surface. Changing the tesselation paramters of the cylinder will alter the effeciveness of this technique, depending on the texture chosen. Remember that the texture must be in 32-bit-fp format
  Minimum Required GPU








Download


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

volume-texture fireball
  Minimum Required GPU








Download


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

Animated layered fire, based on Yury Uralsky's "Volumetric Fire" post on Cg Shaders.Org.
The shader revolves a cross section of a flame image around the Y axis to produce a cylindrical volume, and then perturbs the texture coordinates with 4 octaves of animated 3D procedural noise to produce the flame effect. This simpling is displayed on multiple parallel transparent camera-facing planes.
  Minimum Required GPU

Texture





Video
Download


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

hemisphere_lighting project from Microsoft
  Minimum Required GPU








Download


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

ocean waves
  Minimum Required GPU








Download


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

In this example, the shadow map from one lamp is aimed automatically at the second "dummy" point light (which doesn't provide illumination, we only use its location as an aim point). An advantage of this method is that the overall size of the show texels, relative to the object, will remain relatively constant regardless of where the light may move.
  Minimum Required GPU






Whitepaper

Download


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

Sprites that always face the camera, aimed by the vertex shader without CPU intervention
  Minimum Required GPU








Download


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

image processing trick
  Minimum Required GPU






Whitepaper

Download


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

scene_mandelbrot shows a mandelbrot set computed in Shader Model 2. Compare to the SM3 version!
  Minimum Required GPU








Download


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

Colored highlights create the illusion of a thin lastic or oily film on any surface. Pixel-shaded on GeForce FX and higher.
  Minimum Required GPU








Download


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

Texture-based subsurface scattering emulation. In this effect, render-to-texture is used to store a depth image from the ivantage point of the light source #151; that is, a shadow map. The map is stored in one channel an floating-point image, while another channel stores the fresnel attentuation (realtive to the light) of each surface point. For the final render, each visible point is compared to the shadow depth. If the point is farther from the light than the stored shadow depth, it is considered shadowed — but rather than just losing all illumination, the illumination is attentuate by distance through the object, to simulate light tunneling through a translucent medium. The stored fresnel term is also sampled, so that light striking at grazing angles, which would in nature be reflected-away, is not inadertently included in this material-diffusion effect.
  Minimum Required GPU






Whitepaper

Download


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

Using a single shadow map for multiple lights
  Minimum Required GPU






Whitepaper

Download


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

Using textured anti-aliased lines, create an object-space Wireframe on any object
  Minimum Required GPU








Download


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

An actual raytracer witten in HLSL
  Minimum Required GPU

Environment






Download


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

Mandelbrot Set in a ps_3 pixel shader
  Minimum Required GPU

Fractal






Download


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

Edge detection overlayed on scene — handy with "toon" shading
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

PointShadowAim uses shadow maps created along an "aim point" — one light is the shadw source, while another (which contributes no illumination) is used to as an aim point. The shadow-camera projection will always center on the aim point, and is guaranteed to enclose a spherical volume around the aim point as defined by the radius parameter. The light itself can then be moved around freely, far or near, and the shadow will aways be well-formed and with roughly the same number of texels.
  Minimum Required GPU

Shadow




Whitepaper

Download


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

shadRPort uses a floating point texture as a shadow map. The shadow camera is aligned using built-in DXSAS annotations and semantics.
  Minimum Required GPU

Shadow




Whitepaper

Download


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

Tonemap adjusts a high-range picture to appear on 8bit displays
  Minimum Required GPU

Image Postprocessing





Download


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

A simple demo of the new SM3 "Facing" register -- note how the texture is flipped on both sides of a surface in this demo, so that it always remains quot;straight"
  Minimum Required GPU

Basic






Download


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

paint_brush provides simple soft-edged painting in FX Composer. Just draw with the mouse! FX Composer has only simple mouse handling, but using time dynamics and GPU-based texturing, many paint-program effects are easily implemented.
  Minimum Required GPU

Paint






Download


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

Use the mouse to paint, and use any input file texture as a brush shape. Simple dynamics are also handled by the TIME semantic. Rotation jitter is hanled not by the CPU, but by a vertex-shader noise function running on the GPU
  Minimum Required GPU

Paint






Download


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

paint_3D lets you paint directly on a geometric surface in FX Composer. Read in any model with valid texture coordinates, and paint using the mouse. The result texture will appear in the texture display (and can be saved). Be careful of resizing the scene window — it will clear your painting.
  Minimum Required GPU

Paint






Download


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

paint_sculpt uses the new features of PS_3_0 and VS_3_0 to allow you to interactively sculpt geometry in a paint-like application. paint_sculpt paints on any 3D surface with valid texture coordinates, and then the result of your painting actions are read back into that object via vertex texture fetch. The values then are applied to the surface geometry to permit you to freely sculpt any painted displacement you like in real time.
  Minimum Required GPU

Paint






Download


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

paint_liquid is a tool similar to Photoshop's "liquify" command. Read any texture from disk, and then "paint" over it with the mouse — the underlying image can be freely distorted and warped in real time. This shader works best with GPUs that can support 16-bit floating point render targets, but will function on some older GPUs also — the distortion effect comes from painting an unseen extra texture, which is then used to perform a "dependant texture read" on the main input image.
  Minimum Required GPU

Paint






Download


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

paint_ripple is similar to paint_liquid in that unseen image displacements are painted, but the displacement image is also used for 3D lighting effects, creating a "ripple glass" effect,
  Minimum Required GPU

Paint






Download


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

Click-here demo
  Minimum Required GPU

Paint






Download


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

The "TV" post-processing effect draws any scene through an animated "old TV" screen effect, driven by the scene clock. The elements of this TV effect include contrast and color changes, a flickering "overbrite" effect, and scrolling "scan lines" based on a sine function.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Create a bg glow based on the object alpha
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Jerk picture around. Mess with mouse
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Overbright glow effect
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Animated noisy glow effects around each object, "Corona" is an animated extension of "post_halo" and "post_glowTrail" with the simple addition of noise. Objects are rendered into a texture, that texture swizzled and blurred, noise used to repeatedly offset the texels, and over several frames each new frame is tinted, faded, and moved by noise to a new location for a fire-like effect around the edges of each object.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Draw an overlay image over the current scene, using a variety of pixel-shader-driven blend modes. Compile-time options provide dissolve and Photoshop(tm)-style "Advanced Blend" operations
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Add 2D dropshadow
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Draw a colored glow along the INSIDE edges of the scene objects (based on alpha)
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Glow overlay to scene
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Psychotronic glow trails over animated scenes. The post_glowtrail shader uses persistent render-to-texture for animated effect. Each frame is rendered to a texture, and its alpha is blurred and swizzled into RGB, tinted, and saved from frame-to-frame. Each frame, the previous blur is faded slightly before being added to the new glow.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Psychotronic glow trails over animated scenes. The post_glowtrail shader uses persistent render-to-texture for animated effect. Each frame is rendered to a texture, and its alpha is blurred and swizzled into RGB, tinted, and saved from frame-to-frame. Each frame, the previous blur is faded slightly before being added to the new glow.
  Minimum Required GPU

Image Postprocessing



Whitepaper
Video
Download


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

Leave persistent but fading images behind as the scene moves. Looks best with "Draw Always" active. The uses persistent render-to-texture for animated effect. Each frame is rendered to a texture, blurred and saved from frame-to-frame. Each frame, the previous blur is faded slightly before being added to the new scene.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Halos around any object -- these halos are based on the object's alpha channel, which is blurred and swizzled into RGB space via render-to-texture.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Create a star-shaped flare. This shader uses two passes, like the separable "glow" shader, but the passes are completely independant, creating a crossed-star shape. Only pixels brighter than "Starmin" will flare.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Kuwahara "blur" filter — selectively preserve some egde detail and color
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Draws a "lens" effect over the curent frame, based on the current mouse location (drag over the render window). The "lens" displacement is ased on a pre-calculated texture, so this provides a handy template for displacement shaders.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Edge detection applied to scene
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Edge detection applied to scene -- faster version with some terms skipped because they were zero or one
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Fasster Edge Detect in RGBA (instead of grayscale)
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Use vertex noise for postprocess camera shake
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Make the viewer dizzy
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Make the viewer dizzier
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Process scene colors for Saturation, contrast, etc
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Like the Photoshop(tm) color mixer
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Apply a color curve texture to the vlaues in the R,G, B or grayscale values in the scene. Note that setting grayscale conversion weights of (1,0,0) gives the same result as just using "red" though at lower performance.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Like the Photoshop(ps) color mixer when set to "monochrome" — interactively create the final color mix for the B&W result. Unlike Photoshop(tm), consider alpha contribution too.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

ColorSpin ignores scene geometry, but rotates the color coordinates of the input texture image according to the HLSL World-View matrix
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Desaturate scene colors
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Add sepia toning (or any color toning)
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Apply a color curve, much like the Photoshop(tm) "curves" filter. Curves are stored as textures, which can be defined via HLSL or from a disk file.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Edgy frost effect on image
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Edgy frost effect on image -- cheaper version
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

B&W white noisy halftoning as a postprocess
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Simple round-dor pure B&W imaging
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Reduce color palette
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Simple wipe between two images — default valuess set up a quot;Star Wars Special"
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Aply unsharp mask to scene
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Reduce image to a mosaic of stylized 3D tiles
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

The "TV" post-processing effect draws any scene through an animated "old TV" screen effect, driven by the scene clock. The elements of this TV effect include contrast and color changes, a flickering "overbrite" effect, and scrolling "scan lines" based on a sine function.
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Invert image
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Just pass image through another texture (useful for capturing that texture to disk in FX Composer)
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Copy scene to a fixed-size map
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Apply texture as background
  Minimum Required GPU

Background




Whitepaper

Download


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

pre_cubeBg uses a cube environment map as the background, adjusting appropriately for the camera's view direction
  Minimum Required GPU

Environment




Whitepaper

Download


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

Draw gradient as background
  Minimum Required GPU

Background




Whitepaper

Download


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

create gradient texture for use as background
  Minimum Required GPU

Background




Whitepaper

Download


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

Use object surface normals to displace an image
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Scene_radialBlur uses a accumulation-style motion blur effect
  Minimum Required GPU

Image Postprocessing





Download


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

Show the scene alpha channel
  Minimum Required GPU

Image Postprocessing





Download


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

Mandelbrot Set in a ps_2 pixel shader
  Minimum Required GPU

Fractal






Download


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

Blend modes
  Minimum Required GPU

Image Postprocessing



Whitepaper

Download


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

Show effects of texture bias
  Minimum Required GPU

Texture




Whitepaper

Download


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

Clear to any color
  Minimum Required GPU

Background




Whitepaper

Download


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

Apply a displacement texture to the scene
  Minimum Required GPU

Image Postprocessing





Download


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

Conversion of HSV data to RGB
  Minimum Required GPU

Texture




Whitepaper

Download


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

Bake lighting from one object into a texture, then apply that texture to instances of that object, rather than lighting them.
  Minimum Required GPU

Texture






Download


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

Show a texture
  Minimum Required GPU

Background




Whitepaper

Download


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

Clear to a texture
  Minimum Required GPU

Background




Whitepaper

Download


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

Early image processing demo
  Minimum Required GPU

Image Postprocessing





Download


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

Bicubic filtering example
  Minimum Required GPU

Image Postprocessing





Download


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

Graph1DTextures uses an image shader to graph RGBA values from any 1-D texture onto the scene frame
  Minimum Required GPU

Debug






Download


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

Fast texture-engine version of anti-aliased 3D checkering. See check3D.fx for a numerical equivalent with lower performance. HLSL texture shader functions are used to generate special samplers for high performance
  Minimum Required GPU

ProceduralAA






Download


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

A 3D checkboard surface. The checker is calculated analytically using ddx() and ddy() functions. For a faster texture-engine version, see check3DX.fx
  Minimum Required GPU

ProceduralAA






Download


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

Anti-aliased Brick Shader #151; uses the texturing ngine for high performance
  Minimum Required GPU

ProceduralAA






Download


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

"Cage" creates the illusion of an anti-aliased wire-mesh cage. A 3D periodic function is used, and accelerated by use of the texturing engine and a pattern texture generated by HLSL at run time
  Minimum Required GPU

ProceduralAA






Download


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

Display a variety of different scene-data values such as surface normals, halfAngles, etc as colors — useful for debugging shaders and models (Note the use of cube_normalize()) for some colors, too). Compare to the pattern-based display of "SeeValues.fx"
  Minimum Required GPU

Debug






Download


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

Display 2D/3D checkerboard patterns to illustrate different spaces (coordinate systems) used in shading. Can be applied to any model. Use the "scale" control to alter the size of the displayed pattern, and compare to the use of color for debugging display, as found in "SeeValues.fx"
  Minimum Required GPU

Debug






Download


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

Return scene depth as a grayscale
  Minimum Required GPU

Debug






Download


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

SHow surface UV coordinates
  Minimum Required GPU

Debug






Download


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

D rasterization in pixel shader
  Minimum Required GPU

Debug






Download


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

CookTorranceMulti uses texturing to perform shading via multitexturing. Two textures are indexed against dot-product lighting factors, then their results multiplied. The two textures combine as factors to create the final complex BRDF. In the example textures, a Cook-Torrance model is emulated -- other isotropic BRDFs are just as easily created (or invented in Photoshop). Note that the factors are actually calculated in the vertex shader, so this method will function even under DirectX 8.
  Minimum Required GPU

BRDF






Download


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

Nightfall -- uses two textures to show different lighting effects for night and day. One texture shows the earth at night, the other shows it illuminated by daylight -- the lighting equation modulates between the two
  Minimum Required GPU

Materials






Download


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

Concentric-shells technique simple fur
  Minimum Required GPU

BRDF






Download


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

scruffy is fur with random "scruffiness"
  Minimum Required GPU

BRDF






Download


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

Anisotropic specular calculated through a BRDF texture. The texture can be calculated on the fly by the HLSL Virtual machine
  Minimum Required GPU

BRDF






Download


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

Dsplay a surface colored as if it has been coated with a thum, refractive and transparent film
  Minimum Required GPU

BRDF






Download


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

Use of two prefactored textures to calculate a complex BRDF -- Directional-light version
  Minimum Required GPU

BRDF






Download


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

Use of two prefactored textures to calculate a complex BRDF, Version with Reflections
  Minimum Required GPU

BRDF






Download


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

Vertex animation combined with Mutlitextured BRDF
  Minimum Required GPU

VertexAnim






Download


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

A shader to display objects with an "hatched" look in two colors, inspired by colored-paper drawings by Albrecht Durer. Like Durer's drawings, the diffuse tone is drawn with a dark hatch on a midtone, and then the hilight tones are hatched in a bright tone at a different angle on top of the darker tones.
  Minimum Required GPU

ProceduralAA






Download


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

Provides a vertex-shaded version of "Goch" shading — expecially useful for workstation and other modelling applications. Instead of normal lighting, cool and warm tones are interpolated across the entire surface — not just lit areas — to give a good impresion of depth and solidity. See goochy2.fx for a version with a vertex-shaded hilight, and goochy_HLSL.fx for a pixel_shaded version using HLSL and PS_2.
  Minimum Required GPU

BRDF






Download


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

Gooch shading with glossy hilight
  Minimum Required GPU

NPR






Download


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

Gooch shading with glossy hilight, lit by a directional source
  Minimum Required GPU

NPR






Download


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

goochy_HLSL provides a PS2 pixel shader version of gooch shading, along with a "superglossy" highlight -- the highlight has a threshhold below "GloosTop" where it drops steeply to give a large wet-looking disk
  Minimum Required GPU

NPR






Download


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

Ocean shader -- looks best on a flat plane
  Minimum Required GPU

Materials






Download


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

spinFX shows accumulation-buffer motion blur. By default a SINGLE motion-blurred frame is drawn. Uncomment the USE_TIMER macro and recompile to enable animation.
Accumulation buffer effects are created by rendering the same object repeatedly, and accumulating the resultant pixels into a deep (FP16) "accumulation buffer." This is therefore a render-to-texture effect. For each subsequent re-rendering, the objects and/or camera are moved or changed slightly. Once the accumulation passes are complete, the resultant floating-point pixels are re-averaged into a viewable and nicely-blurred picture. Controls in the shader determine the balance between render speed (a small number of samples) and blur quality (a large number of samples).
  Minimum Required GPU

Image Postprocessing





Download


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

Vertex noise animation
  Minimum Required GPU

Noise






Download


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

An animated flame effect, using noise, lookup colors, and multiple transparent planes
  Minimum Required GPU

Materials






Download


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

Animated lava, created by combined animating textures... including tree bark!
  Minimum Required GPU

Texture






Download


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

MrTwister is a simple cycling vertex-animation distortion demo
  Minimum Required GPU

VertexAnim






Download


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

Simple shader that samples different parts of a texture to look-up different digits. Combined with the TIME semantic, this creates a simple GPU-based clock display
  Minimum Required GPU

Texture






Download


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

Simple sinusoidal vertex animation
  Minimum Required GPU

VertexAnim






Download


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

Vertices will avoid the mouse... or chase it, if the left button is pressed
  Minimum Required GPU

VertexAnim






Download


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

Align sprites to the view direction, using a vertex shader — no load to CPU
  Minimum Required GPU

Texture






Download


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

cardProxy
  Minimum Required GPU

Environment






Download


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

Hemispheric lighting demo from Microsoft
  Minimum Required GPU

BRDF






Download


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

Glow shader from Microsoft
  Minimum Required GPU

Image Postprocessing





Download


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

Metallic Flake (carpaint) shader from Microsoft
  Minimum Required GPU

BRDF






Download


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

Wood shader from Microsoft
  Minimum Required GPU

BRDF






Download


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

Filmy Dawn Bustier Material
  Minimum Required GPU

Materials






Download


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

Gungrip material is a reflective metal with a thin plastic coating. Two lights are used.
  Minimum Required GPU

Materials






Download


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

HammerTime is a simple textured shader with glow
  Minimum Required GPU

Materials






Download


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

Glassy surface
  Minimum Required GPU

BRDF






Download


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

Plastic, lit by a directional source
  Minimum Required GPU

Basic






Download


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

plastic with a quadratic-falloff point lamp
  Minimum Required GPU

Basic






Download


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

lambSkin -- a skin shader (based on a tweaked lambert function) that provides a simple simulation of subsurface scattering. An extra "sub" color is added to the diffuse shading, and that color will "bleed through" to the back of the model depending on the setting of the "wrap" rolloff paramter. Because this is part of the diffuse shading,it tends to be low-frequency, so versions are provided for both pixel-shaded and vertex-shaded surfaces — both textured or untextured.
  Minimum Required GPU

BRDF






Download


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

Plastic with a special rim-lit effect — the highlight exponenet changes as the hilight is drawn near the contur edge
  Minimum Required GPU

Basic






Download


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

"Glossy Hilight" in this case means a crisp, round-edged hilight -- the hilight rolls-over normally but when it hits the "top" value it will drop off rapidly until it reaches the "bot" value. The result looks like a highlight from a larger round source, rather than the usual point-light source. A specific function, vertex shaded, pixel shaded, textured and untextured samples are supplied.
  Minimum Required GPU

BRDF






Download


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

A collection of vertex-shaded, pixel-shaded, textured or untextured metal surfaces.
  Minimum Required GPU

BRDF






Download


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

metal lit by a directional source
  Minimum Required GPU

Basic






Download


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

metalRefl provides reflective metal shading in ps_2 - lit by a point source
  Minimum Required GPU

BRDF






Download


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

Just use a texture — no lighting
  Minimum Required GPU

Debug






Download


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

The newly-popular parallax or "offset" bump-mapping technique creates an effective illusion of displacement mapping.
  Minimum Required GPU

Bump






Download


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

Simple textured surface
  Minimum Required GPU

Texture






Download


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

SimpleDiffuseHLSL is a very simple template shader
  Minimum Required GPU

BRDF






Download


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

Simple vertex-shaded surface
  Minimum Required GPU

Basic






Download


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

SimpleTexPs Simple textured template
  Minimum Required GPU

Texture






Download


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

A complex Bumpy Glossy surface with multiple textures and multiple lights
  Minimum Required GPU

Bump






Download


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

A complex Bumpy Glossy surface with multiple textures and multiple lights
  Minimum Required GPU

Bump






Download


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

Bumpmapped Plastic
  Minimum Required GPU

Bump






Download


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

A new HLSL version of "bumpy shiny"
  Minimum Required GPU

Bump






Download


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

PlasticDX9 s a typical plastic shader with options for texturing and fresnel-attenuated reflections. Vertex shaded (no pixel shader) and pixel-shaded versions are supplied
  Minimum Required GPU

BRDF






Download


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

PlasticDX9multipass shows a reflective plastic surface illumiated by multip0le light sources. Each source in accumulated in a separate pass.
  Minimum Required GPU

BRDF






Download


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

Reflective metal — the reflection is set to have a specific radisu and location, rather than an infinite distance. This permits a number of interactive motion effects (see GPU Gems)
  Minimum Required GPU

Environment






Download


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

Velvet catches light around its edges, thanks to lots of trnslucent fuzz. This surface (vertex-shaded or pixel-shaded) simulates this effect inexpensively. Textured and untextured versions are both suplied.
  Minimum Required GPU

BRDF






Download


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

Classic Renderman-style "wood" shader, uses textures fr faster lookup than color spline() functions
  Minimum Required GPU

BRDF






Download


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

PerfTutor is a simple template for trying different effects and seeing their results on the overall shader perfomance. Multiple lights are used.
  Minimum Required GPU

Debug






Download


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

Show 3D noise texturing in a simple direct form
  Minimum Required GPU

NPR






Download


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

Diffuse shader with texture. Controls permit scaling, rotation, etc of texture in the shader
  Minimum Required GPU

Texture






Download


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

Diffuse Bumped Surface in HLSL
  Minimum Required GPU

Bump






Download


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

Pass through the surface to a background cube map — direction is traced from eye position.
  Minimum Required GPU

NPR






Download


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

Volume shadowing
  Minimum Required GPU

Shadow




Whitepaper

Download


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

This example performs volume rendering in a single pass using ray marching. The code calculates the intersection between the eye ray and an axis-aligned box using the slabs method. It then marches along the ray between the two intersection points, looking up in a 3D texture at each sample point, and accumulating color and opacity as it goes. If using pixel shader 3.0, this will compile to a real REP/ENDREP loop.
  Minimum Required GPU

BRDF






Download


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

Animated "zap" textures -- looks like a random oscilloscope
  Minimum Required GPU

Texture






Download


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

softStencilShadow
  Minimum Required GPU






Whitepaper

Download


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

gooch_slicer
  Minimum Required GPU








Download


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

goochy_shadow
  Minimum Required GPU






Whitepaper

Download


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

post_1024x1024
  Minimum Required GPU








Download


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

post_colorClip
  Minimum Required GPU








Download


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

post_bleach_bypass
  Minimum Required GPU








Download


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

post_drainBamage
  Minimum Required GPU








Download


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

post_distort
  Minimum Required GPU








Download


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

post_fromCMYK
  Minimum Required GPU








Download


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

post_fromCMY
  Minimum Required GPU








Download


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

post_fromYUV
  Minimum Required GPU








Download


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

post_fromHSV
  Minimum Required GPU








Download


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

post_image_diffusion
  Minimum Required GPU








Download


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

post_holga
  Minimum Required GPU








Download


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

post_sepiaX
  Minimum Required GPU








Download


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

post_scratch
  Minimum Required GPU








Download


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

post_titleOverlay
  Minimum Required GPU








Download


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

post_swizzle
  Minimum Required GPU








Download


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

post_toCMYK
  Minimum Required GPU








Download


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

post_toCMY
  Minimum Required GPU








Download


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

post_toYUV
  Minimum Required GPU








Download


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

post_toHSV
  Minimum Required GPU








Download


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

pre_noise
  Minimum Required GPU








Download


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

pre_opto
  Minimum Required GPU








Download


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

pre_noise3d
  Minimum Required GPU








Download


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

scene_lineDraw
  Minimum Required GPU

Image Postprocessing





Download


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

pre_psych
  Minimum Required GPU








Download


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

softStencilShadow
  Minimum Required GPU






Whitepaper

Download

Last Update: Jan 17, 2007
NVPerfHUD 4