0 votes

As far as I know multimesh method just spams the same object on a surface without much manual control. I'm adding trees to my game and if I just copy-paste them, draw calls go up to hundreds and if I add rocks etc. draw calls will grow even more.
So, how can I reduce the amount of drawcalls?

in Engine by (23 points)

1 Answer

+1 vote

You're correct that the "Populate MultiMesh" window from https://docs.godotengine.org/en/3.1/tutorials/3d/using_multi_mesh_instance.html gives few options and does essentially spam the object around randomly.

But if you attach a script to a multimesh instead, you can control where each instance gets placed in _ready. From the "Making a school of fish" section of http://docs.godotengine.org/uk/latest/tutorials/3d/vertex_animation/animating_thousands_of_fish.html

for i in range($School.multimesh.instance_count):
    var position = Transform()
    position = position.translated(Vector3(randf() * 100 - 50, randf() * 50 - 25, randf() * 50 - 25))
    $School.multimesh.set_instance_transform(i, position)
by (394 points)
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 Frequently asked questions and 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 [email protected] with your username.