2317-abstract.pdf

(790 KB) Pobierz
Image-SpaceHorizon-BasedAmbientOcclusion
LouisBavoil MiguelSainz RouslanDimitrov
NVIDIACorporation
Figure1:Ambientocclusionwithoutanyshading.(left)67MPixels/swithourhorizon-basedalgorithm.(right)15MPixels/swithray
marchingand4raysperdirection.ImagesrenderedwithN d =8andN s =8onGeForce8800GTXUltra.
1Introduction
Ambientocclusionisalightingmodelthatapproximatesthe
amountoflightreachingapointonadiffusesurfacebasedon
itsdirectlyvisibleoccluders. Itgivesperceptualcluesofcurva-
tureandspatialproximity.Like[Mittring2007]and[Shanmugam
andArikan2007],weproposeareal-timeambientocclusioncom-
putationasapostprocessingpassmainlybasedonadepthimage
fromtheeye’spointofview.Thisapproachrequiresnoscene-
dependentprecomputationsandisapplicabletodynamicscenes.
Ourproposedmethoddoesnothavetheoverocclusionissuefrom
[ShanmugamandArikan2007]andsamplesinsidetheradiusof
influence,unlike[Mittring2007].
WeusethefollowingformoftheambientocclusionilluminationA
atagivensurfacepoint P
(a)
(b)
(c)
Figure2:(a)Theazimuthalangleqaroundtheviewvector ~ V.The
tangentanglet(q)isthesignedelevationangleofthesurfacetan-
gentvector.(b)Thehorizonangleh(q)isthemaximumelevation
a>=t(q)forwhich ~ wisoccludedforalla<h(q)(c)Example
ofsamplelocationsfor4directionsandastepsizeof2texels.
Z
A=1− 1
2p
directionsinimagespaceandsteppingontheheightfieldstoredin
thedepthimage.WepickN d directionsqinimagespacearound
thecurrentpixelwhichcorrespondtodirectionsaroundtheZaxisin
eyespace( ~ VonFigure2a).Foreachangleq,wecomputethehori-
zonangleh(q)bysamplingthedepthimagealongalinesegment
inimagespace.Theeye-spaceradiusofinfluenceRisprojectedon
theimageplaneandissubdividedintoN s stepsofequallengths.
Forfindingthehorizonangleindirectionq,westartbycomputing
thetangentanglet(q)andintersectaviewraywiththetangent
planedefinedby P andthesurfacenormal~n.Wethenstepinthe
depthimageindirectionqandcomputeD=S i −P,whereS i is
thereconstructedeye-spacepositionofagivensampleS i .Based
ontheelevationanglesa(S i )=atan(−D.z/||D.xy||),thehorizon
angleh(q)ismax(t(q),a(S i ),i=1..N s )whereN s isthenumber
ofstepsperdirection.Weignoresamplesforwhich||S i −P||>R.
BecauseD.zmustbetheexactdepthassociatedwiththeoffsetD.xy,
wemakesuretoalwayssampleattexelcenters.Todoso,wesnap
thetexturecoordinatesofthesamplesalongeachdirectiontothe
nearesttexelcenters(seeFigure2c).
Totradebandingartifactsfornoise,werandomlyjitterthestepsize
perpixelandrandomlyrotatetheN d uniformdirectionsperpixel.
Althoughusingasingledepthlayertypicallyproducesplausible
results(seeFigure1),itcouldbeextendedbyusingmultiplelayers
suchasthefrontandbackfaces.
V( ~ w)W( ~ w)dw (1)
W
whereVisthevisibilityfunctionoverthenormal-orientedunit
hemisphere W ,whichreturns1ifaraystartingfrom P indirec-
tion ~ wintersectsanoccluderand0otherwise,andWisalinear
attenuationfunction.
2Horizon-BasedAmbientOcclusion
Weuseasphericalcoordinatesystemwiththezenithaxisaligned
intheviewdirection ~ V,azimuthangleqandelevationanglea(see
Figure2a).Similarlytohorizonmapping[Max1986],wesplitthe
unitspherebyahorizonlinedefinedbythesignedhorizonangle
h(q)(seeFigure2b).Assumingthattheneighborhoodof P isa
continuousheightfield,raysthatwouldnormallybetracedbelow
thehorizonareknowntointersectanoccludersotheintersection
testfortheserayscanbeomitted.Underthecontinuousheightfield
assumption,Equation1canberewrittenas:
Z p
Z h(q)
a=t(q) W(~w)cos(a)dadq (2)
A=1− 1
2p
q=−p
WeusethelinearattenuationfunctionW(q)=max(0,1−r(q)/R)
wherer(q)isthedistancebetween P andthehorizonpointindi-
rection~wandRistheradiusofinfluence.Inthiscase,
References
M AX ,N.L.1986.Horizonmapping:Shadowsforbump-mappedsurfaces.InPro-
ceedingsofComputerGraphicsTokyo’86onAdvancedComputerGraphics.
M ITTRING ,M. 2007.Findingnextgen:Cryengine2. InSIGGRAPH’07:ACM
SIGGRAPH2007courses.
S HANMUGAM ,P., AND A RIKAN ,O.2007.Hardwareacceleratedambientocclusion
techniquesongpus.InI3D’07:Proceedingsofthe2007symposiumonInteractive
3Dgraphicsandgames.
Z p
A=1− 1
2p
(sin(h(q))−sin(t(q)))W(q)dq (3)
q=−p
3Image-SpaceIntegration
Ouralgorithmtakesasinputper-pixellineardepthsandeye-space
normals.Foreverypixel,wecomputeitseye-spaceposition P and
weintegrateEquation3usingaMonteCarloapproachbysampling
Copyright is held by the author / owner(s).
SIGGRAPH 2008, Los Angeles, California, August 11–15, 2008.
ISBN 978-1-60558-466-9/08/0008
979360763.001.png 979360763.002.png 979360763.003.png 979360763.004.png
Zgłoś jeśli naruszono regulamin