infinite resolution textures - nvidia · infinite resolution textures july 24 2016 . distance...

41
Alexander Reshetov David Luebke Infinite Resolution Textures July 24 2016

Upload: others

Post on 25-Aug-2020

34 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

Alexander Reshetov David Luebke

Infinite Resolution Textures

July 24 2016

Page 2: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

DISTANCE

ASSETS

3D

Models

2D

Textures

Page 3: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

DISTANCE

ASSETS

3D

Models

2D

Textures

Page 4: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

DISTANCE

ASSETS

3D

Models

2D

Textures

Page 5: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

DISTANCE

ASSETS

3D

Models

2D

Textures

Page 6: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

DISTANCE

ASSETS

3D

Models

2D

Textures

Page 7: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

Before ’70s, all computer graphics was actually 2Dvector graphics. It was changed with a hardware-accelerated texture sampling. 2D graphics continueto proliferate in professional applications where itwas rendered in software.

It all changed in this century, when GPUs becomeuniversal enough to accelerate rendering ofsmooth curves, as proposed by Loop & Blinn.

Kilgard and Bolz introduced a two-step Stencil, thenCover approach, allowing efficient GPU renderingof general vector textures. Ganacim et al. wentfurther, employing an acceleration structure whosetraversal enabled rendering parts of the image.

Now it is a part of Adobe products and you couldalso download NV Path Rendering SDK which is apart of GameWorks.

One of the most interesting – and unusual – papersat HPG was one by Ellis et al. who described asystem that allows converting 3D scenes to vectorgraphics directly.

Page 8: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

still a problem

Page 9: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

still a problem

no random sampling

Kilgard & Bolz ≅ rasterization

Ganacim et al. ≅ tiled rasterization

Page 10: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

We aim at a more general approach seamlessly combining raster and vector representations.

Page 11: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

= raster image + silhouettes @ grid

float4 color = colorMap.SampleLevel(colorSampler, uv + , lod);

Page 12: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

IRT calculates duv at runtime by evaluating distances to the precomputed silhouette edges

instead offloat4 color = colorMap.SampleLevel(colorSampler, uv, lod);

usefloat4 color = colorMap.SampleLevel(colorSampler, uv + duv, lod);

Just by tempering duv, we can blend between

• IRT (@ closeups) and

• traditional textures at a distance

Page 13: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

https://www.pinterest.com/mizzchanty/facebook-quotespinned from sharenator.com

Page 14: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 15: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

↦IRT

Page 16: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

pinned from Scarlett Image

Page 17: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• SilmapsPradeep Sen

• BixelsJack Tumblin,Prasun Choudhury

• Vector Texture Maps Nicolas Ray et alCurvilinear Contours Stefan Gustavson

• PinchmapsMarco Tarini, Paolo Cignoni

• piecewise-linear edges• always interpolating colors on

the same side of the edge• with a custom interpolation

scheme

Page 18: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• SilmapsPradeep Sen

• BixelsJack Tumblin,Prasun Choudhury

• Vector Texture Maps Nicolas Ray et alCurvilinear Contours Stefan Gustavson

• PinchmapsMarco Tarini, Paolo Cignoni

• piecewise-linear edges• always interpolating colors on

the same side of the edge• with a custom interpolation

scheme

• decompose the texture plane into patches with straight boundary segments

• 10 patch functions

Page 19: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• SilmapsPradeep Sen

• BixelsJack Tumblin,Prasun Choudhury

• Vector Texture Maps Nicolas Ray et alCurvilinear Contours Stefan Gustavson

• PinchmapsMarco Tarini, Paolo Cignoni

• piecewise-linear edges• always interpolating colors on

the same side of the edge• with a custom interpolation

scheme

• decompose the texture plane into patches with straight boundary segments

• 10 patch functions

• implicit cubic polynomials for edges

• binary classification function defines a patch

Page 20: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• SilmapsPradeep Sen

• BixelsJack Tumblin,Prasun Choudhury

• Vector Texture Maps Nicolas Ray et alCurvilinear Contours Stefan Gustavson

• PinchmapsMarco Tarini, Paolo Cignoni

• piecewise-linear edges• always interpolating colors on

the same side of the edge• with a custom interpolation

scheme

• decompose the texture plane into patches with straight boundary segments

• 10 patch functions

• implicit cubic polynomials for edges

• binary classification function defines a patch

• a single quadratic silhouette edge per pinchmap texel

• use distance to the edge to compute new uv

Page 21: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 22: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 23: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

•Occam's Razorthe simpler one is usually better

• Einstein Principle“a scientific theory should be as simple as possible, but no simpler ”

Page 24: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

•…will beresampled from the original texture

•define an implicitquadratic curve,

• so all samples that have 4 pinchmap texels…

•pinchmap texels Issues

•No intersections

XX zero adjustment

for all ‘outside’ samples ⇒discontinuous duv

X

X

X

Page 25: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

…IRT uses more evolved processing…

…that is easier to explain

legs-isential quandaryby Roger N. Shepard

Page 26: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

First, we need curved edges

Page 27: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

2 2 pixels

Those edges are split into segments and we create truncated Voronoi regions. These regions are offset from the curve by a specified distance (of a few pixels). It can also be reduced for the open-ended segments and bifurcated edges.

Page 28: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

X

X

float4 color = colorMap.SampleLevel(colorSampler, uv + , lod);

At run time, we just move the sample away from the edge. The samples outside Voronoi regions ( ) will have zero duvX

Page 29: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

1. Temper* raster and vector modes just by scalingthe texture coordinate adjustment using pixel/texel ratio as

float pixratio = 0.5*length(fwidth(uv * texdim));duv *= min(1, 2 * (1 - pixratio)) / texdim;

2. Perform antialiasing in a single fetch by adjusting lod

3. Do whatever we like with it (like ‘soft landing’)

* having the elements mixed in satisfying proportions

http://www.merriam-webster.com/dictionary/tempered

Page 30: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

original trilinear

crisp edges smooth edgestweak duv

soft landing

Page 31: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 32: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

For each sample , we need

• scalar distance to the curve d

•offset vector ni

d

ni

Page 33: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

To compute ni

we could

• interpolate n12

•with weights |w12|Note:

signs of w12 can also be used to verify that the sample is in curve’s Voronoi region

nin1

n2

w1 w2

Page 34: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• ∃ numerous prior art approaches

• To compute it even faster, we propose two algorithms:

1. Implicit representation of cubic Bézier curves – using barycentric coordinates (savings: 6 terms instead of 10)(see also “Rendering Cubic Curves on a GPU with Floater's Implicitization” by Ron Pfeifle in JGT 2012)

2. A quotient of two multivariate polynomials over variables that we choose (to make life easier)≈ beefed up Phong interpolation in 1D

Page 35: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 36: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 37: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

• unless strict reproduction of Bézier curves is required,

√ it should be a method of choice

√ since it is unconditionally stable; there are otherinteresting possibilities as well

Page 38: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS
Page 39: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

↤ IRTraster ↦

good

Page 40: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS

↤ IRTraster ↦

bad

Page 41: Infinite Resolution Textures - NVIDIA · Infinite Resolution Textures July 24 2016 . DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS 3D Models 2D Textures. DISTANCE ASSETS