← All namespaces

texture

Project & assets Core

Create, import, inspect, and configure textures: render targets, texture arrays, compression, streaming, channels.

What it's for

This namespace is the full lifecycle for texture assets. It creates them from scratch (procedural noise, gradients, and patterns, plus render targets), imports them from image files on disk, and derives new ones from existing content (normal maps from height, AO from a mesh, channel-packed masks). It also reads a texture's real state and configures the import-side settings that decide how it renders.

The configuration surface covers the settings you would otherwise click through in the texture editor: compression mode, texture/LOD group, LOD bias, mip streaming and virtual-texture streaming, filtering, and wrap mode. There is also a set of pixel operations (resize, blur, sharpen, invert, desaturate, level and curve adjustments) that bake a new texture from a source.

For a read, texture.describe is the canonical live inspection: it loads the asset as a UTexture, so it works for 2D textures, cube textures, arrays, volume textures, and render targets, and returns the same shape as the texture.json asset-dump sidecar (size, pixel format, compression, sRGB, mips, streaming, and source fields).

Use this namespace when you care about the texture asset itself: its bytes, its channels, and its import settings. Use call("material") when you are wiring a texture into a shader graph or a material instance, not changing the texture asset.

Examples

Generate a procedural noise texture

Bake a tileable Perlin noise texture straight into your content folder, no source image needed.

You: Make a 512x512 seamless Perlin noise texture called T_Noise under /Game/Textures.

  call("texture.create_noise_texture", {name:"T_Noise", path:"/Game/Textures",
        noiseType:"Perlin", width:512, height:512, seamless:true})
    → {ok:true, assetPath:"/Game/Textures/T_Noise"}

Done. Created a 512x512 seamless Perlin noise texture at /Game/Textures/T_Noise.

Channel-pack a mask and mark it as a mask texture

Combine three grayscale maps into one RGB mask, then set the compression mode so it is not treated as color.

You: Pack AO, roughness, and metallic into one mask texture and set it up as a mask.

  call("texture.channel_pack", {name:"T_ORM", path:"/Game/Textures",
        redTexture:"/Game/Textures/T_AO",
        greenTexture:"/Game/Textures/T_Rough",
        blueTexture:"/Game/Textures/T_Metal"})
    → {ok:true, assetPath:"/Game/Textures/T_ORM"}
  call("texture.set_compression_settings", {assetPath:"/Game/Textures/T_ORM",
        compressionSettings:"TC_Masks"})
    → {ok:true}

Done. Packed T_ORM from three channels and set compression to TC_Masks.

Inspect a texture's real settings

Read the live state of any texture asset as text before you change it.

You: What are the size and compression settings on T_Rock_Diffuse?

  call("texture.describe", {assetPath:"/Game/Textures/T_Rock_Diffuse"})
    → {kind:"Texture2D", size:{x:2048, y:2048}, pixelFormat:"PF_DXT5",
        compressionSettings:"TC_Default", sRGB:true, neverStream:false}

Done. T_Rock_Diffuse is a 2048x2048 sRGB DXT5 texture using TC_Default.

← Back to all namespaces