AMD has released 6 new **Direct3D** demos with complete source code and binaries. There are 3 Direct3D 10 demos and 3 Direct3D 11 demos.

Actually, all these demos are already included in Microsoft DirectX 11 SDK 😉

The first funny thing is that all these demos are linked to D3D 9:

To get ride of this error, just install the latest DirectX runtimes and that should be enough.

All these demos are available HERE.

I tested all demos under Windows 7 64-bit with MSI’s R5770 Hawk (a quick test of this nice product will be available shortly).

## Direct3D 10 Demos

### Depth of Field

This sample presents a technique for combining multi-sample anti-aliasing (MSAA) with a depth-of-field effect. It utilizes Direct3D 10.1 APIs and hardware to retrieve depth values from a multi-sampled depth buffer.

The depth of field demo didn’t convince me. I wasn’t be able to get a realist DoF effect.

### High Definition Ambient Occlusion

This sample presents an innovative technique for achieving High Definition Ambient Occlusion (HDAO). It utilizes Direct3D 10.1 APIs and hardware, making use of the new shader model 4.1 gather4 instruction, to greatly accelerate the performance of this technique.

HDAO disabled

HDAO enabled

HDAO buffer visualization

### Transparency Anti-Aliasing

This sample presents a technique for achieving MSAA quality rendering for primitives that require transparency. It utilizes Direct3D 10.1 APIs and hardware to make use of the new fixed MSAA sample patterns, and the export of the coverage mask from the pixel shader.

Transparency Anti-Aliasing global view

Transparency Anti-Aliasing – Technique: Alpha Test

Transparency Anti-Aliasing – Technique: Alpha to coverage

Technique: Transparency Anti-Aliasing

## Direct3D 11 Demos

### Detail Tessellation

This sample demonstrates the use of detail tessellation for improving the quality of material surfaces in real-time rendering applications. Detail Tessellation is typically a faster-performance and higher-quality alternative to per-pixel height map-tracing techniques such as Parallax Occlusion Mapping.

Detail Tessellation global view

Detail Tessellation – Tessellation factor 1.0

Detail Tessellation – Tessellation factor 5.0

Detail Tessellation – Tessellation factor 11.0

The developer has limited the max tessellation factor to 11.0 (it’s hardcoded in the source code – const float MAX_TESSELLATION_FACTOR = 11.0f;). I wonder why if the new programmable tessellation unit is used (I hope so).

From the doc that comes with the demo:

In its simplest form, detail tessellation is a combination of tessellation combined with displacement mapping. The Vertex Shader calculates position and tangent space light/view vectors before passing them to the Hull Shader along with texture coordinates. The Hull Shader triggers “pass-through” mode by outputting three control points that are a direct copy of the input data (position, texture coordinates and light/view vectors), while the HS Patch Constant function applies a uniform tessellation factor to triangle edges and its inside.

The new vertices generated by the fixed-function tessellatorare input to the Domain Shader, which calculates their position and displace them using the height map provided. All lighting is performed in the pixel shader using the interpolated tangent space light vector (and view vector if specular is enabled) and normal.

From this recent article, there should be two tessellation engines in Radeon HD 5000: the old (fixed – max factor limited to 15.0) and the new (programmable – max factor limited to 64.0). There’s something I missed somewhere…

### PN-Triangles

This sample presents a technique for achieving smooth surfaces from the position and normal data of a low density mesh. It utilizes Direct3D 11 APIs and hardware to make use of the new tessellation stages of the pipeline.

PN-Triangles – Tessellation – overview

PN-Triangles – Tessellation factor=1.0

PN-Triangles – Tessellation factor=7.0

PN-Triangles – Tessellation factor=15.0

PN-Triangles – Tessellation factor=19.0

Did you notice the max tessellation factor of 19.0 ? This time the demo uses the new tessellation engine included in HD 5000 graphics cards. But in the doc that comes with the demo, the developer talks about a

**Fixed Function Tessellator**:

Hull Shader

The hull shader stage performs the usual pass through steps that you’d expect, such as, tessellation factors and input patch control points. In addition to this the shader generates the 7 cubic positional control points, and the 3 quadratic normal control points using the algorithm described in the whitepaper as above. Also this shader stage optionally handles distance based adaptive tessellation.

Fixed Function Tessellator

The fixed function HW tessellator stage produces new geometry based on the input tessellation factors, as barycentric coordinates in the patch domain.Domain Shader

The domain shader stage uses the positional and normal control points to weight the barycentric coordinates of the generated geometry, using the algorithm described in the whitepaper as above.

**My conclusion about tessellation**: The Radeon HD 5000 has two physsically separated tessellation units: the old one (max factor of 15.0 – Radeon HD 2000, 3000, 4000 and 5000) and the new one (max factor of 64.0 – Radeon HD 5000 only). In both cases, the hardware tessellator (or tessellation stage) is a fixed function. The difference between both tessellation units is that in HD 5000 the tessellation stage is between new programmable stages (hull and domain) whereas in HD 2000, 3000 and 4000 the tessellation stage is alone.

### Contact Hardening Shadows

This sample presents a Direct3D 11/ Shader Model 5.0 accelerated technique that uses non-stationary/dynamic weight matrices for unique per-sample filter weights (these don’t necessarily represent a separable filter) for a contact hardening shadow effect. The effect is comparable to PCSS (Percentage-Closer Soft Shadows [Fer05]) but does not suffer from banding or noise artifacts.

no offense – these demos were long ago. I’ve tried HDAO 10.1 probably three or four months ago and on my system (Radeon 4850 over up to 720 core) it shows about 120 FPS with DX10.1 off and about 240FPS with DX10.1 on

but anyway it’s great works thanks!

btw the font is really big 😀

The Fixed Function Tesselator is refering to the block between the programmble hull and domain shaders.

The old tesselator didn’t have hull/domain shaders.

Here is a detailed explanation of DX11 tesselation:

http://msdn.microsoft.com/en-us/library/ee417841(VS.85).aspx

Basically:

Hull Shader – takes a patch and computes the tessellation factor for tessellator and user-defined input for domain shader. Use this to compute LoD based on distance from camera etc.

Fixed Function Tessellator – takes the tesselation factor (1 – 64) and tesselates the patch based on 4 different modes.

Domain Shader – called once per tessellated vertex, also receives the coordinates of vertex on patch (eg. texture coordinates). Can do whatever it wants to vertices. Use this for displacement mapping.

I look forward to GL_EXT_tessellator!

Thanks Leith for the link. That confirms what I said: the tessellation stage is a fixed function on all Radeon. The only difference is that on HD 5000 series the max tessellation factor is X64.0 whereas on previous gen this factor is X15.0.

NVIDIA’s Developer Technology Head Ashu Rege is coming to Bangalore this February at India Game Developer Summit (gamedevelopersummit dot com) to speak on GPU Computing and Stereo 3D.