Provides a compressed texture for disk and/or VRAM in a way that is portable.
This class allows storing compressed textures as self contained (not imported) resources. For 2D usage (compressed on disk, uncompressed on VRAM), the lossy and lossless modes are recommended. For 3D usage (compressed on VRAM) it depends on the target platform. If you intend to only use desktop, S3TC or BPTC are recommended. For only mobile, ETC2 is recommended. For portable, self contained 3D textures that work on both desktop and mobile, Basis Universal is recommended (although it has a small quality cost and longer compression time as a tradeoff). This resource is intended to be created from code.
Initializes the compressed texture from a base image. The compression mode must be provided. [param normal_map] is recommended to ensure optimum quality if this image will be used as a normal map. If lossy compression is requested, the quality setting can optionally be provided. This maps to Lossy WebP compression quality.
Return the compression mode used (valid after initialized).
Return the image format used (valid after initialized).
Return whether the flag is overridden for all textures of this type.
Sets the compressor parameters for Basis Universal compression. See also the settings in [ResourceImporterTexture]. [b]Note:[/b] This method must be called before [method create_from_image] for this to work.
Overrides the flag globally for all textures of this type. This is used primarily by the editor.
- If [code]true[/code], when running in the editor, this texture will keep the source-compressed data in memory, allowing the data to persist after loading. Otherwise, the source-compressed data is lost after loading and the texture can't be re-saved. [b]Note:[/b] This property must be set before [method create_from_image] for this to work.
- Allows overriding the texture's size (for 2D only).