class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCountedResourceTextureTexture2D PortableCompressedTexture2D
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.

Enum CompressionMode<>():Enum

COMPRESSION_MODE_LOSSLESS = 0

There is currently no description for this enum. Please help us by contributing one!


COMPRESSION_MODE_LOSSY = 1

There is currently no description for this enum. Please help us by contributing one!


COMPRESSION_MODE_BASIS_UNIVERSAL = 2

There is currently no description for this enum. Please help us by contributing one!


COMPRESSION_MODE_S3TC = 3

There is currently no description for this enum. Please help us by contributing one!


COMPRESSION_MODE_ETC2 = 4

There is currently no description for this enum. Please help us by contributing one!


COMPRESSION_MODE_BPTC = 5

There is currently no description for this enum. Please help us by contributing one!

bool keep_compressed_buffer<>():bool

When running on the editor, this class will keep the source compressed data in memory. Otherwise, the source compressed data is lost after loading and the resource can't be re saved.

This flag allows to keep the compressed data in memory if you intend it to persist after loading.

Vector2 size_override<>():Vector2

Allow overriding the texture size (for 2D only).

void create_from_image<>( Image image=, image:Image=, CompressionMode compression_mode=, compression_mode:CompressionMode=, bool normal_map=false, normal_map:bool=false, float lossy_quality=0.8, lossy_quality:float=0.8, ):void

Initializes the compressed texture from a base image. The compression mode must be provided.

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.

CompressionMode get_compression_mode<>():CompressionMode

Return the compression mode used (valid after initialized).

Format get_format<>():Format

Return the image format used (valid after initialized).

bool is_keeping_all_compressed_buffers<>():bool

Return whether the flag is overridden for all textures of this type.

void set_keep_all_compressed_buffers<>( bool keep=, keep:bool=, ):void

Overrides the flag globally for all textures of this type. This is used primarily by the editor.




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...