0 votes

I will explain it as simple as possible,First im trying to create a minecrafty voxel game, i am instancing around 10,000 mesh's obviously this isn't very performant, and I started looking for a way to optimize performance, and I found multi-mesh instance it sounds great and exactly what im looking for, but I go to the docs and Im clueless I have no clue on how to implement it into my code.

To make it easier for you guys to understand what I want I will post my code in a link here:

Godot version 3.2.3
in Engine by (135 points)

1 Answer

0 votes

GridMaps are much closer to what you want to implement.

Edit: Since you really want to use MultiMesh.

Mesh and MultiMesh are Resources, containing information about what to display. MeshInstance and MultiMeshInstance are Spatials which can display them.

Basic code to create a MultiMesh can be found here. Once created, simply put it into a MultiMeshInstance in the tree to display it.

Since you will probably have quite a few blocks, you may want to use MeshLibrary anyway, even without any GridMap (for convenient storage). If the default way of creating one is insuficient for you, see this answer to create one by code.

by (2,276 points)
edited by

Thanks, I'm aware of gridmaps but I like to accomplish this without it.

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.