public sealed class TextureImporterTurns an image an artist saved into the KTX2 file a device uploads.
As a importer
- Extensions
- .png .jpg .jpeg .bmp .tga .psd .gif .hdr .ktx2 .dds
Remarks
Decode, limit, label, reduce, compress, write. Every step but the first is Vixen.Core.Imaging, and the whole reason this class is short is that the decisions live where they can be tested against something: the mip filter's variants, the block encoders' bounds, the container's layout.
What it decides, and what it refuses to decide. It picks a compressed format from the usage when the settings say Automatic, and it will not pick one that cannot hold what the texture is — a colour texture is not silently squeezed into BC5's two channels. When the target is a phone it produces uncompressed and says why, rather than shipping BC7 that most Android hardware cannot sample.
A compressed source passes straight through. A .ktx2 an artist compressed with a better encoder is copied rather than decoded and re-encoded, because a second round of lossy compression only ever loses.
A high-range source takes its own path and keeps its range. A .hdr decodes to Rgba32Float, which the eight-bit path cannot hold and used to fail on; it ships as BC6H, or as floats when the settings say no compression. See HighRange for the three eight-bit decisions that are reported rather than applied.
Fields and properties (1)
public override int VersionIts own version. Bumping it invalidates every artefact it has ever produced, which is the whole mechanism for "I fixed the mip filter, re-import everything".
Methods (3)
public TextureImporter()Uses the decoders that ship.
public TextureImporter(IReadOnlyList<IImageDecoder> decoders)Uses a given set of decoders.
protected override ValueTask<ImportResult> ImportAsync(ImportContext context, TextureImportSettings settings, CancellationToken cancellationToken)Imports one asset.
Used by (6)
- BuiltInImportersVixen.Editor.Assets
- DdsImportTestsVixen.Editor.Assets.Tests
- EveryAttributedImporterTestsVixen.Editor.Assets.Tests
- FixtureProjectTestsVixen.Editor.Assets.Tests
- HdrImportTestsVixen.Editor.Assets.Tests
- TextureImporterTestsVixen.Editor.Assets.Tests