Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

ResourceImporterTexture

Inherits: ResourceImporter < RefCounted < Object

Imports an image for use in 2D or 3D rendering.

Description

This importer imports CompressedTexture2D resources. If you need to process the image in scripts in a more convenient way, use ResourceImporterImage instead. See also ResourceImporterLayeredTexture.

Tutorials

Properties

int

compress/channel_pack

0

int

compress/hdr_compression

1

bool

compress/high_quality

false

float

compress/lossy_quality

0.7

int

compress/mode

0

int

compress/normal_map

0

int

detect_3d/compress_to

1

bool

editor/convert_colors_with_editor_theme

false

bool

editor/scale_with_editor_scale

false

bool

mipmaps/generate

false

int

mipmaps/limit

-1

bool

process/fix_alpha_border

true

bool

process/hdr_as_srgb

false

bool

process/hdr_clamp_exposure

false

bool

process/normal_map_invert_y

false

bool

process/premult_alpha

false

int

process/size_limit

0

int

roughness/mode

0

String

roughness/src_normal

""

float

svg/scale

1.0


Property Descriptions

int compress/channel_pack = 0

Controls how color channels should be used in the imported texture.

sRGB Friendly: Prevents the RG color format from being used, as it does not support sRGB color.

Optimized: Allows the RG color format to be used if the texture does not use the blue channel. This reduces memory usage if the texture's blue channel can be discarded (all pixels must have a blue value of 0).


int compress/hdr_compression = 1

Controls how VRAM compression should be performed for HDR images.

Disabled: Never use VRAM compression for HDR textures, regardless of whether they're opaque or transparent. Instead, the texture is converted to RGBE9995 (9-bits per channel + 5-bit exponent = 32 bits per pixel) to reduce memory usage compared to a half-float or single-precision float image format.

Opaque Only: Only uses VRAM compression for opaque HDR textures. This is due to a limitation of HDR formats, as there is no VRAM-compressed HDR format that supports transparency at the same time.

Always: Force VRAM compression even for HDR textures with an alpha channel. To perform this, the alpha channel is discarded on import.

Note: Only effective on Radiance HDR (.hdr) and OpenEXR (.exr) images.


bool compress/high_quality = false

If true, uses BPTC compression on desktop platforms and ASTC compression on mobile platforms. When using BPTC, BC7 is used for SDR textures and BC6H is used for HDR textures.

If false, uses the faster but lower-quality S3TC compression on desktop platforms and ETC2 on mobile/web platforms. When using S3TC, DXT1 (BC1) is used for opaque textures and DXT5 (BC3) is used for transparent or normal map (RGTC) textures.

BPTC and ASTC support VRAM compression for HDR textures, but S3TC and ETC2 do not (see compress/hdr_compression).


float compress/lossy_quality =