Upload
b5af9e
View
224
Download
0
Embed Size (px)
Citation preview
8/11/2019 Occlusion - Al Hastings, Insomniac Games
1/23
OcclusionOcclusionVisibility determination for staticVisibility determination for static
and dynamic objectsand dynamic objects(Al Hastings, Insomniac Games)(Al Hastings, Insomniac Games)
8/11/2019 Occlusion - Al Hastings, Insomniac Games
2/23
Static OcclusionStatic Occlusion
Essentially it is an implementation of VSEssentially it is an implementation of VS(potentially !isible set) concept(potentially !isible set) concept
"rom a gi!en camera position, t#e"rom a gi!en camera position, t#e
occlusion database reports $#ic# objectsocclusion database reports $#ic# objectsare potentially !isibleare potentially !isible
Only $or%s for static objects (ufrag, ties,Only $or%s for static objects (ufrag, ties,
s#rubs, foliage, etc)s#rubs, foliage, etc)e run'time is simple all t#e compleitye run'time is simple all t#e compleitycomes in generating t#e databasecomes in generating t#e database
8/11/2019 Occlusion - Al Hastings, Insomniac Games
3/23
*ynamic Occlusion*ynamic Occlusion
Implemented using t#e +S #ard$are pielImplemented using t#e +S #ard$are pielcounterscounters
-sed for dynamic objects (mobys, real'time-sed for dynamic objects (mobys, real'time
lig#ts and particle effects)lig#ts and particle effects)Visibility determination is computed based onVisibility determination is computed based onbounding !olumes (sp#eres, cones, AA..s) andbounding !olumes (sp#eres, cones, AA..s) andnot on t#e actual geometrynot on t#e actual geometry
ere is a one frame lag t#e - uses t#eere is a one frame lag t#e - uses t#eresults t#at t#e +S computed on t#e pre!iousresults t#at t#e +S computed on t#e pre!iousframe/ is leads to complications/frame/ is leads to complications/
8/11/2019 Occlusion - Al Hastings, Insomniac Games
4/23
Static Occlusion ipelineStatic Occlusion ipeline
0) aint grids $#ere t#e camera can go0) aint grids $#ere t#e camera can go
1) Auto'generate sample points from grids1) Auto'generate sample points from grids
2) +un ps2 utility to determine !isibility2) +un ps2 utility to determine !isibility3) Group objects into 1435 6clusters73) Group objects into 1435 6clusters7
8) 9ompress t#e !isibility database8) 9ompress t#e !isibility database
:) ;atc# up t#e database to t#e latest:) ;atc# up t#e database to t#e latestassets in t#e le!elassets in t#e le!el
8/11/2019 Occlusion - Al Hastings, Insomniac Games
5/23
ainting t#e gridsainting t#e grids
Grids are uniform and non'#ierarc#icalGrids are uniform and non'#ierarc#ical
-sually 1m on a side, sometimes larger-sually 1m on a side, sometimes larger
&ypically 14,444 044,444 on a le!el&ypically 14,444 044,444 on a le!el
ainting is done in'game by running around $it# t#eainting is done in'game by running around $it# t#ec#aracter/c#aracter/
It
8/11/2019 Occlusion - Al Hastings, Insomniac Games
6/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
7/23
Generating t#e sample pointsGenerating t#e sample points
Automated process on ps2 t#at runs $#ene!erAutomated process on ps2 t#at runs $#ene!ert#e grids are edited/t#e grids are edited/
-ses run'time collision tests to (try to) a!oid-ses run'time collision tests to (try to) a!oidputting samples inside geometry ($#ic# can leanputting samples inside geometry ($#ic# can lean
to a lot of o!er'inclusion)to a lot of o!er'inclusion)+elies on t#e collision geometry being a close+elies on t#e collision geometry being a closematc# to t#e render geometry/matc# to t#e render geometry/
Attempts to place samples at t#e corners ofAttempts to place samples at t#e corners of
eac# grid, or as close as t#e collision $ill allo$/eac# grid, or as close as t#e collision $ill allo$/&ypically a le!el ends up $it# 0/8 more sample&ypically a le!el ends up $it# 0/8 more samplepoints t#an grids/points t#an grids/
8/11/2019 Occlusion - Al Hastings, Insomniac Games
8/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
9/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
10/23
*etermining Visibility*etermining Visibility
is is done using a ps2 stand'alone app calledis is done using a ps2 stand'alone app called>occlgenocclgen
8/11/2019 Occlusion - Al Hastings, Insomniac Games
11/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
12/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
13/23
9ompressing t#e database9ompressing t#e database
At run'time, eac# grid stores a 18:'byte arrayAt run'time, eac# grid stores a 18:'byte array
indicating t#e onCoff !isibility for eac# of t#e 1435indicating t#e onCoff !isibility for eac# of t#e 1435
clustersclusters
"urt#er compression is done by combining grids"urt#er compression is done by combining grids$it# !ery similar !isibility lists/$it# !ery similar !isibility lists/
is stage can ta%e up to an #our of processingis stage can ta%e up to an #our of processing
is also introduces o!er'inclusion error/is also introduces o!er'inclusion error/&ypically it adds less error t#an clustering/&ypically it adds less error t#an clustering/
+un'time budget for occlusion data is 1 ;egs/+un'time budget for occlusion data is 1 ;egs/
8/11/2019 Occlusion - Al Hastings, Insomniac Games
14/23
Syncing t#e databaseSyncing t#e database
Visibility is re'computed once per day at most/Visibility is re'computed once per day at most/.ut t#e le!el art c#anges muc# more uic%ly/.ut t#e le!el art c#anges muc# more uic%ly/
Occlusion data s#ould decay gracefully as t#eOcclusion data s#ould decay gracefully as t#eart c#anges/ .ut in t#e past t#is is t#e stage t#atart c#anges/ .ut in t#e past t#is is t#e stage t#at
#as pro!en most problematic/#as pro!en most problematic/In principle, adding or mo!ing an object $ill onlyIn principle, adding or mo!ing an object $ill onlyin!alidate occlusion on t#at object $#ile %eepingin!alidate occlusion on t#at object $#ile %eepingit intact on t#e rest of t#e le!el/it intact on t#e rest of t#e le!el/
e ne$ tools s#ould ma%e t#is more robuste ne$ tools s#ould ma%e t#is more robustbecause $e no$ #a!e proper -I*s for eac#because $e no$ #a!e proper -I*s for eac#object/object/
8/11/2019 Occlusion - Al Hastings, Insomniac Games
15/23
D#at
8/11/2019 Occlusion - Al Hastings, Insomniac Games
16/23
D#at
8/11/2019 Occlusion - Al Hastings, Insomniac Games
17/23
*ynamic Occlusion*ynamic Occlusion
o pre'computed data is in!ol!ed/o pre'computed data is in!ol!ed/
otentially !isible objects render aotentially !isible objects render a
bounding !olume t#en c#ec% on t#e netbounding !olume t#en c#ec% on t#e net
frame if any piels $ere !isible/frame if any piels $ere !isible/
ings t#at use dynamic occlusion=ings t#at use dynamic occlusion= ;obys;obys
+eal'time @ig#ts+eal'time @ig#ts
EffectsEffects
8/11/2019 Occlusion - Al Hastings, Insomniac Games
18/23
8/11/2019 Occlusion - Al Hastings, Insomniac Games
19/23
roblems caused by one'frame lagroblems caused by one'frame lag
It
8/11/2019 Occlusion - Al Hastings, Insomniac Games
20/23
D#at
8/11/2019 Occlusion - Al Hastings, Insomniac Games
21/23
D#at
8/11/2019 Occlusion - Al Hastings, Insomniac Games
22/23
"uture Dor%"uture Dor%
Eplore using +S conditional renderingEplore using +S conditional rendering
to remo!e one'frame lag in certainto remo!e one'frame lag in certain
situations/situations/
Etend system to $or% $ell for large'scaleEtend system to $or% $ell for large'scale
mo!ing objects (use actual geometry formo!ing objects (use actual geometry for
!isibility test instead of bounding !olume)!isibility test instead of bounding !olume)
A!oid !isibility spi%es $it# better #andlingA!oid !isibility spi%es $it# better #andling
of mode transitions and camera cutsof mode transitions and camera cuts
8/11/2019 Occlusion - Al Hastings, Insomniac Games
23/23
FuestionsFuestions