NVIDIAdeveloper.nvidia.com
Google
WWWdeveloper.nvidia.com

SDK 9.51 Effects - Video and Image Processing

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.

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


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


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


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

Last Update: Jan 17, 2007
NVPerfHUD 4