pixel shader

Pixel shaders


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. That in turn creates a tremendous computational load. Modern cards process this load through Pixel Shaders. Per-pixel shading brings out a high level of surface detail-allowing you to see effects beyond the triangle level. Rather than simply choosing from a pre compiled palette of effects, developers can create their own. Pixel Shaders provide developers with the control for determining the lighting, shading, and color of each individual pixel, allowing them to create some really cool effects.

Shader Model 1.0, 1.1, and 1.2


DirectX 8 brought us pixel shader 1.0, 1.1 and 1.2
DirectX 8 allowed programmers to write shader programs up to 12 instructions in length. After DX8's release, it was determined by programmers and Microsoft themselves that 12 instructions werent quite enough. So immediately after DX8's release, MS gave birth to DirectX 8.1, and introduced us to a couple of new shader...PS 1.3, and PS 1.4
PS 1.4 allowed programmers to now write shaders at nearly twice the size of DX8 shaders...up to 22 instructions in length. So now you have to remember that cards that are DX8(Ti series) support pixel shader 1.0, 1.1, 1.2, and 1.3, but not 1.4. Cards that are DX8.1(Radeon 8500 and up) support all of the same shaders as are required in DX8, but also support PS 1.4. Now that we have DirectX 8 and 8.1 covered briefly, lets talk a little about DirectX 9.

Shader Model 2.0


DirectX 9 brings us some new features in the way of pixel and vertex shaders version 2.0. These new shaders have a much higher instruction count in comparison to their directX 8.1 bretheren, and allow game programmers to pull off some even cooler effects then they were able to before. however, the real key feature of DirectX 9 is the introduction of RGBA values in 64 (16-bit FP per color) as well as 128-bit (32-bit FP per color) floating point precision. This large increase of color precision allows a suprisingly new amount of visual effects and picture quality.

Shader Model 3.0


Shader Model 3.0 is a Microsoft High Level Shader Language (HLSL) specification. Currently SM 3.0 is the mainstream choice for shading technology in new games. SM 3.0 represented such a leap in both performance and image quality that several game developers created SM 3.0 patches for games based on SM 2.0. Crytek's Far Cry is a prime example of this.

Screenshot comparison between SM 1.1 and 3.0

Shader Model 4.0


Shader Model 4.0 will represent the biggest leap in shading ever. Currently no video card supports SM 4.0, however nVidia's upcoming GeForce 8800 and ATI's R600 will support the new specification. Additionally, SM 4.0 will only be available in Microsoft's upcoming Direct X 10 API.

Features:

Unified pixel and vertex shading capability
Geometry Shading
Resource Virtualization (virtual memory on the GPU)

DX9 SM 3.0 screenshotDX10 SM 4.0 Concept Image

More pages