godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.8k stars 3.08k forks source link

Article on Using the MeshDataTool suggests uses of tessellation and simplifying meshes, even though you can't do that with the MeshDataTool #4347

Open Arnklit opened 3 years ago

Arnklit commented 3 years ago

Your Godot version: 3.2.3.Stable

Issue description: Article on Using the MeshDataTool suggests uses of tessellation and simplifying meshes, even though you can't do that with the MeshDataTool. Unless these functions exists somewhere but then there is the error of them not being documented in the docs or API either.

The MeshDataTool is not used to generate geometry. But it is helpful for dynamically altering geometry, for example if you want to write a script to tessellate, simplify, or deform meshes.

URL to the documentation page (if already existing): https://docs.godotengine.org/en/stable/tutorials/content/procedural_geometry/meshdatatool.html

Calinou commented 3 years ago

cc @clayjohn

clayjohn commented 3 years ago

What do you mean you can't do that with the MeshDataTool?

There is not a built in "tesselate" or "simplify" function, which is why the docs say

"...for example if you want to write a script to tessellate, simplify, or deform meshes.

And then the doc gives you an example of deforming a mesh to describe the API usage.

Arnklit commented 3 years ago

But how would you tessellate or simplify anything with the MeshDataTool? It can move verts and change vertex colours. Looking at the API I don't see any options to change the actually structure of the mesh, you'd have to use the SurfaceTool for all those tasks as far as I can tell.

clayjohn commented 3 years ago

I see your confusion now. Yes. When using MeshDataTool to directly alter vertices using "set_vertex" you are limited to the number of vertices in the original mesh.

When increasing or decreasing the vertex count you use the MeshDataTool to give you access to the meshes data in a robust way including triangles, edges, etc. And then you use that data to generate a new mesh using the SurfaceTool or the ArrayMesh API.

It is worth making a note somewhere in that docent that MeshDataTool.commit() is not the only way to use the MeshDataTool