hn.today

Wavelets in 3D Graphics

comonad.com11 points0 comments
Screenshot of Wavelets in 3D Graphics

Wavelet techniques are applied to multiresolution texture storage and compression for 3D game engines to reduce memory use and avoid runtime stutter. Textures like 256x256 RGBA consume about 256 KB each and mipmaps add roughly 1/3 more storage, so scenes with dozens of textures can require hundreds of megabytes. Simple fixes such as 8-bit palettization reduce memory but worsen quality and complicate alpha; whole-image compression (e.g., JPEG/DCT) gives good ratios but forces full decompression and mipmap generation at once, creating stalls and CPU work. Haar-based transforms offer a cheaper alternative: inverse DCT on an 8x8 block costs many multiplies and adds per channel, whereas a Haar step decompression can be implemented mostly with additions.

The Haar approach converts texel grids into a scaling value plus multi-level wavelet coefficients via pairwise averaging and differences, then normalizes coefficients (e.g., multiply by 1/sqrt(2^j)). Using a nonstandard 2D decomposition that peels one level per row and column enables reconstructing low-resolution mipmaps incrementally from a small subset of coefficients, avoiding full-image decompression. Compression comes from zeroing small weighted coefficients and quantizing the remainder (the author uses a neural network for quantization), which bounds perceptual error and produces greater compressibility. This yields progressive, controllable quality, reduced memory footprint (no stored mipmaps), and smoother frame-rate behavior for low-contrast textures.

Read on comonad.com0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Other

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.