Materials and textures
A material is a shader with settings
Section titled “A material is a shader with settings”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_ slot lambert101. material_ instance - Texturebasic_
ball_ albedo: colourbc. tga. import - Texturebasic_
ball_ normals: bumpsno. tga. import - Texturebasic_
ball_ roughness, metal, shadowrma. tga. import - Texturedefault_
e. emissive: glowpng. import - Texturebasic_
ball_ team_emissiveem. tga. import
- Materialbasic_
ball_ slot Glowglow_ 01. material_ instance
Slots are the shader’s
Section titled “Slots are the shader’s”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.
One change, many things
Section titled “One change, many things”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.
Textures, and the two PC targets
Section titled “Textures, and the two PC targets”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.
What the colour map is laid out like
Section titled “What the colour map is laid out like”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.
Where to go next
Section titled “Where to go next”- Tutorial: Recolour a ball.
- Lighting: why the same material looks different in different maps.