Shader Programming Guides

Shaders | Thursday 9 October 2008 5:16 pm

Here are some links to a couple of quick guides and references that’s useful when writing shaders.

The OpenGL GLSL shader language Quick Reference Guide.
http://www.opengl.org/sdk/libs/OpenSceneGraph/glsl_quickref.pdf

The full specification of GLSL 1.20.8.
http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.20.8.pdf

The full specification of GLSL 1.30.08
http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.30.08.pdf

GPU Programming guide from Nvidia for both OpenGL and DirectX.
http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide.pdf

Guide to write shaders in DirectX9 in HLSL
http://msdn.microsoft.com/en-us/library/bb944006(VS.85).aspx

Guide to write shaders in DirectX10 in HLSL
http://msdn.microsoft.com/en-us/library/bb509703(VS.85).aspx

Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

Normal map in 2 channels

Optimizations | Friday 3 October 2008 10:38 am

It’s possible to save the normal map in only two channels because of the fact that you know that the normal will be of unit length and pointing out from the surface. The technique is called hemisphere remapping and uses the following formula to unpack the third component from the two you saved in the normal map:

N.z = sqrt( 1 – N.x*N.x – N.y*N.y );

Because of the extra operations to get the third component, this method might not always be faster. And this method only works for tangent-space normals with unit length (but this is often the case).

Nvidia recommends the following texture formats to store the 2 channel normal map:

D3DFMT_V8U8 in DirectX

GL_LUMINANCE8_ALPHA8 in OpenGL

 

More information can be found in this GPU programming guide in chapter 4.11:
http://developer.download.nvidia.com/GPU_Programming_Guide/GPU_Programming_Guide.pdf

Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

Using Vertex Texture Displacement for Realistic Water Rendering

Water | Friday 26 September 2008 5:01 pm

A method to create realistic water by combining normal mapping and vertex displacement. The water looks best when viewed from a distance.

Water Rendering

Link to the chapter in GPU Gems that describes this method:
http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter18.html

Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks
« Previous Page