Material graphs
MGIR
A material is a network of nodes: constants, parameters, math, texture samples and outputs. It is stored
in a binary .uasset that you normally read in the Material Editor. MGIR writes that network
out as short, line-based text, with every node, connection and property value. Your assistant reads it
and writes edited text back into the material.
What it gives you
- Diffable in version control
- A recolor or a rewired output becomes a few changed lines in a pull request. Reviewers don't have to open the editor to see it.
- Reviewable like code
- You read the whole graph top to bottom: which constant feeds which output, and which parameters exist. You can check an edit to a material the same way you check a code change.
- Easy for your assistant to write
- One consistent format, with nodes named by their full Unreal class path. Your assistant reads the whole graph, edits a few lines and writes it back, instead of wiring nodes one at a time.
- What carries over
- Reading is stable, and the same text appears in asset dumps as
mgir.txt. Nodes, connections, property values and authored@(x, y)positions carry over. Editor cosmetics do not.
What the text looks like
The first line names the material. Each node gets a %name, an optional @(x, y)
sets its position, and output lines connect values to the material's pins:
entry material `/Game/Materials/M_Rim` {
%tint = constant Float3(0.2, 0.4, 1.0) @(0, 0)
%fres = call `/Script/Engine.MaterialExpressionFresnel`() @(200, 0)
output BaseColor: %tint
output EmissiveColor: %fres
}
Nodes use full class paths (call `/Script/Engine.MaterialExpressionAdd`()). Short aliases
are rejected, so the text always has one meaning. When the Substrate shorthand is on, common Substrate
nodes show in a shorter form such as %front = slab(DiffuseAlbedo: %albedo).
How to ask for it
Ask for the change in plain words. Your assistant reads the material as text, edits it, and writes it back. You never need to write the syntax yourself. More examples are on the Materials page.
You: In M_Rim, make the rim tint green instead of blue.
Done. The rim tint in M_Rim is now green.What carries over
Nodes, connections, property values and authored@(x, y) positions survive a read and write. Editor cosmetics are left out: comment boxes,
node colors, list order and layout-only reroutes. Close the material in the Material Editor before you
ask for a change, so the editor's open copy doesn't overwrite it.