Shader Model 3.0 (cont’d)
Centroid sampling support
If you think back to last summer’s Half-Life 2 AA fiasco that erupted on the halflife2.net forums, chances are you’ve heard of centroid sampling. Just in case though we’ll provide a quick refresher.
While multisample anti-aliasing does a good job of cleaning up jaggies without to much of an impact on performance, one of the limitations is that it takes its texture sample from the center of a pixel. As a result, the wrong texel could be sampled, causing artifacts on the polygon boundaries where this occurs. This is a problem in any game that uses lightmaps with anti-aliasing turned on, including the entire Quake series and the original Half-Life.
With centroid sampling, if the triangle fails to cross the pixel’s texture sampling position, it takes the sample from within the centroid of the covered samples, hence the name centroid sampling.
ATI first introduced this feature in RADEON 9700, now it has become a standard feature in pixel shader 3.0 and is supported by NVIDIA’s GeForce 6 series.
FP32 minimum
Another topic that was hotly contested last year was NVIDIA’s decision to adopt FP32 whereas ATI relied on FP24 for its series of DX9 RADEON cards. In shader model 3.0, FP32 is now the required minimum precision for compliance, all others are considered partial precision. The end result is higher fidelity particularly when dealing with effects like high dynamic range lighting and fog.
On GeForce FX 6800, programmers can choose between the core’s native 32-bit mode or, if memory storage is a concern, 16-bit mode. Other formats are also supported, although not FP24.
Multiple Render Targets
Like centroid sampling, multiple render targets is another feature first introduced in RADEON 9700. Multiple render targets allows the pixel shader to save pixel data into buffers. This data can then be used to produce complex lighting effects after the geometry is rendered without having to run multiple passes through the scene.
Vertex processing with textures
The key addition in vertex shader 3.0 (besides the aforementioned aspects like dynamic branching and instruction count) is vertex textures. This allows vertex shaders to do texture lookups.
This feature makes displacement mapping possible in GeForce FX 6800. With this technique, texture data can be mapped onto vertices, providing more control over the shape of objects and surfaces. Previously developers used bump maps to add detail. Bump maps looked good, but with displacement maps, developers can create objects with ridges, peaks and valleys, and more detailed textures.
![NVIDIA GeForce 6800 Ultra Performance Preview [ Displacement mapping @ 575 x 214 ] > View Full-Size in another window.](images/08-s.jpg) Displacement mapping
|
|
High Dynamic Range lighting
NVIDIA has integrated high dynamic range lighting in its GeForce 6 series of GPUs. If you recall, previous designs were limited to just 256 levels for each color, with one of those 256 hues being black. This is particularly important in rendering a scene with wild lighting variations: an area where light from the sun can be very bright, while the shadows cast can be very dark. Without HDR, these variations can’t adequately be rendered, resulting in less lifelike images. Valve has demonstrated HDR in action in Half-Life 2.