Skip to content

Meshes and materials

A Mesh component draws a mesh asset at its entity. An imported model’s prefab has one for each of the model’s parts: place it with Scene > Entity > Spawn Prefab…. To add one by hand, use Add Component > Mesh and pick the mesh.

  • Materials: one per material slot of the mesh, in the mesh’s order. A mesh with one slot needs one; a slot left empty uses the first.
  • Color: a tint, multiplied into the materials’ colour, so one material can make red, green and blue crates.
  • Visible: hide it without removing it.
  • Fade: fades it out, from 0 (solid) to 1 (gone), with a fine dither. Its shadow stays.
  • LOD Bias and Force LOD: for meshes with several levels of detail, coarser versions for far away. A positive bias switches to them sooner, a negative one later; Force LOD pins one level (0 is the finest, -1 lets it choose).

A material says how a surface looks. Importing a model makes a material for each of its materials, with its textures; to make one yourself, use Create > Materials > PBR Material (lit) or Unlit Material (just a colour or a texture, unaffected by light, still casting shadows).

Double-click a material to open its page: a preview on the left, which can show it on a Shape (a sphere, cube, plane, cylinder, torus or cone) or on one of your meshes, and its settings on the right. Save, and every mesh using it updates.

A PBR material has:

Setting
Base Color and Albedo Map Its colour, and a texture multiplied by it.
Metallic 0 for most things, 1 for bare metal.
Roughness 0 is a mirror, 1 completely matte. 0.5 at first.
Metallic Roughness Map A texture of both, as glTF has them: roughness in green, metallic in blue.
Normal Map and Normal Scale Fine bumps and dents, and how strong they look.
Occlusion Map and Occlusion Strength Darkening in creases and corners.
Emissive Color and Emissive Map Light the surface gives off, unlit. Emissive Color Intensity above 1 makes it glow, and with bloom, bleed light.
Alpha Cutoff With Blend Masked, where see-through starts.
Wind Strength, Wind Speed, Wind Height Sway, for leaves and grass. 0 strength is still.

Blend says how the surface combines with what is behind it:

  • Opaque: solid. The default, and the fastest.
  • Masked: each point is solid or not there at all, by the alpha of the colour and texture against Alpha Cutoff. Leaves, fences, cut-outs.
  • AlphaBlend: see-through by its alpha. Glass, water, smoke.
  • Additive: adds its light to what is behind. Fire, glows, beams.
  • Multiply and PremultipliedAlpha, for effects that need them.

Cull Back (the default) leaves out the back of each face; None draws both sides, for a leaf or a sheet of paper. Depth is how it takes part in depth sorting; leave it at ReadWrite unless an effect calls for otherwise.

A glTF model’s see-through materials import as Masked or AlphaBlend, and double-sided ones with Cull None.

Instanced Mesh draws one mesh, many times, in a single draw: scattered rocks, a crowd, a forest. Its instances move with the entity. Its inspector sets the Mesh, the Materials (one per material slot, as a mesh’s), a shared Color and Visible; the instances themselves are not edited there. For trees and grass on a terrain, vegetation places them for you.

An entity can be one of its instances: give it an Instance Member component and set its Instanced Mesh to the entity with the Instanced Mesh. It is drawn there, at its own position, wherever it goes: moved by navigation, physics, a script or the network, and still one draw with all the others. Pickups, props, units and the people of a crowd suit it. Its Clip chooses which animation it plays when the instances are animated (see crowds).

A Sprite draws a flat picture in the world: a tree in the distance, a spark, a sign.

  • Texture, its Size in metres, and Uv Rect, the part of the texture to show (for a sheet of several pictures).
  • Tint, and Additive for a glow that adds light instead of covering what is behind.
  • Orientation: CameraFacing always faces the camera; CameraFacingY turns only about the vertical, for trees and characters that should stay upright; WorldAligned lies in the world’s XY plane whatever the entity’s rotation; EntityOriented lies in the entity’s own plane and turns with it, for a sign on a wall.

A Decal projects a texture onto whatever is inside its box: a footprint, a scorch mark, a painted sign on a wall. The box points along the entity’s local Z axis, so turn the entity to face the surface.

  • Size: the box. X and Y are the picture’s size, Z how deep it reaches.
  • Texture and Color.
  • Fade Start and Fade End: on a surface turned away from the projection, the decal fades between these angles, in radians, so it does not smear down the sides of things.

Up to 256 decals draw at once.

A material can use a shader you write: see Custom shaders.