A game material
A world material of the game (a wall, a rail, the ground) can take other numbers and pictures under its own key. Everything drawn with that material changes, wherever it is.1
Find a mesh that uses it
Open Game library, pick Meshes, and pick a mesh. The panel beside the list shows Materials: the mesh’s materials, each by name and key.
2
Pick the material
It shows the Shader, whether it is changed In this mod, and every parameter of the shader with its value. Hover a value for the game’s value and the shader’s most used one.
3
Change it
Type a number, flip a switch, or type a game texture’s name or the path of a picture file into a picture slot and press Enter. The change goes into your mod; the game’s own stays as it is.
- Only 209 of the game’s 1,636 parameter keys have a name. The others are shown by their key: the names are not in the game.
- The shader stays the material’s own. Another shader, or shader code, is refused for a game material.
- A game texture the material cannot be shown to load is refused.
- Studio does not preview a changed game material. Test it in the game.
- The material’s shadow keeps the game’s values.
A cosmetic’s materials
A cosmetic of your own changes its materials in its Materials part: its pictures, its colours and numbers, and the game shader each section is drawn with. A section can move only to a shader the game compiled for that kind of mesh; hair cannot move. See cosmetics. A cosmetic has exactly the material sections of the item it was made from. It cannot gain a section of its own.A prop’s materials
Each material of a prop’s model becomes a material of its own. The prop’s Materials part lists them; pick one to set:- Shader: one of the game’s world shaders, searched by number or by a material it is seen on (Find a shader: its number, or a material it is seen on). The note under it says where the shader is seen, whether it casts a shadow, and whether the build will refuse it.
- Its parameters: each by name or key, beside what the game’s materials of that shader use most, with Reset.
- Its pictures: a game texture by name, or File… for a picture of yours.
- Shader code: see below.
A map’s materials
A map’s materials come from its scene. In Blender, the add-on’s Material panel sets how each is drawn and what surface it is: see the Blender add-on. In Studio’s map editor, a material picked under Objects can be made collision only, given a surface, a transparency and a kind (surface, decal, foliage, ocean). The map editor has no Materials part of its own. Another game shader, its numbers and its pictures for a map’s plain materials are set on the command line only:Custom shader code
Where Studio allows it, a material can run code of your own: HLSL, or a ShadertoymainImage. The code is compiled at the build, with the game’s own compiler, and the build says what is wrong with it.
Use the template fills in a starting point, and Take it off removes the code. A shader’s source is at most 32 KB.
What code cannot do:
- change the vertex shader, the render state, or the passes a material is drawn in;
- read a pass constant other than the clock, or a picture the game’s shader does not already bind;
- add parameters of its own, or be a whole new shader program;
- run in Studio’s preview: a prop’s code is seen in the game only, and a cosmetic’s preview uses Studio’s own shader.
On the command line
material verb.