Motivation MGB Agenda. Compression. Scalability. Scalability. Motivation. Tessellation Basics. DX11 Tessellation Pipeline

Similar documents
Next-Generation Rendering of Subdivision Surfaces. Developer Technology - NVIDIA

D3D11 Tessellation. Sarah Tariq NVIDIA

Approximating Subdivision Surfaces with Gregory Patches for Hardware Tessellation

Approximate Catmull-Clark Patches. Scott Schaefer Charles Loop

Efficient GPU Rendering of Subdivision Surfaces. Tim Foley,

Introduction to the Direct3D 11 Graphics Pipeline

Real-Time Hair Rendering on the GPU NVIDIA

Rendering Subdivision Surfaces Efficiently on the GPU

A Trip Down The (2011) Rasterization Pipeline

INF3320 Computer Graphics and Discrete Geometry

Real-Time Hair Simulation and Rendering on the GPU. Louis Bavoil

Lecture 4: Geometry Processing. Kayvon Fatahalian CMU : Graphics and Imaging Architectures (Fall 2011)

Per-Face Texture Mapping for Realtime Rendering. Realtime Ptex

DirectX10 Effects and Performance. Bryan Dudash

DirectX10 Effects. Sarah Tariq

From curves to surfaces. Parametric surfaces and solid modeling. Extrusions. Surfaces of revolution. So far have discussed spline curves in 2D

Beginning Direct3D Game Programming: 1. The History of Direct3D Graphics

Hardware Displacement Mapping

Direct Rendering of Trimmed NURBS Surfaces

How to Work on Next Gen Effects Now: Bridging DX10 and DX9. Guennadi Riguer ATI Technologies

Smooth Surfaces from 4-sided Facets

The Application Stage. The Game Loop, Resource Management and Renderer Design

Real - Time Rendering. Pipeline optimization. Michal Červeňanský Juraj Starinský

2.11 Particle Systems

Rendering Grass with Instancing in DirectX* 10

Curves & Surfaces. Last Time? Progressive Meshes. Selective Refinement. Adjacency Data Structures. Mesh Simplification. Mesh Simplification

Subdivision Surfaces. Homework 1: Last Time? Today. Bilinear Patch. Tensor Product. Spline Surfaces / Patches

Subdivision Surfaces. Homework 1: Questions on Homework? Last Time? Today. Tensor Product. What s an illegal edge collapse?

REAL-TIME SMOOTH SURFACE CONSTRUCTION ON THE GRAPHICS PROCESSING UNIT

Subdivision Surfaces. Homework 1: Questions/Comments?

Subdivision Surfaces

Computergrafik. Matthias Zwicker Universität Bern Herbst 2016

Deus Ex is in the Details

All the Polygons You Can Eat. Doug Rogers Developer Relations

Subdivision Surfaces

HW-Tessellation Basics

Real-Time Reyes Programmable Pipelines and Research Challenges

GCN Performance Tweets AMD Developer Relations

1. Introduction. 2. Parametrization of General CCSSs. 3. One-Piece through Interpolation. 4. One-Piece through Boolean Operations

Real-Time Reyes: Programmable Pipelines and Research Challenges. Anjul Patney University of California, Davis

A SIMD-efficient 14 Instruction Shader Program for High-Throughput Microtriangle Rasterization

CS GAME PROGRAMMING Question bank

Interactive Cloth Simulation. Matthias Wloka NVIDIA Corporation

Fast Tessellated Rendering on Fermi GF100. HPG 2010 Tim Purcell

Pump Up Your Pipeline

Computer Graphics CS 543 Lecture 13a Curves, Tesselation/Geometry Shaders & Level of Detail

Computergrafik. Matthias Zwicker. Herbst 2010

Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces

Cg 2.0. Mark Kilgard

Next-Generation Graphics on Larrabee. Tim Foley Intel Corp

Real - Time Rendering. Graphics pipeline. Michal Červeňanský Juraj Starinský

Advanced Graphics. Subdivision Surfaces. Alex Benton, University of Cambridge Supported in part by Google UK, Ltd

CS GPU and GPGPU Programming Lecture 2: Introduction; GPU Architecture 1. Markus Hadwiger, KAUST

Curves and Curved Surfaces. Adapted by FFL from CSE167: Computer Graphics Instructor: Ronen Barzel UCSD, Winter 2006

RSX Best Practices. Mark Cerny, Cerny Games David Simpson, Naughty Dog Jon Olick, Naughty Dog

CS770/870 Fall 2015 Advanced GLSL

Image Morphing. The user is responsible for defining correspondences between features Very popular technique. since Michael Jackson s clips

CS GPU and GPGPU Programming Lecture 7: Shading and Compute APIs 1. Markus Hadwiger, KAUST

Graphics Architectures and OpenCL. Michael Doggett Department of Computer Science Lund university

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

3D Modeling techniques

Many rendering scenarios, such as battle scenes or urban environments, require rendering of large numbers of autonomous characters.

Chapter IV Fragment Processing and Output Merging. 3D Graphics for Game Programming

Data passed from a source application is recognized by the destination application, yielding identical results. Data (Converted) compatibility

CMSC427 Advanced shading getting global illumination by local methods. Credit: slides Prof. Zwicker

Curved PN Triangles. Alex Vlachos Jörg Peters

B x. Interoperability Chart Version 2011 LEGEND. Perfect compatibility. Data (Converted) compatibility. Emulated (Bake) compatibility.

Programming for Real-Time Tessellation on GPU

Ray Casting of Trimmed NURBS Surfaces on the GPU

CPSC / Texture Mapping

The Graphics Pipeline

developer.nvidia.com The Source for GPU Programming

Spring 2010 Prof. Hyesoon Kim. AMD presentations from Richard Huddy and Michael Doggett

Information Coding / Computer Graphics, ISY, LiTH. Splines

The Need for Programmability

Craig Peeper Software Architect Windows Graphics & Gaming Technologies Microsoft Corporation

Approximating Catmull-Clark Subdivision Surfaces with Bicubic Patches

CSE528 Computer Graphics: Theory, Algorithms, and Applications

Physically-Based Modeling and Animation. University of Missouri at Columbia

Effective Back-Patch Culling for Hardware Tessellation

NVIDIA Developer Toolkit. March 2005

Real-Time Rendering (Echtzeitgraphik) Michael Wimmer

Graphics Hardware. Graphics Processing Unit (GPU) is a Subsidiary hardware. With massively multi-threaded many-core. Dedicated to 2D and 3D graphics

3/1/2010. Acceleration Techniques V1.2. Goals. Overview. Based on slides from Celine Loscos (v1.0)

GDC 2014 Barthold Lichtenbelt OpenGL ARB chair

Soft Particles. Tristan Lorach

Advancements in V-Ray RT GPU GTC 2015 Vladimir Koylazov Blagovest Taskov

Optimizing and Profiling Unity Games for Mobile Platforms. Angelo Theodorou Senior Software Engineer, MPG Gamelab 2014, 25 th -27 th June

Computer Graphics Curves and Surfaces. Matthias Teschner

Dynamic Feature-Adaptive Subdivision

Modeling. Simulating the Everyday World

Beyond Programmable Shading Keeping Many Cores Busy: Scheduling the Graphics Pipeline

GUERRILLA DEVELOP CONFERENCE JULY 07 BRIGHTON

Graphics Hardware. Instructor Stephen J. Guy

Comparing Reyes and OpenGL on a Stream Architecture

Efficient GPU Rendering of Subdivision Surfaces using Adaptive Quadtrees

Real-Time Universal Capture Facial Animation with GPU Skin Rendering

Higher Order Surfaces in OpenGL with NV_evaluators. Sébastien Dominé

12.3 Subdivision Surfaces. What is subdivision based representation? Subdivision Surfaces

A Real-time Micropolygon Rendering Pipeline. Kayvon Fatahalian Stanford University

Transcription:

MGB 005 Agenda Motivation Tessellation Basics DX Tessellation Pipeline Instanced Tessellation Instanced Tessellation in DX0 Displacement Mapping Content Creation Compression Motivation Save memory and bandwidth Memory is the main bottleneck to render highly detailed surfaces = + Level 8 Level 6 Level Level 6 Regular Triangle Mesh 6MB 59MB 6MB 9MB Displaced Subdivision Surface.9MB 7.5MB 0MB 8MB Scalability Continuous Level of Detail Scalability View Dependent Level of Detail 008 NVIDIA Corporation. All rights reserved.

MGB 005 Animation & Simulation Perform Expensive Computations at lower frequency: Realistic animation: blend shapes, morph targets, etc. Goal Enable unprecedented visuals: Highly detailed characters Realistic animation Physics, collision detection, soft body dynamics, etc. Mike Asquith, Valve Corporation 007 Tessellation Concept A new primitive called patch Patch is defined by a set of control points Tessellation Basics A new type of operation called refinement Generate a number of triangles from a patch Kenneth Scott, id Software 008 Transforming control points Animation can be performed at a lower rate Per-patch Operations LOD computation Transform control points to different basis Computes edge tessellation levels Transforming control points 008 NVIDIA Corporation. All rights reserved.

MGB 005 Generating Topology Evaluating Points Generate a set of (u,v)-points in the tessellation domain (0, ) (, ) (x, y, z) (u, v) (0, 0) (, 0) Evaluation Example: Catmull-Clark Subdivision Example: Catmull-Clark Subdivision Most popular scheme Based on B-Spline subdivision Evaluation through recursive refinement Add one new vertex for every face and every edge Example: Catmull-Clark Subdivision Example: Catmull-Clark Subdivision 6 6 n n 6 8 6 8 n n 7 n 008 NVIDIA Corporation. All rights reserved.

MGB 005 Catmull-Clark Subdivision Resulting mesh only approximates the limit subdivision surface Halstead et al show that it s possible to project the vertices to the limit surface Efficient, Fair Interpolation using Catmull-Clark Surfaces http://graphics.cs.uiuc.edu/~jch/cs97jch/halstead.pdf GPU Implementations Previous approaches on the GPU: Adaptive Tessellation of Subdivision Surfaces with Displacement Mapping, Michael Bunnell Recursive Geometry Shader refinement Require multiple passes Direct evaluation is preferred DX Tessellation Pipeline Tessellation Pipeline DirectD extends DirectD0 with support for programmable tessellation Two new shader stages: Hull Shader (HS) Domain Shader (DS) One fixed function stage: Tessellator (TS) Input Assembler Vertex Shader Hull Shader TS Domain Shader Geometry Shader Setup/Raster Input Assembler Vertex Shader New Patch primitive type Arbitrary vertex count (up to ) No implied topology Only supported primitive when tessellation is enabled Input Assembler Vertex Shader Hull Shader TS Domain Shader Transforms patch control points Usually used for: Animation (skinning, blend shapes) Physics simulation Allows more expensive animation at a lower frequency Input Assembler Vertex Shader Hull Shader TS Domain Shader Geometry Shader Geometry Shader Setup/Raster Setup/Raster 008 NVIDIA Corporation. All rights reserved.

MGB 005 Hull Shader (HS) Domain Shader (DS) One invocation per patch Parallelized explicitly. Code split to multiple threads by compiler One thread per output control point One thread per patch constant Vertex Shader HS input: [..] control points Hull Shader One invocation per generated vertex DS input: control points Tess factors Hull Shader TS DS input: U V {W} coordinates HS output: [..] control points Tessellation factors TS Domain Shader Domain Shader DS output: one vertex Surface Evaluation DS shader simply evaluates the bicubic Bezier patch and the corresponding tangent fields Special care has to be taken to obtain watertight results (prevent cracks) Instanced Tessellation in DX0 All computations need to be symmetric along the patch edges Instanced Tessellation GS is not for tessellation We can approximate the tessellation pipeline with DirectX 0 API GS outputs triangles serially Instancing can be used to replicate patches GS Thread Thread Thread Thread Thread n 008 NVIDIA Corporation. All rights reserved.

MGB 005 GS is not for tessellation Limited output size (maximum 0 scalars) is not always enough If each vertex is float s, you can only tessellate up to 6x6 Use instancing instead Render pre-tessellated patch with instancing Set the entire mesh as instance data V U Use instancing instead Render pre-tessellated patch with instance count equal to patch count in the mesh Use instancing instead Pre-tessellated patch represents results of tessellating every input patch Patch data Patch 0 Patch Patch Patch... Patch n Instancing x = Use instancing instead Input attributes limitation Compute refined vertex position in the vertex shader using chosen evaluation algorithm Maximum VS input size is not enough to fit all data required for point evaluation Instead all data can be stored in buffers bound as shader resources Use Load() instruction to fetch this data Instanced tessellation 008 NVIDIA Corporation. All rights reserved.

MGB 005 Using Load() Store mesh data in vertex buffers Bind these buffers as shader resources Load() and InstanceID Use SV_InstanceID as an index to the patch buffer Patch Control points Patch 0 Patch Patch Patch... Patch n SV_InstanceID Load( InstanceID ) 0 Tangents Patch 0 Patch Patch Patch... Patch n Bitangents Patch 0 Patch Patch Patch... Patch n Texture coordinates Compute vertex position... n Patch 0 Patch Patch Patch... Patch n Computing U and V coords Application integration Use SV_VertexID to compute U and V coordinates for the current vertex SV_VertexID Without tessellation With tessellation U = VertexID mod LoD V = VertexID div LoD Compute vertex position SV_VertexID and SV_InstanceID is the only VS input Bind_mesh_vertex_buffer(); Bind_VS(); Bind_PS(); Draw ( primitives_count ); Bind_mesh_vertex_buffer_SRV(); Bind_tessellation_VS(); Bind_PS(); Draw_instanced ( primitives_count, refined_vertex_count ); Results of refinement Results of refinement Before After Before After 008 NVIDIA Corporation. All rights reserved.

MGB 005 Tips Pack all data in float-buffers to use Load() more efficiently Displacement Mapping Use n x n tessellation and bitwise operations to compute U and V from Vertex_ID Integer division is slow! Kenneth Scott, id Software 008 Displacement Maps Consistent Normal Evaluation Crack-free displacement maps Control tangents along edges are not symmetric: Consistent normal evaluation Watertight texture sampling Watertight Texture Sampling Watertight Texture Sampling Texture seams cause holes in the mesh! Due to bilinear discontinuities Varying floating point precision on different regions of the texture map Seamless parameterizations remove bilinear artifacts, but do not solve floating point precision issues 008 NVIDIA Corporation. All rights reserved.

MGB 005 Watertight Texture Sampling Texture coordinate interpolation yields different result depending on location of the seam edges: Content Creation Production Pipeline Modeling Tools Base surface Sculpting Tools Detailed mesh Baker Tools Normal, displacement, occlusion, and other maps Modeling Performance depends on number of topology combinations Optimization guidelines: Eliminate triangles (Quad only meshes) Close holes (Avoid open meshes) Reduce number of extraordinary vertices Decrease number of patches to the minimum Try to create uniform, regular meshes Topology Optimization Topology Optimization 05 topology combinations topology combinations Mike Asquith, Valve Corporation 007 Mike Asquith, Valve Corporation 007 008 NVIDIA Corporation. All rights reserved.

MGB 005 Topology Optimization NVIDIA Mesh Processing Tool Topology visualization tool (nvanalyze) Maya plugin that highlights faces that damage mesh quality the most Successor of NVMeshMender and NVTriStrip but for subdivision surfaces: Reorder faces for consistent adjacencies Minimize topology combinations Pre-compute stencils for different approximation schemes Compute texture coordinates for watertight texture sampling Optimize vertex and face order for best performance And more! Sculpting Baker Tools Many tools available: Autodesk Mudbox Pixologic ZBrush modo, Silo, Blender, etc. Many options: xnormal Mudbox, ZMapper Melody, etc. PolyBump, etc. Two approaches Ray casting Dual parameterization Vector Displacements NVIDIA Baker Tool Native representation of most sculpting tools Uses dual parameterization to extract: Normal and displacement maps Only tool that generates vector displacements Occlusion maps, and more! No other tool supports custom base surfaces: Bezier ACC Gregory ACC Triangle meshes Mike Asquith, Valve Corporation 007 D Displacements Mike Asquith, Valve Corporation 007 D Displacements 008 NVIDIA Corporation. All rights reserved.

MGB 005 NVIDIA Baker Tool Thanks Uses optimized Montecarlo Raytracer Can be easily extended to support: Bent normals Spherical harmonic PRTs etc. Bay Raitt, Mike Asquith, Valve Corporation Kenneth Scott, id Software Full source code will be openly available Questions? calin@nvidia.com 008 NVIDIA Corporation. All rights reserved.