summaryrefslogtreecommitdiff
path: root/doc/classes
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-01-26 22:52:19 +0100
committerRémi Verschelde <rverschelde@gmail.com>2023-01-26 22:52:19 +0100
commit7cf21f296bfe931fb4243f1c16f9f6b5963a9ef4 (patch)
tree7863d50d479f6a2b642d295bb66f6d56032647df /doc/classes
parentb2164ee75bc241fef82f1c42a7528f5a1b1c968c (diff)
parentda893c14cf06df4baa144e3e3f4b619e23e7228e (diff)
Merge pull request #68034 from Klowner/surfacetool-generate-normals
Make SurfaceTool.generate_normals() behave consistently with smoothing groups
Diffstat (limited to 'doc/classes')
-rw-r--r--doc/classes/SurfaceTool.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml
index 9d73e9fb39..5b567dbc28 100644
--- a/doc/classes/SurfaceTool.xml
+++ b/doc/classes/SurfaceTool.xml
@@ -133,7 +133,7 @@
<description>
Generates normals from vertices so you do not have to do it manually. If [param flip] is [code]true[/code], the resulting normals will be inverted. [method generate_normals] should be called [i]after[/i] generating geometry and [i]before[/i] committing the mesh using [method commit] or [method commit_to_arrays]. For correct display of normal-mapped surfaces, you will also have to generate tangents using [method generate_tangents].
[b]Note:[/b] [method generate_normals] only works if the primitive type to be set to [constant Mesh.PRIMITIVE_TRIANGLES].
- [b]Note:[/b] [method generate_normals] takes smooth groups into account. If you don't specify any smooth group for each vertex, [method generate_normals] will smooth normals for you.
+ [b]Note:[/b] [method generate_normals] takes smooth groups into account. To generate smooth normals, set the smooth group to a value greater than or equal to [code]0[/code] using [method set_smooth_group] or leave the smooth group at the default of [code]0[/code]. To generate flat normals, set the smooth group to [code]-1[/code] using [method set_smooth_group] prior to adding vertices.
</description>
</method>
<method name="generate_tangents">
@@ -241,7 +241,7 @@
<return type="void" />
<param index="0" name="index" type="int" />
<description>
- Specifies whether the current vertex (if using only vertex arrays) or current index (if also using index arrays) should use smooth normals for normal calculation.
+ Specifies the smooth group to use for the [i]next[/i] vertex. If this is never called, all vertices will have the default smooth group of [code]0[/code] and will be smoothed with adjacent vertices of the same group. To produce a mesh with flat normals, set the smooth group to [code]-1[/code].
</description>
</method>
<method name="set_tangent">