From a6366256ec55ec72d2d406a64ece8e4d82d485c4 Mon Sep 17 00:00:00 2001 From: Dathide <47128084+Dathide@users.noreply.github.com> Date: Fri, 30 Jul 2021 14:51:33 -0700 Subject: [PATCH] Add extra info from SurfaceTool class page Added a few sentences about generate_normals() and generate_tangents() taken from the SurfaceTool class page in the docs. --- tutorials/content/procedural_geometry/surfacetool.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tutorials/content/procedural_geometry/surfacetool.rst b/tutorials/content/procedural_geometry/surfacetool.rst index c6f49808a..27cbbb148 100644 --- a/tutorials/content/procedural_geometry/surfacetool.rst +++ b/tutorials/content/procedural_geometry/surfacetool.rst @@ -87,7 +87,13 @@ you want to use unique normals or colors per face instead of per-vertex), you ca st.deindex() -If you don't add custom normals yourself, you can add them using ``generate_normals()``. The same goes for tangents. +If you don't add custom normals yourself, you can add them using ``generate_normals()``, which should +be called after generating geometry and before committing the mesh using ``commit()`` or +``commit_to_arrays()``. Calling ``generate_normals(true)`` will flip the resulting normals. As a side +note, ``generate_normals()`` only works if the primitive type is set to ``Mesh.PRIMITIVE_TRIANGLES``. + +If you don't add custom tangents, they can be added with ``generate_tangents()``, but it requires +that each vertex have UVs and normals set already. .. tabs:: .. code-tab:: gdscript GDScript