NVIDIAdeveloper.nvidia.com
Google
WWWdeveloper.nvidia.com

SDK 9.51 Code Samples

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:

Coverage-Sampled Antialiasing (CSAA) TutorialFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.


This sample demonstrates how to enable Coverage-Sampled Antialiasing (CSAA) on GeForce 8 series GPUs in DX9.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


Virtual Shadow Depth Cube TexturesFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This code sample demonstrates a variety of techniques for increasing the performance of omnidirectional shadowmapping effects on DirectX 9 hardware, including an implementation of virtual shadow depth cube texturing as described in ShaderX3 (a technique for efficiently 'unrolling' a cube shadowmap into a hardware-accelerated depth texture, such as D24_X8 on NVIDIA GeForce FX, 6- and 7-series hardware).
  Minimum Required GPU

Graphics API Type





Download


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

This sample demonstrates the GeForce 7 Series per-primitive super-sample and multi-sample modes for antialiasing primitives with transparent fragments. The problem with using alphatest to virtually simulate geometry is a hard edge that is produced where the test occurs. The conventional solution for dealing with this problem is to use alpha blending. Using a GeForce 7 Series GPU, you can enable super-sampling or multi-sampling per-primitive, yielding much higher image quality along the alpha tested edges.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


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

This sample demonstrates the proper way to detect SLI-configured systems, as well as how to achieve maximum performance benefit from SLI.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


Post Processing Effects with Anti AliasingFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example demonstrates how to combine post-processing effects with multisample antialiasing in OpenGL. Current texture hardware is not capable of reading directly from a multisampled buffer, so it is not possible to use render-to-texture in this case. Instead, we render to the back buffer, and then use glCopyTexImage to copy from the back buffer to a texture. The copy performs the necessary downsampling automatically. This example also shows how to use the Transparency Antialiasing mode of the ARB multisample extension to provide higher quality, order independent transparency for geometry such as trees. This mode converts the alpha value of the pixel into a 16-level (dithered) coverage mask, which is logically ANDed with the raster-generated coverage mask.
  Minimum Required GPU

Graphics API Type





Download


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

This simple code example shows how to use the framebuffer object (FBO) extension to perform rendering to texture in OpenGL. The code renders a wireframe teapot to an off-screen frame buffer object, binds this as a texture and then displays it to the window on a textured quad.The FBO extension has the advantages that it is window system independent and does not require a separate OpenGL context for each render target. See the GL_EXT_framebuffer_object spec for more details.
  Minimum Required GPU

Graphics API Type





Download


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

This sample uses the GPU to render post-processing effects with source images and video. It takes advantage of the nv_image_processing framework, Cg, and GLSL for to implement several video filters, including guassian blur, edge detection overlay, wobble, TV-noise, radial blur, and night vision.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


HDR with 2x FP16 MRTsFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample shows how to exploit the floating power texturing power and shader model 3.0 of the GeForce 6 and 7 series on HDR applications. Bilinear and anisotropic fp16 texture filtering and vertex texture fetch (VTF) are used to speed up some of the different steps of the HDR rendering process such as image downsampling, blurring or luminance adaptation. Additionally, on the 6 series, by using two G16R16F render targets and MRT, you can achieve an additional speed up (20 to 30%). (All HDR maps are courtesy of Paul Debevec www.debevec.org).
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

This sample demonstrates a new technique for computing diffuse light transfer and shows how it can be used to compute global illumination for animated scenes. The technique efficiently calculates ambient occlusion and indirect lighting data on the fly for each rendered frame. It does not have the limitations of precomputed radiance transfer (PRT) or precomputed ambient occlusion techniques, which are limited to rigid objects that do not move relative to one another. It works by treating polygon meshes as a set of surface elements that can emit, transmit, or reflect light and that can shadow each other. This method is efficient because it works without calculating the visibility of one element to another. Instead, it uses a much simpler and faster technique that uses shadowing to account for occluding (blocking) geometry.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


Antialiasing with Post-ProcessingFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

In this sample, an antialiased backbuffer is read as the source image for a post-processing effect which creates a green glow. The IDirect3DDevice9::StretchRect() function is used to copy the antialiased image to a render-target texture for post-processing. This technique yields better results than simply rendering the scene to an off screen render target.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


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

This example implements an image histogram using occlusion queries. For a histogram with n entries this method takes n passes. It renders the scene to a texture, and then for each bucket in the histogram renders a quad with the scene texture, using a fragment program that discards pixels outside the range of interest. Occlusion query is used to count how many pixels remain, and were therefore inside the range.
  Minimum Required GPU

Graphics API Type





Download


Decimation Using Anisotropic FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample demonstrates how anisotropic filtering can be used to significantly increase the performance of common image decimation filters.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This demo presents a technique that is very similar to the glow effect developed for Buena Vista Interactive's "Tron 2.0." The glow is created by post-processing the rendered scene in a series of render-to-texture operations, where the alpha channel contains the strength of the glow sources at each pixel. The technique is compatible with full-scene anti-aliasing, which you can activate through the demo's GUI.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This sample demonstrates how apply shader effects onto two videos and composite them together using pixel shaders. Shaders are then used to perform YUV2RGB color conversion, color correction, and effects like sepia, blur, sharpen, luminance edge detection, fade, and radial blur.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


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

This sample demonstrates how to use Shader Model 3.0 to simulate and render cloth on the GPU. The cloth vertex positions are computed through several pixel shaders and saved into a texture. A vertex shader then reads these positions using Vertex Texture Fetch (VTF) to render the cloth.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  
Video  
Download


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

This sample demonstrates how to implement a DirectX Semantics and Annotations (DXSAS) ScriptExecute parser in an engine. Full support for the standard annotations and semantics is provided. The user interface lets you apply multiple scene and model effects simultaneously, so the you can see hundreds of different effect combinations. All effect files were developed using FX Composer.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

This sample uses Microsoft's Direct3D9 Instancing Group to render thousands of meshes on the screen with only a handful of draw calls. This significantly reduces the CPU overhead of submitting many separate draw calls and is a great technique for rendering trees, rocks, grass, RTS units and other groups of similar (but necessarily identical) objects.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


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

This sample demonstrates a technique for speeding up the rendering of instanced geometry with GLSL.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


High Dynamic Range RenderingFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example demonstrates how to implement simple high-dynamic range rendering in OpenGL on both GeForce FX and GeForce 6 series GPUs. It loads environment map images in the Radiance ".hdr" format and uses these to light simple 3D objects. On GeForce FX series GPUs it uses two "HILO" format cubemaps (16-bit integer). On GeForce 6 series GPUs it uses 16-bit floating point cube maps with texture filtering. The example also implements a glow post-processing effect using a separarable Gaussian blur.
  Minimum Required GPU

Graphics API Type




Video  
Download


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

This example shows how to implement the forward and inverse discrete cosine transform (DCT) using fragment programs. The DCT operates on 8x8 pixel blocks and is used as the basis for JPEG compression. The code can perform the forward DCT followed by the inverse DCT at around 160 frames per second for a 512 x 512 monochrome image on a GeForce 6800. This could be extended into a complete hardware accelerated JPEG viewer by performing the rest of the JPEG algorithm (entropy decompression etc.) on the CPU and adding resampling and color space conversion to the GPU code.
  Minimum Required GPU

Graphics API Type





Download


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

Shows how to check for availability and use of the various query types supported in DirectX9. This sample queries for and displays results for queries of type: event, occlusion, timestamp, timestamp frequency, timestamp disjoint, and if running with the debug runtime, resource and vertex stats.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


Get GPU And System InfoFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample querries Microsoft's IDXDiagContainer interface to retrieve graphics hardware and system information. Most notable is the retrieval of the amount of physical video memory on the primary graphics device. The IDXDiagContainer interface is wrapped in a convenient C++ class, and no IDirect3DDevice9 object is required to retrieve the information.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


Fast Third Order FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Demonstrates a fast and efficient technique to perform cubic texture filtering. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This sample illustrates the NVIDIA Stereo API which allows developers to leverage the driver to control stereoscopic rendering. The API exposes the ability to set convergence and and stereo separation as needed in the application.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

This sample shows a technique for procedurally adding snow to a non snow scene.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


GPU Filter for Photoshop(tm)For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This code example implements a Photoshop™ filter plugin that performs its key pixel operations using GLSL shaders. Docs are included to guide developers who desire to use GLSL in Photoshop on their own. This code sample requires the use of Adobe's Photoshop CS API toolkit, which is available to registered developers directly from Adobe Systems. If you just want to use the filter without compiling the source, move the enclosed GPUFilter.8bf to your local Photoshop Plugins\Filters folder.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This simple example illustrates the use of the ATI_draw_buffers extension to render to multiple draw buffers simultaneously. Instead of outputing a single color value, a fragment program can now output up to 4 different color values to 4 separate buffers. This feature is supported on all GeForce 6 series GPUs. It is known as "Multiple Render Targets" in Direct3D.
  Minimum Required GPU

Graphics API Type





Download


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

This simple example demonstrates the use of the NV_fragment_program2 extension, including looping and branching in fragment programs, and fast normalization of fp16 vectors using the "NRM" instruction. The example uses this functionality to implement multiple per-pixel lights in a single pass. NV_fragment_program2 is only available on GeForce 6 series GPUs.
  Minimum Required GPU

Graphics API Type




Video  
Download


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

Explores various ways to use OpenGL pixel buffer objects (PBOs). This code sample can also be used to see the maximum bus-transfer rates for textures to and from the GPU.
  Minimum Required GPU

Graphics API Type


User Guide  

Video  
Download


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

This sample shows high dynamic range (HDR) lighting combined with deferred shading. Deferred shading is a technique where the components of the lighting equation (surface attributes like the normal, position, albedo, etc.) are rendered into multiple screensized render targets (MRTs). Lighting is then done using geometrically simple passes over these MRT buffers, fetching the components of the lighting equation and outputting lighting results. This results in less shaded depth complexity, less geometry processing, better batching, and a cleaner rendering pipeline. The high dynamic range comes from the lighting passes being accumulated using fp16 blending into a floating point render target, after which tone mapping and a bloom effect are done using fp16 filtering to get the HDR results into the displayable 0..1 range.
  Minimum Required GPU

Graphics API Type


User Guide  

Video  
Download


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

This simple example demonstrates the use of the NV_vertex_program3 extension to perform texture look-ups in a vertex program. It uses this feature to perform simple displacement mapping. The example also shows how to implement bilinear filtering of vertex texture fetches.
  Minimum Required GPU

Graphics API Type




Video  
Download


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

This sample shows how to use conditional branching to compute filtered soft shadows efficiently. This technique could also be applied to accelerate other filtering algorithms to increase performance significantly on GPUs that support Shader Model 3.0.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  
Video  
Download


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

This sample demonstrates how branching in fragment programs can be used to optimize soft shadow rendering in OpenGL. This technique could also be applied to accelerate other filtering algorithms to increase performance significantly on GPUs that support Shader Model 3.0.
  Minimum Required GPU

Graphics API Type



Whitepaper  
Video  
Download


16-bit Floating Point Blending and FilteringFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This simple example demonstrates 16-bit floating point blending and texture filtering. It repeatedly renders an OpenEXR-format image to a 16-bit floating point p-buffer with additive blending, and then uses a fragment program to display the results to the screen. The exposure multiplier value can be increased and decreased using the '+' and '-' keys.
  Minimum Required GPU

Graphics API Type




Video  
Download


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

This sample presents an implementation of FFTs on the GPU, performing image reconstruction on magnetic resonance imaging (MRI) and ultrasonic imaging data. This implementation automatically balances the load between the vertex processor, the rasterizer, and the fragment processor; it also uses several other novel techniques to obtain high performance on the Quadro NV4x family of GPUs. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

Fast Fourier Transforms (FFT) are used to reconstruct images from medical scans. This sample presents an implementation of FFTs on the GPU. This implementation automatically balances the load between the vertex processor, the rasterizer, and the fragment processor; it also uses several other novel techniques to obtain high performance on the Quadro NV4x family of GPUs. This technique is described in GPU Gems 2: Programming Techniques for High-Performance Graphics and General-Purpose Computation.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Shiny Sprites Using QuadsFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

Shows how to use quads to render billboards to perform a sparkling effect, and how to use an occlusion map to change intensity of the sparkles.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

Shows how to use create a glowing line with 2 triangles.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

Shows how to use Perlin noise for an explosion effect.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This example demonstrates the use of the NvTriStrip library.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

A simple Direct3D Vertex Shader 1.1 is used to render a transparent membrane effect. Thin membranes are more visible when viewed edge-on, and they appear transparent when viewed perpendicular to their surface. To give this effect, the Vertex Shader computes the dot product between the vertex normal and the direction from the vertex to the camera. The absolute value of the dot product is used as a texture coordinate to access a 1D color ramp texture. Other material effects are easy to achieve by changing the color ramp.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This sample renders an ordinary animated polygon object as a thick volume of translucent fog. A few passes of rendering to offscreen texture render targets are used to calculate the thickness through the fog object at each pixel on screen. This thickness is used as a texture coordinate to fetch the color for the volume object from a simple color ramp texture.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


Vertex Texture Fetch WaterFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This sample demonstrates a technique for simulating and rendering water. The water is simulated via Verlet integration of the 2D wave equation using a pixel shader. The simulation result is used by a vertex shader via vertex texture fetch (VTF). The water surface is rendered by combining screen-space refraction and reflection textures.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  
Video  
Download


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

Render-to-texture is used to drive a procedural simulation of water. The water is rendered with a technique similar to environment mapped bump mapping (EMBM), but an enhancement allows the EMBM rotation matrix to vary per-vertex and fade the bumps out as distance to the viewer increases. This sample requires vertex and pixel shaders 1.1.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This entry and the accompanying technical report answer the question, ''When is cube-map normalization faster than normalize()?'' The report describes experiments performed with a non-trivial pixel shader, and uses the experimental results to derive useful rules of thumb regarding the performance and quality of normalization in pixel shaders. These heuristics provide tuning dials that developers can use to trade quality for performance (and vice versa) in 3D applications. To gain an intuitive understanding of these performance-quality tradeoffs, the entry application is provided to allow the same experiments described in this report.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This demonstrates how to render a physically modeled rainbow in realtime. It does so by using a lookup texture with the color of scattered white light given the angle between a view vector and a light vector. To blend the rainbow nicely with the scene, the scene is rendered encoding moisture data in a texture and using this to change the intensity of the rainbow. This same technique can also be used to render halos, corona, fogbows, and any other radially symetrical optical light scattering effects.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This sample compares texturing from regular textures versus textures from an atlas. Putting multiple textures in at atlas can help reduce draw calls, thus decreasing CPU load. Comparisons are made with respect to both image quality and performance.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This sample creates a disturbing dynamic disease effect. It simulates a phenomenon known as chemical reaction-diffusion, by solving the governing partial differential equations in a fragment program. The result is an endless variety of changing patterns that are then used to generate bump and texture maps which are applied to a mesh with various shaders.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

This code sample demonstrates fast, realistic fluid dynamics simulation on the GPU. The sample solves the Navier-Stokes equations for incompressible fluid flow using a technique originally presented at SIGGRAPH 1999 by Jos Stam. The sample allows the user to draw arbitrary obstacles and flow viscous or inviscid fluid around them.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This sample demonstrates Hardware Shadow Mapping featured on GeForce 3 and higher GPUs. Hardware shadow maps give performance, quality and ease-of-use advantages over shader-based approaches.
  Minimum Required GPU

Graphics API Type





Download


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

This effect shows generating texture coordinates for shadow mapping, along with using the shadow map in the lighting equation per pixel.
  Minimum Required GPU

Graphics API Type





Download


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

This code sample shows a variety of lighting effects. It demonstrates Diffuse, Specular, Bump-Map, and Environment-Map lighting via HLSL.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


Stencil Shadow Volume ExtrusionFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

In this sample, vertex shaders are used to extrude polygon objects into stencil shadow volumes. This avoids the CPU cost of computing shadow volumes and updating the shadow volume vertex buffers. It requires more memory to store additional face vertices and zero-area triangles for the automatic shadow volume extrusion.
  Minimum Required GPU

Graphics API Type





Download


Motion Blur as a 2D Post-Processing EffectFor a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.

This example demonstrates motion blur as a 2D post process. The algorithm was described at GDC 2003 in the "Stupid OpenGL Shader Tricks" presentation. The advantage of this method over an accumulation buffer is that you only need to render the scene once, but it does have artifacts.
  Minimum Required GPU

Graphics API Type





Download


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

This entry contains a set of material shaders rendering window-shade like geometry. The approach is easily extensible to metal grates and similar, highly repetitive, man-made materials.
  Minimum Required GPU

Graphics API Type


User Guide  
Whitepaper  

Download


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

This sample implements a large-scale particle system entirely on the GPU. The positions and velocities of each particle are stored in floating point textures. Fragment programs are used to update the velocities and positions of the particles by rendering to texture each time step. The particles also collide against a sphere object, and a terrain heightfield which is stored in a texture. If available, the multiple draw buffers extension (MRT) is used to update the position and velocities in a single pass. The particles are rendered as point sprites. The position texture is converted into a vertex array for rendering the particles using the vertex buffer and pixel buffer object extensions (VBO and PBO). On the GeForce 6800, this method can render a million particles at about 20 frames per second. This example is inspired by Lutz Latta's talk from GDC 2004, "Building a Million Particle System".
  Minimum Required GPU

Graphics API Type





Download


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

The anisotropic lighting effect shows the vertex program's halfangle vector calculation. It uses HdotN and LdotN per-vertex to look up into a 2D texture to achieve interesting lighting effects.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This sample illustrates occlusion query using a simple sphere and a plane.
  Minimum Required GPU

Graphics API Type





Download


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

This sample shows usage of occlusion queries to cull out complex objects and save bandwidth to the card. Occlusion queries report how many pixels a set of draw calls actually wrote to.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This example demonstrates a simple cloth simulation that executes entirely on the GPU using fragment programs and floating point buffers.
  Minimum Required GPU

Graphics API Type





Download


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

This entry illustrates the use of detailed normalmaps.
  Minimum Required GPU

Graphics API Type





Download


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

When light strikes a material boundary, Fresnel reflection describes how much light reflects at that boundary versus how much refracts and transmits. Fresnel reflection occurs commonly in nature and is thus important for realistic real-time graphics. This entry shows an implementation of Fresnel reflection in HLSL
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


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

This entry shows how to simulate metallic paint on objects such as cars.
  Minimum Required GPU

Graphics API Type





Download


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

This sample demonstrates hardware-accelerated large-scale perspective shadow maps, using Simon Kozlov's improvements in GPU Gems.
  Minimum Required GPU

Graphics API Type


User Guide  


Download


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

This entry presents a method by which to animate a viscous fluid across an arbitrary surface. Utilizing PS 2.0 and HLSL we are able to animate a fluid entirely on the GPU as it is affected by gravity and surface details.
  Minimum Required GPU

Graphics API Type



Whitepaper  

Download


Clip Planes