Presentation is loading. Please wait.

Presentation is loading. Please wait.

UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques.

Similar presentations


Presentation on theme: "UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques."— Presentation transcript:

1 UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques

2 Goals 1. Talk about some visual quality topics and techinques

3 Antialiasing  Reducing pixelation on sharp, oblique edges  Three basic methods:  Full-screen post-process filters (basically blurring the image) Rarely satisfactory  Edge antialiasing Render wireframe, “fuzzing” or blending the edges only  Coverage-based antialiasing [D3DPRESENT_PARAMETERS::MultiSampleType] Most popular nowadays Coverage: maps parts of the pixel “covered” by the triangle Multiple techniques: MSAA, SSAA, CSAA, A-buffer

4 Antialiasing quirks  Full-screen filters: the only comprehensive method  Edge and coverage AA only improve triangle edges  Most bang for the buck, anyway  Edge AA requires rendering the meshes twice  Twice the vertex shader cost  Coverage AA requires serious changes in rasterizer  Triangle touches pixel if it touches a single sample  Turning on AA can reveal mistakes  MSAA: center of the pixel might be outside of the triangle! Use centroid if appropriate, but use it responsibly [semantic: TEXCOORD0_centroid]  Use responsibly: there is always a cost

5 Multiple Render Targets (MRTs)  Output more than one color from pixel shader  COLOR1, COLOR2, COLOR3  Four render targets can hold 16 components  SetRenderTarget(DWORD RenderTargetIndex, …)  Use components for any imaginable purpose  Depth (for depth-of-field focusing)  Velocity (for motion-blur)  Mesh index (for some shadowing techniques)

6 Deferred rendering  Implements per-pixel lighting by design  Same lighting model over the entire scene  Only opaque geometry Transparent triangles must be handled entirely separately  Render all geometry first  Using fast vertex and pixel shaders  Multiple render targets to hold all the information  Then apply lighting and shadowing as post-process

7 Deferred rendering implementation  Three steps:  Step 1: Render (encode) geometry into render target(s) Depth, normal, material parameters  Step2: Apply lights in one or more full-screen passes Point lights are cheaper (only cover portions of the screen) Shadows, too – using shadow maps or volumes  Step 3: Render transparent stuff using regular methods  Doesn’t work well with coverage or edge AA

8 Multi-tap filters  Bilinear filter is a kind of multi-tap filter  Fetch multiple times around the texture coordinates for (int y = -2; y <= 2; ++y) for (int x = -2; x <= 2; ++x) Accum = Kernel(x, y) * tex2D(Sampler, coords + float2(x, y));  That’s a 25-tap filter (25 calls to tex2D)  The filter kernel determines the type of filter  Gaussian bell, box filter, etc  Most symmetric filters can be done in 2 passes  Turn a 25-tap filter into two 5-tap filters

9 Dependent reads from scene  Render scene into a texture  Create a texture that contains displacement vectors  Use a 2-component signed texture format, like D3DFMT_V8U8  In shader, fetch displacement vectors  Use the vectors to fetch again, from scene texture  Many uses:  Magnifying glass, imperfect windows, heat shimmers, water wobble, raindrops on the camera, refraction…


Download ppt "UW EXTENSION CERTIFICATE PROGRAM IN GAME DEVELOPMENT 2 ND QUARTER: ADVANCED GRAPHICS Visual quality techniques."

Similar presentations


Ads by Google