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.
This commit is contained in:
Dathide
2021-07-30 14:51:33 -07:00
committed by GitHub
parent df36ec954d
commit 42d2ae5e7e

View File

@@ -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