Skip to content
hikari
RenderingEditorAIToolchainDocumentation
Download

© 2026 Flying Rat Studio.
All rights reserved.

Explore the engineDocumentationContributorsDownloadLicenseBack to top
Documentation / Tutorials
Browse docs
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Start exploring
  • No matching sections. Try fewer words or another topic.
NavigateEnter Openesc Close
Overview
Tutorials17
OverviewPlay, Edit, and scenesFirst UI documentFirst game projectFirst entityComponent properties and the inspectorFirst mesh and materialFirst physics body and triggerFirst character controllerFirst session servicesFirst UIFirst input actionFirst messagesFirst runtime spawnFirst motionFirst skeletal animationAssets in Play (soft refs and hot reload)Dynamic editor recompile
Guides25
OverviewWorking in the editorDevelopment guideGameplay APIActor and component lifecycleThreads, jobs, events, and routinesGameplay AI tasksGame AI: perception and movement playgroundBrain assetsBrain execution for swarm populationsLocalizationGame cursorsChoosing component storageBuild and packagingProject filePluginsHikari Plugin APIData-driven content, JSON, and pathsScripting with KawaShader authoringChoosing and scaling shadowsTime of dayUser interfaceUI layoutUI widgetsMigration from Unity / Unreal
Systems32
OverviewArchitectureApplication lifecycleFrontends and driversPlatforms and supportSession services and cross-scene stateScenes and gameplayActor communication (hi.actors)Game-facing refsSave / replication wire versionCoordinate space and camera conventionsRenderingRenderer architecture mapFrame governorPipeline compilationSkeletal animationGPU particlesVisual ZonesVolumetric mediaInputAudioPhysicsMotion KitTemporal KitUI documentsAssets and ShinraPrefabsAsset residencyAsset formats (Shinra pipeline)Document schemasUI and editorEditor asset hot reloadEditor Project Selector
Language reference3
OverviewAkari GPU ABIAkari language referenceKawa language reference
Engine overview
Tutorials2 min read

Tutorial: first mesh and material

On this page
On this page1. Entity with render2. Material JSON3. Scene actorMulti-material models (placeable)Soft failures (expected) Back to top

Rendered actors need an explicit mesh and material in scene JSON when the archetype lists hi.ComponentRender. Paths use asset:// URIs (hi.AssetRef at runtime).

  • Unscoped: asset://./models/cube (catalog → pack; pack must be retained)
  • Explicit pack: asset://shared/models/cube

See Game-facing refs and Asset URIs and packs. Mesh / material / texture refs are extension-free stems (no .shinmodel / .png). Scene "model" placeables must end with .model.json (validator).

Deep reference: Assets and Shinra, Shinra asset formats.

1. Entity with render

zig
const hi = @import("hikari_game");

pub const CrateEntity = hi.defineActor(.{
    .archetype = "crate",
    .components = .{hi.ComponentRender},
});

Rebuild so the archetype is in the manifest.

2. Material JSON

Sample: hikari-games/example/assets/materials/cube.material.json

json
{
  "kind": "com.hikari.material",
  "version": 1,
  "id": "cube",
  "material": {
    "name": "cube_material",
    "shader": {
      "name": "DeferredGeometry",
      "package": "_engine/gbuffer",
      "entry_points": { "vertex": "gbuffer_vertex", "fragment": "gbuffer_fragment" }
    },
    "textures": { "albedo": "asset://./textures/crate" },
    "params": { "base_color": [1, 1, 1, 1] }
  }
}

Shinra turns source textures/models into .shintexture / .shinmodel (and packs). Point materials at logical stems, not raw .png.

3. Scene actor

Scene document is flat version 1. Capability blocks live under "components". The runtime derives required packs from the asset references:

json
{
  "kind": "com.hikari.scene",
  "version": 1,
  "id": "my_level",
  "name": "My Level",
  "actors": [{
      "id": "crate_01",
      "archetype": "crate",
      "transform": {
        "position": [0, 0.5, 0],
        "rotation_euler": [0, 0, 0],
        "scale": [1, 1, 1]
      },
      "components": {
        "render": {
          "mesh": "asset://./models/cube",
          "material": "asset://./materials/cube"
        }
      }
    }]
}

Do not add a scene packs field. Configure asset membership in configs/layout.json; the loader retains the referenced packs and their dependencies. Sample: scenes/physics_playground.json.

Multi-material models (placeable)

Cook merges glTF primitives that share a material into one slot, then emits companions with unscoped refs (asset://./…). Place the model with a single actor:

json
{
  "id": "prop",
  "name": "MosquitoInAmber",
  "archetype": "empty",
  "transform": { "position": [0, 1, 0], "rotation_euler": [0, 0, 0], "scale": [1, 1, 1] },
  "components": {
    "render": {
      "model": "asset://./scenes/mosquito_in_amber/models/MosquitoInAmber.model.json"
    }
  },
  "script": { "path": "asset://./scripts/cinematic_prop_rotate" }
}

One entity submits N draws (one per material slot). Optional components.render.materials[] overrides slot materials. Samples: scenes/material_samples.json (both Khronos multi-slot models side by side).

Soft failures (expected)

Missing / failedPlaceholder
MeshError cube
Material / shaderPink error_material
PreviousTutorial: component properties and the inspectorNext Tutorial: first physics body and trigger

Documentation follows the current engine checkout.

Snapshot 86f12d68Source docs/tutorials/first-mesh-material.md
On this page1. Entity with render2. Material JSON3. Scene actorMulti-material models (placeable)Soft failures (expected) Back to top