Improve the procedural geometry class documentations
This references Godot's winding order at the top of every
procedural geometry class, as well as referencing other classes
within a given geometry class.
A warning about ImmediateGeometry3D performance was also added.
(cherry picked from commit ed7347d73d
)
This commit is contained in:
parent
93555d9ccc
commit
24265c498b
4 changed files with 9 additions and 1 deletions
|
@ -22,6 +22,8 @@
|
||||||
m.mesh = arr_mesh
|
m.mesh = arr_mesh
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
The [MeshInstance] is ready to be added to the [SceneTree] to be shown.
|
The [MeshInstance] is ready to be added to the [SceneTree] to be shown.
|
||||||
|
See also [ImmediateGeometry], [MeshDataTool] and [SurfaceTool] for procedural geometry generation.
|
||||||
|
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
<link>https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link>
|
<link>https://docs.godotengine.org/en/latest/tutorials/content/procedural_geometry/arraymesh.html</link>
|
||||||
|
@ -52,7 +54,6 @@
|
||||||
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
|
Surfaces are created to be rendered using a [code]primitive[/code], which may be any of the types defined in [enum Mesh.PrimitiveType]. (As a note, when using indices, it is recommended to only use points, lines or triangles.) [method Mesh.get_surface_count] will become the [code]surf_idx[/code] for this new surface.
|
||||||
The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used.
|
The [code]arrays[/code] argument is an array of arrays. See [enum ArrayType] for the values used in this array. For example, [code]arrays[0][/code] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array or be empty, except for [constant ARRAY_INDEX] if it is used.
|
||||||
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
|
Adding an index array puts this function into "index mode" where the vertex and other arrays become the sources of data, and the index array defines the order of the vertices.
|
||||||
Godot uses clockwise winding order for front faces of triangle primitive modes.
|
|
||||||
</description>
|
</description>
|
||||||
</method>
|
</method>
|
||||||
<method name="clear_blend_shapes">
|
<method name="clear_blend_shapes">
|
||||||
|
|
|
@ -5,6 +5,9 @@
|
||||||
</brief_description>
|
</brief_description>
|
||||||
<description>
|
<description>
|
||||||
Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
|
Draws simple geometry from code. Uses a drawing mode similar to OpenGL 1.x.
|
||||||
|
See also [ArrayMesh], [MeshDataTool] and [SurfaceTool] for procedural geometry generation.
|
||||||
|
[b]Note:[/b] ImmediateGeometry3D is best suited to small amounts of mesh data that change every frame. It will be slow when handling large amounts of mesh data. If mesh data doesn't change often, use [ArrayMesh], [MeshDataTool] or [SurfaceTool] instead.
|
||||||
|
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
mesh.surface_remove(0)
|
mesh.surface_remove(0)
|
||||||
mdt.commit_to_surface(mesh)
|
mdt.commit_to_surface(mesh)
|
||||||
[/codeblock]
|
[/codeblock]
|
||||||
|
See also [ArrayMesh], [ImmediateGeometry] and [SurfaceTool] for procedural geometry generation.
|
||||||
|
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method add_uv] or [method add_color], then the last values would be used.
|
The above [SurfaceTool] now contains one vertex of a triangle which has a UV coordinate and a specified [Color]. If another vertex were added without calling [method add_uv] or [method add_color], then the last values would be used.
|
||||||
Vertex attributes must be passed [b]before[/b] calling [method add_vertex]. Failure to do so will result in an error when committing the vertex information to a mesh.
|
Vertex attributes must be passed [b]before[/b] calling [method add_vertex]. Failure to do so will result in an error when committing the vertex information to a mesh.
|
||||||
Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices.
|
Additionally, the attributes used before the first vertex is added determine the format of the mesh. For example, if you only add UVs to the first vertex, you cannot add color to any of the subsequent vertices.
|
||||||
|
See also [ArrayMesh], [ImmediateGeometry] and [MeshDataTool] for procedural geometry generation.
|
||||||
|
[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-OpenGL/Face-culling]winding order[/url] for front faces of triangle primitive modes.
|
||||||
</description>
|
</description>
|
||||||
<tutorials>
|
<tutorials>
|
||||||
</tutorials>
|
</tutorials>
|
||||||
|
|
Loading…
Reference in a new issue