Table of Contents
Fetching ...

Filtering After Shading With Stochastic Texture Filtering

Matt Pharr, Bartlomiej Wronski, Marco Salvi, Marcos Fajardo

TL;DR

This work argues that filtering after shading yields more accurate imagery than traditional texture filtering before shading, especially for nonlinear shading contributions. It introduces stochastic texture filtering (STF) as an efficient framework to perform after-shading filtering, with two complementary methods: Filter Reservoir Sampling (FRS) and Filter Importance Sampling (FIS), enabling high-quality filtering for textures stored in compressed or neural representations. The authors demonstrate substantial real-time and offline benefits, including significant rendering-time speedups, improved minification and anisotropic filtering, and viable integration with complex material graphs and novel texture representations. They also discuss practical considerations, noise management via spatiotemporal reconstruction, and avenues for future work such as appearance-driven MIP strategies and broader nonlinear reconstruction filters.

Abstract

2D texture maps and 3D voxel arrays are widely used to add rich detail to the surfaces and volumes of rendered scenes, and filtered texture lookups are integral to producing high-quality imagery. We show that applying the texture filter after evaluating shading generally gives more accurate imagery than filtering textures before BSDF evaluation, as is current practice. These benefits are not merely theoretical, but are apparent in common cases. We demonstrate that practical and efficient filtering after shading is possible through the use of stochastic sampling of texture filters. Stochastic texture filtering offers additional benefits, including efficient implementation of high-quality texture filters and efficient filtering of textures stored in compressed and sparse data structures, including neural representations. We demonstrate applications in both real-time and offline rendering and show that the additional error from stochastic filtering is minimal. We find that this error is handled well by either spatiotemporal denoising or moderate pixel sampling rates.

Filtering After Shading With Stochastic Texture Filtering

TL;DR

This work argues that filtering after shading yields more accurate imagery than traditional texture filtering before shading, especially for nonlinear shading contributions. It introduces stochastic texture filtering (STF) as an efficient framework to perform after-shading filtering, with two complementary methods: Filter Reservoir Sampling (FRS) and Filter Importance Sampling (FIS), enabling high-quality filtering for textures stored in compressed or neural representations. The authors demonstrate substantial real-time and offline benefits, including significant rendering-time speedups, improved minification and anisotropic filtering, and viable integration with complex material graphs and novel texture representations. They also discuss practical considerations, noise management via spatiotemporal reconstruction, and avenues for future work such as appearance-driven MIP strategies and broader nonlinear reconstruction filters.

Abstract

2D texture maps and 3D voxel arrays are widely used to add rich detail to the surfaces and volumes of rendered scenes, and filtered texture lookups are integral to producing high-quality imagery. We show that applying the texture filter after evaluating shading generally gives more accurate imagery than filtering textures before BSDF evaluation, as is current practice. These benefits are not merely theoretical, but are apparent in common cases. We demonstrate that practical and efficient filtering after shading is possible through the use of stochastic sampling of texture filters. Stochastic texture filtering offers additional benefits, including efficient implementation of high-quality texture filters and efficient filtering of textures stored in compressed and sparse data structures, including neural representations. We demonstrate applications in both real-time and offline rendering and show that the additional error from stochastic filtering is minimal. We find that this error is handled well by either spatiotemporal denoising or moderate pixel sampling rates.
Paper Structure (42 sections, 24 equations, 17 figures)

This paper contains 42 sections, 24 equations, 17 figures.

Figures (17)

  • Figure 1: A section of the Disney Cloud rendered with path tracing. Trilinear filtering leads to blocky artifacts in the image. Tricubic filtering gives a much better result, but requires $64$ voxel lookups to compute each filtered value. Stochastic filtering performs a single voxel lookup yet provides indistinguishable results, with rendering time speedups of $1.60\times$ and $2.77\times$ for the trilinear and tricubic filters. Times reported are for pbrt-v4 running on an NVIDIA 4090 RTX GPU, rendering at 1080p with 256 samples per pixel.
  • Figure 2: Appearance of a normal-mapped material under minification. Filtering before shading incorrectly filters the surface normal before shading, while filtering after shading more accurately reconstructs the material's appearance.
  • Figure 3: (a) Two texels with normals nearly 90 degrees apart. (b) With bilinear filtering, a smooth distribution of normals is reconstructed. (c) Filtering after shading always uses single texel values from the image, so filters two discrete normals in this case.
  • Figure 4: (a) The traditional approach filters first, then uses Planck's law to compute the volumetric emission spectrum. In contrast, (b) filtering after shading filters the emission spectra given by Planck's law. Because Planck's law is highly nonlinear, the results differ. Under minification, (c) MIP mapping introduces error by applying linear filtering to nonlinear quantities. Appearance is accurately preserved with (d) filtering after shading and no MIP maps.
  • Figure 5: A magnified normal-mapped specular surface. (a) Traditional filtering. (b) Filtering after shading with Equation \ref{['eq:filtering-after-shading']} introduces aliasing.
  • ...and 12 more figures