Jump to content
  • Advertisement


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



This topic is 5459 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

What exactly is a shader? and how hard is it to write? is it easier to use an existing one? (sorry about this... but the search for the forums doesnt work)

Share this post

Link to post
Share on other sites
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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!