Skip to main content

Module texture

Module texture 

Source
Expand description

Texture decoder: image bytes → CpuTexture (via the image crate).

Auto-registered via inventory::submit! under the canonical "texture" slot. Single canonical implementation — no swap needed.

The decoder reports the pixel layout only. Whether the values are to be read as sRGB or linear is the role of the material slot referencing them, supplied downstream as a TextureColorSpace — the same PNG is an sRGB albedo map or a linear normal map depending on the slot. Float sources (Radiance .hdr, OpenEXR) keep their high dynamic range instead of being flattened to 8-bit, which is what makes an authored environment map usable by the IBL bake.

Structs§

TextureDecoder
Decodes common image formats (PNG, JPEG, HDR, EXR, …) into a CpuTexture.