Today I m releasing Spark for Unity, a Unity package that brings the Spark texture codecs to the Unity engine. It s available now on GitHub and it s free for projects with lifetime revenue under $100K. Unity’s built-in runtime texture compression is CPU-bound, limited in format support, and often too slow for real-time use cases. Spark for...
You would think that loading images in the browser is a solved problem. After all, websites are basically composed of text and images. Turns out that loading images from JavaScript to use in WebGL/WebGPU applications is not nearly as simple or well supported as it should be. There are several APIs for it, and the...
The Apple Lossy compression format was introduced in the A15 and M2 chipsets (which share the same GPU generation) and it enables sampling and rendering to textures with a 1:2 compression ratio. The format is transparent to the application: the GPU handles compression and decompression automatically, and the block layout is never exposed through the...
In my previous post Writing to Compressed Textures in Metal, I showed how Metal heaps can be used to alias buffers and textures to inspect their actual memory layout. Something that caught my attention was how much memory is wasted with non-power-of-two textures. On many devices the texture dimensions get rounded up to the next...
About a year ago I wrote GPU Texture Compression Everywhere, a post in which, among other things, I lamented that Metal did not have support for writing to compressed textures. Unlike Vulkan or D3D12, Metal doesn t support resource casting. There s no way to write to a compressed texture through an uncompressed view. The only way...
One of the things I ve always lamented about hardware image formats is the slow pace of innovation. Developers were usually unwilling to ship textures in a new format unless that format was widely available. That is, the format had to be supported in the majority of the hardware they were targeting, and must be supported...
I m excited to announce spark.js 0.1, now with WebGL support! spark.js has been evolving since I released it last summer. Since then, the WebGPU ecosystem has matured considerably. WebGPU is now more stable and widely supported across browsers and platforms. However, users kept telling me the same thing: even though targeting WebGPU is practical today,...
One of the advantages of runtime texture compression is that mipmaps can also be computed at runtime and do not need to be transmitted. In contrast, offline codecs must precompute mipmaps so they can be compressed and transmitted alongside the base image. Each mip level requires one quarter of the memory of its parent, so...
The other day I was looking at this clustered shading WebGPU demo and was surprised by the jarring texture compression artifacts: The glTF model using KTX ETC1S textures is very compact, but is it worth the dramatic quality reduction? I wanted to see how this model would look with AVIF and Spark, so I went...
Normal maps are one of the most widely used texture types in real-time rendering, but they’re also a bit unusual. They don’t represent color, rely on geometric assumptions, and small encoding or decoding details can lead to subtle artifacts. This article takes a practical look at how normal maps are commonly compressed today, the tradeoffs...