multimesh asset type
Godot's MultiMesh: a mesh and the instances it is drawn at, for multimesh3d.source and multimesh2d.source. Each instance is a transform in the node's…
Files live in multimeshes/. Used by multimesh2d · source, multimesh3d · source.
Godot's MultiMesh: a mesh and the instances it is drawn at, for multimesh3d.source and multimesh2d.source. Each instance is a transform in the node's space, a color and four floats of custom data a material's shader reads. visible_instance_count draws the first so many; -1 draws them all.
type = "multimesh"
mesh = "models/post.toml" # a mesh asset, or an inline { type = "mesh", ... }
visible_instance_count = -1
instances = [ # a 2D instance writes [x, y] and turns about z
{ position = [0.0, 0.0, 0.0] },
{ position = [0.9, 0.0, 0.0], rotation_euler = [0.0, 0.5, 0.0], scale = [1.0, 2.0, 1.0] },
{ position = [1.8, 0.0, 0.0], color = "#ff8080", custom = [1.0, 0.0, 0.0, 0.0] },
# a 3x3, columns first, in place of rotation_euler and scale: it keeps a shear
{ position = [2.7, 0.0, 0.0], basis = [1.0, 0.0, 0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 1.0] },
# the node's wireframe and vertex dots, for this instance alone; they draw
# only while the node's own wireframe_width and dot_size are above zero
{ position = [3.6, 0.0, 0.0], wireframe_color = "#00ff00", wireframe_width = 2.0, dot_color = "#ffff00", dot_size = 4.0 },
]
A 2D instance also takes region_origin and region_size, the rectangle of the texture it draws in pixels. multimesh2d draws through Balaur's own pipeline, which reads neither the rectangle nor the four overrides yet.