+1 vote

Hi,
I have some questions about mesh instances (is it the same as "Multimesh"?)

  1. Can one (at runtime) generate instances of (at runtime) procedural generated meshes?

  2. Will instances be treatet as one big mesh/object or as individual objects/meshes. So: is it possible to use LOD and cull distance etc. with them?

  3. Are different materials or different UV-parameters (e.g. for using a texture-atlas) per instance possible?

  4. Does it matter for any of this if SurfaceTool or ImmediateGeometry is used?

Greetings and thx, CoD

in Engine by (22 points)

1 Answer

+1 vote
Best answer

0) Multimesh is not the same as MeshInstance. The former refers to usage of hardware-instancing, which is the ability to draw many times the same mesh at low cost in a single draw call.

1) Yes, you can do this with ImmediateGeometry, SurfaceTool, or generating the vertex and index arrays directly

2) It's you to decide. Generating one mesh will make... one mesh. You can use the same mesh on multiple MeshInstances, or have a unique mesh for all instances.

3) You can have different materials per MeshInstance with the material_override property, which will override any eventual material found in the mesh used by the instance. So you can re-use the same mesh on multiple instances and still be able to have different materials (only supports one override though).

4) Using SurfaceTool, ImmediateGeometry or Mesh API is up to you. ImmediateGeometry is good for geometry that changes every frame. SurfaceTool is good for generating an actual mesh that won't change later on. Using the Mesh API directly is good if it's easier for you to generate vertex arrays, normals and indices manually.

by (27,603 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.