summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2021-06-29 22:55:11 -0300
committerreduz <reduzio@gmail.com>2021-06-30 14:14:41 -0300
commit85cf99f28e93556f1298a5136254253f9da82b9a (patch)
treed38bc6dde1d41417149a8b37111abcba1e6dc4af /doc
parentbcd1fc832fff5c1cc1efa4d2450b9e2919b972c9 (diff)
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.
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/ArrayMesh.xml30
-rw-r--r--doc/classes/ImmediateGeometry3D.xml113
-rw-r--r--doc/classes/ImmediateMesh.xml103
-rw-r--r--doc/classes/MeshDataTool.xml2
-rw-r--r--doc/classes/RenderingServer.xml175
-rw-r--r--doc/classes/Sprite3D.xml6
-rw-r--r--doc/classes/SurfaceTool.xml2
7 files changed, 141 insertions, 290 deletions
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.
</description>
<tutorials>
@@ -202,7 +202,31 @@
Sets a name for a given surface.
</description>
</method>
- <method name="surface_update_region">
+ <method name="surface_update_attribute_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <argument index="1" name="offset" type="int">
+ </argument>
+ <argument index="2" name="data" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="surface_update_skin_region">
+ <return type="void">
+ </return>
+ <argument index="0" name="surf_idx" type="int">
+ </argument>
+ <argument index="1" name="offset" type="int">
+ </argument>
+ <argument index="2" name="data" type="PackedByteArray">
+ </argument>
+ <description>
+ </description>
+ </method>
+ <method name="surface_update_vertex_region">
<return type="void">
</return>
<argument index="0" name="surf_idx" type="int">
@@ -212,8 +236,6 @@
<argument index="2" name="data" type="PackedByteArray">
</argument>
<description>
- 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.
</description>
</method>
</methods>
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 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<class name="ImmediateGeometry3D" inherits="GeometryInstance3D" version="4.0">
- <brief_description>
- Draws simple geometry from code.
- </brief_description>
- <description>
- 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>
- <tutorials>
- </tutorials>
- <methods>
- <method name="add_sphere">
- <return type="void">
- </return>
- <argument index="0" name="lats" type="int">
- </argument>
- <argument index="1" name="lons" type="int">
- </argument>
- <argument index="2" name="radius" type="float">
- </argument>
- <argument index="3" name="add_uv" type="bool" default="true">
- </argument>
- <description>
- Simple helper to draw an UV sphere with given latitude, longitude and radius.
- </description>
- </method>
- <method name="add_vertex">
- <return type="void">
- </return>
- <argument index="0" name="position" type="Vector3">
- </argument>
- <description>
- Adds a vertex in local coordinate space with the currently set color/uv/etc.
- </description>
- </method>
- <method name="begin">
- <return type="void">
- </return>
- <argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType">
- </argument>
- <argument index="1" name="texture" type="Texture2D" default="null">
- </argument>
- <description>
- 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.
- </description>
- </method>
- <method name="clear">
- <return type="void">
- </return>
- <description>
- Clears everything that was drawn using begin/end.
- </description>
- </method>
- <method name="end">
- <return type="void">
- </return>
- <description>
- Ends a drawing context and displays the results.
- </description>
- </method>
- <method name="set_color">
- <return type="void">
- </return>
- <argument index="0" name="color" type="Color">
- </argument>
- <description>
- The current drawing color.
- </description>
- </method>
- <method name="set_normal">
- <return type="void">
- </return>
- <argument index="0" name="normal" type="Vector3">
- </argument>
- <description>
- The next vertex's normal.
- </description>
- </method>
- <method name="set_tangent">
- <return type="void">
- </return>
- <argument index="0" name="tangent" type="Plane">
- </argument>
- <description>
- The next vertex's tangent (and binormal facing).
- </description>
- </method>
- <method name="set_uv">
- <return type="void">
- </return>
- <argument index="0" name="uv" type="Vector2">
- </argument>
- <description>
- The next vertex's UV.
- </description>
- </method>
- <method name="set_uv2">
- <return type="void">
- </return>
- <argument index="0" name="uv" type="Vector2">
- </argument>
- <description>
- The next vertex's second layer UV.
- </description>
- </method>
- </methods>
- <constants>
- </constants>
-</class>
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 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<class name="ImmediateMesh" inherits="Mesh" version="4.0">
+ <brief_description>
+ Mesh optimized for creating geometry manually.
+ </brief_description>
+ <description>
+ Mesh optimized for creating geometry manually, similar to OpenGL1.x immediate mode.
+ </description>
+ <tutorials>
+ </tutorials>
+ <methods>
+ <method name="clear_surfaces">
+ <return type="void">
+ </return>
+ <description>
+ Clear all surfaces.
+ </description>
+ </method>
+ <method name="surface_add_vertex">
+ <return type="void">
+ </return>
+ <argument index="0" name="vertex" type="Vector3">
+ </argument>
+ <description>
+ Add a 3D vertex using the current attributes previously set.
+ </description>
+ </method>
+ <method name="surface_add_vertex_2d">
+ <return type="void">
+ </return>
+ <argument index="0" name="vertex" type="Vector2">
+ </argument>
+ <description>
+ Add a 2D vertex using the current attributes previously set.
+ </description>
+ </method>
+ <method name="surface_begin">
+ <return type="void">
+ </return>
+ <argument index="0" name="primitive" type="int" enum="Mesh.PrimitiveType">
+ </argument>
+ <argument index="1" name="material" type="Material" default="null">
+ </argument>
+ <description>
+ Begin a new surface.
+ </description>
+ </method>
+ <method name="surface_end">
+ <return type="void">
+ </return>
+ <description>
+ End and commit current surface. Note that surface being created will not be visible until this function is called.
+ </description>
+ </method>
+ <method name="surface_set_color">
+ <return type="void">
+ </return>
+ <argument index="0" name="color" type="Color">
+ </argument>
+ <description>
+ Set the color attribute that will be pushed with the next vertex.
+ </description>
+ </method>
+ <method name="surface_set_normal">
+ <return type="void">
+ </return>
+ <argument index="0" name="normal" type="Vector3">
+ </argument>
+ <description>
+ Set the normal attribute that will be pushed with the next vertex.
+ </description>
+ </method>
+ <method name="surface_set_tangent">
+ <return type="void">
+ </return>
+ <argument index="0" name="tangent" type="Plane">
+ </argument>
+ <description>
+ Set the tangent attribute that will be pushed with the next vertex.
+ </description>
+ </method>
+ <method name="surface_set_uv">
+ <return type="void">
+ </return>
+ <argument index="0" name="uv" type="Vector2">
+ </argument>
+ <description>
+ Set the UV attribute that will be pushed with the next vertex.
+ </description>
+ </method>
+ <method name="surface_set_uv2">
+ <return type="void">
+ </return>
+ <argument index="0" name="uv2" type="Vector2">
+ </argument>
+ <description>
+ Set the UV2 attribute that will be pushed with the next vertex.
+ </description>
+ </method>
+ </methods>
+ <constants>
+ </constants>
+</class>
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.
</description>
<tutorials>
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].
</description>
</method>
- <method name="immediate_begin">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="primitive" type="int" enum="RenderingServer.PrimitiveType">
- </argument>
- <argument index="2" name="texture" type="RID">
- </argument>
- <description>
- Sets up [ImmediateGeometry3D] internals to prepare for drawing. Equivalent to [method ImmediateGeometry3D.begin].
- </description>
- </method>
- <method name="immediate_clear">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <description>
- Clears everything that was set up between [method immediate_begin] and [method immediate_end]. Equivalent to [method ImmediateGeometry3D.clear].
- </description>
- </method>
- <method name="immediate_color">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="color" type="Color">
- </argument>
- <description>
- Sets the color to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_color].
- </description>
- </method>
- <method name="immediate_create">
- <return type="RID">
- </return>
- <description>
- 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.
- </description>
- </method>
- <method name="immediate_end">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <description>
- Ends drawing the [ImmediateGeometry3D] and displays it. Equivalent to [method ImmediateGeometry3D.end].
- </description>
- </method>
- <method name="immediate_get_material" qualifiers="const">
- <return type="RID">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <description>
- Returns the material assigned to the [ImmediateGeometry3D].
- </description>
- </method>
- <method name="immediate_normal">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="normal" type="Vector3">
- </argument>
- <description>
- Sets the normal to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_normal].
- </description>
- </method>
- <method name="immediate_set_material">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="material" type="RID">
- </argument>
- <description>
- Sets the material to be used to draw the [ImmediateGeometry3D].
- </description>
- </method>
- <method name="immediate_tangent">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="tangent" type="Plane">
- </argument>
- <description>
- Sets the tangent to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_tangent].
- </description>
- </method>
- <method name="immediate_uv">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="tex_uv" type="Vector2">
- </argument>
- <description>
- Sets the UV to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_uv].
- </description>
- </method>
- <method name="immediate_uv2">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="tex_uv" type="Vector2">
- </argument>
- <description>
- Sets the UV2 to be used with next vertex. Equivalent to [method ImmediateGeometry3D.set_uv2].
- </description>
- </method>
- <method name="immediate_vertex">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="vertex" type="Vector3">
- </argument>
- <description>
- Adds the next vertex using the information provided in advance. Equivalent to [method ImmediateGeometry3D.add_vertex].
- </description>
- </method>
- <method name="immediate_vertex_2d">
- <return type="void">
- </return>
- <argument index="0" name="immediate" type="RID">
- </argument>
- <argument index="1" name="vertex" type="Vector2">
- </argument>
- <description>
- 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].
- </description>
- </method>
<method name="init">
<return type="void">
</return>
@@ -1787,21 +1650,6 @@
Sets a mesh's surface's material.
</description>
</method>
- <method name="mesh_surface_update_region">
- <return type="void">
- </return>
- <argument index="0" name="mesh" type="RID">
- </argument>
- <argument index="1" name="surface" type="int">
- </argument>
- <argument index="2" name="offset" type="int">
- </argument>
- <argument index="3" name="data" type="PackedByteArray">
- </argument>
- <description>
- 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.
- </description>
- </method>
<method name="multimesh_allocate_data">
<return type="void">
</return>
@@ -3677,35 +3525,32 @@
<constant name="INSTANCE_MULTIMESH" value="2" enum="InstanceType">
The instance is a multimesh.
</constant>
- <constant name="INSTANCE_IMMEDIATE" value="3" enum="InstanceType">
- The instance is an immediate geometry.
- </constant>
- <constant name="INSTANCE_PARTICLES" value="4" enum="InstanceType">
+ <constant name="INSTANCE_PARTICLES" value="3" enum="InstanceType">
The instance is a particle emitter.
</constant>
- <constant name="INSTANCE_PARTICLES_COLLISION" value="5" enum="InstanceType">
+ <constant name="INSTANCE_PARTICLES_COLLISION" value="4" enum="InstanceType">
</constant>
- <constant name="INSTANCE_LIGHT" value="6" enum="InstanceType">
+ <constant name="INSTANCE_LIGHT" value="5" enum="InstanceType">
The instance is a light.
</constant>
- <constant name="INSTANCE_REFLECTION_PROBE" value="7" enum="InstanceType">
+ <constant name="INSTANCE_REFLECTION_PROBE" value="6" enum="InstanceType">
The instance is a reflection probe.
</constant>
- <constant name="INSTANCE_DECAL" value="8" enum="InstanceType">
+ <constant name="INSTANCE_DECAL" value="7" enum="InstanceType">
The instance is a decal.
</constant>
- <constant name="INSTANCE_VOXEL_GI" value="9" enum="InstanceType">
+ <constant name="INSTANCE_VOXEL_GI" value="8" enum="InstanceType">
The instance is a VoxelGI.
</constant>
- <constant name="INSTANCE_LIGHTMAP" value="10" enum="InstanceType">
+ <constant name="INSTANCE_LIGHTMAP" value="9" enum="InstanceType">
The instance is a lightmap.
</constant>
- <constant name="INSTANCE_OCCLUDER" value="11" enum="InstanceType">
+ <constant name="INSTANCE_OCCLUDER" value="10" enum="InstanceType">
</constant>
- <constant name="INSTANCE_MAX" value="13" enum="InstanceType">
+ <constant name="INSTANCE_MAX" value="12" enum="InstanceType">
Represents the size of the [enum InstanceType] enum.
</constant>
- <constant name="INSTANCE_GEOMETRY_MASK" value="30" enum="InstanceType">
+ <constant name="INSTANCE_GEOMETRY_MASK" value="14" enum="InstanceType">
A combination of the flags of geometry instances (mesh, multimesh, immediate and particles).
</constant>
<constant name="INSTANCE_FLAG_USE_BAKED_LIGHT" value="0" enum="InstanceFlags">
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.
</member>
<member name="region_enabled" type="bool" setter="set_region_enabled" getter="is_region_enabled" default="false">
- If [code]true[/code], texture will be cut from a larger atlas texture. See [member region_rect].
</member>
<member name="region_rect" type="Rect2" setter="set_region_rect" getter="get_region_rect" default="Rect2(0, 0, 0, 0)">
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.
</description>
</signal>
- <signal name="texture_changed">
- <description>
- Emitted when the [member texture] changes.
- </description>
- </signal>
</signals>
<constants>
</constants>
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.
</description>
<tutorials>