Which GPU-based Algorithms Cut It?

pumpedlessSoftware and s/w Development

Dec 2, 2013 (3 years and 6 months ago)

47 views

J. Loviscach: WhichGPU-basedalgorithmscutit?0
Which
GPU
-
based
AlgorithmsCut It?
Jörn Loviscach
J. Loviscach: WhichGPU-basedalgorithmscutit?1
WhatGPUscoulddo in games
Someexamples…
J. Loviscach: WhichGPU-basedalgorithmscutit?2
WhatGPUscoulddo in games
20 G samples at 60 fps, no popping, no hick-ups:
￿
LOD pyramid; nestedgridsaroundtheviewer
￿
Morphingbetweengrids; continuousreloading,
decompression
Losasso, Hoppe. Geometry
clipmaps: Terrain renderingusing
nestedregulargrids. SIGGRAPH
2004 and GPU Gems2
J. Loviscach: WhichGPU-basedalgorithmscutit?3
WhatGPUscoulddo in games
Ambient occlusion:
￿
Sum(groupsof) polygonsas disk-likeblockers
￿
Multi-passto takecareof
blockersblockingblockers
Bunnel. Dynamic ambient
occlusion and indirect
lighting. GPU Gems 2
J. Loviscach: WhichGPU-basedalgorithmscutit?4
WhatGPUscoulddo in games
Shadowsmaps
withoutjaggies:
￿
Renderdepthmap
plus shadowsilhouettes
￿
Pixel shader:
connectthedots
Sen, Cammarano,
Hanrahan. Shadow
silhouettemaps.
SIGGRAPH 2003
J. Loviscach: WhichGPU-basedalgorithmscutit?5
WhatGPUscoulddo in games
OK, butwhydon’tGPUs
actuallydo thisin games?
J. Loviscach: WhichGPU-basedalgorithmscutit?6
WhatGPUscoulddo in games
Completely
reorganizeassets
and renderloop?
Howto create
and manage
blockers?
Trade instructions
forbandwidth?
J. Loviscach: WhichGPU-basedalgorithmscutit?7
Outline
￿
What’sneeded?
￿
What’savailable?
￿
So, whichalgorithms
docutit?
￿
Callto action
￿
Epilog
J. Loviscach: WhichGPU-basedalgorithmscutit?8
What’sneeded?
Thatis:
Whatarethe
requirements
of gamedevelopment
practice?
J. Loviscach: WhichGPU-basedalgorithmscutit?9
What’sneeded?
Buzzwordsforthepress?
J. Loviscach: WhichGPU-basedalgorithmscutit?10
What’sneeded?
Great resultswith
lightweightmethods!
Whichmeans…
J. Loviscach: WhichGPU-basedalgorithmscutit?11
What’sneeded?
…hard requirements on:
￿
Timing
(# of instructions,
state changes,
dependent texreads,
multithreading, …)
￿
Memory
(textures, vertices,
off-screen rendering, …)
J. Loviscach: WhichGPU-basedalgorithmscutit?12
What’sneeded?
Robustness: no tweaking needed, just works
￿
Unexpected things may happen in a game
(shadow acne?)
￿
Unexpected ideas may crop up during its design
(100 NPCsin a swimming pool?)
J. Loviscach: WhichGPU-basedalgorithmscutit?14
What’sneeded?
Integration
withgameengine
and/orexistingcode:
￿
Shadows?
￿
Collision, physics?
￿
Resource
Management?
￿

J. Loviscach: WhichGPU-basedalgorithmscutit?15
What’sneeded?
Workflowintegration(1):
Reuse of content;
asset management;
integration with DCC
tools
J. Loviscach: WhichGPU-basedalgorithmscutit?16
What’sneeded?
Workflowintegration(2):
Testing: algorithms,
benchmarks, gameplay,
…on a range of
hardware!
J. Loviscach: WhichGPU-basedalgorithmscutit?17
What’sneeded?
Workflowintegration(3):
Division of labor
between artists
and programmers
J. Loviscach: WhichGPU-basedalgorithmscutit?18
What’sneeded?
In short:
￿
Lightweightprocessing
￿
Robustness
￿
Flexibility
￿
Run-timeintegration
￿
Workflowintegration
J. Loviscach: WhichGPU-basedalgorithmscutit?19
What’savailable?
Thatis:
Whataretheresults
of computergraphics
research?
J. Loviscach: WhichGPU-basedalgorithmscutit?21
What’savailable?
Publish or perish:
￿
Least Publishable
Unit? (Owen)
￿
Applied and inter-
disciplinary work
disencouragedas
“soft”
J. Loviscach: WhichGPU-basedalgorithmscutit?22
What’savailable?
Papers on applications:
￿
Bunchesof block diagrams
￿
Oftensketchy
A
X
Y
Z
J. Loviscach: WhichGPU-basedalgorithmscutit?23
What’savailable?
Needto do something
arcaneand/or
sophisticated
becauseall simple
thingshavebeen
done.
Really?
J. Loviscach: WhichGPU-basedalgorithmscutit?24
What’savailable?
Some of those
“simple”things:
￿
Artifact-free noise?
￿
Sharp textures?
￿
Volume-preserving
soft skinning?
￿
Carefree shadows?
J. Loviscach: WhichGPU-basedalgorithmscutit?25
What’savailable?
Attemptsto maketheGPU do tasks
itwasn’tdesignedfor:
￿
Is this going to bite back?
￿
Ugly hack, till the next chip generation
comes around? (Testing? Maintaining?)
J. Loviscach: WhichGPU-basedalgorithmscutit?26
J. Loviscach: WhichGPU-basedalgorithmscutit?27
So, which algorithms docut it?
Someexamples
withtheirbenefits
and issues:
￿
Relief mapping
￿
Mipmappingnormal maps
￿
Bi-leveltextures
￿
BRDF-Shop
￿
PRT
J. Loviscach: WhichGPU-basedalgorithmscutit?28
So, which algorithms docut it?
Replacenormal maps
byvirtualgeometry:
￿
Ray casting
in thepixelshader
￿
Convertnormal maps
to heightmaps
cf. ParallaxOcclusion
Mappingetc.
Policarpo, Oliveira. Rendering
surfacedetailsin gameswith
reliefmappingusinga minimally
invasiveapproach. ShaderX4
J. Loviscach: WhichGPU-basedalgorithmscutit?29
So, which algorithms docut it?
Relief mapping(1):
￿
Convertnormal to heightmap:
automaticstepin thebuildprocess
￿
Doom3 demoimplementation
￿
Easilyswitchableoption
￿
Extensible: multilayer, curvedbase
J. Loviscach: WhichGPU-basedalgorithmscutit?30
So, which algorithms docut it?
Relief mapping(2):
￿
Best ifsurfacepushedback: expandedmodels
(Keeptwoversions?)
￿
Aliasingnear, far, at grazingangles
￿
Computationalload:
approx. 150 PS instructions
￿
z setforintersections;
texkillforsilhouettes:
early-zswitchedoff
J. Loviscach: WhichGPU-basedalgorithmscutit?31
So, which algorithms docut it?
Relief mapping:
￿
Lean processing
￿
Robustness
￿
Flexibility
￿
Run-time integration
￿
Workflow integration
?
￿
￿
?
￿
J. Loviscach: WhichGPU-basedalgorithmscutit?32
So, which algorithms docut it?
BetterMIP-mappingfornormal maps:
￿
Denormalizationof interpolatednormals
indicatestheirlocaldivergence
￿
Model bya Gaussiandistribution
Toksvig.
Mipmapping
normal maps.
Nvidiaonline
J. Loviscach: WhichGPU-basedalgorithmscutit?33
So, which algorithms docut it?
Mipmappingnormal maps:
￿
Fast and simple:
just oneadditional 2D textureretrieval
￿
IssueswithlocallyvaryingNTB frames
￿
Helpertexturedependson shinyness
￿
No localvariation?
￿
Assetmanagement?
J. Loviscach: WhichGPU-basedalgorithmscutit?34
So, which algorithms docut it?
Mipmappingnormal maps:
￿
Lean processing
￿
Robustness
￿
Flexibility
￿
Run-time integration
￿
Workflow integration
￿
￿
￿
￿
￿
J. Loviscach: WhichGPU-basedalgorithmscutit?35
So, which algorithms docut it?
Vector-qualitytextures
withoutthecost:
￿
Applysoft thresholding
￿
Optimizetexturesoffline
forbest result
J. Loviscach: WhichGPU-basedalgorithmscutit?36
So, which algorithms docut it?
Bi-leveltextures:
￿
Jaggiesand MIP-mappinghandled
￿
Runs everywhere:
12 PS instructions, 1 texread
￿
Compareto PerfectHashing(SIGGRAPH
2006): 40 instructions, up to 5 texreads
￿
Somemanualadjustmentswithoptimizer
softwarerequired
￿
Manage hi-resand optimizedtextures
J. Loviscach: WhichGPU-basedalgorithmscutit?37
So, which algorithms docut it?
Bi-leveltextures:
￿
Lean processing
￿
Robustness
￿
Flexibility
￿
Run-time integration
￿
Workflow integration
￿
￿
￿
￿
?
J. Loviscach: WhichGPU-basedalgorithmscutit?38
So, which algorithms docut it?
Definecomplex
reflectivebehavior
bypainting:
￿
Specializedtools
￿
Option: restrictions
fromopticalphysics
Colbert, Pattanaikand Křivánek. BRDF-
Shop: Creatingphysicallycorrect
bidirectionalreflectancedistribution
functions. IEEE CG&A 26, 2005
J. Loviscach: WhichGPU-basedalgorithmscutit?39
So, which algorithms docut it?
BRDF-Shop:
￿
IntegratedintoMaya, real-timepreview
￿
Howto createspatiallyvaryingbehavior,
i.e., textures?
￿
No run-timecomponentprovided?
J. Loviscach: WhichGPU-basedalgorithmscutit?40
So, which algorithms docut it?
BRDF-Shop:
￿
Lean processing
￿
Robustness
￿
Flexibility
￿
Run-time integration
￿
Workflow integration
?
￿
?
￿
?
J. Loviscach: WhichGPU-basedalgorithmscutit?41
So, which algorithms docut it?
Encodediffuse light
interreflectionsand
SSS intoa 3D model
￿
Sphericalharmonics
(SH) describe
low-frequencyvariations
￿
Processingcanmostly
bedonedirectly
in SH base
Sloan, Kautz, Snyder. Precomputed
radiance transfer for real-time rendering
in dynamic, low-frequency lighting
environments. SIGGRAPH 2002
J. Loviscach: WhichGPU-basedalgorithmscutit?42
So, which algorithms docut it?
PrecomputedRadianceTransfer:
￿
Precomputation:
￿
Software included
￿
Adaptive tesselation
￿
Authoring& runtimesoftware
￿
Part of DirectX9, butwhataboutotherplatforms?
￿
Fallback ifperformancegetscritical?
￿
About100 VS instructions;
needenoughtriangles
￿
US patent applications
J. Loviscach: WhichGPU-basedalgorithmscutit?43
So, which algorithms docut it?
PrecomputedRadianceTransfer:
￿
Lean processing
￿
Robustness
￿
Flexibility
￿
Run-time integration
￿
Workflow integration
￿
￿
￿
?
￿
J. Loviscach: WhichGPU-basedalgorithmscutit?44
So, which algorithms docut it?
Conclusion:
Even algorithmsthatlookpromising
havetheirshareof issues.
J. Loviscach: WhichGPU-basedalgorithmscutit?45
Callto action
J. Loviscach: WhichGPU-basedalgorithmscutit?46
Callto action
For the scientists:
￿
Think about systems.
Create better ones?
￿
Use standard DCC software
and game engines
￿
Handle the ugly details
￿
Publish “Lessons learned,”
i.e., negative results
J. Loviscach: WhichGPU-basedalgorithmscutit?47
Callto action
For the developers:
￿
What are
the day-to-day issues
of game production?
￿
How would you like
to create games
for tomorrow’s platforms?
Let the researchers know!
J. Loviscach: WhichGPU-basedalgorithmscutit?48
Callto action
For the developers
(cont’d):
￿
Efficient apps of
GPUsneed more
than geometry:
advanced linear
algebra, PCA,
harmonic functions,

￿
This is where
researchers shine!
J. Loviscach: WhichGPU-basedalgorithmscutit?50
Epilog
￿
How to cope
with radical changes?
￿
Long-term investment:
start abstracting today
to save your code
and content
￿
Today’s hack may
be tomorrow’s
built-in feature
J. Loviscach: WhichGPU-basedalgorithmscutit?51
Thanksforyourattention.
Questions?
J. Loviscach: WhichGPU-basedalgorithmscutit?52
Noticerequiredbythemanufacturerof theclipart:
Copyright ©2006 Jörn Loviscach
und dessen Lizenzgeber.
Alle Rechte vorbehalten.