nv_path_rendering

10
An Introduction to NV_path_rendering Mark J. Kilgard NVIDIA Corporation June 8, 2011

Upload: nigel-stewart

Post on 17-May-2015

303 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: NV_path_rendering

An Introduction toNV_path_rendering

Mark J. KilgardNVIDIA Corporation

June 8, 2011

Page 2: NV_path_rendering

Purpose of this Presentation

Overview of GPU-accelerated path renderingUsing “stencil, then cover”

Explain and demonstrate the NV_path_rendering APIAimed primarily at programmers

Introduce you to the content of NVIDIA’s NVpr SDK

Page 3: NV_path_rendering

What is path rendering?A rendering approach

Resolution-independent two-dimensional graphicsOcclusion & transparency depend on rendering order

So called “Painter’s Algorithm”Basic primitive is a path to be filled or stroked

Path is a sequence of path commandsCommands are

– moveto, lineto, curveto, arcto, closepath, etc.

StandardsContent: PostScript, PDF, TrueType fonts, Flash, Scalable Vector Graphics (SVG), HTML5 Canvas, Silverlight, Office drawingsAPIs: Apple Quartz 2D, KhronosOpenVG, Microsoft Direct2D, Cairo, Skia, Qt::QPainter, Anti-grain Graphics,

Page 4: NV_path_rendering

Path Filling vs. Stroking

just filling just stroking

filling + stroke =intended content

Page 5: NV_path_rendering

Handling Common Path RenderingFunctionality: Filtering

GPUs are highly efficient at image filtering

Fast texture mappingMipmappingAnisotropic filteringWrap modes

CPUs aren't really

� GPU

� Qt

� Cairo

Moiréartifacts

Page 6: NV_path_rendering

Projective Path Rendering SupportCompared

� GPUflawless

� Skiayes, but bugs

� Cairounsupported

� Qtunsupported

correct

wrong

correct

correct

unsupported

unsupported

unsupported

unsupported

Page 7: NV_path_rendering

Rendering Paths Clipped toSome Other Arbitrary Path

Example clipping the PostScript tiger to a heart constructed from two cubic Bezier curves

unclipped tiger tiger with pink background clipped to heart

Page 8: NV_path_rendering

Benchmark Scenes

Tiger Dragon Round Dogs Butterfly Spikes

Coat of Arms Cowboy Buonaparte Embrace Japanese Strokes

Page 9: NV_path_rendering

Learning NV_path_rendering

White paper + source code available“Getting Started with NV_path_rendering”

ExplainsPath specification“Stencil, then Cover” API usageInstanced rendering for text and glyphs

Page 10: NV_path_rendering

Feedback and Contacts

We need your feedbackIssues?Questions?

Contact us by [email protected]