Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Shader
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Design == Shaders are simple programs that describe the traits of either a [[Vertex (computer graphics)|vertex]] or a [[pixel]]. Vertex shaders describe the attributes (position, [[Texture mapping|texture coordinates]], colors, etc.) of a vertex, while pixel shaders describe the traits (color, [[Z-buffering|z-depth]] and [[Alpha compositing|alpha]] value) of a pixel. A vertex shader is called for each vertex in a [[Geometric primitive|primitive]] (possibly after [[Tessellation (computer graphics)|tessellation]]); thus one vertex in, one (updated) vertex out. Each vertex is then rendered as a series of pixels onto a surface (block of memory) that will eventually be sent to the screen. Shaders replace a section of the graphics hardware typically called the Fixed Function Pipeline (FFP), so-called because it performs [[Computer graphics lighting|lighting]] and texture mapping in a hard-coded manner. Shaders provide a programmable alternative to this hard-coded approach.<ref>{{cite web|url=http://www.directx.com/shader/|title=ShaderWorks' update - DirectX Blog|date=August 13, 2003}}</ref> The basic [[graphics pipeline]] is as follows: * The CPU sends instructions (compiled [[shading language]] programs) and geometry data to the graphics processing unit, located on the graphics card. * Within the vertex shader, the geometry is transformed. * If a geometry shader is in the graphics processing unit and active, some changes of the geometries in the scene are performed. * If a tessellation shader is in the graphics processing unit and active, the geometries in the scene can be [[Subdivision (computer graphics)|subdivided]]. * The calculated geometry is triangulated (subdivided into triangles). * Triangles are broken down into [[fragment quads]] (one fragment quad is a 2 Γ 2 fragment primitive). * Fragment quads are modified according to the fragment shader. * The depth test is performed; fragments that pass will get written to the screen and might get blended into the [[frame buffer]]. The graphic pipeline uses these steps in order to transform three-dimensional (or two-dimensional) data into useful two-dimensional data for displaying. In general, this is a large pixel matrix or "[[frame buffer]]".
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)