From 85cf99f28e93556f1298a5136254253f9da82b9a Mon Sep 17 00:00:00 2001 From: reduz Date: Tue, 29 Jun 2021 22:55:11 -0300 Subject: Deprecate ImmediateGeometry * Removed entirely from RenderingServer. * Replaced by ImmediateMesh resource. * ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future. * Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4). * RootMotionView works again. * Polygon3D editor works again. --- doc/classes/ArrayMesh.xml | 30 ++++++- doc/classes/ImmediateGeometry3D.xml | 113 ----------------------- doc/classes/ImmediateMesh.xml | 103 +++++++++++++++++++++ doc/classes/MeshDataTool.xml | 2 +- doc/classes/RenderingServer.xml | 175 +++--------------------------------- doc/classes/Sprite3D.xml | 6 -- doc/classes/SurfaceTool.xml | 2 +- 7 files changed, 141 insertions(+), 290 deletions(-) delete mode 100644 doc/classes/ImmediateGeometry3D.xml create mode 100644 doc/classes/ImmediateMesh.xml (limited to 'doc/classes') diff --git a/doc/classes/ArrayMesh.xml b/doc/classes/ArrayMesh.xml index 1bbf9bcd93..7fbf53c7d1 100644 --- a/doc/classes/ArrayMesh.xml +++ b/doc/classes/ArrayMesh.xml @@ -43,7 +43,7 @@ [/csharp] [/codeblocks] The [MeshInstance3D] is ready to be added to the [SceneTree] to be shown. - See also [ImmediateGeometry3D], [MeshDataTool] and [SurfaceTool] for procedural geometry generation. + See also [ImmediateMesh], [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. @@ -202,7 +202,31 @@ Sets a name for a given surface. - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -212,8 +236,6 @@ - Updates a specified region of mesh arrays on the GPU. - [b]Warning:[/b] Only use if you know what you are doing. You can easily cause crashes by calling this function with improper arguments. diff --git a/doc/classes/ImmediateGeometry3D.xml b/doc/classes/ImmediateGeometry3D.xml deleted file mode 100644 index d2d663847f..0000000000 --- a/doc/classes/ImmediateGeometry3D.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - Draws simple geometry from code. - - - 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. - - - - - - - - - - - - - - - - - Simple helper to draw an UV sphere with given latitude, longitude and radius. - - - - - - - - - Adds a vertex in local coordinate space with the currently set color/uv/etc. - - - - - - - - - - - Begin drawing (and optionally pass a texture override). When done call [method end]. For more information on how this works, search for [code]glBegin()[/code] and [code]glEnd()[/code] references. - For the type of primitive, see the [enum Mesh.PrimitiveType] enum. - - - - - - - Clears everything that was drawn using begin/end. - - - - - - - Ends a drawing context and displays the results. - - - - - - - - - The current drawing color. - - - - - - - - - The next vertex's normal. - - - - - - - - - The next vertex's tangent (and binormal facing). - - - - - - - - - The next vertex's UV. - - - - - - - - - The next vertex's second layer UV. - - - - - - diff --git a/doc/classes/ImmediateMesh.xml b/doc/classes/ImmediateMesh.xml new file mode 100644 index 0000000000..d2ae091cad --- /dev/null +++ b/doc/classes/ImmediateMesh.xml @@ -0,0 +1,103 @@ + + + + Mesh optimized for creating geometry manually. + + + Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode. + + + + + + + + + Clear all surfaces. + + + + + + + + + Add a 3D vertex using the current attributes previously set. + + + + + + + + + Add a 2D vertex using the current attributes previously set. + + + + + + + + + + + Begin a new surface. + + + + + + + End and commit current surface. Note that surface being created will not be visible until this function is called. + + + + + + + + + Set the color attribute that will be pushed with the next vertex. + + + + + + + + + Set the normal attribute that will be pushed with the next vertex. + + + + + + + + + Set the tangent attribute that will be pushed with the next vertex. + + + + + + + + + Set the UV attribute that will be pushed with the next vertex. + + + + + + + + + Set the UV2 attribute that will be pushed with the next vertex. + + + + + + diff --git a/doc/classes/MeshDataTool.xml b/doc/classes/MeshDataTool.xml index da02511dc0..c0ee1e1956 100644 --- a/doc/classes/MeshDataTool.xml +++ b/doc/classes/MeshDataTool.xml @@ -45,7 +45,7 @@ AddChild(mi); [/csharp] [/codeblocks] - See also [ArrayMesh], [ImmediateGeometry3D] and [SurfaceTool] for procedural geometry generation. + See also [ArrayMesh], [ImmediateMesh] 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. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 44e0202307..acfa277dcb 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -988,143 +988,6 @@ Returns [code]true[/code] if the OS supports a certain feature. Features might be [code]s3tc[/code], [code]etc[/code], [code]etc2[/code] and [code]pvrtc[/code]. - - - - - - - - - - - Sets up [ImmediateGeometry3D] internals to prepare for drawing. Equivalent to [method ImmediateGeometry3D.begin]. - - - - - - - - - Clears everything that was set up between [method immediate_begin] and [method immediate_end]. Equivalent to [method ImmediateGeometry3D.clear]. - - - - - - - - - - - Sets the color to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_color]. - - - - - - - Creates an immediate geometry and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]immediate_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - To place in a scene, attach this immediate geometry to an instance using [method instance_set_base] using the returned RID. - - - - - - - - - Ends drawing the [ImmediateGeometry3D] and displays it. Equivalent to [method ImmediateGeometry3D.end]. - - - - - - - - - Returns the material assigned to the [ImmediateGeometry3D]. - - - - - - - - - - - Sets the normal to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_normal]. - - - - - - - - - - - Sets the material to be used to draw the [ImmediateGeometry3D]. - - - - - - - - - - - Sets the tangent to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_tangent]. - - - - - - - - - - - Sets the UV to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_uv]. - - - - - - - - - - - Sets the UV2 to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_uv2]. - - - - - - - - - - - Adds the next vertex using the information provided in advance. Equivalent to [method ImmediateGeometry3D.add_vertex]. - - - - - - - - - - - Adds the next vertex using the information provided in advance. This is a helper class that calls [method immediate_vertex] under the hood. Equivalent to [method ImmediateGeometry3D.add_vertex]. - - @@ -1787,21 +1650,6 @@ Sets a mesh's surface's material. - - - - - - - - - - - - - Updates a specific region of a vertex buffer for the specified surface. Warning: this function alters the vertex buffer directly with no safety mechanisms, you can easily corrupt your mesh. - - @@ -3677,35 +3525,32 @@ The instance is a multimesh. - - The instance is an immediate geometry. - - + The instance is a particle emitter. - + - + The instance is a light. - + The instance is a reflection probe. - + The instance is a decal. - + The instance is a VoxelGI. - + The instance is a lightmap. - + - + Represents the size of the [enum InstanceType] enum. - + A combination of the flags of geometry instances (mesh, multimesh, immediate and particles). diff --git a/doc/classes/Sprite3D.xml b/doc/classes/Sprite3D.xml index f7f2ff0de1..ddb9d543e8 100644 --- a/doc/classes/Sprite3D.xml +++ b/doc/classes/Sprite3D.xml @@ -21,7 +21,6 @@ The number of columns in the sprite sheet. - If [code]true[/code], texture will be cut from a larger atlas texture. See [member region_rect]. The region of the atlas texture to display. [member region_enabled] must be [code]true[/code]. @@ -39,11 +38,6 @@ Emitted when the [member frame] changes. - - - Emitted when the [member texture] changes. - - diff --git a/doc/classes/SurfaceTool.xml b/doc/classes/SurfaceTool.xml index 22d1b52479..a8b836ff0c 100644 --- a/doc/classes/SurfaceTool.xml +++ b/doc/classes/SurfaceTool.xml @@ -24,7 +24,7 @@ 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 set_uv] or [method set_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. 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], [ImmediateGeometry3D] and [MeshDataTool] for procedural geometry generation. + See also [ArrayMesh], [ImmediateMesh] 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. -- cgit v1.2.3