Fragment shader?

Started by
8 comments, last by robirt 21 years, 7 months ago
What is a fragment?
Rodger
Advertisement
I think that it is a single pixel colour, u use them with Register combiners, computing colour fragments and such, but I am not 100% posative.

- Weasalmongler
Unfortunately, i dont know what a register combiner is. I would be happy if you tell me. I have no experience with shaders, but I am trying to learn. so is it like a pixel shader then? if not, how would that be different.
Also, if anyone knows of some articles or tutorials for shaders in opengl that isnt only nvidia.(I like nvidia, but I want to support everything) Right now my only resource is the opengl 2 specifications. Thanks.
Rodger
A fragment is a point on an object in a 3d scene. Fragments from the scene are projected onto the xy-plane to determine the pixels on your screen. Or something like that.

quote:if anyone knows of some articles or tutorials for shaders in opengl that isnt only nvidia.(I like nvidia, but I want to support everything)

ATI has a demo on useing EXT_vertex_shader here. I think that''s about it.
fragment in opengl normally means colour
eg
glLine
glCOlor3f(1,0,0); vertA
glCOlor3f(1,1,0); vertB

thus the fragment colour at vertA is red and half way between the 2 is (1,0.5,0)

http://uk.geocities.com/sloppyturds/gotterdammerung.html
I found this.

"Fragments consist of pixel location in framebuffer, color, texture coordinates, and depth (z buffer). Depending on the shading mode, vertex attributes are either interpolated across the primitive to all fragments (smooth shading), or all fragments are assigned the same values based on one vertex''s attributes (flat shading)."

So, Im wondering, are fragment shaders the same as pixel shaders? if not how are fragment shaders different from pixel shaders?
Rodger
A fragment is a color of a pixel on a polygon. Fragment Shaders are the same as Pixel Shaders they both do operations on every pixel of a give polygon.
------------------------------------------------------------I wrote the best video game ever, then I woke up...
ever seen a so called ''pixel shader'' extension in OpenGL ?

Now you know why, it''s cause it''s called Fragment Shaders in OpenGL.

BTW a fragment is not a pixel it''s a bunch of them.

-* So many things to do, so little time to spend. *-
-* So many things to do, so little time to spend. *-
a fragment is the smallest singular unit the hardware can rasterise (aka, pixel). Fragment shaders just a way of programming the graphics pipeline, more or less for per-pixel transformations. Vertex shaders are the same, only they work on vertices, and are per vertex. Only useful for fast snazzy graphical touches.
*st0ned*
my bad a fragment isn't a bunch or pixels, but neither is it a pixel

After rasterization stage (including texturing and fog), the data are not yet pixels, but are fragments.
Each fragment has coordinates data that corresponds to a pixel, as well as color and depth values.

So it's more than a single color value, its the whole set of informations for a final pixel.

*- edit -*
How the hell have I not seen that someone already said it ?
I guess I won't post when tired.

-* So many things to do, so little time to spend. *-


[edited by - Ingenu on September 7, 2002 10:17:58 AM]
-* So many things to do, so little time to spend. *-

This topic is closed to new replies.

Advertisement