EngineBeginner

Assets, materials, and shaders

Understand reusable project resources, generate assets from parameters, and see how scene objects reference them.

Project resources

Assets, materials, scripts, and shaders live at the project level. Scene objects store references to those resources, allowing the same mesh, texture, material, or script to be reused in multiple scenes.

Account library: reusable revisions

The Materials, Assets and Scripts panels manage resources in the current project. The Account library stores reusable prefabs, assets, scripts, materials and shaders for all projects in the same account. Open Objects → Add An Object → Account library… to save a source or add a chosen revision to the open project. The global Account library page manages the catalog. See Editor basics for the workflow.

Every save creates an immutable revision. An import makes independent project records with fresh IDs, including transitive resource dependencies: materials bring their texture maps and shaders, and scripts follow literal resource UUIDs. A shared dependency is copied once per import. Material name collisions gain a numbered suffix; default white remains built in. Later saves do not update earlier imports.

Assets include meshes, images, sounds, fonts, animation clips and height maps, retaining source files and generation metadata. Saved files remain available after the source project is deleted or its asset is regenerated. Imports share retained file bytes rather than upload duplicates; account storage counts each distinct live file once, including files held only by library revisions. Deleting an item removes all revisions, but imported project copies keep their files. There is no revision-pruning interface.

Prefabs can package GUI panels, particle effects, rigs and vehicles as object hierarchies. They cannot carry external object links or multiplayer weapon bindings; standalone scripts cannot refer to objects outside their bundle. Computed IDs, name-based lookups, actions and scene variables need review in the destination. Scenes, environment presets, combat definitions and other game settings are not captured.

Library items and revisions live outside project history. Restoring a project checkpoint or reverting an AI turn does not change the account library. Imported copies are ordinary project source and follow normal project history rules.

Assets

Upload models, textures, audio, and fonts through the asset library. The accepted formats are the same whether a file comes from the editor, an MCP client, or a URL import:

  • Models — GLB, GLTF, FBX, OBJ
  • Images — PNG, JPG/JPEG, WebP, GIF, TIFF
  • Audio — MP3, WAV, OGG
  • Fonts — TTF, OTF, WOFF, WOFF2

The file extension decides how a file is loaded, so it has to be right: a file whose extension is not on the list, or whose declared type contradicts its extension, is refused. Animated GLTF/GLB models expose their embedded clip names through gameObject.getAnimationNames().

A character or mesh can also play clips from separate animation files, added with Add Animation in its inspector. The inspector's animation preview shows a Rig compatibility box for any clip that does not fit the model: how many of its tracks bind to the model's bones, which bones are missing, and what to do about it, such as re-exporting a clip made for a different skeleton or in different units. Scripts read the same report with gameObject.getAnimationDiagnostics(); see Animation playback API.

Deleting one tells you what it will break

Nothing holds an asset in place. An object binds one by id, so deleting the file leaves the binding pointing at nothing, and the object is only told when it next tries to load. The editor therefore asks the project what still uses the asset before it asks you to confirm, and lists what it finds: the objects, the scenes they are in, the materials, and what each one loses.

It enumerates rather than refuses. Clearing out uploads nothing uses is a reasonable thing to be doing, and the point is to see the cost rather than be blocked by it. The list names the binding and not just a count, because the consequences are not interchangeable — a missing mesh means the object does not load at all, a missing height map means the terrain loads in the wrong shape, a missing texture means the material renders without one. Deleting a material works the same way.

Through MCP there is no dialog to read, so the list arrives in the response instead: assets_delete, materials_delete, and shaders_delete return referenced_by and reference_count for what the delete has just left dangling.

Generated assets

Not every asset has to be a file you found or made elsewhere. Five kinds are built from parameters instead, in the editor's Assets panel under Generate (the sixth entry there, AI texture, is described further down; it is drawn by an image model rather than from parameters):

  • Bitmap — a PNG composed from up to 16 layers of colours, patterns, noise and shapes, with opacity, blending and a preview before saving.
  • Terrain — a deterministic grayscale PNG height map for a height field, optionally with a pixel-aligned colour map from one of four palettes. The same seed and settings always produce the same terrain.
  • Shape — a mesh built from solids (box, sphere, cylinder, cone, capsule, torus, wedge, plus extrude, revolve, and sweep, which take an outline you draw) combined with union, difference, and intersection. This is how you cut a doorway out of a wall or a hole through a block without opening a modelling tool.
  • Rock — a seeded, moderately faceted boulder, clustered outcrop, arch, bridge, cliff wall, or freestanding cliff. The declared size is guaranteed, every result has a flat base for placing on terrain, and arches and bridges preserve the requested clear opening.
  • Track — a road swept along a centreline, described either as a list of straights and arcs or as a line of points the road passes through. It can solve a circuit so the ends meet, and can add barriers — separate walls along either edge that leave a gap wherever you place a world-space exclusion zone, so a road can cross itself at the same level. A track starts heading +Z; a positive arc angle turns toward -X, a right turn for a driver, and positive bank and a barrier's right side are the road's +X edge, which is a driver's left. It can stripe its curbs red and white — a curb stripe length alternates the curb between a curb and a curb_stripe material slot every that many metres, cut exactly at each stripe — and paint edge or centre lines into the road surface as a line slot, each an offset from the centreline and a width. The builder has no barrier or line fields; add them through the AI assistant, an MCP client, or the recipe's Edit as JSON.

A generated asset is an ordinary project asset. Bind a generated mesh through a mesh object's mesh field, a terrain image through a height field's height-map and colour-map fields, or a bitmap through a material's colour-map field, a GUI image or a particle emitter's texture field, exactly as you would an uploaded one.

Generate a bitmap texture or sprite

In the Assets panel, choose Generate → Bitmap and give the image a name. The builder supports Checkerboard, Stripes, Gradient, Soft sprite, Perlin noise, Worley noise, Solid color, Grid, Dots, Rectangle and Ring. Set the shared width, height and canvas colour, then select a layer to edit its pattern and colours. Gradients and stripes have a direction; shapes expose their position, size and edge controls.

The preview updates as you edit and does not save an asset. On desktop it stays beside the controls while you scroll through a long stack; phones show the preview above the controls. Generate becomes available once the named image has a valid preview, then saves its PNG and recipe to the library. Colours accept #RRGGBB or #RRGGBBAA; the final two digits control alpha, so a Canvas color ending in 00 is transparent. Use the image as a material's colour map, a GUI image or a particle emitter's texture. Materials need transparency enabled to show transparent pixels in their colour maps.

Combine layers

The Layers list shows the topmost layer first. Select a row to edit that layer. Choose a kind under New layer and click Add layer to place it on top; the arrow buttons move a layer up or down, and the remove button deletes it from the draft. A recipe keeps at least one layer and supports up to 16. Canvas size and colour apply to the whole stack.

Each layer has Opacity and Blending. Normal draws it over layers below, Multiply darkens, and Screen lightens. For example, start with a checkerboard, add a rectangle and lower its opacity to keep the checker visible through it. Reordering layers can change the composite, so check the preview before saving.

Noise and seamless tiling

Perlin noise makes smooth, cloudy variation; Worley noise makes cellular, stone-like variation. Set a layer's Scale (px) for the feature size: larger cells make broader features. Low color colours low noise values and High color colours high ones. The shared Seed and New variation affect every noise layer. The same seed and settings reproduce a texture; New variation changes only the seed. Switching between Perlin and Worley keeps the layer's scale and colours. Reordering noise layers can also change their variation, because their position in the recipe contributes to their seed.

Seamless tiling applies to the whole recipe. Every layer must support tiling, and every repeating layer must fit whole periods in both dimensions: pairs of cells for checkerboards, or whole cell periods for stripes, grids, dots and noise. A solid colour can tile; gradients and standalone shapes cannot. For example, a 32-pixel checker cell fits a 256 × 256 image; for noise, width and height must each be divisible by Scale (px). The preview explains an incompatible combination and blocks saving. Adjust the layers or dimensions, or turn off Seamless tiling with the shared checkbox.

Revise an existing bitmap

Open a bitmap's stored recipe from the Assets library to revise it with the same layer controls. Rebuild replaces the existing asset in place, so its bindings keep pointing to the same image asset. Edit as JSON remains available; unknown future recipe versions or layer kinds use the generic fields and JSON editor.

The AI assistant and MCP clients can create and revise the same layered images. For example, ask: “Make a seamless dark-grey checker texture and apply it to the floor,” or “Make a soft white particle sprite with a transparent background and use it for this emitter.” Images are up to 1024 × 1024 pixels. See Procedural bitmaps in the MCP tool guide for the recipe fields; its JSON layers are ordered bottom to top, while the editor shows the top layer first.

Generated skies

A sky panorama can be generated too, for a scene's Skybox: a 360° image, twice as wide as it is tall, built from layers of a colour gradient by height, sun or moon discs with a glow, stars, clouds that shrink toward the horizon, and mountain silhouettes that join seamlessly all the way round. Skies are made by the AI assistant or an MCP client rather than from the Generate menu. Ask, for example: “Give this scene a dusk sky with a low orange sun, scattered clouds and distant blue mountains.” The assistant makes the new sky the scene's skybox straight away.

A generated sky is an ordinary image asset that keeps its recipe. Open it from the asset library to change a colour or move the sun, then Rebuild; every scene using it shows the new sky. To use one, or an uploaded panorama, choose it under Skybox in Scene Settings (see Editor basics). See Procedural skies in the MCP tool guide for the recipe fields.

Generated sound effects

Short sound effects can be generated as well: a WAV of up to 4 seconds, mixed from up to eight retro-style voices. Each voice has a square, sine, saw, triangle or noise wave, a fade in and out, a pitch slide, vibrato and filters, and an echo can be added to the mix. Like skies, sounds are made by the AI assistant or an MCP client. There are ready-made starting points for a coin, laser, explosion, power-up, hit, jump and blip, each with as many variations as you like. Ask, for example: “Make a coin pickup sound and play it when the player touches a coin,” or “Give me three different laser sounds.”

A generated sound is an ordinary audio asset. Scripts play it by its asset ID with playSound, like an uploaded one (see the gameObject API). It keeps its recipe: open it from the asset library to hear it, change a pitch or a length, and Rebuild. The player in that dialog switches to the rebuilt sound, and scripts that play it get the new sound without any change. See Procedural sounds in the MCP tool guide for the recipe fields.

AI textures

For a realistic or painterly surface that layers of patterns and noise cannot draw, such as mossy cobblestones, bark or rusted metal, an image model can draw a tiling colour texture from a description. In the Assets panel, choose Generate → AI texture, give it a name and describe the surface under Describe the surface. Describe only the material; tiling, flat lighting and a top-down view are asked for automatically.

  • Image model: GPT Image 2 gives the best results in about 30 seconds. Qwen Image 3 is cheaper and slightly less reliable. FLUX.3 Klein makes fast, cheap drafts in about 5 seconds.
  • Seams: Make the edges wrap suits most surfaces. Choose Even out lighting only for bricks, tiles and other strict grids, where blending the edges can double the grout lines. Leave as generated keeps the model's image.
  • Reference images: tick up to three of the project's images to guide colour and pattern. With FLUX, the provider may use reference images to train its models; pick GPT Image 2 to avoid that.
  • With an object selected, Apply to that object puts the result on it when you accept.

Nothing is added to the project until you accept. The result is shown tiled three by three so you can see whether the edges show when it repeats, with a warning when they may. Accept adds the image to your assets and makes a standard material that uses it as its colour map, applied to the object if you chose one. Regenerate asks again with the same settings, and Discard throws the result away. A result you never review is deleted after 7 days.

The AI assistant can make them too. Ask, for example: “Give the castle wall a weathered sandstone texture.” The result appears as the same card in the chat and waits there for you to accept it. For patterns, noise and flat colour, the assistant makes a bitmap instead, which is free and instant.

Each AI texture uses your AI allowance, including each regenerate, and each account can make 25 a day by default; a request that fails is not charged or counted. AI textures are labelled AI-generated in the asset library and have no recipe to rebuild. They must not be used to train AI models or be presented as made by a person. See AI textures in the MCP tool guide for the MCP tools.

The recipe is kept, so you can change your mind

Every generated shape, rock formation, track, bitmap, sky and sound stores the recipe it was built from. Open it from the asset library and you get the parameters back as fields — change a radius, widen a road, move a hole, and rebuild.

Rebuilding keeps the asset's identity, so every scene object already bound to it simply picks up the new content. Widening a track is one number rather than a rebuild-and-rebind. For a structural change rather than a numeric one — adding a hole, adding a section — the same panel has an Edit as JSON escape hatch.

Height maps are the exception: their settings are recorded with the asset but are not reopened as an editable recipe, so changing terrain means generating it again. Through MCP, assets_get_generated_recipe likewise declines a height map; assets_generate_height_map returns the settings it used, and rebinding the height field to the new image is the way to change terrain.

Shapes from your own outline

Three solids take a profile you draw as a list of points instead of fixed dimensions. A profile is a closed outline of 3 to 128 points; it closes itself, so do not repeat the first point at the end, and it must enclose some area. In the Shape builder each point is a row of number fields, and + point adds another.

  • extrude — an [x, y] outline given a depth along the solid's local Z, centred on its origin. twist_degrees turns the far face against the near one, scale_top tapers it ([0, 0] brings it to a point), and divisions (0 to 128) adds intermediate rings so a twist stays smooth. Use it for signs, brackets, and cut-out silhouettes.
  • revolve — a [radius, y] outline turned around the local +Y axis, like a part on a lathe. Radii cannot be negative. angle (default 360) stops short of a full turn for a cut-away, and segments sets how many facets the turn has. Use it for columns, vases, barrels, and bottles.
  • sweep — a [lateral, up] outline carried along a smooth curve through a path of [x, y, z] points (up to 500). An open path needs at least two points; turn on closed for a ring, which needs three and joins itself. segment_length (default 0.25 m) sets how finely the curve is sampled. Use it for pipes, handrails, cables, and moulding.

All three build watertight solids, so they combine with union, difference, and intersection like any other solid: a revolved vase with a smaller revolve subtracted from it is hollow.

Several materials on one shape

One generated shape can carry several materials: a red roof on white walls, a tyre barrier in alternating colours. Give a node a material slot name, with + material slot on that node in the Shape builder or material_slot in the recipe JSON. A node without one takes its parent's slot, and the top of the recipe defaults to surface. After the Boolean operations each face keeps the slot of the solid it came from, so the faces a difference cuts take the cutter's slot: to give a window reveal the wall's colour, name the cutter after the wall's slot, or leave it unnamed under a parent that has it. A shape can have up to 16 slots, and when it has more than one the preview tints each a different colour. Then bind a material to each slot in the mesh object's Surfaces list, exactly as for a track's road and curb (see Per-surface materials).

Build a rock formation

  1. Open the Assets panel, choose Generate, then choose Rock.
  2. Choose a formation and its overall size. New variation changes only the stored seed; Detail moves from chunky low-poly facets at 0 to a finer silhouette at 3. Roughness, asymmetry, erosion, and top flatness change the character without changing the declared envelope.
  3. For an arch or bridge, enter the opening width and height. A successful build guarantees that full rectangular gameplay clearance, with the rounded crown carved above it. A bridge also receives a flat walking surface.
  4. Choose a texture layout and collision mode, generate the GLB, then bind it to a mesh object's Mesh File field.

Choose collision for how the rock will be used

Exact and static uses the finished triangle mesh. It preserves openings, cliff faces, and walking surfaces exactly, but the object cannot move. This is the normal choice for arches, bridges, and cliffs.

Movable builds a convex decomposition for Jolt. It is the normal choice for boulders and outcrops that scripts or physics will push. Read the generation warning: if decomposition reaches its hull budget, the collider can be slightly more solid than the visible rock. Raise the recipe's maximum hull count or switch to exact static collision when that difference would block a passage.

Tile a texture or paint one rock

Seamless tiling projects reusable textures in world units. Adjust UV Scale to control metres per tile; use it when many formations should share the same stone, moss, or soil textures.

Unique painting atlas gives every facet its own padded UV island. Choose 512, 1024, 2048, or 4096 pixels, then download the colour-coded UV guide from the result. Dark edges mark island boundaries; gray, green, and brown identify the rock, top, and ground material regions.

  1. Open the guide in a painting application and paint without changing its canvas size or moving the islands.
  2. Upload the finished image as a texture asset and use it as a material map.
  3. Bind that material to the generated mesh's named surfaces. Bind one atlas material to all three slots for a continuous hand-painted texture, or use separate materials for rock, top, and ground.

The recipe panel keeps both Download asset and Download UV guide available later. Rebuilding with the same recipe is deterministic. Geometry changes can move atlas islands, so the editor warns before a topology-changing rebuild; texture-layout-only changes do not need that warning. The guide is a UV and material-region template, not an ambient-occlusion or curvature bake.

What the generator tells you

After a build you get a preview image and a short report. Both are worth reading, because a build that succeeds is not the same as a build that did what you meant:

  • The preview shows three orthographic elevations of a solid — front, top, and side — because one view cannot distinguish a hole cut through the face you are looking at from one cut through the face you are not. A track gets a plan view instead, with its closure gap drawn on it.
  • Genus tells a hole that goes all the way through from a dent that does not.
  • Closure reports how far, and at what angle, a circuit misses meeting itself.
  • Warnings call out geometry that built but is probably not what you wanted.

The AI assistant and connected MCP clients call the same generators, so an asset made in the chat is indistinguishable from one made here, stored recipe included — and either can edit the other's. See the MCP tool guide and the AI assistant.

Materials

Materials control surface appearance and may reference texture assets. A material's texture (mapId) must be an image asset in the same project; a missing id, an asset from another project, or a non-image such as a mesh is refused when the material is saved. Assign a material through an object's inspector, by asking the AI assistant, or through the MCP material and scene-object tools.

Each material has a materialType: basic, lambert, phong, standard, physical, or shader. The first five are built-in surface models configured with properties like color, roughness, metalness, emissiveIntensity, opacity/transparent, and wireframe. They render the front of each face only. On a cube, sphere, cylinder or capsule, a material that is transparent with opacity 0 casts no shadow; to make a collider nobody sees, turn off the object's Visible in Game instead (see Physics, collisions, and triggers). A shader material renders with your own GLSL instead, and is the one type that takes side (front, back, or double; front when unset) — see Shaders below.

Colour channels run 0 to 1

Every colour field — color, specular, emissive, and sheen — takes an object of r, g, and b channels expressed as normalized values from 0 through 1, not 0–255. Pure red is {r: 1, g: 0, b: 0}.

Those channels are linear RGB, the renderer's working space, not the sRGB of CSS and most palettes. A value copied straight from a hex code therefore looks washed out: 0.5 renders about as light as the CSS grey #bcbcbc, not #808080. In the material editor the colour picker's hex is sRGB and is converted for you, while the number fields beside it show the stored linear values. Through MCP, materials_create and materials_update also accept an sRGB hex string such as "#38383d" and convert it; the MCP tool guide gives the formula for converting by hand.

A channel outside that range is rejected, not clamped, and so is a channel key the field does not recognise. {r: 255, g: 128, b: 0} is now an error rather than something that renders: values above 1 used to reach the renderer unchanged, where every channel at or above 1 is full intensity, so that triple came out flat yellow instead of the orange it was meant to be.

Texture maps

Every material except a shader can carry a colour map (mapId), sampled as sRGB. Standard and physical materials can also carry four physically based maps, each an image asset in the same project, sampled as linear data:

FieldEditor pickerWhat it reads
normalMapIdNormal MapA tangent-space normal map in the OpenGL convention (+Y up). normalScale (Normal Scale, -10 to 10, default 1) sets its strength.
roughnessMapIdRoughness MapThe image's green channel, multiplied by the material's Roughness.
metalnessMapIdMetalness MapThe image's blue channel, multiplied by the material's Metalness.
aoMapIdAmbient Occlusion MapThe image's red channel, read from the model's ordinary UVs; no second UV set is needed. aoMapIntensity (AO Intensity, 0 to 10, default 1) sets its strength.

Because each map reads its own channel, one packed ORM image (occlusion in red, roughness in green, metalness in blue) can fill the ambient occlusion, roughness and metalness slots at once. Roughness and metalness multiply their maps, so set both to 1 to use the maps as painted: with metalness at 0 a metalness map has no effect. Normal Scale and AO Intensity appear in the editor once their map is bound.

The PBR pickers appear only on standard and physical materials, and the server refuses these fields on a phong, basic or lambert material, which would never render them. In the editor each picker can choose an image, upload one, or remove the binding.

Tiling a texture

Texture Tiling in the material editor (textureRepeat, textureOffset and textureRotation) applies to every map on the material at once, so the colour, normal and roughness maps stay aligned. Repeat X/Y is how many times the image tiles across the object's UVs, Offset X/Y shifts it in texture widths, and Rotation (deg) turns it counter-clockwise about the UV origin. Reset puts back one unrotated copy. A material with no tiling set stretches the image once across the UVs, as before. Shader materials ignore tiling.

Per-surface materials on an imported model

A model usually arrives carrying its own named materials — a swept track has road, curb, and side, plus curb_stripe when its curbs are striped, line when it has painted lines, and barrier when it has barriers. Bind red to curb and white to curb_stripe for racing curbs, and give the two the same friction unless a car should feel the stripes. A mesh object publishes the surface names the engine found in the loaded file, and surfaceOverrides binds a project material to any of them by name. One imported model can therefore carry several materials without being split into separate objects in a modelling tool.

Each entry is a surface — the material name exactly as it appears in the file — plus a materialId naming an existing project material. In the editor this is the Surfaces list on a mesh object's inspector; through MCP it is the surfaceOverrides array on scene_objects_create and scene_objects_update. Unlike an object's own materialId, a surface binding does not accept default-white — to say “leave this slot alone”, omit the binding rather than pointing it at the default.

The list is sparse, and each slot resolves in a fixed order:

  1. The project material bound to that surface name, if there is one.
  2. Otherwise the object's own materialId.
  3. Otherwise — when the object is left on Default White — the material embedded in the model file.

So binding one surface does not flatten the rest: give road a gravel material and curb keeps whatever it would have had. The same order is what makes Default White mean “show me the model as it was authored” rather than “paint the whole model white”.

If a bound material is deleted, that slot falls back to its embedded material instead of rendering untextured, and the binding itself is kept — the inspector shows it as Missing material, so pointing it at a replacement is one change rather than re-entering the whole list.

Skinned meshes are excluded. An animated character's skinned geometry always keeps the material it was imported with; neither a surface binding nor the object's own material replaces it.

A vehicle's running gear is excluded too, for a different reason: it is not part of any model. Tires, rims, and track belts are drawn from the vehicle's physics wheel layout, so they have no surface to inherit from and no embedded material to fall back on. They take their colour from the vehicle's own Tire Color, Rim Color, and Track Color fields, which leaves the object's Material free to tint the body. See Vehicles, constraints, ragdolls, and navigation.

A surface entry can also carry friction and restitution. Those are physics, not appearance, and they apply only to an object whose collisionType is triangleMesh — it is the one collider that keeps per-triangle material identities in Jolt, while a hull or a convex decomposition is a handful of volumes with no memory of which part of the model they came from. On any other collider the physics half of an entry is ignored while the visual half still applies. The editor hides the friction and bounce boxes unless the collider is a triangle mesh. See Physics and collisions.

Particles

A particle emitter draws smoke, exhaust, dust, sparks, fire and explosions. Add one from the Effects group of the Add menu. It has no collider and never moves on its own; parent it to a car, a torch or a gun to carry it. Particles exist only while the game runs: in the editor the emitter is a small orange gizmo, so tune it with Play running, where inspector changes apply to the live emitter at once. Particles follow the time scale and pause with the game, and Stop clears them.

  • Rate is particles per second while emitting (0 to 1000). Burst emits that many at once when the run starts, if the emitter is emitting. Max particles (up to 2,000 per emitter) caps how many are alive at once; emission past it is dropped until old ones die.
  • Lifetime and Speed are ranges: each particle picks a life in seconds and a launch speed in m/s between the two.
  • Direction is the launch direction in the emitter's own frame, and the spread angle opens it into a cone: 0 is a straight jet, 180 sprays every way.
  • Gravity scales the scene's gravity on each particle: 0 (the default) floats, 1 falls like a thrown object, and a small negative value such as -0.05 makes smoke rise. Drag is the share of its speed a particle loses per second: 1 to 3 for smoke, about 0 for sparks.
  • Size, Colour and Opacity each go from a value at birth to one at death; an opacity at death of 0 fades each particle out.
  • Blending is normal for smoke, dust and steam, or additive for fire, sparks and explosions, which brighten what is behind them. Texture draws each particle with an image asset multiplied by its colour; without one each particle is a soft round puff.
  • Simulation space world leaves particles where they were born, so smoke trails behind a moving car; local carries them with the emitter, for a flame on a torch someone is holding.
  • Emitter shape is where particles are born: at a point, anywhere inside a sphere of the emitter radius, or anywhere inside a box.

Some starting points:

  • Tyre smoke: an emitter parented to the car at a rear wheel, world space, not emitting at the start, rate 40, lifetime 1 to 2.5 s, speed 0.3 to 1, gravity -0.05, drag 1.5, size 0.4 to 2, opacity 0.5 to 0. The bundled lua/tyre_smoke.lua turns it on while the car slides; see the gameObject API reference.
  • Exhaust: the same at the tailpipe, with a lower rate and smaller, darker, shorter-lived puffs.
  • Dust: a sphere or box shape near the ground, brown-grey, a wide spread and low speed.
  • Sparks: additive, small and bright, fast, gravity about 1 and drag about 0, short lifetimes.
  • Explosion: rate 0 with the emitter not emitting, then a script calls emit(count) at the moment of the blast; additive, spread 180, fast with high drag, growing as it fades.

Particles are not depth-sorted, which suits soft additive or low-opacity effects; dense normal-blended smoke can show order artefacts. Very large particles close to the camera stop growing at the graphics card's largest point size, which is lower on phones. Particles themselves are cheap to draw: in a test scene, about 1,100 live particles from eight emitters, including large soft smoke and ground mist, held 60 fps on an iPhone 12 mini once ambient occlusion and bloom were off. On a phone, those two scene effects are what to cut first, not particle counts (see Editor basics). In a multiplayer room every browser draws its own particles and the room server draws none; see Build and test a multiplayer game.

Shaders

Project shaders contain GLSL source that can be referenced by compatible material settings. Keep shader source and its expected uniforms together, and test it in the real editor viewport.

Each shader has a shaderType of vertex_shader or fragment_shader. To use custom GLSL, create a material with materialType: "shader" and set its vertexShaderId and fragmentShaderId to a vertex shader and a fragment shader, plus a uniforms object for the values your GLSL reads. A material with only one of the two saves, but draws as a wireframe placeholder until it has both. Each id must name a shader in this project of the matching type: a fragment shader in the vertex slot, or an id that does not exist, is refused.

Every shader material also receives three uniforms you do not have to declare in uniforms: u_time (a float, seconds since the run started), u_resolution (a vec2, the canvas size in pixels), and u_mouse (a vec2 of the player's held look direction — -1, 0, or 1 on each axis — not the pointer position). Declare them in your GLSL to read them.

Your own uniforms are named entries in uniforms, each a type and a value: float takes a number, vec2/vec3/vec4 take {x, y, …}, and color takes 0-1 {r, g, b}, for example {"u_tint": {"type": "color", "value": {"r": 1, "g": 0.5, "b": 0}}}. A texture uniform is accepted but not yet bound to an image. To start from working GLSL, the material editor's shader form has a Load Template... menu with Basic, Voronoi 3D, Explosion, and Brick.

Editing a shader's source re-renders every object using a material that references it, so there is no need to recreate the material to pick up a change. Deleting a shader that a material still points at leaves that material unable to render — repoint or delete those materials in the same pass.

Animation names are exact

Clip lookup is case-sensitive. Print getAnimationNames() before hardcoding a name from a model.