O'Reilly logo

GPU PRO 3 by Wolfgang Engel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

2
III
Screen-Space Bent Cones:
A Practical Approach
Oliver Klehm, Tobias Ritschel,
Elmar Eisemann, and Hans-Peter Seidel
2.1 Overview
Ambient occlusion (AO) is a popular technique for visually improving both real-
time as well as offline rendering. It decouples occlusion and shading, providing
a gain in efficiency. This results in an average occlusion that modulates the
surface shading. However, this also reduces realism due to the lack of directional
information. Bent normals were proposed as an amelioration that addresses this
issue for offline rendering. Here, we describe how to compute bent normals as a
cheap byproduct of screen-space ambient occlusion (SSAO). Bent cones extend
bent normals to further improve realism. These extensions combine the speed
and simplicity of AO with physically more plausible lighting.
2.2 Introduction
AO is a physically incorrect but perceptually plausible approximation of environ-
mental lighting and global illumination (GI). It has been used in many games, in
particular when implemented in screen space. AO achieves high performance by
averaging occlusion that modulates the surface shading instead of respecting the
directionality of the lighting. However, the lack of directionality can be visually
unpleasant and leaves room for improvement.
To this end, Landis [Landis 02] introduced so-called bent normals. While AO
stores the average occlusion, bent normals are modified normals bent according
to an estimate of the direction that is most disoccluded, in other words, the
average unblocked direction. Using these bent normals in shading—for example,
with preconvolved environment maps—leads to improved lighting. Usually, bent
191
192 III Global Illumination Effects
Figure 2.1. Lighting computed using bent cones: 2048 × 1024 pixels, 60.0 fps, including
direct light and DOF on an Nvidia GF 560Ti.
normals can be easily integrated in rendering engines; the only required change
is to apply a bending of the normal. Adjusting the length of the bent normal by
multiplying it with the corresponding AO value leads to automatically integrating
AO in the shading evaluation.
Computing AO in screen space (SSAO) is one popular implementation of
the approach [Mittring 07, Shanmugam and Arikan 07, Bavoil et al. 08, Ritschel
et al. 09, Loos and Sloan 10]. In this chapter, we will describe a technique to
extend SSAO. Our idea is to keep the simplicity of SSAO by relying on a screen-
space solution, but to add the advantages of bent normals. Additionally, a new
extension to further improve accuracy is introduced: bent cones. Bent cones
capture the distribution of unoccluded directions by storing its directional average
and variance.
2.3 Ambient Occlusion
Ambient occlusion [Zhukov et al. 98] decouples shading and visibility by moving
visibility outside of the integral of the rendering equation [Kajiya 86]:
L
o
(x
o
) AO(x)
Z
+
f
r
(x ω
o
) L
i
(x)(n · ω)dω,
AO(x) :=
1
2π
Z
+
V (x)dω,
2. Screen-Space Bent Cones: A Practical Approach 193
where L
o
(ω
o
) is the outgoing radiance in direction ω
o
,Ω
+
is the upper hemi-
sphere, f
r
is the bidirectional reflectance distribution function (BRDF), n is the
surface normal, L
i
is the incoming light, and V is the visibility function that is
zero when a ray is blocked and one otherwise. We assume that the diffuse sur-
faces f
r
are constant and then ω
o
can be dropped. Applying AO, light from all
directions is equally attenuated by the average blocking over all directions.
Landis [Landis 02] used Monte-Carlo integration based on ray tracing to com-
pute the hemispherical integral of AO. The idea of bent normals also dates back
to the work of Landis, where it was proposed as a generalization of AO. Bent
normals are the mean free direction scaled by the mean occlusion and are used
for shading instead of the normals. Different from AO, their definition includes
the direction ω inside the integral:
N(x) :=
1
π
Z
+
V (x) ω dω.
For lighting computations, bent normals simply replace the surface normal and
the visibility term:
L
o
(x)
1
π
Z
+
L
i
(x)(N(x) · ω)dω.
In the case of bent normals, the visibility has to be multiplied with the direction
using Monte-Carlo computation of bent normals N(x), which is computationally
simple and efficient compared to AO alone.
AO—in particular in screen space—has become a key ingredient in the shading
found in a range of contemporary games [Mittring 07,Shanmugam and Arikan 07,
Eye
Normal: n
i
Ray: ω
Bent normal: N(x
i
)
Bent cone: C(x
i
)
Sample: x
x
j
.zx
i
.z
Figure 2.2. Overview: AO, bent normals, and bent cones in flatland.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required