0 votes

I am trying to create a plane that is procedurally generated at runtime and which I can then modify during the game. (Basically a little heightmap, with level data stored in a 100x100 array.)

I started using an ImmediateGeometry node, but I can't access or modify the vertices in the mesh, so every time I modify the array I have to regenerate the entire plane. If I modified every vertex every frame the FPS dropped to 7-10.

Then I tried using a MeshInstance node and SurfaceTool.new(), which seems to be more flexible, but it takes about 10 seconds to generate the 100x100 mesh! I also see that there is a MeshDataTool that appears to do a similar thing.

I am a bit bewildered by all the Godot 3D stuff. There seem to be 3 nodes for everything, but each one works in a different way and requires a different approach. What is best method for this situation?

in Engine by (109 points)

1 Answer

+1 vote
Best answer

Try using ArrayMesh, which is the fastest solution for static geometry according to the documentation.

by (12,359 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 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 webmaster@godotengine.org with your username.