FACTOID # 168: There are 11 countries where the average woman has more than six children. Ten of them are in Africa.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

FACTS & STATISTICS    Simple view

  1. Select countries to view: (hold down Control key and click to select several)

     

     

    Compare:

     

     

  1. Select fact or statistic: (* = graphable)

     

     

     

  2. (OPTIONAL) Compare to statistic: (both need to be graphable)

     

     

     

  3. View result as:

     

       
(OR) SEARCH ALL encyclopedia, stats & forums:   

Encyclopedia > Pixel shader

Vertex and pixel (or fragment) shaders are computer programs that run on a graphics card, executed once for every vertex or pixel in a specified 3D mesh. They operate in the context of interactively rendering a 3D scene, usually using either the Direct3D or OpenGL API.

Contents

Background

Flexible shaders were initially used for non-interactive rendering applications like Pixar's RenderMan, famously used to render the feature film Toy Story.


3D hardware previously used fixed-function pipelines in which, for example, one was stuck with the lighting model chosen by the hardware vendor. Graphics hardware was able to do transformation and lighting (T&L for short) on the card, but it was not flexible. A vertex shader sidesteps the T&L stage in the pipeline and lets the user add on to it.


Pixel shaders operate after the geometry pipeline and before final rasterization. They operate in parallel with multitexturing to produce a final pixel color and z-value for the final, rasterization step in the graphics pipeline (where alpha blending and depth testing occur).


In years past, video cards from Nvidia and ATI Technologies started supporting pixel and vertex shaders in hardware, allowing their use for real-time rendering. The technology is not yet quite mature, but the latest generation of games, including Doom3 and Half-Life 2 make increasing use of hardware shaders. A brewing standards battle between ATI and Nvidia is likely to prove entertaining viewing.


Details

The programs are written in either the native assembly language of the card or in a high-level shader language like the aptly named High Level Shader Language. Some key facts about vertex and pixel shaders are that they

  • can only access data in the graphics card's own memory, such as texture and geometry data, and therefore cannot access data in the computer's main memory or cache.
  • operate independently for each vertex or pixel. This ensures that they can be trivially parallelized. For instance, ATI's latest cards run 8 shaders at a time.
  • have access to a rich instruction set including many vector and matrix operations, but often no branching.
  • may be limited to a certain number of instructions and texture reads per vertex or pixel, which varies by card and shader language version.

Capabilities

The capabilities of vertex and pixel shaders are still being explored, and since hardware capabilites are improving with each generation we can expect their abilities to approach those of programmable shaders such as RenderMan's.


There exist vertex shaders that:

  • Apply an arbitrary deformation to the vertices of a mesh
  • Perform toon rendering
  • Fake motion blur
  • Apply a fisheye lens effect to the scene

There exist pixel shaders that:

  • Apply an accurate per-pixel Phong lighting model
  • Simulate multilayer metallic paint
  • Fake volume lighting, so that a spotlight lights up dust motes in the air
  • Simulate turbulent air flow and display swirling wisps of smoke
  • Apply depth of field to the scene

One of the most intriguing uses of hardware shaders is for physical simulation. The powerful vector math and parallelized architecture make current graphics cards much faster than general-purpose CPU's for certain simulations where the current state at a certain point is only dependent upon the previous state for a small area around it, like turbulent flow. Several projects are exploiting this unintended use.


The Future

New technologies, including DirectX's Pixel Shader 3.0 specification and accompanying implementations, promise to increase shaders extensibility. Capabilities of more advanced programming languages, such as loops and if/then constructs, are being extended to the shader languages. Many experts see the logical continuation of this increasing flexibility to be the eventual merging of the pixel and vertex shaders into one unit. It seems likely that in the future the Graphics Processing Unit, already rivaling the complexity of the CPU, will take over more graphically related tasks currently performed by CPUs. (Note: The Pixel Shader 3.0 is already available in new NVidia cards, for example in GeForce 6800)


See Also

External links

  • ATI's RenderMonkey (very useful shader development tools) home page (http://www.ati.com/developer/sdk/radeonSDK/html/Tools/RenderMonkey.html)
  • Microsoft DirectX vertex shader tutorial (for DirectX 8, but it applies to DX9 as well) (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndrive/html/directx02192001.asp)

  Results from FactBites:
 
Pixel Shaders (343 words)
A Pixel Shader is a graphics function that calculates effects on a per-pixel basis.
Depending on resolution, in excess of 2 million pixels may need to be rendered, lit, shaded, and colored for each frame, at 60 frames per second.
Programmable Pixel Shaders then give artists and developers the ability to create per-pixel effects that mirror their creative vision.
GameDev.net -- Shader Programming Part III: Fundamentals of Pixel Shaders (3403 words)
For example to calculate per-pixel lighting the pixel shader needs the orientation of the triangle, the orientation of the light vector and in some cases the orientation of the view vector.
On pixel shader-capable hardware, the pixel shader heightens the number of transistors on the graphic chip, because it is added to the already existing DX 6/7 multitexturing hardware.
The already Gouraud shaded or flat shaded pixel might be combined in the pixel shader with the specular color and the texture values fetched from the texture map.
  More results at FactBites »


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your comments
Please enter the 5-letter protection code

Want to know more?
Search encyclopedia, statistics and forums:

 


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.