Geometry Shader:
There is a new stage in the DirectX 10 shader pipeline that is known as the Geometry Shader. We touched on this feature during our
GeForce 8800 GTX review, but it’s definitely worth expanding on. It’s an area where Microsoft has saved some precious CPU cycles, removing more of the CPU limitation shackles that developers have had to deal with in the past.
If you follow the logic that the Vertex Shader is able to manipulate vertex data values on vertices and the Pixel Shader calculates shader effects on a per-pixel basis, the Geometry Shader can process entire primitives (like triangles, lines, and vertices from the Vertex Shader) as inputs, along with being able to generate new or modify existing primitives and output them without the need for CPU intervention – the latter is known as data amplification.
In much the same way that the Geometry Shader can output more vertex data than it originally received, it can also output less vertex data than it received, too. Rather unsurprisingly, this is known as data minimisation. With that said, there are some limitations imposed on the amount of data the Geometry Shader can output – it’s limited to outputting 0-to-1024 vertices for each vertex it received during amplification/minimisation. The reason that Microsoft chose this range of values was because it was a reasonable compromise between the hardware costs and allowing useful levels of amplification and minimisation.
Some examples of Geometry Shader use: displacement mapping, single-pass cube map, and shadow volume generation The Geometry Shader is also adds the capability for displacement mapping with tessellation. Displacement mapping is an extension of normal mapping and allows the developer to create incredibly complex models with relatively simple vertex data. Typically, tessellation is used to manage data sets for polygons before dividing them up into suitable structures that are ready for rendering.
Although DirectX 9.0 hardware was capable of displacement mapping to some extent, the hardware didn’t have the capability to generate its own data. This meant that displacement mapping was very limited and there were no tessellation capabilities. With that said though, tessellation is a function that could potentially result in sharp performance degradation and Microsoft is cautioning developers, ensuring that they don’t go overboard on the tessellation front.
Along with displacement mapping, the Geometry Shader also has the ability to access adjacency information from the vertex data. Adjacency information is a collection of data from nearby vertices and how those vertices interact with each other. Using that data, it’s possible to uncork some very powerful algorithms that can be used for things like calculating realistic fur, shadow volumes, particle systems, procedural geometry and procedural detailing.
Stream Output:
Stream Output is another very important addition to the DirectX 10 pipeline – it essentially gives both the Vertex Shader and Geometry Shader a mid-pipeline memory write capability, allowing either Vertex or Geometry data to be passed straight into frame buffer memory. Along with that, the geometry generated in the Vertex and Geometry shaders can be redrawn with no CPU intervention.
When using Stream Output in conjunction with the Geometry Shader, it’s possible to process new graphical algorithms and also be more effective when it comes to physics or general calculations. Now that the GPU has the ability to generate, destroy and stream data, complex particles systems are possible without needing to worry about potential CPU overheads.
With Stream Output, the Geometry Shader can create particles and then amplify their presence by generating additional points before feeding them back into the Vertex Shader for animation. Once the animation sequence has started, the Geometry Shader can gradually fade the particle system before eventually deleting the shader effect completely.
Want to comment? Please log in.