Skip to content

Materials and textures

Every surface is drawn by a shader, a small program on the graphics card that works out each pixel’s colour. The game ships its shaders; you don’t write new ones. What you make is a materialmaterial: How a surface looks: one of the game's shaders, with the textures and values that feed it. (Studio calls the file a material instance): one of the game’s shaders, plus the texturestexture: An image a material uses: the colour of a surface, its bumps, how shiny it is. and values that feed it.

Each one uses the ones to its right.

  • Modelball_basic_01.model
    • Materialbasic_ball_01.material_instanceslot lambert1
      • Texturebasic_ball_bc.tga.importalbedo: colour
      • Texturebasic_ball_no.tga.importnormals: bumps
      • Texturebasic_ball_rma.tga.importroughness, metal, shadow
      • Texturedefault_e.png.importemissive: glow
      • Texturebasic_ball_em.tga.importteam_emissive
    • Materialbasic_ball_glow_01.material_instanceslot Glow
The standard ball as Studio shows it: two slots, each with its own material, and the main material's five texture slots.

A material puts textures into slots, and which slots exist is up to the shader it uses. Most props use the game’s main shader, which has four:

Slot Holds Looks like
albedo The surface’s colour. The picture you’d paint.
normals Small bumps and dents, faked without extra triangles. Mostly light blue-purple.
roughness_metal_ao How rough, how metallic, and how shadowed in crevices, one per colour channel. Mixed greys and colours.
emissive What glows by itself. Black where it doesn’t glow.

Other shaders have other slots. The ball’s shader adds team_emissive for the team-coloured glow; the hologram shader has five slots of its own. Studio’s Inspector always shows the slots the material’s shader has.

Besides textures, a material holds values its shader reads: a colour tint, how far to scale the texture, how strongly to glow. And a few settings about how it’s drawn, such as whether it’s solid or see-through.

Materials and textures are shared. Hundreds of props can use one material, and several materials one texture. So:

  • Change a material, and everything using that material changes.
  • Replace a texture, and every material using it changes.
  • To change one thing only, give it its own material: make a new material, and point that one model’s slot at it.

Before replacing something, look at what uses it. That decides how far your change reaches.

A texture is an image, imported from a PNG, JPEG, TGA or BMP. The game stores it compressed and with smaller copies of itself (mipmaps) for distance, which Studio makes when you import.

The two PC versions of the game each need their own copy of every texture. You rarely have to think about it: Studio makes the PC · Low-res copy from the PC · Standard image, at full size or smaller. A texture’s Inspector shows each target’s source, and you can give a target an image of its own when the automatic one isn’t good enough. See Targets and generations.

A model’s texture is the model’s surface unfolded flat, a bit like the net of a box. Paint over an exported texture in the same places and the colours land in the same places on the model. Painting somewhere the unfolded surface doesn’t reach changes nothing you can see.

For programmers

A .material_instance names a shipped .material (the shader interface) or a shader graph, and supplies texture bindings keyed by the material’s own slot names, uniform values, and pipeline state. The slot set belongs to the material, not to the format, so there’s no fixed list. Textures are stored compressed with a full mip chain, once per render target.