Skip to main content

Texture

The "texture" data structure contains information about an image texture used in a computer program or game engine. The following keys are included in this structure:

KeyTypeDescription
hashStringA unique identifier for the texture
typeStringThe type of the texture (e.g. Image, Normal, etc.)
slotStringThe prefered texture slot
mipmapCountIntegerThe number of mipmap levels in the texture
levelsIntegerThe number of levels a texture has
sizesizeThe size of the texture in pixels
filterModeIntegerThe filtering mode used when rendering the texture
wrapModeIntegerThe wrapping mode used when rendering the texture
linearBooleanA value indicating whether linear filtering
transparentBooleanA value indicating whether the texture has any
textureFilesArray of textureFilesArray of texture files

The above data structure can be represented:

"texture":{
"hash": "24138b00e6f6d85f9b410777a56aead0",
"type": "Image",
"slot": "_MainTex",
"mipmapCount": 10,
"levels": 6,
"size": {
"width": 512,
"height": 512,
"pow2": true
},
"filterMode": 1,
"wrapMode": 0,
"linear": false,
"transparent": false,
"textureFiles":[]
}

Texture File

Texture file describes properties of a texture. It inherits all keys from a file and has more keys described in the table bellow.

KeyTypeDescription
filefileFile information
sizesizeThe size of the texture in pixels
formatstringFormat
mipmapCountintegerThe number of mipmap levels in the texture file
levelintegerLevel of a texture
transparentbooleanIs transparent

Example

textureFile example
{
"file":{
"name": "24138b00e6f6d85f9b410777a56aead0.basis",
"hash": "24138b00e6f6d85f9b410777a56aead0",
"size": 44619,
"url": "https://example.com/24138b00e6f6d85f9b410777a56aead0.basis",
"type": "basis",
"storage": "AWS"
},
"variant": "original",
"size": {
"width": 512,
"height": 512,
"pow2": true
},
"format": "RGBA32",
"mipmapCount": 10,
"level": 1,
"transparent": false
}