Archived

This topic is now archived and is closed to further replies.

Shaders

This topic is 5173 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There are two types of ''shaders'' (a horrible misnomer imo), pixel shaders and vertex shaders.
These are known, alot more sensibly imo, as fragment programs and vertex programs.

Fragment programs (aka pixel shaders) are bits of code which are run when a fragment is rendered and can be used for applying per-pixel effects to objects.

http://www.opengl.org/developers/code/gdc2003/GDC03_ARBFragmentProgram.ppt has an overview.

Vertex programs (aka vertex shaders) are bits of code which are run per vertex of the object and can be used to replace the fix function pipeline with your own custom transform and lighting routines.
http://www.opengl.org/developers/code/gdc2003/GDC03_ARBVertexProgram.ppt for an overview

www.google.co.uk for more infomation

As for how hard they are to write, i guess it depends on what ya want to do.

Share this post


Link to post
Share on other sites
The term shader originally described a small program which was run by an offline renderer like Pixar's Renderman to create a specific effect on a surface. A number of shaders could be run for one surface to combine effects.

Like _the_phantom_, I think that shader is a misused term these days. Vertex shader is quite misleading (it should be vertex program, in my opinion). However, I suppose that pixel shader is true to the original definition, but fragment program is equally valid (and perhaps a little more accurate, if you know your graphics card architecture).

The Quake III engine used the term shader for it's definitions of surface properties (each surface is, in fact, a shader, which can have specific properties as defined in a text file). However, the Quake III shader language is more like a set of rules than a true shader language.

More recently, NVIDIA have created Cg (Microsoft's HLSL), which is based on the shader language used in Renderman, among others. It is a language in the true sense of the word, which requires compilation and can support boolean comparisons, math operations and the like. It's syntax is identical to C/C++ (with a few new concepts to absorb on the programmer's part), and it's quite simple to learn if you've ever used C/C++ and can get your head around the principles of vertex and fragment programs...

[Insert witty signature here]

[edited by - iNsAn1tY on October 13, 2003 6:46:04 AM]

Share this post


Link to post
Share on other sites