Technical sectionMemory efficient light baking
Graphical abstract
Highlights
► Global illumination effects are usually pre-computed for real-time rendering. ► Data is typically stored at vertices or in textures. ► Textures provide higher quality, but demand considerably more GPU memory. ► We combine both methods to significantly reduce memory requirement at same quality. ► Our method is fully automatic and has no impact on rendering performance.
Introduction
High quality rendering requires global illumination effects, in particular soft shadows, environmental lighting, indirect illumination, and reflections. All of them are computationally expensive and cannot be computed in real-time for complex scenes. The common solution is to precompute view independent effects, e.g., soft shadows, ambient occlusion, indirect illumination or radiance transfer coefficients and store them as vertex attributes or textures.
Storing precomputed lighting data is commonly referred to as baking. Two methods are well established: storing the data with the mesh vertices or in textures. Vertex baking requires only memory for lighting data at the mesh vertices, however, sub-triangle information cannot be reconstructed. Hence, texture-based baking is typically preferred, since textures can provide a larger number of samples and a more uniform sample distribution. Besides memory for the samples, textures require a parameterization of the mesh, which often involves manual intervention and texture coordinates as an additional vertex attribute.
The motivating application for this paper is the high-quality visualization of complex objects for product design and review, where important decisions are made upon the visual appearance of the models. This usually requires high resolution textures for lighting, which in practice occupy the majority of available video memory. Between review sessions, models are edited, so manual intervention during unwrapping and tweaking parameters is time-consuming. Hence, fast and fully automatic solutions are desirable. Industry models are typically modeled using free form surfaces, which are tessellated into very small triangles for interactive rendering. Therefore, we observe that vertex baking is often sufficient for the majority of scene triangles and only for a fraction of triangles artifacts appear (we will discuss vertex versus texture baking in detail in Section 3).
In this paper, we propose a simple hybrid representation which stores lighting data with the vertices by default, and only uses textures where necessary. To realize this simple idea, we use the following pipeline:
- •
First, the triangles for which vertex-based interpolation is sufficient are determined. The lighting information at the vertices is computed by sampling and solving a linear optimization problem (Section 4.1).
- •
All triangles that require texture are extracted, segmented, and unwrapped to a texture atlas. Since these chunks are usually much smaller than the original mesh, and typically form simple strips, unwrapping them is much cheaper than unwrapping the complete mesh. The lighting information is then baked into the generated texture atlas (Section 4.2).
- •
During rendering, the lighting data is merged using a simple shader that can do both, vertex-based interpolation and texture lookups, and smoothly blends the results (Section 4.3).
Section snippets
Previous work
Precomputed lighting: Much work has been done on precomputing lighting using, e.g., Monte–Carlo ray tracing, photon mapping or radiosity solvers. Besides effects like shadows and indirect lighting, more advanced methods have been developed such as precomputed radiance transfer [19], incident light probes using spherical harmonics [16], [2], radiosity normal mapping [6] or irradiance normal mapping [7]. The resulting data ranges from 1D 8-bit scalar data up to 36D RGB coefficients. Most modeling
Vertex baking vs. texture baking
Baking light information as vertex data is very simple: the information is attached to the vertices as an attribute which is automatically interpolated during rasterization [5]. However, sample density is static and no sub-triangle information can be represented. Subdividing the mesh until the signal can be adequately represented makes it necessary to also duplicate all other attributes. In practice this is mostly not an option, as this results in significant memory overhead.
Vertex-based baking
Pipeline
In the following, we describe a pipeline that realizes this hybrid storage scheme. We first sample the lighting data uniformly and compute optimized vertex values using a method similar to [11]. Then we determine for each triangle whether vertex-based storage is sufficient to reconstruct the signal, or texture-based storage is necessary (Section 4.1). For triangles containing high frequency detail, we compute a parameterization and store lighting data in a texture (Section 4.2). At render time,
Results
In Fig. 9 we show results of our method for the Utah Fairy scene with baked ambient occlusion, a complex car model with soft shadows of an area light source and baked indirect lighting for a car seat. Detail comparisons to vertex-based baking, a ray traced reference using 1024 samples per pixel and classification results are available in Fig. 11, Fig. 12, Fig. 13. For vertex-baking we examine point sampling (sampling the signal at the vertex positions) and least-squares fitting as described
Limitations and conclusion
We introduced a simple and memory efficient technique for baking precomputed lighting. Our method combines the advantages of vertex-based (low memory footprint) and texture-based storage (high resolution also on large triangles). We showed that our method generates a close to optimal solution in a fully automatic process. Rendering requires only little additional shader code which has no negative impact on rendering time. Our method allows to use standard texture compression methods to further
References (21)
- et al.
Two bit/pixel full color encoding
Computer graphics (Proceedings of SIGGRAPH'86)
(1986) - Chen H, Liu X. Lighting and material of Halo 3. In: ACM SIGGRAPH 2008 classes;...
- et al.
An unsymmetric-pattern multifrontal method for sparse LU factorization
SIAM J Matrix Anal Appl
(1997) - Fenney S. Texture compression using low-frequency signal modulation. In: Proceedings of HWWS'03; 2003. p....
Continuous shading of curved surfaces
IEEE Trans Comput C
(1971)- Green C. Efficient self-shadowed radiosity normal mapping. In: ACM SIGGRAPH 2007 courses;...
- Habel R, Wimmer M. Efficient irradiance normal mapping. In: Proceedings of I3D 2010; 2010. p....
- Hu Y, Wang X. Lightmap compression in Halo 3. In: Game developer conference 2008;...
- Iourcha K, Nayak K, Hong Z. System and method for fixed-rate block-based image compression with inferred pixels values....
- Julius D, Kraevoy V, Sheffer A. D-Charts: quasi-developable mesh segmentation. In: Computer graphics forum (Proceedings...
Cited by (5)
When a tree model meets texture baking: an approach for quality-preserving lightweight visualization in virtual 3D scene construction
2023, International Journal of Digital EarthReal-time Deep Radiance Reconstruction from Imperfect Caches
2022, Computer Graphics ForumEfficient light baking based on adaptive triangle subdivision
2013, Jisuanji Xuebao/Chinese Journal of ComputersMultiresolution attributes for hardware tessellated objects
2013, IEEE Transactions on Visualization and Computer GraphicsAdaptive mesh subdivision for efficient light baking
2012, Visual Computer