Skip to content

Format

typescript
Graphics.DrawMesh(world, mesh, mtl, shadow_cast)

class: Graphics

Description

Draw a mesh.

DrawMesh draws a mesh for one frame. The mesh will be affected by lighting, can cast and receive shadows, and be affected by projectors - just like it is part of some game object. It can be drawn for all cameras or only for specific cameras.

If you want to draw a large number of meshes but don't want to incur the overhead of creating and managing game objects, use DrawMesh. Note that DrawMesh does not immediately draw the mesh; it just "submits" it for rendering. The mesh will be rendered as part of the normal rendering process. If you want to draw the mesh immediately, use Graphics.DrawMeshNow.

Parameters

param_nametypedescription
worldMatrix4x4The world coordinate matrix.
meshMeshThe mesh to be drawn.
mtlMaterialThe texture to use when drawing the mesh.
shadow_castShadowCastingMode?Determines if the mesh can cast shadows.

Return

typedescription
void

Code Example