• Advertisement

Archived

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

pixelshader vs vertexshader

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

hi whats the key difference between a pixelshader and a vertexshader? yes, i can assume that the one shades pixels and the other vertices... but what does "shade" mean in this case? coloring? if so, how are the pixels colored between two vertices when using a vertexshader only? and when doing a cel-shader... would you do this with a pixel- or vertexshader? thanks!

Share this post


Link to post
Share on other sites
Advertisement
"Shader" refers to a series of operations to perform on the given data. So, a "pixel shader" applies the operations to a pixel and a "vertex shader" applies the operations to the vertex. Cel-shading is usually done in a vertex shader.

Share this post


Link to post
Share on other sites
ok thanks so far!

what kind of "operations" are these? could i do some kind of lightning with it?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
''shader'' is a seriously bad name for them, think of
them as ''programs'' instead, it makes slightly more sense


The root of the term comes from RenderMan''s (or REYES'') shade trees first developped by Robert L Cook of Pixar in 1984, who coined the term ''shader'' we still use today. Most if not all of the ''shader'' stuff we use nowadays has its root in RenderMan in one way or another.

Share this post


Link to post
Share on other sites
The operations include things like addition, multiplication, subtraction, matrix math, dot products, etc. Yes, you can do both per-vertex and per-pixel lighting with shaders.

Share this post


Link to post
Share on other sites
ok thanks.

maybe now i ask a little bit much but how would the lightning of sphere look like in pixelshader/vertexshader code?

thanks.

Share this post


Link to post
Share on other sites
If you look up the reference articles on OpenGL pixel/vertex shaders (on the sgi site) they have an examples. Basically... vertex shaders REPLACE the normal T&L bit of the pipeline. ie no lighting/transformation etc is done. The basic method to light a general object (as T&L does) it outlined in the article... This is a waste of time, as the T&L pipeline would do the same... but it is well worth looking at to get more used to the way it all works. As for pixel shaders... They work in a similar way, but per pixel. This means you can do all sorts of trickery... look up phong shading for a simple example (essentially the OGL light model extended to per pixel). Once you understand those two.. you''ll be well on your way, and can look up more info... or try doing some stuff for yourself.

Share this post


Link to post
Share on other sites

  • Advertisement