table of contents
Shader Model 5 introduces several new stages into the graphics and programmable pipeline, as seen in the diagram below.
This stage is responsible for preparing geometry input to be available for Vertex Shader.
First geometry needs to provide layouts, which indicates how vertices are arranged into memory (format,size,semantic).
Then we create an Input Layout to match Vertex Shader Input and Geometry input. Input Assembler will then fetch data accordingly to send it to vertex shader.
As in previous DirectX versions, Vertex Shader allows to modify vertices.
Please note two things:
This stage is the first part for tessellation.
We receive data from Vertex Shader as control points (Patches), that we can modify in the hull shader.
Also we need to provide a Hull Shader Constant function which will provide tessellation factors (how much we tessellate input geometry).
This stage is not programmable, the graphics card tesselator will subdivide geometry according to control points and tessellation factors.
This is when we finally process tessellated data.
Depending on the type of tessellation we asked for, we receive different type of data, but all in the form of barycentric coordinates.
We can then process every new generate vertex the way we want (displacement for example)
Geometry shader allows to completely modify geometry.
Instead of receiving vertices like in other stages here we receive a fully assembled primitive (line/triangle point), and from there we can any of those types (only one of those types, but we can generate several or none of those).
This stage is optional and can happen either after Vertex/Domain or Geometry stage.
Stream Output allows to directly output the modified vertices/primitives into a new Buffer, which can be reused later (it's a bit like render to geometry)
This is controlled trough rasterizer state. Rasterization takes the primitives and prepare them for pixel shader (culling, clipping, depth test).
This works the same way as before, we can process every pixel that makes it on the screen.
Please also note in Shader Model 5 we can also have pixel shaders able to write into buffers as well.
VVVV Pipeline has been adapted in some ways to works with new DirectX 11 features.
Instead of having the DirectX9 Mesh, which doesn't exist anymore, it has been replaced by custom made and more flexible. Index buffers are not mandatory anymore and geometry topology can be any allowed by the pipeline (which means you can send point/line to a shader).
Additionally now we attach a Drawer to geometry. By default we attach a "default drawer", which will draw the object the same way it used to be in DirectX 9 version.
This drawer can be modified (this does NOT modify the geometry), to be able to use advanced features (Instancing, Indirect drawing, Per Vertex...)
Layer system has also be modified. Another page will provide more details about it, but to summarize.
Shader node works also in different way, and is processed as follows:
anonymous user login