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)
|
|
Percentage-Closer Soft Shadows
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. |
|
|
|
Shadow
Whitepaper
Video
Download |
|
|
softStencilShadow
softStencilShadow Project |
|
|
|
Whitepaper
Download |
|
|
goochSlicer
goochSlicer Project |
|
|
|
Download |
|
|
dilation
dilation Project |
|
|
|
Download |
|
|
stencilShadow
stencilShadow implements vertex-shader shadow-volume extrusion and shows how to set up simple stencil shadowing in FX Composer |
|
|
|
Whitepaper
Download |
|
|
|
cmykBloom
cmykBloom Project |
|
|
|
Download |
|
|
psych_bg
psych_bg Project |
|
|
|
Download |
|
|
gooch_shadow
gooch_shadow Project |
|
|
|
Whitepaper
Download |
|
|
drainBamage
drainBamage Project |
|
|
|
Download |
|
|
|
lineDraw
lineDraw Project |
|
|
|
Download |
|
|
optical_distort1
optical_distort1 Project |
|
|
|
Download |
|
|
bleach_bypass
bleach_bypass Project |
|
|
|
Download |
|
|
duskHolga
duskHolga Project |
|
|
|
Download |
|
|
titleOverlay
titleOverlay Project |
|
|
|
Download |
|
|
|
uvDetective
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 |
|
|
|
Debug
Video
Download |
|
|
anaglyphic_stereo
Anaglyphic stereo view of a tree model -- use red/blue 3D glasses |
|
|
|
Image Postprocessing
Download |
|
|
BRDFpaint
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. |
|
|
|
BRDF
Whitepaper
Download |
|
|
|
scroll
Side-scroll animation |
|
|
|
Image Postprocessing
Download |
|
|
DebugCab
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 |
|
|
|
Download |
|
|
|
ToksvigAA
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. |
|
|
|
Basic
Whitepaper
Video
Download |
|
|
|
post_spot
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. |
|
|
|
Whitepaper
Download |
|
|
hwShadowMap
"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." |
|
|
|
Shadow
Whitepaper
Video
Download |
|
|
shadowSpot2
Spotlight with the cone angle defined by the shadow projection. Fast and flexible |
|
|
|
Whitepaper
Download |
|
|
relief_maps
"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. |
|
|
|
Texture
Video
Download |
|
|
displace_maps
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 |
|
|
|
Texture
Video
Download |
|
|
grisaille
From Siggraph 2004 - "grisaille" shading permits a simple numeric "flattening" of the overall shading, similar to engraved stone grisaille |
|
|
|
Download |
|
|
shadow_fp_pcf
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. |
|
|
|
Whitepaper
Download |
|
|
chain
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). |
|
|
|
BRDF
Video
Download |
|
|
dusk_gloom
"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." |
|
|
|
Whitepaper
Download |
|
|
fluid
"fluid" is an image-processing effect. Be sure to "splash" using the mouse! |
|
|
|
Download |
|
|
fire
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. |
|
|
|
Texture
Video
Download |
|
|
paintLiquid
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. |
|
|
|
Image Postprocessing
Whitepaper
Video
Download |
|
|
oneCycleSkin
"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 |
|
|
|
Download |
|
|
|
paint_HDR
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! |
|
|
|
Whitepaper
Download |
|
|
paint_blur
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 |
|
|
|
Whitepaper
Download |
|
|
MrWiggleDot
The "MrWiggleDot" FXComposer sample combines Vertex Animation and a "halftone" imaging shader |
|
|
|
Download |
|
|
mandelbrotPS3
mandelbrotPS3 is a numerically-demanding example of pixel shader dynamic branching. Change the # of iterations at run time for varying precision effects |
|
|
|
Download |
|
|
fireball
volume-texture fireball |
|
|
|
Download |
|
|
durerDusk
durerDusk shows a non-photo-real shading effect, designed to emulate a style of cross-hatched two-layer pen drawing |
|
|
|
Download |
|
|
lambSkinDusk
lambSkinDusk shows a cheap, fast way to emulate subsurface light scattering effects. The overall image is further enhanced by a sepia-tone pass |
|
|
|
Download |
|
|
|
glowTrailFP
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. |
|
|
|
Image Postprocessing
Whitepaper
Video
Download |
|
|
|
displace2
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 |
|
|
|
Download |
|
|
blendLayers
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 |
|
|
|
Download |
|
|
|
tonemap
tonemap shows high-dynamic-range imaging effects by permitting the user to control the exposure and look of a "deep pixel" image |
|
|
|
Image Postprocessing
Video
Download |
|
|
corona
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. |
|
|
|
Image Postprocessing
Video
Download |
|
|
spinFX
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). |
|
|
|
Image Postprocessing
Video
Download |
|