Docs
Guides
Follow practical examples for common game tasks, from moving a character to loading a scene and saving progress.
Scenes and assets3 guides
Rendering and motion2 guides
- Tween a transform
app.tweensis core: it interpolates any number,Vec2,Vec3orQuatproperty of any object, on the game clock, inPostUpdate— so a tween honourstime.timeScaleand stops withapp.pause()unless it asks forupdateWhenPaused. - Instance many meshesOne mesh, one material, thousands of copies, one draw call.
Shaders3 guides
- Write a custom shaderA
.wgslfile whose// @ignifxpragma 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 postfile is one full-screen fragment function.
Particles3 guides
- Play a particle effectAn effect is a document — a
.particles.json, or the same object built in code byparticleDefinition(preset, overrides)— and aParticleSystemcomponent plays it. - Burst particles on a hit
emit(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 2D
ParticleSystem2Dplays the same.particles.jsona 3DParticleSystemplays, but draws it as sprites in a@ignifx/2dsorting layer, so torch fire sorts, blends and pans with the rest of the scene.
Terrain3 guides
- Load a heightmap terrainA
.terrain.jsonsays 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/terraindoes not depend on@ignifx/physics: a terrain without physics costs no physics code. - Scatter foliage on terrain
TerrainScatterplaces 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.
Input2 guides
3D3 guides
- Move a 3D character controllerA
CharacterControlleris a kinematic capsule that collides and slides. - Follow a character with a third-person camera
ThirdPersonCamerais an orbit rig: it puts the entity carrying theCamerabehindtarget, atdistance, offset byshoulderOffset, and damps toward that pose. - Raycast and catch a trigger in 3DTwo ways to ask the physics world a question.