47
Image-Space Image-Space Image-Space Horizon-Based A bi t Image-Space Horizon-Based A bi t Ambient Occlusion Ambient Occlusion Louis Bavoil Miguel Sainz Louis Bavoil, Miguel Sainz NVIDIA

Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Embed Size (px)

Citation preview

Page 1: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Image-SpaceImage-SpaceImage-Space Horizon-Based A bi t

Image-Space Horizon-Based A bi tAmbient OcclusionAmbient Occlusion

Louis Bavoil Miguel SainzLouis Bavoil, Miguel Sainz

NVIDIA

Page 2: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Sky LightSky LightSky LightSky Light

Si l t f f A bi t O l i• Simplest form of Ambient Occlusion– Light source = sky (sphere light)

– Two definitions of AO• AO = diffuse illumination from the sky

scene

[Landis 02] [Christensen 03]

• AO = shadow from the sky illumination [Pharr and Green 04] [Hegeman et al 06]

sphere light

[Pharr and Green 04] [Hegeman et al. 06]

• Limited to outdoor scenes

Page 3: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Ambient OcclusionAmbient OcclusionAmbient OcclusionAmbient Occlusion

Li h l l h i h• Light = local hemisphere– Centered at current

scene

surface point

– Radius = user parameter

n

p

• Can be rendered withray tracing

P

ray-tracing– [Gelato] [Mental Ray]

local sphere light

Page 4: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Ambient OcclusionAmbient OcclusionAmbient OcclusionAmbient Occlusion

Gi l l f d h• Gives perceptual clues of depth, curvature and spatial proximity

Without AO With our AO

Page 5: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Screen Space Ambient OcclusionScreen Space Ambient OcclusionScreen Space Ambient OcclusionScreen Space Ambient Occlusion

A h i t d d b• Approach introduced by[Shanmugam and Orikan 07] [Mittring 07] [Fox and Compton 08]

eye

image plane[Mittring 07] [Fox and Compton 08]

• Input = Z-Buffer + normalsRender approximate AO for

g p

– Render approximate AO for dynamic scenes with no precomputations Z-Buffer

• Z-Buffer = Heightfield– z = f(x,y)

Page 6: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Horizon Mapping [Max 86]Horizon Mapping [Max 86]Horizon Mapping [Max 86]Horizon Mapping [Max 86]

Gi 1D h i htfi ld

-Z

• Given a 1D heightfield

horizon angle

P +X

sampling direction

Page 7: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Finding the HorizonFinding the HorizonFinding the HorizonFinding the Horizon

-Z

• Marching on the heightfield

Z

S0P

S0 horizon angle+X

sampling direction

Page 8: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Finding the HorizonFinding the HorizonFinding the HorizonFinding the Horizon

-Z

• Marching on the heightfield

Z

S0P

S1

S0

+X

1

sampling direction

Page 9: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Finding the HorizonFinding the HorizonFinding the HorizonFinding the Horizon

-Z

• Marching on the heightfield

Z

S2

S0

horizon angle

P

S1

S0

+X

1

sampling direction

Page 10: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Finding the HorizonFinding the HorizonFinding the HorizonFinding the Horizon

-Z S

• Marching on the heightfield

Z S3

horizon angle

S2

S0P

S1

S0

+X

1

sampling direction

Page 11: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Tangent PlaneTangent PlaneTangent PlaneTangent Plane

Gi i P d i l• Given point P and its normal n

Z-Zn

P

XY plane

tangent vector T tangent angle

Page 12: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Horizon Based AOHorizon Based AOHorizon-Based AOHorizon-Based AO

-Zhorizon angle in [-π/2, π/2]

XY plane

g [ ]h(H) = atan(H.z / ||H.xy||)horizon vector H

tangent vector T

P

XY plane

tangent angle in [-π/2, π/2]t(T) = atan(T z / ||T xy||)tangent vector T t(T) = atan(T.z / ||T.xy||)

AO = sin h – sin t

Page 13: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Ambient Occlusion RadiusAmbient Occlusion RadiusAmbient Occlusion RadiusAmbient Occlusion Radius

A bi t l i di Eye• Ambient occlusion radius defined in eye space

Eye

image plane– Scene = depth image

• Project light sphere into texture space– Approximate projection of pp p j

the sphere by a disk

– Project disk onto uv spaceP R

sphere lightj p

Page 14: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Sampling the Depth ImageSampling the Depth ImageSampling the Depth ImageSampling the Depth Imageu

• Use uniform distribution of directions per pixel

• Fixed num samples / dir

• Per pixel randomization Pv• Per-pixel randomization

• Rotate directions by random per-pixel angle

• Jitter samples by a Example with 4 directions / pixel

random offset

Page 15: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

NormalsNormalsNormalsNormals

W t i l l• We store per-pixel normals– Not interpolated normals

interpolated normal

face false occlusion

• Would generate false occlusion

– But face normals

normalocclusion

• Using ddx/ddy instructions on eye-space coordinates in the geometry pass

P

g y p

Page 16: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Core AlgorithmCore AlgorithmCore AlgorithmCore Algorithm

I t t AO i 2D• Integrate AO in 2D– Average AO over multiple 2D directions θ

– AO(θ) = sin h(θ) - sin t(θ)

θ

-Zh(θ)

surface point PXY plane

t(θ)

Page 17: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Ambient Occlusion in CreasesAmbient Occlusion in CreasesAmbient Occlusion in CreasesAmbient Occlusion in Creases

Page 18: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Low Tessellation ProblemLow Tessellation ProblemLow-Tessellation ProblemLow-Tessellation Problem

-Z

θ

n

XY planeAO > 0 false occlusion

sampling direction tangent plane

Page 19: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Solution: Angle BiasSolution: Angle BiasSolution: Angle BiasSolution: Angle Bias

Si il t “ d” t i [M t l R ]• Similar to “spread” parameter in [Mental Ray]

• Ignore occlusion near the tangent plane

n-Z

θ

effective tangent plane

t(θ) + biasn

XY planeAO 0

tangent plane

p

t(θ)

AO == 0

sampling direction tangent plane (signed angle)

sampling direction

Page 20: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

The Angle Bias in ActionThe Angle Bias in ActionThe Angle Bias in ActionThe Angle Bias in Action

Without angle bias With angle bias = 30 deg

Page 21: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Sampling Outside the ScreenSampling Outside the ScreenSampling Outside the ScreenSampling Outside the Screen

N i f i id i f• No scene information outside view frustum– We remove false occlusion by using clamping to

edge and an angle bias

angle bias = 0 angle bias = 30 degg

Page 22: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Discontinuity ProblemDiscontinuity ProblemDiscontinuity ProblemDiscontinuity Problem

Z Z-Z

Sn S1n

-Z

Pixel P0 S0

S1

Adjacent

S1n

AO(P0) = sin h – sin t

0 AdjacentPixel P1

AO(P1) = sin h – sin t =( 0)= sin 0 – sin 0 = 0

( 1)= sin(45deg) – sin 0 = 0.7

Large AO discontinuity between P0 and P1

Page 23: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Attenuation FunctionAttenuation FunctionAttenuation FunctionAttenuation Function

W i ht AO b di l f ti W( )• Weight AO by a radial function W(r)– Similar to obscurances [Zhukov et al. 98]

– “Falloff” in [Gelato] and [Mental Ray]

Normalized distance1.2

r = ||S – P|| / R

We use the attenuationW(r) = 1 - r20.6

0.8

1

step W(r) 1 r

0.2

0.4

0.6 p

1-r

1-r^2

-0.2

00 0.5 1 1.5 2

Page 24: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Per Sample AttenuationPer Sample AttenuationPer-Sample AttenuationPer-Sample Attenuation

I iti li WAO 0• Initialize WAO = 0

• After sample S1S2

Φ(S1)

Φ(S2)

– AO(S1) = sin Φ(S1) – sin t

– WAO += W(S1) AO(S1)

( 1)

R S1

WAO W(S1) AO(S1)

• After sample S2

If Φ(S ) Φ(S )

P1

– If Φ(S2) > Φ(S1)• AO(S2) = sin Φ(S2) – sin t

WAO W(S ) (AO(S ) AO(S ))

sampling direction

• WAO += W(S2) (AO(S2) - AO(S1))

Page 25: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

With and Without AttenuationWith and Without AttenuationWith and Without AttenuationWith and Without Attenuation

With AttenuationW(r) = 1 - r2

Without AttenuationW(r) = 1

Page 26: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

NoiseNoiseNoiseNoise

P i l d i i i• Per-pixel randomization generates noise

AO with 6 directions x 6 steps/dir

Page 27: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Cross Bilateral FilterCross Bilateral FilterCross Bilateral FilterCross Bilateral Filter

W bl th bi t l i• We blur the ambient occlusion

• Depth-dependent Gaussian blur• [Petschnigg et al. 04]

[Eisemann and Durand 04]

• Reduces blurring across edges

• Although it is a non separable filter we apply it• Although it is a non-separable filter, we apply it separately in the X and Y directions

Page 28: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Cross Bilateral FilterCross Bilateral Filter

D th d d t Bl

Cross Bilateral FilterCross Bilateral Filter

• Depth-dependent Blur

Without Blur With 15x15 Blur

Page 29: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Half Resolution AOHalf Resolution AOHalf-Resolution AOHalf-Resolution AO

AO i l l f• AO is mostly low frequency– Can render the AO in half resolution

• Source half-resolution depth image

• Still do the blur passes in full resolutionStill do the blur passes in full resolution– To avoid bleeding across edges

– Source full resolution eye-space depths• [Kopf et al. 07]

Page 30: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Rendering PipelineRendering PipelineRendering PipelineRendering Pipeline

Render opaqueRender opaque geometry

eye-spacel

eye-spaced th

Unprojection parameters

Render AO(Half or Full Res)

normals depths

l

p j p(fovy and aspect ratio)

Eye-space radius RNumber of directions

Blur AO in X

colors Number of steps / directionAngle bias

Kernel radius

Blur AO in Y

Kernel radiusSpatial sigmaRange sigma

Modulate Color

Page 31: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

DemoDemoDemoDemo

Page 32: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

PerformancePerformancePerformancePerformance

D d• Depends on – Screen Resolution

– Ambient Occlusion Resolution

– Number of samples (directions * steps)– Number of samples (directions steps)

– Blur Size

Page 33: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Half Resolution AOHalf Resolution AOHalf-Resolution AOHalf-Resolution AO

I Si 1600 1200Image Size 1600x1200AO Resolution 800x600Blur Resolution 1600x1200

Half‐Res AO GeForce GTX 280Geometry 1.0 ms

AO 3.5 msBlur 2.5 msTotal 7.0 ms

143 fps

6 directions per pixel6 steps per direction15x15 Blur Size

Page 34: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Full Resolution AOFull Resolution AOFull-Resolution AOFull-Resolution AO

I Si 1600 1200Image Size 1600x1200AO Resolution 1600x1200Blur Resolution 1600x1200

Full‐Res AO GeForce GTX 280Geometry 1.0 ms

AO 30.0 msBlur 2.5 msTotal 33.5 ms

30 fps

6 directions per pixel6 steps per direction15x15 Blur Size

Page 35: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Half-Resolution AO6x6 samples / AO pixelNo Blur

AO = 3.5 ms @ 800x600On GeForce GTX 280

No Blur

Page 36: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

AO = 3.5 ms @ 800x600Blur = 2.5 ms @ 1600x1200On GeForce GTX 280

Half-Resolution AO6x6 samples / AO pixel15x15 Blur On GeForce GTX 28015x15 Blur

Page 37: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Full-Resolution AO6x6 samples / AO pixel15x15 Blur

AO = 30 ms @ 800x600Blur = 2.5 ms @ 1600x1200On GeForce GTX 28015x15 Blur On GeForce GTX 280

Page 38: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Full-Resolution AO16x16 samples / pixel16x16 samples / pixelNo Blur

Page 39: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Full-Resolution AO16x32 samples / pixel16x32 samples / pixelNo Blur

Page 40: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

ConclusionConclusionConclusionConclusion

Di tX10 SDK l• DirectX10 SDK sample– Now available on developer.nvidia.com

– Including video and brief whitepaper

• Easy to integrate into a game engineEasy to integrate into a game engine– Input Data = eye-space depths and normals

Rendered in a post processing pass– Rendered in a post-processing pass

• More details in ShaderX7 (to appear)

Page 41: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

AcknowledgmentsAcknowledgmentsAcknowledgmentsAcknowledgments

NVIDIA– NVIDIA• Rouslan Dimitrov, Samuel Gateau, Michael Thompson,

Ignacio Castano the demo teamIgnacio Castano, the demo team

– Models• Dragon Stanford 3D Scanning Repository• Dragon - Stanford 3D Scanning Repository

• Sibenik Cathedral - Marko Dabrovic

Page 42: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Questions?Questions?Questions?Questions?

[email protected]@nvidia.com

Code sample available onhttp://developer.nvidia.com

Page 43: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

ReferencesReferencesReferencesReferences

[M 86] MAX N L 1986 “H i i Sh d f b• [Max 86] MAX, N. L. 1986. “Horizon mapping: Shadows for bump-mapped surfaces.” In Proceedings of Computer Graphics Tokyo ’86 on Advanced Computer Graphics.

• [Zhukov et al. 98] Sergej Zhukov, Andrej Inoes, Grigorij Kronin, 1998. “An ambient light illumination model.” In Rendering Techniques ’98, G. Drettakis and N. Max, Eds., Eurographics, 45–56.Drettakis and N. Max, Eds., Eurographics, 45 56.

• [Landis 02] Landis, 2002. “Production-Ready Global Illumination,” In ACM SIGGRAPH Course #16.

• [Christensen 03] Christensen, P. H. 2003. “Global illumination and all that”. In ACM SIGGRAPH Course 9.

Page 44: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

ReferencesReferencesReferencesReferences

[Ei d D d 04] El Ei d F éd D d• [Eisemann and Durand 04] Elmar Eisemann and Frédo Durand, “Flash Photography Enhancement via Intrinsic Relighting”, ACM SIGGRAPH 2004.

• [Petschnigg et al. 04] Petschnigg, Szeliski, Agrawala, Cohen, Hoppe,Toyama, “Digital photography with flash and no-flash image pairs.”ACM SIGGRAPH 2004.ACM SIGGRAPH 2004.

• [Schüler 05] Christian Schüler, 2005. “Eliminate surface acne with gradient shadow mapping”, ShaderX4: Advanced Rendering Techniques.

• [Gelato] Gritz, L. 2006. “Gelato 2.1 Technical Reference”. NVIDIA.

“ S f ”• [Mental Ray] “mental ray Shader Reference”, November 2007.

Page 45: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

ReferencesReferencesReferencesReferences

[Mitt i 07] MITTRING M 2007 “Fi di t C E i 2” I• [Mittring 07] MITTRING, M. 2007. “Finding next gen: Cry Engine 2”. In SIGGRAPH ’07: ACM SIGGRAPH 2007 courses.

• [Shanmugam and Orikan 07] SHANMUGAM, P., AND ARIKAN, O. [ g ] , , ,2007. “Hardware accelerated ambient occlusion techniques on GPUs”. In I3D ’07: Proceedings of the 2007 symposium on Interactive 3D graphics and games.3D graphics and games.

• [Kopf et al. 07] Johannes Kopf, Michael F. Cohen, Dani Lischinski, Matt Uyttendaele, “Joint Bilateral Upsampling”, SIGGRAPH '07: ACM SIGGRAPH 2007 papers.

• [Fox and Compton 08] Megan Fox and Stuart Compton, “Ambient Occlusive Crease Shading” Game Developer Magazine March 2008Occlusive Crease Shading , Game Developer Magazine, March 2008.

Page 46: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Computing Eye Space PositionsComputing Eye Space PositionsComputing Eye-Space PositionsComputing Eye-Space Positions

F i l S ( )• For a given sample S at (u,v)

uveye space

st

uv

u,v

unprojects,tsnap

to s,tt t

x,yuv space

snapping to pixel center

texturefetch

z

– Snap uv to avoid mismatch betweenreconstructed (x,y) and sampled z

Page 47: Image-Space Horizon-Based Abi tAmbient Occlusiondeveloper.download.nvidia.com/presentations/2008/... · Half‐Res AO GeForce GTX 280 Geometry 1.0 ms AO 3.5 ms ... • Dragon - Stanford

Tangent AngleTangent AngleTangent AngleTangent Angle

Gi T• Given a tangent vector T– T(θ) on the plane

– t(θ) = atan(T.z / ||T.xy||)

• Compute plane basis P

XY

n

• Compute plane basis– Basis = (dP/du,dP/dv) tangent vector T(θ)

Pt(θ) in [-π/2,π/2]

– T = dP/du ∆u + dP/dv ∆v

– Similar to gradient shadow mapping [Schüler 05]