Material Editor
How NVEditor reads, edits, and saves material JSON and shader metadata.
Material Files
Material JSON lives under:
game/materials/Open a material from the Project panel to edit shader parameters, texture slots, and renderer flags.
Pinned Flags
The Material panel pins these renderer flags:
| Label | Canonical key |
|---|---|
| Ignore Lights | unlit |
| Receive Shadows | receiveShadows |
| Cast Shadows | castShadows |
Legacy ignoreLights and ignoreShadows are read for compatibility. Saves write canonical keys.
Shader-Driven Controls
NVEditor reads the shader's material metadata:
{
"material": {
"parameters": [
{
"key": "normalStrength",
"label": "Normal Strength",
"target": "normalStrength",
"type": "float",
"default": 1.0,
"min": 0.0,
"max": 1.0,
"speed": 0.01
}
],
"textures": [
{
"key": "normal",
"label": "Normal",
"type": "normal"
}
]
}
}The editor writes material values into params or canonical top-level fields, and the runtime loader maps those back into the Material struct.
Texture Slots
The editor understands the same texture slot types as the runtime:
diffusenormaldetailemissive
Textures can be assigned from existing paths or by dragging image assets.
Save Behavior
Material saves are written through a temporary file before replacing the original. This reduces the chance of corrupting a material if a write fails.
Good Material Hygiene
- Prefer canonical
unlit,receiveShadows, andcastShadows. - Keep texture paths relative to the game asset root.
- Use shader metadata for custom controls instead of editing
customData0..3by hand everywhere. - Use
paramsfor shader-specific values. - Keep
castShadowsexplicit on transparent, sky, or special-effect materials.
