KROYSDOCS
HomeWhat's newv0.1.0
MANUAL / Editor / Materials

Materials

Materials are node graphs that compile to shaders in the background while the old shader keeps drawing. Instances change parameters without a graph.

PanelMaterial Editor
WorkspaceMaterials
Files.kmat, .kmatinst, .kmatfunc
01

Open a material

Double-click a material in the Content panel. The Materials workspace opens with the Material Editor: the Library of nodes, the Graph in the middle, a Preview of the material on a shape and Details with every input of the material output.

Open a material: Material Editor in the editor
02

Working in the graph

ActionHow
Add a nodeRight-click or Tab for search, or drag from the Library
Add a textureDrag it from the Content panel onto the graph
ConnectDrag between pins; incompatible pins dim
Move a wireDrag it off the input it is plugged into
New node from a wireDrop the wire on empty space and pick a node; it connects itself
Remove a wireRight-click it, or Alt-click
Pan and zoomMiddle or right drag, the minimap; mouse wheel
FrameF frames the selection or everything
Duplicate, copy, paste, deleteCtrl+D, Ctrl+C, Ctrl+V, Del
Undo, redoCtrl+Z, Ctrl+Y; one drag is one step

Edits save themselves after a second; Ctrl+S saves at once.

Working in the graph: Graph in the editor
03

The node library

Nodes by category: inputs, textures, parameters, math, vectors, colours, utilities, procedural patterns and the particle inputs effects use. Type in the search field or open a category, then drag a node onto the graph.

The node library: Library in the editor
04

Parameters in Details

Details lists every input of the material output. Changing one that has no node creates and connects it: a parameter for colours and values, or the texture, sample and normal-map nodes for a normal. An input fed by a texture shows that texture; one built from other nodes shows its source, and clicking it selects that node.

Parameters in Details: Details in the editor
05

How edits reach the screen

Moving nodes never touches the shader. Other edits build in the background and the previous shader keeps drawing until the new one is ready, in the Preview and in the scene. If an edit cannot be built, the last working shader stays on screen, the node is outlined in red and Details says what is wrong; the compiler's own output goes to the Console. Shaders are named by a hash of their source, so an unchanged shader is never rebuilt.

How edits reach the screen: Preview in the editor
06

Instances and imported materials

A material instance (.kmatinst) has no graph: tick a parameter to override its parent's value. Materials imported with a model edit their surface values directly; those edits are saved beside the project, never into the source model.

To edit several materials at once, select them in the Content panel (Ctrl+A selects a whole folder) and change Opaque, Alpha Masked, Double Sided or Alpha Cutoff in the Inspector. Only the property you change is written.

Instances and imported materials: Inspector in the editor

KroysEngine 0.1.0 documentation, built from the engine repository by Tools/BuildDocsSite.py.