PDA

View Full Version : Pixel Shader



PlayBoy
01-08-2003, 02:06 PM
what is meant by pixel shader in opengl ?
thnks

SThomas
01-08-2003, 03:42 PM
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 (http://oss.sgi.com/projects/ogl-sample/registry/ARB/fragment_program.txt) . the only consumer level board i know of that supports the extension is the radeon 9700.

here's a tutorial (http://www.gamedev.net/columns/hardcore/dxshader3/) 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.

Halcyon
01-08-2003, 03:43 PM
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. (http://www.nvidia.com.)

- Halcyon