Examples

Material and Shader Recipes

Practical material JSON and shader metadata patterns used by Nevo-base.

Textured Surface

Use basic shader with diffuse and normal textures:

{
  "version": 0,
  "shader": "basic",
  "color": [1.0, 1.0, 1.0, 1.0],
  "normalStrength": 1.0,
  "castShadows": true,
  "textures": [
    {
      "path": "textures/asphalt/Road012B_4K-PNG_Color.png",
      "type": "diffuse"
    },
    {
      "path": "textures/asphalt/Road012B_4K-PNG_NormalDX.png",
      "type": "normal"
    }
  ]
}

This is the current asphalt.json pattern.

Unlit Texture

Use this for sky meshes, billboards, or debug visuals that should ignore lighting:

{
  "version": 0,
  "shader": "basic",
  "color": [1.0, 1.0, 1.0, -1.0],
  "castShadows": false,
  "params": {
    "unlit": true,
    "receiveShadows": false
  },
  "textures": [
    {
      "path": "textures/StandardCubeMap.png",
      "type": "diffuse"
    }
  ]
}

Use canonical keys in new material edits:

  • unlit
  • receiveShadows
  • castShadows

Legacy ignoreLights and ignoreShadows are read for compatibility.

Emissive Material

{
  "version": 0,
  "shader": "basic",
  "color": [1.0, 1.0, 1.0, 1.0],
  "emissionColor": [0.0, 0.8, 1.0, 1.0],
  "emissionStrength": 8.0,
  "params": {
    "receiveShadows": false
  }
}

Pair high emission with Bloom in the post-processing stack for glow.

Shader Control Metadata

Add a material block to shader JSON so NVEditor can generate controls:

{
  "version": 0,
  "pixelShader": "basic",
  "vertexShader": "basic",
  "material": {
    "parameters": [
      {
        "key": "metallic",
        "label": "Metallic",
        "target": "customData0.x",
        "type": "float",
        "default": 0.0,
        "min": 0.0,
        "max": 1.0,
        "speed": 0.01
      }
    ],
    "textures": [
      {
        "key": "diffuse",
        "label": "Diffuse",
        "type": "diffuse"
      }
    ]
  }
}

Material files can then use:

{
  "params": {
    "metallic": 0.75,
    "diffuse": "textures/metal.png"
  }
}

Target Cheatsheet

TargetWrites
colorMaterial base color vec4.
tintColorTint vec4.
emissionColorEmission vec4.
customData0.xFirst custom data component.
uvScaleUV scale vec2.
uvOffsetUV offset vec2.
alphaCutoffAlpha cutoff float.
normalStrengthNormal map strength float.
emissionStrengthEmission multiplier float.
unlitIgnore lighting boolean.
receiveShadowsReceive shadows boolean.
castShadowsCast shadows boolean.

Import Workflow

When importing GLTF/GLB:

  • Reuse existing materials by name when possible.
  • Load matching material JSON if it exists.
  • Create placeholders only when you want editor-managed material files.
  • Assign material IDs per mesh slot when the imported mesh has multiple materials.

If a mesh renderer has no explicit material, the loader tries imported mesh material names. If none resolve, it falls back to basic.