71
1 Winter 2011 Beyond Programmable Shading A Trip Down The (2011) Rasterization Pipeline Aaron Lefohn - Intel / University of Washington Mike Houston AMD / Stanford

A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

1Winter 2011 – Beyond Programmable Shading

A Trip Down The (2011) Rasterization Pipeline

Aaron Lefohn - Intel / University of Washington

Mike Houston – AMD / Stanford

Page 2: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

2Winter 2011 – Beyond Programmable Shading

This talk

• Overview of the real-time rendering pipeline available in ~2011 corresponding to graphics APIs:

– DirectX 11

– OpenGL 4.x

• Discuss

– What changes from DX9 to DX11

– Key uses of these new features

Page 3: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

3Winter 2011 – Beyond Programmable Shading

General Rasterization Pipeline

• Geometry processing:

– Transforms geometry, generates more geometry, computes per-vertex attributes

• Rasterization:

– Sets up a primitive (e.g., triangle), and finds all samples inside the primitive

• Pixel processing

– Interpolates vertex attributes, and computes pixel color

ApplicationGeometryProcessing

RasterizationPixelProcessing

Graphics Processing (Unit)

Slide by Tomas Akenine-Möller

Page 4: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

4Winter 2011 – Beyond Programmable Shading

DX10

Page 5: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

5Winter 2011 – Beyond Programmable Shading

Remember DX9?

Vertex Shader

Input Assembler

Rasterization

Pixel Shader

Output Merger

Index buffer

Vertex Buffer

Texture

Depth/Stencil

Render Target

Memory

Slide by Tomas Akenine-Möller

Page 6: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

6Winter 2011 – Beyond Programmable Shading

DX10

Vertex Shader

Input Assembler

Geometry Shader

Rasterization

Pixel Shader

Output Merger

Index buffer

Vertex Buffer

Texture

Texture

Texture

Depth/Stencil

Render Target

Stream Output

Memory

Slide by Tomas Akenine-Möller

Page 7: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

7Winter 2011 – Beyond Programmable Shading

DX10 Increased Shading Capability

• In addition to adding a new pipeline stage, DX10 greatly increased programmability of vertex and fragment stages

– All shader stages have same limitations (unified shading cores)

– Pixel/fragment shaders “grow up”

– Instruction limits, register limits, flow control, etc.

– Well-specified floating point precision requirements

– Write up to 8, fp32x4 outputs per fragment

Page 8: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

8Winter 2011 – Beyond Programmable Shading

MemoryGeometry Shader

Geometry Shader Texture

Stream Output

• Input

– Vertices of a full primitive (1 for point, 2 for line, 3 for triangle)

– Vertices of edge-adjacent primitives

– Primitive ID - allows to fetch or compute per-face data

• Output

– Point-, line- or triangle strip

– Sent to rasterizer or vertex buffer in memory

– Variable output size

– makes it hard to parallelize

Slide by Tomas Akenine-Möller

Page 9: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

9Winter 2011 – Beyond Programmable Shading

Geometry Shader

• Usage examples

– Point Sprite Tessellation: The shader takes in a single vertex and generates four vertexes (two output triangles) that represent the four corners of a quad

– Wide Line Tessellation: The shader receives two line vertexes and generates four vertexes for a quad that represents a widened line.

– Other uses: generation of shadow volumes and cube maps

Geometry Shader

Geometry Shader

Slide by Tomas Akenine-Möller

Page 10: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

10Winter 2011 – Beyond Programmable Shading

Point Sprites and Wide Lines

• Smoke represented by point sprites

– Points converted to quads in geometry shader

• Hair represented by “wide lines”

– Lines converted to quads in geometry shader

Images from “Adaptive Volumetric Shadow Maps,” EGSR 2010, Salvi et al.

Scene courtesy of Valve Corporation

Page 11: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

11Winter 2011 – Beyond Programmable Shading

Render-To-Volume

Geometry Shader

Slide by Sam Glassenberg

Page 12: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

12Winter 2011 – Beyond Programmable Shading

Single Pass Render-To-Cubemap

x

yz

uv

Geometry Shader

Slide by Sam Glassenberg

Page 13: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

13Winter 2011 – Beyond Programmable Shading

Direct3D 10.1 Features

Full anti-aliasing control

• Application control over:

– Multi-sample AA (smooth edges)

or

– Super-sample AA (smooth edges and interior)

– Selecting sample patterns

– Pixel coverage mask

– High-quality vegetation, motion blur, particles…

• Minimum of 4 samples/pixel required

Slide by Sam Glassenberg

Page 14: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

14Winter 2011 – Beyond Programmable Shading

DX11

Page 15: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

15Winter 2011 – Beyond Programmable Shading

Remember DX10?

Vertex Shader

Input Assembler

Geometry Shader

Rasterization

Pixel Shader

Output Merger

Index buffer

Vertex Buffer

Texture

Texture

Texture

Depth/Stencil

Render Target

Stream Output

Memory

Slide by Tomas Akenine-Möller

Page 16: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

16Winter 2011 – Beyond Programmable Shading

DX11

Vertex Shader

Input Assembler

Hull Shader

Tessellation

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

Index buffer

Vertex Buffer

Texture

Texture

Arbitrary memory region

Depth/Stencil

Render Target

Stream Output

Patch info

Memory

Texture

Slide by Tomas Akenine-Möller

Page 17: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

17Winter 2011 – Beyond Programmable Shading

DX11 Tessellation example:Displaced subdivision surfaces

Slide by Tomas Akenine-Möller

Page 18: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

18Winter 2011 – Beyond Programmable Shading

DX11 - new stages for tessellation

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• New Programmable stages

– Hull Shader

– Domain Shader

• Fixed Function Stage

– Tessellator

Slide by Tomas Akenine-Möller

Page 19: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

19Winter 2011 – Beyond Programmable Shading

Tessellation - Input Assembler

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• New Patch primitive type

• Outputs vertices to vertex shader and patch control points to hull shader

Slide by Tomas Akenine-Möller

Page 20: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

20Winter 2011 – Beyond Programmable Shading

Tessellation - Vertex Shader

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• One invocation per control point

• For example, skin/animate the control points

Slide by Tomas Akenine-Möller

Page 21: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

21Winter 2011 – Beyond Programmable Shading

Hull Shader

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• HS works on an entire patch

• HS can access all the input and output control points

• Typical functions

– Assigns edge LODs

– Change the basis

Slide by Tomas Akenine-Möller

Page 22: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

22Winter 2011 – Beyond Programmable Shading

Tessellator

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• TS inputs are edge LODs and additional knob values

– Inner tessellation + tess mode

• TS generates (u,v) coordinates and connectivity information

• The (u,v) coordinates are in the domain [0,1]

– Calculated using fixed point math to ensure water tight edges

Slide by Tomas Akenine-Möller

Page 23: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

23Winter 2011 – Beyond Programmable Shading

Domain Shader

Vertex Shader

Input Assembler

Hull Shader

Tessellator

Domain Shader

Geometry Shader

Rasterization

Pixel Shader

Output Merger

• One domain shader invocation per (u,v) pair

• DS gets (u,v) from tessellator and control points from HS

• Computes a real 3D point from a domain location (u,v)

– For example, displace the point using displacement map

– Project the point

• Calculate auxiliary per vertex data

– Texture coordinates

– Tangent space vectors

Slide by Tomas Akenine-Möller

Page 24: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

24Winter 2011 – Beyond Programmable Shading

An example through thetessellation pipeline

Slide by Tomas Akenine-Möller

Page 25: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

25Winter 2011 – Beyond Programmable Shading

DX11 Tessellation Examples:Codemasters DiRT2

Slides from “DiRT2 DirectX 11 Technology“, Thomas and Story, GDC 2010

Page 26: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

26Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 27: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

27Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 28: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

28Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 29: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

29Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 30: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

30Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 31: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

31Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 32: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

32Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 33: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

33Winter 2011 – Beyond Programmable Shading

PN-Triangles

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 34: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

34Winter 2011 – Beyond Programmable Shading

PN-Triangles

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 35: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

35Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 36: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

36Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 37: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

37Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 38: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

38Winter 2011 – Beyond Programmable Shading

PN-Triangles

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 39: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

39Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 40: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

40Winter 2011 – Beyond Programmable Shading

Original Mesh

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 41: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

41Winter 2011 – Beyond Programmable Shading

PN-Triangles

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 42: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

42Winter 2011 – Beyond Programmable Shading

PN-Triangles + Displacements

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 43: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

43Winter 2011 – Beyond Programmable Shading

Displacement Mapped Surface

Slide from GDC 2010 Presentation,“DiRT2 DirectX11 Technology, Tomas Thomas, CodemastersJon Story, AMD

Page 44: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

44Winter 2011 – Beyond Programmable Shading

Displacement Mapping: OFF

Page 45: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

45Winter 2011 – Beyond Programmable Shading

Displacement Mapping: ON

Page 46: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

46Winter 2011 – Beyond Programmable Shading

DX11 Pixel Shader

Page 47: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

47Winter 2011 – Beyond Programmable Shading

DirectX11 Pixel Shader Changes

• Read and write anywhere in memory

– “Unordered access views” (UAVs)

– Pixel shaders can now write somewhere other than pixel position (!)

• Atomic read-modify-write operations

– add, subtract, min, max, compare-exchange, …, or, xor

Page 48: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

48Winter 2011 – Beyond Programmable Shading

DX11 Pixel Shader Implications

• Pixel shaders can build data structures other than images

– Scatter/gather and atomic operations

– “Render to user-defined data structure”

• Limitations

– Atomic RMW operations only on 32-bit integers (no atomic struct RMW)

– No critical sections / mutexes

Page 49: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

49Winter 2011 – Beyond Programmable Shading

Pixel Shader 5 ExampleReal-time A-Buffer Generation

Page 50: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

50Winter 2011 – Beyond Programmable Shading

Order Independent Transparency I

“Real-Time Concurrent Linked List Construction on the GPU,”

Yang et al., EGSR 2010

Page 51: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

51Winter 2011 – Beyond Programmable Shading

The Problem with Transparency

Sorting is hard!

With Sorting

No Sorting

Skeleton hidden

Arm appears in front of body

“Real-Time Concurrent Linked List Construction on the GPU,”

Yang et al., EGSR 2010

Page 52: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

52Winter 2011 – Beyond Programmable Shading

Solution: Sort Fragments Per Pixel

• Create A-Buffer using DX11 rendering pipeline

– “The A -buffer, an antialiased hidden surface method,” Carpenter, SIGGRAPH 1984

• Render pass 1

– Store linked list of fragments per-pixel in 2 separate buffers

– UAV 1: Storage for all [RGBA,Z,next] values from all fragments

– UAV 2: “Image-sized” storage for a head pointer per pixel position

• Render pass 2

– Full-screen pass that sorts and blends fragments to create pixel color

Page 53: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

53Winter 2011 – Beyond Programmable Shading

DX11 A-Buffer

• Pros

– Correct solution to order-independent transparency

– Runs at interactive rates on current hardware

• Cons

– A-buffers use unbounded amount of memory

– Performance variable depending on order fragments stored in memory

Page 54: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

54Winter 2011 – Beyond Programmable Shading

DX11 ComputeShader / DirectCompute

• “Out-of-pipeline” new programming model for “general” computation, designed to interact tightly with the graphics API (language is HLSL)

• Similar in semantics and capability to OpenCL and CUDA

• We will discuss DirectCompute later in the course

Page 55: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

55Winter 2011 – Beyond Programmable Shading

Summary

• Jump from DX9 to DX11 (OGL2 to OGL4)

– Adds 4 new pipeline stages (hull, tessellator, domain, geometry)

– Makes shader stages far more general compute engines

– Enables users to render to user-defined data structures (and defer visibility determination)

– Greatly relaxes memory model of shaders (especially scatter/atomics)

– Adds DirectCompute, which begins to blur lines between pipeline and user-defined parallel programs

– Is still new wrt adoption in the game world (but a number of DX11 titles shipping)

• Get to know DX11/GL4 well---you can do *a lot* within the confines of the rendering pipeline

Page 56: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

56Winter 2011 – Beyond Programmable Shading

Backup

Page 57: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

57Winter 2011 – Beyond Programmable Shading

Geometry Shader Example

Shadow volume generation

Slide by Sam Glassenberg

Page 58: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

58Winter 2011 – Beyond Programmable Shading

Geometry Shader Example

Generalized displacement maps

• Displacement Mapping (Direct3D 10)

Slide by Sam Glassenberg

Page 59: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

59Winter 2011 – Beyond Programmable Shading

Page 60: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

60Winter 2011 – Beyond Programmable Shading

New DX10 and DX10.1 features heavily used for shadow techniques in production games

Examples of some from “High Quality Direct3D 10.0 & 10.1 Accelerated Techniques“, Story and Gruen, GDC 2009

Page 61: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

61Winter 2011 – Beyond Programmable Shading

HDAO Code SampleHDAO Buffer (depth only)– 40 Gathers

– No filtering needed

HDAO On (depth only)HDAO Off

Page 62: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

62Winter 2011 – Beyond Programmable Shading

HDAO Buffer (depth & normals)- 80 Gathers (could use alot less)- No filtering needed

HDAO On (depth only)HDAO On (depth & normals)

Page 63: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

63Winter 2011 – Beyond Programmable Shading

Tom Clancy‘s HAWXPublisher: UbisoftDeveloper: Ubisoft Romania

Page 64: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

64Winter 2011 – Beyond Programmable Shading

StormrisePublisher: SEGADeveloper: The Creative Assembly Australia

Page 65: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

65Winter 2011 – Beyond Programmable Shading

BattleForgePublisher: EADeveloper: EA Phenomic

Page 66: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

66Winter 2011 – Beyond Programmable Shading

From DICE’s Frostbite Engine:Uniform Shadow Filtering

Page 67: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

67Winter 2011 – Beyond Programmable Shading

From DICE’s Frostbite Engine:Unique Weight Shadow Filtering

Page 68: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

68Winter 2011 – Beyond Programmable Shading

From DICE‟s Frostbite Engine: Standard 2x2 Shadow Filtering

Page 69: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

69Winter 2011 – Beyond Programmable Shading

From DICE‟s Frostbite Engine: 5x5 Unique Weight Filtering

Page 70: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

70Winter 2011 – Beyond Programmable Shading

Tom Clancy„s HAWXPublisher: UbisoftDeveloper: Ubisoft RomaniaBlurred VSM

Page 71: A Trip Down the 2001 Rasterization Pipeline...–Scatter/gather and atomic operations –“Render to user-defined data structure” • Limitations –Atomic RMW operations only on

71Winter 2011 – Beyond Programmable Shading

Tom Clancy„s HAWXPublisher: UbisoftDeveloper: Ubisoft RomaniaUnique Weight Shadows