Efficient Multiscale Rendering of Specular Microstructure
Asen Atanasov

Charles University, Prague
Chaos GroupJaroslav KřivánekCharles University, Prague
Chaos Czech a. s.

Ours

directrender

Vladimir Koylazov
Chaos GroupOurs
Time: 35sec
Mem: 144MB

Alexander Wilkie

Charles University, Prague

Ours
Time: 50sec
Mem: 576MB

Time: 1576sec
Mem: 25GB[Yan et al. 2016]

Time: 4247sec
Mem: 100GB[Yan et al. 2016]

Figure 1: Our filtering method on surfaces such as car paint and scratched metal: left to right, texture resolution is 4k, 4k, and8k and number of bins 𝐵 is 1272 , 632 and 2552 . In the leftmost figure, the insets show the difference between our method (top)and unfiltered direct normal map evaluation (bottom). Unfiltered rendering misses many sparkles, and would flicker in ananimation. The insets of the middle and right images are comparisons between our method (top) and that of Yan et al. [2016](bottom) which is rendered with one Gaussian element per texel and intrinsic roughness 𝜎𝑟 = 0.005.

ABSTRACT
Texturing is a ubiquitous technique used to enrich surface appearance with fine detail. While standard filtering approaches, such as
mipmapping or summed area tables, are available for rendering
diffuse reflectance textures at different levels of detail, no widely
accepted filtering solution exists for multiresolution rendering ofsurfaces with fine specular normal maps. The current state of the art
offers accurate filtering solutions for specular reflection at the costof very high memory requirements and expensive 4D queries. We
propose a novel normal map filtering solution for specular surfaces
which supports data pre-filtering, and with an evaluation speed
that is roughly independent of the filtering footprint size. Its memory usage and evaluation speed are significantly more favorable
than for existing methods. Our solution is based on high-resolution
binning in the half-vector domain, which allows us to quickly build
a very memory efficient data structure.

CCS CONCEPTS• Computing methodologies → Reflectance modeling.

KEYWORDS
specular reflection, normal map, car paint, glints
ACM Reference Format:
Asen Atanasov, Jaroslav Křivánek, Vladimir Koylazov, and Alexander Wilkie.
2020. Efficient Multiscale Rendering of Specular Microstructure. In Special
Interest Group on Computer Graphics and Interactive Techniques ConferencePermission to make digital or hard copies of part or all of this work for personal orclassroom use is granted without fee provided that copies are not made or distributedfor profit or commercial advantage and that copies bear this notice and the full citationon the first page. Copyrights for third-party components of this work must be honored.
For all other uses, contact the owner/author(s).
SIGGRAPH ’20 Talks, August 17, 2020, Virtual Event, USA© 2020 Copyright held by the owner/author(s).
ACM ISBN 978-1-4503-7971-7/20/08.
https://doi.org/10.1145/3388767.3407338

Talks (SIGGRAPH ’20 Talks), August 17, 2020. ACM, New York, NY, USA,2 pages. https://doi.org/10.1145/3388767.3407338

1RELATED WORKAccurate rendering techniques for specular normal maps are basedon microfacet theory [Walter et al. 2007]. The smooth distributionof a classical microfacet BRDF 𝐷 (h) defined for the half vector his replaced by a normal distribution function (NDF) defined by thenormal map [Yan et al. 2016]. Given a normal map with 𝑁 texels,
each texel has a normal t𝑘 and occupies region 𝑇𝑘 in the texture
Í𝑁space: the NDF is defined as 𝐷 (h, x) = 𝑘=1
𝛿 (t𝑘 , h)I𝑇𝑘 (x), where𝛿 is a spherical delta function and I𝑆 is the indicator function on theset 𝑆. Note that the NDF depends on the texture space position x.
In order to facilitate efficient evaluation of the sharp spikes typicalfor glitter NDF, Yan et al. [2016] approximate the normal map
positions and normals with 4D Gaussians referred to as elements.
Effectively, this approximation introduces Gaussian filters for bothlocation and normal information. These elements are sorted ina 4D hierarchy, and a traversal is required to evaluate the NDF
or to sample normal proportional to it. Compared to brute force
rendering, this approach offers significant improvements for point
and small area lights. It is the approach closest to our own work,
but we improve in several important aspects: memory efficiency,performance and pre-filtering. This allows our solution to scale
well for distant views, and very high resolution normal maps.
Recently, Gamboa et al. [2018] presented a pre-filtered solution
to the problem, which offers memory and speed improvements
over Yan et al. [2016] via pre-filtering of the environment. However,their solution is not directly suitable for integration into a general
rendering engine, due to a heavy pre-computation step, and lack ofsupport for area lights.
In this paper, we propose a novel filtering technique: our technique is accurate, efficient at all scales, and requires only a brief
preparation phase. Also, our memory requirements are comparable

SIGGRAPH ’20 Talks, August 17, 2020, Virtual Event, USAHjyTkj1 Tkj2hmAtanasov, Křivánek, Koylazov, Wilkie

x
Tkj4

Hi

Tkj5

Tkj3

A

almost arbitrarily large. Therefore, we design the inverse map ofthe bin map to facilitate the evaluation. Since the bin map B maps
a texel index to a bin index, we define the inverse bin map B −1 asthe mapping from a bin index to the list of texel indices for a given
bin index: B −1 ( 𝑗) = {𝑘 𝑗1 , 𝑘 𝑗2 , · · · , 𝑘 𝑗𝑏 }, where 𝑗𝑏 is the number ofnormals in bin 𝑗. For a half vector h, we evaluate the NDF based on
the inverse bin map B −1 as follows: first, we find the bin index 𝑗,such that h ∈ 𝐻 𝑗 . Then we select the subset 𝑘𝐴 𝑗 of texels B −1 ( 𝑗)which lie in 𝐴: in Figure 2, only {𝑘 𝑗2 , 𝑘 𝑗4 , 𝑘 𝑗5 } are in 𝐴.

2.3
Figure 2: Left: The hemisphere partitioned into 5×5 bins seenfrom above. The half vector h is inside bin 𝑗. Right: The pixel
footprint 𝐴 in the texture space. All 5 texels corresponding
to the 𝑗-th bin B −1 ( 𝑗) = {𝑘 𝑗1 , . . . , 𝑘 𝑗5 } are drawn in red. Three𝐻of them overlap with 𝐴, are in 𝑘𝐴 𝑗 , and contribute to 𝐷𝐴 𝑗 .
to mipmapping, which is at least 60 times less than current state ofthe art [Gamboa et al. 2018].

2OUR SOLUTION

To achieve these improvements we apply a constant filter in bothtexture and half-vector spaces. Specifically, we average the NDF
over a finite area 𝐴 around x and a finite ∫solid∫ angle 𝐻 around1
𝐻 =h rendering the filtered NDF 𝐷𝐴|𝐻 | |𝐴 | 𝐻 𝐴 𝐷 (h, x)dxd𝜔 h ≈Í𝑁1
where|𝑆| is the area of the region 𝑆.
I(t)|𝐴∩𝑇|,𝑘|𝐻 | |𝐴 | 𝑘=1 𝐻 𝑘
The approximation is accurate for small 𝐻 . This formulation sug𝐻 is evaluated by summing the area of all texels insidegests that 𝐷𝐴
the filtering area 𝐴 whose normals are in the solid angle 𝐻 . To
define finite solid angles for different half vectors we partition thehemisphere into 𝐵 equiangular bins 𝐻 𝑗 , hence the bin solid angle is|𝐻 𝑗 | = 2𝜋
𝐵 , see projected hemisphere in Figure 2. Furthermore, weset the filtering region 𝐴 to the pixel footprint defined by the raydifferentials [Igehy 1999].
Next we describe how we sample a normal from the NDF and how
we evaluate the NDF. Using these two procedures we implement
sampling and evaluation of a microfacet BRDF [Walter et al. 2007].

2.1

Sample 𝐷𝐴𝐻

As preparation step, we quantise the normal map by assigning eachof its 𝑘 texels t𝑘 to a directional bin 𝐻 𝑗 in a bin map B (𝑘) = 𝑗. Givena pixel footprint 𝐴, we sample a normal proportional to the NDF
by sampling a random point y in 𝐴, and finding its corresponding
bin index 𝑖 from the bin map. We then sample a random normal m
inside the bin 𝐻𝑖 , see the blue regions in Figure 2. The probability
𝐻𝑖to sample this normal is equal to the NDF 𝐷𝐴.

2.2

Evaluate 𝐷𝐴𝐻

A key observation is that in our context sampling and evaluation
are inverse operations. Sampling computes an NDF normal m given
a map texel, while evaluation finds all contributing map texels
given a half vector normal h. We notice that sampling based on
the bin map B is a very efficient operation, while the evaluationis potentially very inefficient, as the number of texels in 𝐴 can be

Implementation details

During the preparation step we compute and store the two 𝑁 element integer maps B and B −1 based on the input normal map
which we do not keep afterwards. Note that in a typical normal
map often |B −1 ( 𝑗)| is too large for linear traversal, therefore, wedevise a combination of two auxiliary data structures that makeaccess to B −1 efficient. The first observation which led us to thisdesign was that for a large number of bins, the nonempty entries
are sparse. Therefore, we use a hash map that maps a bin index
to its texel list in B −1 . Furthermore, some bin lists in B −1 are toolarge to be traversed linearly. To optimise their traversal, we build
a forest of 2D kd trees, one for each texel list in B −1 larger than agiven value 𝐿 (16 in our implementation). 𝐿 is the maximum leaf
size of the forest. During the construction of the forest we follow
several conventions. First, we always split the larger side of thenode in the middle, so that split dimension and split position do
not need to be stored. Second, we sort each texel list so that foreach tree node its texels are consecutive in B −1 . This serves two
purposes for the traversal: cache coherence is improved, and thesize of each node is implicitly propagated as offsets to the node
start and end in B −1 . This property provides pre-filtering data, so
if a node is entirely inside the filtering region 𝐴 its total area isimmediately returned. Lastly, to achieve memory efficiency and tofavour serialisation, we pack the whole forest topology in a single
integer list.
Our benchmarks confirmed that in contrast to existing techniques [Yan et al. 2016], the memory and run time requirementsof our method are compatible with use in a production renderer.
Sample images rendered with our technique are presented in Figure
1, along with timing and memory usage.

ACKNOWLEDGMENTS
We are grateful to Veselin Mihaylov for preparing the scenes andto Lingqi Yan for providing us with his code.

REFERENCES
Luis E. Gamboa, Jean-Philippe Guertin, and Derek Nowrouzezahrai. 2018. Scalable
Appearance Filtering for Complex Lighting Effects. ACM Trans. Graph. 37, 6, Article
277 (Dec. 2018), 13 pages. https://doi.org/10.1145/3272127.3275058
Homan Igehy. 1999. Tracing Ray Differentials. In Proceedings of SIGGRAPH ’99. ACM
Press/Addison-Wesley Publishing Co., New York, NY, USA, 179–186. https://doi.
org/10.1145/311535.311555
Bruce Walter, Stephen R. Marschner, Hongsong Li, and Kenneth E. Torrance. 2007.
Microfacet Models for Refraction Through Rough Surfaces. In Proceedings of the18th Eurographics Conference on Rendering Techniques (EGSR’07). Eurographics
Association, Aire-la-Ville, Switzerland, 195–206. https://doi.org/10.2312/EGWR/
EGSR07/195-206
Ling-Qi Yan, Miloš Hašan, Steve Marschner, and Ravi Ramamoorthi. 2016. PositionNormal Distributions for Efficient Rendering of Specular Microstructure. ACM
Transactions on Graphics (Proceedings of SIGGRAPH 2016) 35, 4 (2016).