Pixel Shader

what is meant by pixel shader in opengl ?

a pixel shader is an application-specified program, typically written in an assembly-like language, that is called once for every pixel in the frame buffer. they let you achieve lots of neat effects that otherwise aren’t possible. in opengl, we tend to use the term “fragment program” instead of pixel shader.

fragment programs are just now becoming available in hardware. the ARB standardized their use with the “ARB_fragment_program” extension . the only consumer level board i know of that supports the extension is the radeon 9700.

here’s a tutorial on pixel shaders. it’s for directx’s pixel shaders though. i couldn’t find an opengl fragment program tutorial.

i’ve never written a fragment program myself, so forgive me if i got something wrong.

Somewhere in the OpenGL pipeline, the colors of the pixels have to be calculated by taking into account the lighting, the textures, and so on. A pixel shader is a ‘script’ that lets your customize some of those calculations. They are very advanced and are relatively new to the graphics world. If you want to know how to program them for OpenGL check out Cg at www.nvidia.com.

  • Halcyon