ignifx

Guides

Follow practical examples for common game tasks, from moving a character to loading a scene and saving progress.

Scenes and assets

  • Load a modelA .glb or .gltf file loads as a ModelAsset, and a Model component instantiates it under an entity.
  • Spawn a prefabA prefab is a scene file (ADR-0005): the same ignifx.scene format, loaded as a SceneAsset and stamped out with world.instantiate.
  • Spawn a prefab on clickA click is a ray.

Rendering and motion

  • Tween a transformapp.tweens is core: it interpolates any number, Vec2, Vec3 or Quat property of any object, on the game clock, in PostUpdate — so a tween honours time.timeScale and stops with app.pause() unless it asks for updateWhenPaused.
  • Instance many meshesOne mesh, one material, thousands of copies, one draw call.

Shaders

  • Write a custom shaderA .wgsl file whose // @ignifx pragma comments **are** its declaration is a material family of your own: the pragmas say which attributes the vertex stage reads, which engine uniforms it wants, and which uniforms, textures and defines a material may set.
  • Add a surface shaderA surface shader is a small piece of WGSL layered onto a **PBR** material, so the engine keeps doing the lighting: shadows, image-based lighting, fog and tone mapping all still apply, and your code only says what the surface is made of.
  • Add a custom post processA // @ignifx post file is one full-screen fragment function.

Particles

  • Play a particle effectAn effect is a document — a .particles.json, or the same object built in code by particleDefinition(preset, overrides) — and a ParticleSystem component plays it.
  • Burst particles on a hitemit(count) spawns particles at the system's current clock whether or not it is playing, which is what a one-off impact wants.
  • Draw particles in 2DParticleSystem2D plays the same .particles.json a 3D ParticleSystem plays, but draws it as sprites in a @ignifx/2d sorting layer, so torch fire sorts, blends and pans with the rest of the scene.

Terrain

  • Load a heightmap terrainA .terrain.json says how big the ground is, where its heights come from, how it is chunked, and which texture layers blend across it.
  • Walk on terrain@ignifx/terrain does not depend on @ignifx/physics: a terrain without physics costs no physics code.
  • Scatter foliage on terrainTerrainScatter places instances on the terrain it shares an entity with — or on any ancestor's — by seeded rules: a density in instances per square metre, the splat layers a candidate may stand on, and the slope and height bands it must fall in.

Input

3D

2D

Audio

UI

  • Build a pause menuGame UI in ignifx is HTML, and @ignifx/ui's Menu is the list widget a front end is made of: a title, rows that declare what they edit, and one selection model that keyboard, gamepad and pointer all drive.

Saving

  • Save and load game stateapp.storage is the asynchronous key–value store behind save games, settings and input rebindings.

Tools