Exponential Shadow Map

https://www.trentreed.net/blog/exponential-shadow-maps/
https://zhuanlan.zhihu.com/p/26853641
https://github.com/jacres/of-ESMShadowMapping

ABSTRACT
Rendering high-quality shadows in real-time is a challenging problem.
Shadow mapping has proved to be an efficient solution, as it
scales well for complex scenes. However, it suffers from aliasing
problems. Filtering the shadow map alleviates aliasing, but unfortunately,
native hardware-accelerated filtering cannot be applied, as
the shadow test has to take place beforehand.
We introduce a simple approach to shadow map filtering, by approximating
the shadow test using an exponential function. This
enables us to pre-filter the shadow map, which in turn allows for
high quality hardware-accelerated filtering. Compared to previous
filtering techniques, our technique is faster, consumes less memory
and produces less artifacts.
Index Terms: I.3.7 [Computer Graphics]: Three-Dimensional
Graphics and RealismColor, Shading, Shadowing and Texture;
I.3.1 [Computer Graphics]: Hardware ArchitectureGraphics processors;

1 INTRODUCTION
Ever since computer graphics has emerged, great efforts have been
made to provide innovative and efficient solutions to visibility and
shadow computation. Unfortunately, high quality shadows still demand
a lot of computational resources, which forces us to sacrifice
quality in order to attain real-time performance. Samplingbased
methods like Shadow Mapping [12] scale well with an increasing
scene complexity, and have become the de facto standard

shadow algorithm in many rendering engines. The major problem
of shadow mapping is discretization artifacts due to insufficient
shadow map resolution, which causes aliasing and temporal
incoherence. Compared to the vast amount of papers dedicated
to increase the effective shadow map resolution [3, 6, 11, 13], only
very few deal with shadow map filtering to provide effective screenspace
anti-aliasing.
High quality texture filtering is commonplace in today’s graphics
hardware. Shadow maps, which are basically depth textures, cannot
be filtered in the same manner, as the shadow test has to be carried
out before the filtering takes place. Percentage Closer Filtering
(PCF) [9] respects the order of filtering and testing, and became
available on graphics hardware, albeit with limited quality (bilinear
filtering only). The lack of decent filtering does not only degrade
image quality, but also reduces temporal coherence. One can increase
the quality of PCF by taking into account more samples,
(e.g., in a hardware shader) but this reduces performance dramatically.
Efficient filtering of regular textures relies on pre-filtering the
image a priori. This is done by pre-computing an image pyramid,
commonly known as a mip-map. However, the shadow test cannot
be carried out at that point, since the distance to the light source of
the to-be-shaded point has to be taken into account as well but is
not known in advance.
Recently, Variance Shadow Maps (VSMs) [5] and Convolution
Shadow Maps (CSMs) [2] have been introduced. They make it possible
to pre-filter the shadow map, and also support additional convolutions,
and increase temporal coherence. However, VSMs are
plagued by severe high frequency light leaking artifacts, and CSMs
suffer from lightness problems at contact shadows but render correct
shadow boundaries. In addition, the large memory footprint
and high filter cost of CSMs hinder their applicability.
We present Exponential Shadow Maps (ESMs), a new shadow
mapping method that allows for efficient (pre-)filtering. ESMs are
inspired by CSMs, but use a single-term approximation, whereas
CSMs use much more (typically 16) terms. This approximation
assumes that the support of a filter kernel does not contain surface

samples (i.e., z values) that lie beyond the distance from each screen
pixel’s world-space position to the light source. This approximation
holds for many cases, e.g., for rendering a shadow on a large
receiver, like a floor. When the assumption does not hold, we fall
back to PCF, which typically only happens for a small fraction of
pixels on the screen.
ESMs offer higher frame rates compared to CSMs, and a reduced
memory footprint, because they use a much simpler approximation
(1 term only). In addition, ESMs do not suffer from the light leaking
artifacts as much as VSMs and CSMs. Finally, compared to
PCF, ESMs can exploit high quality texture filtering modes, such as
anisotropic filtering, which are commonly found on today’s graphics
hardware.
2 RELATED WORK
A complete review of existing shadow algorithms is beyond the
scope of this article and we refer the reader to Woo et al. [14] and
Hasenfratz et al. [7] for excellent overviews on shadow methods.
This section’s focus is on rendering and anti-aliasing of hard shadows
and also on current hardware shadow texture filtering.
Shadows. Shadow Volume rendering [4] is an object-space algorithm
that constructs semi-finite volumes from object silhouettes
with respect to the current light view, to determine whether a point
is in shadow or not. Even though it renders accurate shadows, its
performance strongly depends on the geometric complexity and the
resulting rasterization overhead, and has robustness issues.
Shadow Mapping [12] is an image-based method which discretizes
objects into the depth buffer, viewed from the light source.
This depth buffer is then used by the shadow test in the second
pass, and is typically implemented using projective texture mapping.
Shadow mapping scales very well with increased scene geometry,
but it is also hampered by aliasing due to limited shadow
map resolution.
Previous work tackles this resolution problem, and tries to alleviate
the shadow map’s perspective distortion. Solutions range from
generating the shadow map in post perspective space [11, 13], over
constructing hierarchical and adaptive shadow maps to increase the
resolution where needed [6], to irregular sampling when rendering
the shadow map [1].
Anti-Aliasing. Percentage Closer Filtering [9] determines the
coverage of a camera pixel in light space and applies the shadow test
to a number of samples distributed over this region to get a filtered
results. Unfortunately, the shadow test depends on the distance to
the point to shade. This distance is only available at run-time and
prevents pre-filtering (i.e., mip-mapping).
Variance Shadow Maps [5] is a probabilistic approach that supports
pre-filtering, and additional convolutions. When the shadow
map is rasterized, the z and z2 values are stored and used during rendering
to estimate the probability whether a point is in shadow or
not. Their estimate only gives an upper bound of the result and produces
noticeable high frequency light leaking artifacts for scenes
with a high depth complexity. Recently, a variant of VSMs using
summed-area tables has been published, which reduces light
leaking [8]. However, the authors show that it cannot be removed
completely.
Convolution Shadow Maps [2] achieve anti-aliased shadows by
approximating the shadow test by a Fourier series expansion. Depending
on the truncation order, z-values are converted into several
basis textures. In the final rendering, pre-filtered texture samples
are fetched to reconstruct a smoother shadow. CSMs have the same
desirable properties as VSMs, but do not exhibit such severe light
leaking artifacts. However, a reliable shadow test requires a high
truncation order, which in turn increases memory consumption and
filtering as well as reconstruction effort. This makes CSMs less
attractive for practical applications.

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值