higher order surfaces - nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/surfaces.pdf ·...
TRANSCRIPT
![Page 1: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/1.jpg)
Higher Order SurfacesHigher Order SurfacesHenry Moreton
![Page 2: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/2.jpg)
Why surfaces?Higher order primitives
Animation
Level of Detail
Bandwidth
Filtering
![Page 3: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/3.jpg)
The “Surfaces” RoadmapPolynomial Surfaces
B-Spline, BézierTensor product, Triangle
Subdivision SurfacesCatmull-Clark, Loop
Displacement Mapping
Massive Levels of Geometric Detail
Geo
met
ricCo
mpl
exity
![Page 4: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/4.jpg)
CPU
CPU
Graphics Processor
Graphics Processor
PreviousGeneration
1 Frame(1/60 sec)
1 Frame(1/60 sec)
AI,Physics,Game Play
Transform& Lighting Rendering
T&L Created A Major Content Shift...
Current Generation
![Page 5: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/5.jpg)
A New Band of Computation
CPU Graphics Processor
AI,Physics,Game Play
Transform& Lighting RenderingGeometry
Processing
![Page 6: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/6.jpg)
...Another Order of Magnitude
❋image courtesy of Pixar Animation Studios
![Page 7: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/7.jpg)
The GeForce3 Graphics Pipelinecurved
surfaces
vertexshaders
setuprasterizer
tex-addrops
textureblending
frame-bufferantialiasing
shadowtextures
per-vertex geometry & shading programs
per-pixel shading
![Page 8: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/8.jpg)
Historical Solution e.g. OpenGL Evaluators
Square - tensor product patches
Grid - just specify rows and columns
Integer - number of segments
Share - use T&L hardware
10
20
![Page 9: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/9.jpg)
Triangular Patches are Necessary
3DStudioMax
Patch outlines
Hardware emulation
SquareGridIntegerShare
![Page 10: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/10.jpg)
Four Independent Tessellation Factors
4
6 5
9
4
9
56
SquareGridIntegerShare
![Page 11: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/11.jpg)
Generalized Tessellation isImportant
SquareGridIntegerShare
![Page 12: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/12.jpg)
Fractional Number of Segments
6.0
6.25
6.5
6.75
7.0
SquareGridIntegerShare
![Page 13: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/13.jpg)
LOD Morphing Suppresses Visual Artifacts
SquareGridIntegerShare
![Page 14: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/14.jpg)
Multiple Tessellation StylesOptimal TessellationMorphing Tessellation
SquareGridIntegerShare
![Page 15: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/15.jpg)
Dedicated Hardware
Doesn’t slow down transform
Performance matched pipeline
Most efficient way to draw triangles
Bandwidth
CPU – light weight animation
Transform & Lighting – great vertex reuse
SquareGridIntegerShare
![Page 16: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/16.jpg)
Setting Tessellation Factorsedge based – (patch soup)
Crack preventionTessellation factors must be specified consistently for shared edges.Data structures or -Tessellation factors must be based on shared information, patch edges.
CriteriaCurvatureScreen space
Transform the control hull edge (Bézier)Silhouettes
Shared surface normals
![Page 17: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/17.jpg)
How to Get Started?
ModelingPolynomial Patches – quadrilateral and triangular
DX8Bézier, B-spline, & Catmull-Rom spline patches
OpenGL Bézier patches – rational
NO Trimmed NURBSUse exporters -
Maya, 3DStudio
![Page 18: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/18.jpg)
DX8 InterfaceSurface representation
Bézier
B-spline
Catmull-Rom
Shape (domains)
Quadrilateral
Triangular
Constraints
Uniform degree
Bézier Catmull-Rom
B-spline
![Page 19: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/19.jpg)
DX8 Entry Points
DrawRectPatch & DrawTriPatch Specify and draw triangular/rectangular patches
DeletePatchFree cached patches
SetRenderState D3DPATCHEDGESTYLE
Discrete - integerContinuous – fractional
CAPSD3DDEVCAPS_RTPATCHES D3DDEVCAPS_QUINTICRTPATCHES
![Page 20: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/20.jpg)
OpenGL Interface
Surface representation
Bézier
Shape (domains)
Quadrilateral
Triangular
![Page 21: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/21.jpg)
OpenGL Entry Points
MapControlPointsNVEVAL_2D_NV or EVAL_TRIANGULAR_2D_NV
Specify the control points for the vertex component
MapParameterivNV & MapParameterfvNVMAP_TESSELLATION_NV
Specify the tessellation factors for the patch
EvalMapsNVTessellate (render) the patch, sending vertices, forming triangles to T&L
![Page 22: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/22.jpg)
Tips & TechniquesDos & Don’ts
Level of detail calculationMemory footprintPerformanceMixing with meshesContinuityTangents, normals & bi-normalsSkinning and blending
![Page 23: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/23.jpg)
Level of Detail Calculationscreen space edge length
By patch – significant foreshorteningTransform to screen spaceCompute control hull lengthDivide by desired edge length
By object – little foreshorteningBeforehand
Compute boundary lengths in model spaceEach frame (or so)
Transform Bbox or proxy to screen spaceCompute sizeScale relative lengths computed off-line
![Page 24: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/24.jpg)
Variable vs. Fixed LOD by Object
24,794 triangles6,326 triangles
![Page 25: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/25.jpg)
Memory Footprint
With tessellation factors A,B,C,Dmin(max(A,C), max(B,D))××××order + 3××××order + slopRoughly 2x for fractional tessellation
Equivalent triangle meshmax(A,C) ×××× max(B,D) + min(A,C) + min(B,D) + 1
Comparison – bi-cubicAssume A=B=C=D4A + 16 vs. A^2 + 2A + 1
0
20
40
60
80
100
1 2 3 4 5 6 7 8 9
patchestriangles
![Page 26: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/26.jpg)
Performance - Hardware
One “clock” per degreeBi-cubic position 3
Two partial derivatives 5
Two linearly varying textures 2
total 10 clocks
![Page 27: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/27.jpg)
Performance – SoftwareChange nothing
time to transfer data
Change tessellation (LOD)order^3 multiplies (matrix mult) + order ×××× (order-1) adds
Change geometry+ order^3 multiplies (matrix mult)
Similar to your costs…
![Page 28: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/28.jpg)
Integer tessellationUse tessellation factor of oneUse patch normal
Fractional tessellationAlways splits once…Use tessellation factor of twoCalculate boundary mid point using subdivisionUse patch normal
Mixing with Meshes
![Page 29: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/29.jpg)
Tangents, Normals & Bi-Normals
Autonormal – Standard T&LDriver does the work for you…Only use with standard T&L
Manual – Vertex ShaderCompute tangents (partial derivatives)Compute normal (cross product) in Shader
Partials are simple!Subtract rows and/or columns of control pointsTriangles too
![Page 30: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/30.jpg)
Partial Derivatives
![Page 31: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/31.jpg)
Skinning & Blending
Modify control points on the CPUSimpleRecalculate patch every change (frame?)
Activate union of matricesFor each patch take union of matricesInterpolate weights using a patch or patches
![Page 32: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/32.jpg)
Continuity
Affected regionControl points neighboring boundary
ComplicationsSome control points are incident to two boundaries
SolutionProject onto a plane at the corner
![Page 33: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/33.jpg)
Demos - Animation
![Page 34: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/34.jpg)
Demos – LOD morphing
![Page 35: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/35.jpg)
Examples!
![Page 36: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/36.jpg)
Examples…
![Page 37: Higher Order Surfaces - Nvidiadeveloper.download.nvidia.com/assets/gamedev/docs/Surfaces.pdf · Higher order primitives Animation Level of Detail Bandwidth Filtering. The “Surfaces”](https://reader034.vdocuments.us/reader034/viewer/2022051602/5b05c6c87f8b9a41528e3101/html5/thumbnails/37.jpg)
Questions, comments, feedback
• www.nvidia.com/developer