Google and Binomial Companies source texts , a codec for efficient texture compression and its associated universal file format ".basis" for distributing image and video-based textures. The reference implementation is written in C++ and under the Apache 2.0 license.
Basis Universal complements the previously 3D data compression system Draco and aims to address the texture delivery issue for GPUs. Until now, developers have been limited in their choices between low-level formats that achieve high performance but are GPU-specific and take up a lot of disk space, and other formats that allow for size reduction but cannot compete with GPU textures in performance.
The Basis Universal format enables native-level performance for GPU textures while offering a higher compression ratio.
Basis serves as an intermediate format, providing fast transcoding into various low-level GPU texture formats used on both desktop systems and mobile devices. Currently, it supports transcoding into formats like PVRTC1 (4bpp RGB), BC7 (mode 6 RGB), BC1-5, ETC1, and ETC2. Future support for the ASTC format (RGB or RGBA) and modes 4/5 RGBA for BC7 and 4bpp RGBA for PVRTC1 is expected.
Textures in the basis format take up 6-8 times less video memory and require approximately twice as less data transfer than typical textures based on JPEG format and 10-25% less than textures in RDO mode. For example, with a JPEG image size of 891 KB and an ETC1 texture at 1 MB, the size of data in Basis format is 469 KB in the highest quality mode. In memory tests, the JPEG and PNG textures consumed 16 MB of memory, while the textures in the
Basis format required 2 MB of memory when transcoding to BC1, PVRTC1, and ETC1, and 4 MB when transcoding to BC7.
The process of converting existing applications to Basis Universal is quite simple. It is sufficient to recode the existing textures or images into the new format using the project’s provided utility 'basisu', selecting the desired quality level. Then, within the application, before the rendering code, you need to initialize the basisu transcoder, which is responsible for translating the intermediate format to a format supported by the current GPU. Throughout the entire processing chain, images remain compressed, including being loaded in a compressed form into the GPU. Instead of preemptively transcoding the entire image, the GPU selectively decodes only the necessary parts of the image.
It supports the saving of heterogeneous texture arrays (cubemap), volumetric textures, texture arrays, mipmap levels, video sequences, or arbitrary texture fragments in a single file. For example, it is possible to package a series of images into one file to create short videos or combine multiple textures using a common palette for all images and deduplication of standard image patterns. The implementation of the Basis Universal encoder supports multi-threaded encoding using OpenMP. The transcoder currently operates only in a single-threaded mode.
Additional The Basis Universal decoder for browsers is delivered in a WebAssembly format, which can be used in web applications based on WebGL. Ultimately, Google aims to achieve support for Basis Universal in all major browsers and promote it as a portable texture format for WebGL and the upcoming specification , conceptually similar to the Vulkan, Metal, and Direct3D 12 APIs.
It is noted that the ability to embed video with subsequent processing solely on the GPU side makes Basis Universal an interesting solution for creating dynamic user interfaces in WebAssembly and WebGL, where hundreds of small videos can be displayed simultaneously with minimal CPU load. Before the advent of SIMD instructions in WebAssembly, achieving such performance levels with traditional codecs was not possible; therefore, texture-based video can be used in areas where regular video is not applicable. Currently, code with additional optimizations for video, including the ability to use is being prepared for publication. with support for adaptive filling (CR).
Source: opennet.ru
