In each release of our SDK you will find numerous code samples, complete with carefully commented source code, whitepapers, and videos to help you take advantage of the latest technology from NVIDIA.
This code is released free of charge for use in derivative works, whether academic, commercial, or personal (Full License).
Cg 2.0 Toolkit is required to compile some code samples. Please obtain the Cg 2.0 Toolkit from the full OpenGL SDK 10 installer.
|
Instanced Tessellation ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This example shows how to use bindable uniform buffers and draw instanced in order to render tessellated curved surfaces. The vertices and the indices are stored in buffer objects and bound to the shader. Patches are drawn by rendering a single tessellated quad multiple times, using instancing to do this in a single call and the instance id to index the index buffer. Indices are stored as integers using the integer support in gpu shader4.
This is idea is based on the Generic Mesh Refinement On GPU paper. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/instanced_tessellation/doc/tessellation_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Compress YCoCg-DXT ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This example demonstrates how a pixel shader can be used to compress a dynamically rendered color map into a texture, using both the DXT1 and YCoCg-DXT5 texture formats.
This example accompanies the Real-Time YCoCg-DXT Compression Whitepaper
|
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/compress_YCoCgDXT/doc/compress_YCoCgDXT_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Compress Normal-DXT ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This example demonstrates how a pixel shader can be used to compress a dynamically rendered normal map into a texture, using both the DXT5 and LATC texture formats.
This example accompanies the Real-Time Normal Map DXT Compression Whitepaper |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/compress_NormalDXT/doc/compress_NormalDXT_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Froggy Demo AA ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Showing how the Froggy demo (and also Adriane demo) is doing AA.
This sample allows you to add an additional pass for supersampling AA and kernel filtering.
It also allows you to
- test CSAA mode.
- see how to use FBO. |
|
![Minimum Required GPU](images/GEF6_2D_wte.gif) |
![](src/FroggyAA/doc/FroggyAA_small.jpg) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Glow ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Glow effect using separate filter and FBO.
Simple sample on how to create a post-processing effect without changing too much of the main rendering code of you application.
|
|
![Minimum Required GPU](images/GEF6_2D_wte.gif) |
![](src/simple_glow/doc/SG_small.jpg) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Depth Float ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Simple Depth Float demonstrates the use of a floating point depth buffer. The sample demonstrates the differences in depth fighting between different depth buffer precisions, and it demonstrates inverting the depth values to enhance precision further when using a floating point depth buffer. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/simple_depth_float/doc/simple_depth_float_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Dual Depth Peeling ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This sample demonstrates how to implement depth peeling on GeForce 8 using the new 32-bit depth texture format, as well as an optimization called dual depth peeling which peels from the front and from the back simultaneously. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/dual_depth_peeling/doc/dual_depth_peeling_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Multisample Coverage ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This sample demonstartes the use WGL_NV_multisample_coverage. It shows how to enable CSAA in an application window without rendering to a framebuffer object. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/multisample_coverage/doc/multisample_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Texture Buffer Object ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Simple Texture Buffer Object demonstrates how a texture buffer object can be used as a source for additional array data for a shader. In this sample, the arrays are used in place of regular vertex arrays to allow more comlicated indexing than OpenGL allows. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/simple_texture_buffer_object/doc/texbo_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Cascaded Shadow Maps ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This sample illustrates cascaded shadow mapping with the use of texture arrays in OpenGL with GLSL. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/cascaded_shadow_maps/doc/cascaded_shadow_maps_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Christmas Tree ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Chistmas Tree demonstrates using new fourth generation shader capabilities to render a visually complex Christmas Tree. The sample uses deferred shading into a high dynamic range framebuffer object to handle the complex lighting environment |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/xmas_tree/doc/xmasTree_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Render to 3D Texture ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
This sample demonstrates the use of framebuffer objects to render to a 3D texture. It does a simple wave simulation on the 3D texture, and displays it by ray marching |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/render_texture_3D/doc/render_texture_3D_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Transform Feedback Fractal ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Transform Feedback Fractal shows an advanced use of the transform feedback and the geometry shader, by iteratively feeding the data through the transformation stages, adding more detail each time. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/transform_feedback_fractal/doc/transform_feedback_fractal_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Texture Array ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Simple texture array demonstrates the use of the GL_EXT_texture_array extension. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/simple_texture_array/doc/simple_texture_array_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Geometry Program ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Simple Geometry Program demonstrates the use of the assembly level GL_NV_gpu_program4 shading extension, focusing on geometry shaders. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/simple_geometry_program/doc/simple_geometry_program_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Simple Framebuffer Object ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Simple Framebuffer Object demonstrates the use of GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, GL_NV_framebuffer_multisample_coverage, and several format extensions. This sample shows how a program can search for support format combinations to find something that suites its needs. |
|
![Minimum Required GPU](images/GEF6_2D_wte.gif) |
![](src/simple_framebuffer_object/doc/simple_framebuffer_object_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
HDR ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
HDR demonstrates the use of new image formats for use in high-dynamic range rendering. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/hdr/doc/hdr_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Video
Whitepaper
Download
|
|
|
Cg Isosurf ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Cg Isosurf demonstrates the use of the geometry shader to tessellate an isosurface using marching tetrahedrons. The shaders includes tessellate metaballs, a texture volume, and a procedural vollume. |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/cg_isosurf/doc/cg_isosurf_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|
|
Cg Geometry Program ![For a direct link to this sample, right-click and copy the URL (shortcut) of this link icon.](images/link.jpg)
Cg Geometry Program demonstrates the use of Cg 2.0 in loading and using geometry programs with OpenGL. The sample includes programs for silhouette determination, curve tessellation, and fin extrusion |
|
![Minimum Required GPU](images/GEF8_2D_wte.gif) |
![](src/cg_geometry_program/doc/cg_geometry_program_small.png) |
![Graphics API Type](images/OpenGL_whitebg.gif)
Whitepaper
Download
|
|