LLearnCode
Academy/graphics/The rendered world

intermediate · 29 minute study

A texture is data with a meaning and a budget

A small downloaded image can occupy a large GPU allocation, and a plausible-looking material can still interpret its data incorrectly. Learn representation, color and memory together.

Loading progressEvidence grows with practice
Useful preparation · 1 prerequisite

Use this as a map, not a lock. If these ideas are familiar, continue.

  • Local transforms compose into a world — A model that orbits instead of turning, a child that jumps, or a lit object that goes dark often reflects a misunderstanding of coordinate space or ownership.

First, build a mental model

A material is a recipe for surface response. Texture channels are inputs to that recipe: visible color, roughness, metalness, normals or other data. Their meaning determines how values are decoded. Their dimensions and GPU format determine allocation; their compressed file size answers a separate network question.

  1. A physically based material approximates how a surface responds to light. Roughness controls the spread of reflections; metalness changes the material model. These controls do not describe the mesh's polygon count, and a metallic surface needs something useful to reflect.
  2. Color textures such as base color are commonly encoded in sRGB and need the corresponding color-space annotation. Data textures such as normal or roughness maps should not be treated as sRGB color. GLTFLoader configures many material conventions for you; independently loaded images require deliberate setup.
  3. UV coordinates associate mesh locations with texture locations. A seam is a boundary in that mapping. Distortion, seams and texel density are asset-authoring concerns as well as renderer concerns; a larger file does not repair a wrong UV layout.
  4. An uncompressed RGBA8 level stores four bytes per texel. Width × height × 4 gives the base allocation. A complete square power-of-two mip chain adds about one third more texels; small levels make the exact finite sum slightly smaller.
  5. Network compression, image decode and GPU texture compression are distinct operations. A JPEG or PNG can transfer cheaply and still decode to a large uncompressed allocation. Supported GPU block-compressed formats can change that allocation, with device and quality trade-offs.
Read the codejavascript · educational example
import * as THREE from "three";
const loader = new THREE.TextureLoader();
// Synthetic example paths: supply your own images before running this snippet.
const baseColor = await loader.loadAsync("/assets/demo-base-color.png");
baseColor.colorSpace = THREE.SRGBColorSpace;
const roughness = await loader.loadAsync("/assets/demo-roughness.png");
// Roughness remains non-color data; do not mark it as sRGB.
const material = new THREE.MeshStandardMaterial({
  map: baseColor, roughnessMap: roughness, roughness: 1, metalness: 0
});
const baseBytes = 1024 * 1024 * 4;
console.log(baseBytes / (1024 * 1024)); // 4 MiB, before mip levels
// The owner releases the material and each owned texture when unused.
// material.dispose() alone does not dispose its texture maps.
  1. Transfer

    The browser downloads a compressed file. This byte count affects loading, but it is not a direct report of its eventual GPU allocation.

  2. Interpret

    Base-color values are treated as color; roughness values are treated as numeric surface data. Assigning the wrong interpretation changes the rendered response.

  3. Allocate

    A 1024-square uncompressed RGBA8 base level needs 4 MiB. Additional mip levels, extra maps and duplicated resources increase the total.

Production thinking

Take this beyond the example.

Record dimensions, color/data roles, mip policy and ownership in an asset manifest. Inspect representative lighting and mobile memory behavior. Validate the exported result, since texture packing, color interpretation and material conversion may differ from the authoring viewport. A budget calculator estimates declared representations; a browser measurement must verify actual allocations and behavior.

Sources and further reading

Your evidence

unseen is a local learning signal, not a credential or proof of production competence.

Explain the mental model, then explicitly acknowledge it. Opening a page is not evidence.

Supported retries can complete this lesson. Independent evidence and delayed review determine the skill stage.

Next lesson · Loading a model is an asynchronous lifecycle →