Graphics Reference
In-Depth Information
See also
F We will be rendering more complex objects in the recipes Rendering a cube and
sphere and Loading a static mesh from a file in Chapter 3 , Rendering Meshes
F We will cover how to use the patch topologies in the recipe Tessellation of
primitives in Chapter 5 , Applying Hardware Tessellation
F We use a triangle-strip in Chapter 10 , Implementing Deferred Rendering ,
for implementing a screen-aligned quad renderer
Applying multisample anti-aliasing
In this recipe, we will enable multisample antialiasing (MSAA) to smoothen lines and edges.
Getting ready
We can apply this recipe to any of our recipes that are implemented with a class that
descends from D3DApplicationBase . Otherwise, this can be easily adapted to work
with the creation of any swap chain.
How to do it…
We can smooth the lines in our example by enabling multisampling:
1.
To do this, simply override the D3DApplicationBase.
CreateSwapChainDescription() method in our class as follows:
protected override SwapChainDescription1
CreateSwapChainDescription()
{
var description = base.CreateSwapChainDescription();
description.SampleDescription. Count = 4;
description.SampleDescription. Quality = 0;
return description;
}
2.
Compile and run the project ( F5 ), and you will now have antialiased edges.
 
Search WWH ::




Custom Search