A bunch of renames for Godot 4.0

This commit is contained in:
Max Hilbrunner
2022-10-15 18:19:12 +02:00
parent 024fedb0f3
commit b82cd0690d
11 changed files with 72 additions and 73 deletions
+1 -2
View File
@@ -40,8 +40,7 @@ resizing or stretching the screen. This transform is used internally (as
described in :ref:`doc_multiple_resolutions`), but can also be manually set
on each viewport.
Input events received in the :ref:`MainLoop._input_event() <class_MainLoop_method__input_event>`
callback are multiplied by this transform but lack the ones above. To
Input events are multiplied by this transform but lack the ones above. To
convert InputEvent coordinates to local CanvasItem coordinates, the
:ref:`CanvasItem.make_input_local() <class_CanvasItem_method_make_input_local>`
function was added for convenience.
+1 -1
View File
@@ -58,7 +58,7 @@ The ``_draw()`` function is only called once, and then the draw commands
are cached and remembered, so further calls are unnecessary.
If re-drawing is required because a state or something else changed,
call :ref:`CanvasItem.update() <class_CanvasItem_method_update>`
call :ref:`CanvasItem.queue_redraw() <class_CanvasItem_method_queue_redraw>`
in that same node and a new ``_draw()`` call will happen.
Here is a little more complex example, a texture variable that will be
+19 -19
View File
@@ -19,34 +19,34 @@ parameters and then adding randomness to them.
Particle nodes
~~~~~~~~~~~~~~
Godot provides two different nodes for 2D particles, :ref:`class_Particles2D` and
Godot provides two different nodes for 2D particles, :ref:`class_GPUParticles2D` and
:ref:`class_CPUParticles2D`.
Particles2D is more advanced and uses the GPU to process particle effects, but that limits
GPUParticles2D is more advanced and uses the GPU to process particle effects, but that limits
it to higher end graphics API, and in our case to the GLES3 renderer. For projects using
the GLES2 backend, CPUParticles2D is a CPU-driven option with near feature parity with
Particles2D, but lesser performance. While Particles2D is configured via a
:ref:`class_ParticlesMaterial` (and optionally with a custom shader), the matching options
GPUParticles2D, but lesser performance. While GPUParticles2D is configured via a
:ref:`class_ParticleProcessMaterial` (and optionally with a custom shader), the matching options
are provided via node properties in CPUParticles2D (with the exception of the trail settings).
You can convert a Particles2D node into a CPUParticles2D node by clicking on the node in the
You can convert a GPUParticles2D node into a CPUParticles2D node by clicking on the node in the
inspector, and selecting "Convert to CPUParticles2D" in the "Particles" menu of the toolbar.
.. image:: img/particles_convert.png
The rest of this tutorial is going to use the Particles2D node. First, add a Particles2D
The rest of this tutorial is going to use the GPUParticles2D node. First, add a GPUParticles2D
node to your scene. After creating that node you will notice that only a white dot was created,
and that there is a warning icon next to your Particles2D node in the scene dock. This
is because the node needs a ParticlesMaterial to function.
and that there is a warning icon next to your GPUParticles2D node in the scene dock. This
is because the node needs a ParticleProcessMaterial to function.
ParticlesMaterial
~~~~~~~~~~~~~~~~~
ParticleProcessMaterial
~~~~~~~~~~~~~~~~~~~~~~~
To add a process material to your particles node, go to ``Process Material`` in
your inspector panel. Click on the box next to ``Material``, and from the dropdown
menu select ``New ParticlesMaterial``.
menu select ``New ParticleProcessMaterial``.
.. image:: img/particles_material.png
Your Particles2D node should now be emitting
Your GPUParticles2D node should now be emitting
white points downward.
.. image:: img/particles1.png
@@ -80,7 +80,7 @@ Lifetime: 4.0
One Shot
~~~~~~~~
When enabled, a Particles2D node will emit all of its particles once
When enabled, a GPUParticles2D node will emit all of its particles once
and then never again.
Preprocess
@@ -149,7 +149,7 @@ The rectangle's ``W`` and ``H`` properties respectively control its Width and it
The ``X`` and ``Y`` properties control the position of the upper-left
corner of the rectangle, relative to the particle emitter.
You can have Godot generate a Visibility Rect automatically using the toolbar above the 2d view. To do so, select the Particles2D node and Click ``Particles > Generate Visibility Rect``. Godot will simulate the Particles2D node emitting particles for a few seconds and set the rectangle to fit the surface the particles take.
You can have Godot generate a Visibility Rect automatically using the toolbar above the 2d view. To do so, select the GPUParticles2D node and Click ``Particles > Generate Visibility Rect``. Godot will simulate the Particles2D node emitting particles for a few seconds and set the rectangle to fit the surface the particles take.
You can control the emit duration with the ``Generation Time (sec)`` option. The maximum value is 25 seconds. If you need more time for your particles to move around, you can temporarily change the ``preprocess`` duration on the Particles2D node.
@@ -174,8 +174,8 @@ This controls the order in which individual particles are drawn. ``Index``
means particles are drawn according to their emission order (default).
``Lifetime`` means they are drawn in order of remaining lifetime.
ParticlesMaterial settings
--------------------------
ParticleProcessMaterial settings
--------------------------------
Direction
~~~~~~~~~
@@ -303,11 +303,11 @@ randomness ratio.
Emission Shapes
---------------
ParticlesMaterials allow you to set an Emission Mask, which dictates
ParticleProcessMaterials allow you to set an Emission Mask, which dictates
the area and direction in which particles are emitted.
These can be generated from textures in your project.
Ensure that a ParticlesMaterial is set, and the Particles2D node is selected.
Ensure that a ParticleProcessMaterial is set, and the GPUParticles2D node is selected.
A "Particles" menu should appear in the Toolbar:
.. image:: img/emission_shapes1.png
@@ -348,7 +348,7 @@ Emission Colors
``Capture from Pixel`` will cause the particles to inherit the color of the mask at their spawn points.
Once you click "OK", the mask will be generated and set to the ParticlesMaterial, under the ``Emission Shape`` section:
Once you click "OK", the mask will be generated and set to the ParticleProcessMaterial, under the ``Emission Shape`` section:
.. image:: img/emission_shapes4.png
+38 -38
View File
@@ -13,7 +13,7 @@ Interior environments can be created by using inverted primitives.
.. note:: The CSG nodes in Godot are mainly intended for prototyping. There is
no built-in support for UV mapping or editing 3D polygons (though
extruded 2D polygons can be used with the CSGPolygon node).
extruded 2D polygons can be used with the CSGPolygon3D node).
If you're looking for an easy to use level design tool for a project,
you may want to use `Qodot <https://github.com/Shfty/qodot-plugin>`__
@@ -29,13 +29,13 @@ Introduction to CSG nodes
Like other features of Godot, CSG is supported in the form of nodes. These are
the CSG nodes:
- :ref:`CSGBox <class_CSGBox>`
- :ref:`CSGCylinder <class_CSGCylinder>` (also supports cone)
- :ref:`CSGSphere <class_CSGSphere>`
- :ref:`CSGTorus <class_CSGTorus>`
- :ref:`CSGPolygon <class_CSGPolygon>`
- :ref:`CSGMesh <class_CSGMesh>`
- :ref:`CSGCombiner <class_CSGcombiner>`
- :ref:`CSGBox3D <class_CSGBox3D>`
- :ref:`CSGCylinder3D <class_CSGCylinder3D>` (also supports cone)
- :ref:`CSGSphere3D <class_CSGSphere3D>`
- :ref:`CSGTorus3D <class_CSGTorus3D>`
- :ref:`CSGPolygon3D <class_CSGPolygon3D>`
- :ref:`CSGMesh3D <class_CSGMesh3D>`
- :ref:`CSGCombiner3D <class_CSGCombiner3D>`
.. image:: img/csg_nodes.png
@@ -59,7 +59,7 @@ Every CSG node supports 3 kinds of boolean operations:
CSGPolygon
~~~~~~~~~~
The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
The :ref:`CSGPolygon3D <class_CSGPolygon3D>` node extrude along a Polygon drawn in
2D (in X, Y coordinates) in the following ways:
- **Depth:** Extruded back a given amount.
@@ -71,15 +71,15 @@ The :ref:`CSGPolygon <class_CSGPolygon>` node extrude along a Polygon drawn in
.. image:: img/csg_poly.png
.. note:: The **Path** mode must be provided with a :ref:`Path <class_Path>`
.. note:: The **Path** mode must be provided with a :ref:`Path3D <class_Path3D>`
node to work. In the Path node, draw the path and the polygon in
CSGPolygon will extrude along the given path.
CSGPolygon3D will extrude along the given path.
Custom meshes
~~~~~~~~~~~~~
Any mesh can be used for :ref:`CSGMesh <class_CSGMesh>`; the mesh can be
Any mesh can be used for :ref:`CSGMesh3D <class_CSGMesh3D>`; the mesh can be
modelled in other software and imported into Godot. Multiple materials are
supported. There are some restrictions for geometry:
@@ -90,10 +90,10 @@ supported. There are some restrictions for geometry:
.. image:: img/csg_custom_mesh.png
CSGCombiner
~~~~~~~~~~~
CSGCombiner3D
~~~~~~~~~~~~~
The :ref:`CSGCombiner <class_CSGCombiner>` node is an empty shape used for
The :ref:`CSGCombiner3D <class_CSGCombiner3D>` node is an empty shape used for
organization. It will only combine children nodes.
Processing order
@@ -135,44 +135,44 @@ Create a scene with a Spatial node as root node.
.. image:: img/csg_overdraw.png
Create a CSGBox and name it ``room``, enable **Invert Faces** and change the
Create a CSGBox3D and name it ``room``, enable **Invert Faces** and change the
dimensions of your room.
.. image:: img/csg_room.png
.. image:: img/csg_room_invert.png
Next, create a CSGCombiner and name it ``desk``.
Next, create a CSGCombiner3D and name it ``desk``.
A desk has one surface and 4 legs:
- Create 1 CSGBox children node in **Union** mode for the surface
- Create 1 CSGBox3D children node in **Union** mode for the surface
and adjust the dimensions.
- Create 4 CSGBox children nodes in **Union** mode for the legs
- Create 4 CSGBox3D children nodes in **Union** mode for the legs
and adjust the dimensions.
Adjust their placement to resemble a desk.
.. image:: img/csg_desk.png
.. note:: CSG nodes inside a CSGCombiner will only process their operation
within the combiner. Therefore, CSGCombiners are used to organize
.. note:: CSG nodes inside a CSGCombiner3D will only process their operation
within the combiner. Therefore, CSGCombiner3Ds are used to organize
CSG nodes.
Create a CSGCombiner and name it ``bed``.
Create a CSGCombiner3D and name it ``bed``.
Our bed consists of 3 parts: the bed, the mattress and a pillow. Create a CSGBox
and adjust its dimension for the bed. Create another CSGBox and adjust its
Our bed consists of 3 parts: the bed, the mattress and a pillow. Create a CSGBox3D
and adjust its dimension for the bed. Create another CSGBox3D and adjust its
dimension for the mattress.
.. image:: img/csg_bed_mat.png
We will create another CSGCombiner named ``pillow`` as the child of ``bed``.
We will create another CSGCombiner3D named ``pillow`` as the child of ``bed``.
The scene tree should look like this:
.. image:: img/csg_bed_tree.png
We will combine 3 CSGSphere nodes in **Union** mode to form a pillow. Scale the
We will combine 3 CSGSphere3D nodes in **Union** mode to form a pillow. Scale the
Y axis of the spheres and enable **Smooth Faces**.
.. image:: img/csg_pillow_smooth.png
@@ -186,8 +186,8 @@ Try to re-parent the ``pillow`` node to the root ``Spatial`` node; the hole will
disappear.
.. note:: This is to illustrate the effect of CSG processing order.
Since the root node is not a CSG node, the CSGCombiner nodes are
the end of the operations; this shows the use of CSGCombiner to
Since the root node is not a CSG node, the CSGCombiner3D nodes are
the end of the operations; this shows the use of CSGCombiner3D to
organize the CSG scene.
Undo the re-parent after observing the effect. The bed you've built should look
@@ -195,16 +195,16 @@ like this:
.. image:: img/csg_bed.png
Create a CSGCombiner and name it ``lamp``.
Create a CSGCombiner3D and name it ``lamp``.
A lamp consists of 3 parts: the stand, the pole and the lampshade.
Create a CSGCylinder, enable the **Cone** option and make it the stand. Create
another CSGCylinder and adjust the dimensions to use it as a pole.
Create a CSGCylinder3D, enable the **Cone** option and make it the stand. Create
another CSGCylinder3D and adjust the dimensions to use it as a pole.
.. image:: img/csg_lamp_pole_stand.png
We will use a CSGPolygon for the lampshade. Use the **Spin** mode for the
CSGPolygon and draw a `trapezoid <https://en.wikipedia.org/wiki/Trapezoid>`_
We will use a CSGPolygon3D for the lampshade. Use the **Spin** mode for the
CSGPolygon3D and draw a `trapezoid <https://en.wikipedia.org/wiki/Trapezoid>`_
while in **Front View** (numeric keypad 1); this shape will extrude around the
origin and form the lampshade.
@@ -218,21 +218,21 @@ Adjust the placement of the 3 parts to make it look like a lamp.
.. image:: img/csg_lamp.png
Create a CSGCombiner and name it ``bookshelf``.
Create a CSGCombiner3D and name it ``bookshelf``.
We will use 3 CSGBox nodes for the bookshelf. Create a CSGBox and adjust its
We will use 3 CSGBox3D nodes for the bookshelf. Create a CSGBox3D and adjust its
dimensions; this will be the size of the bookshelf.
.. image:: img/csg_shelf_big.png
Duplicate the CSGBox and shorten the dimensions of each axis and change the mode
Duplicate the CSGBox3D and shorten the dimensions of each axis and change the mode
to **Subtraction**.
.. image:: img/csg_shelf_subtract.png
.. image:: img/csg_shelf_subtract_menu.png
You've almost built a shelf. Create one more CSGBox for dividing the shelf into
You've almost built a shelf. Create one more CSGBox3D for dividing the shelf into
two levels.
.. image:: img/csg_shelf.png
@@ -261,7 +261,7 @@ to quickly apply textures to CSG-based levels.
There are two ways to apply a material to a CSG node:
- Applying it to a CSGCombiner node as a material override
- Applying it to a CSGCombiner3D node as a material override
(**Geometry > Material Override** in the Inspector). This will affect its
children automatically, but will make it impossible to change the material in
individual children.
+1 -1
View File
@@ -193,7 +193,7 @@ Curve2D, Curve3D, Path and Path2D
There are two objects that contain curves: :ref:`Curve3D <class_Curve3D>` and :ref:`Curve2D <class_Curve2D>` (for 3D and 2D respectively).
They can contain several points, allowing for longer paths. It is also possible to set them to nodes: :ref:`Path <class_Path>` and :ref:`Path2D <class_Path2D>` (also for 3D and 2D respectively):
They can contain several points, allowing for longer paths. It is also possible to set them to nodes: :ref:`Path3D <class_Path3D>` and :ref:`Path2D <class_Path2D>` (also for 3D and 2D respectively):
.. image:: img/bezier_path_2d.png
+1 -1
View File
@@ -96,7 +96,7 @@ Using the following pseudocode:
Position3D p1 = GetNode<Position3D>("Position1");
Position3D p2 = GetNode<Position3D>("Position2");
CSGMesh monkey = GetNode<CSGMesh>("Monkey");
CSGMesh3D monkey = GetNode<CSGMesh3D>("Monkey");
monkey.Transform = p1.Transform.InterpolateWith(p2.Transform, _t);
}
@@ -271,5 +271,5 @@ moving. You can move them by updating the per-instance transform for each fish e
doing so will be faster than moving thousands of MeshInstances per frame, it'll still likely be
slow.
In the next tutorial we will cover how to use :ref:`Particles <class_Particles>` to take advantage
In the next tutorial we will cover how to use :ref:`GPUParticles3D <class_GPUParticles3D>` to take advantage
of the GPU and move each fish around individually while still receiving the benefits of instancing.
@@ -8,7 +8,7 @@ update their transform array. It is great for placing many static objects around
scene. But it is still difficult to move the objects around the scene.
To make each instance move in an interesting way, we will use a
:ref:`Particles <class_Particles>` node. Particles take advantage of GPU acceleration
:ref:`GPUParticles3D <class_GPUParticles3D>` node. Particles take advantage of GPU acceleration
by computing and setting the per-instance information in a :ref:`Shader <class_Shader>`.
.. note:: Particles are not available in GLES2, instead use :ref:`CPUParticles <class_CPUParticles>`,
@@ -48,7 +48,7 @@ Then add the following two functions:
return x;
}
These functions come from the default :ref:`ParticlesMaterial <class_ParticlesMaterial>`.
These functions come from the default :ref:`ParticleProcessMaterial <class_ParticleProcessMaterial>`.
They are used to generate a random number from each particle's ``RANDOM_SEED``.
A unique thing about particle shaders is that some built-in variables are saved across frames.
@@ -138,7 +138,7 @@ This code gives you the following behavior:
.. image:: img/scene.gif
Using a ParticlesMaterial you can make the fish behavior as simple or complex as you like. In this
Using a ParticleProcessMaterial you can make the fish behavior as simple or complex as you like. In this
tutorial we only set Velocity, but in your own Shaders you can also set ``COLOR``, rotation, scale
(through ``TRANSFORM``). Please refer to the :ref:`Particles Shader Reference <doc_particle_shader>`
for more information on particle shaders.
@@ -14,12 +14,12 @@ of bugs. There may be differences that are unintentional, but they should be rep
Particles
---------
GLES2 cannot use the :ref:`Particles <class_Particles>` or :ref:`Particles2D <class_Particles2D>` nodes
GLES2 cannot use the :ref:`GPUParticles3D <class_GPUParticles3D>` or :ref:`GPUParticles2D <class_GPUParticles2D>` nodes
as they require advanced GPU features. Instead, use :ref:`CPUParticles <class_CPUParticles>` or
:ref:`CPUParticles2D <class_CPUParticles2D>`, which provides a similar interface to a
:ref:`ParticlesMaterial <class_ParticlesMaterial>`.
:ref:`ParticleProcessMaterial <class_ParticleProcessMaterial>`.
.. tip:: Particles and Particles2D can be converted to their CPU equivalent node with the "Convert to
.. tip:: Particles and GPUParticles2D can be converted to their CPU equivalent node with the "Convert to
CPUParticles" option in the editor.
``SCREEN_TEXTURE`` mip-maps
+2 -2
View File
@@ -8,7 +8,7 @@ Introduction
For the most common cases, Godot provides ready to use materials for
most types of shaders, such as :ref:`StandardMaterial3D <class_StandardMaterial3D>`,
:ref:`CanvasItemMaterial <class_CanvasItemMaterial>` and :ref:`ParticlesMaterial <class_ParticlesMaterial>`.
:ref:`CanvasItemMaterial <class_CanvasItemMaterial>` and :ref:`ParticleProcessMaterial <class_ParticleProcessMaterial>`.
They are flexible implementations that cover most use cases.
Shader materials allow writing a custom shader directly, for maximum flexibility.
@@ -70,7 +70,7 @@ Converting to ShaderMaterial
----------------------------
It is possible to convert from StandardMaterial3D, CanvasItemMaterial and
ParticlesMaterial to ShaderMaterial. To do so, go to the material properties
ParticleProcessMaterial to ShaderMaterial. To do so, go to the material properties
and select the convert option.
.. image:: img/shader_material_convert.png
@@ -42,8 +42,8 @@ program (e.g. Blender). But Godot also has a few :ref:`PrimitiveMeshes
importing Meshes.
There are multiple node types that you can use to draw a mesh. The main one is
:ref:`MeshInstance <class_meshinstance>`, but you can also use :ref:`Particles
<class_particles>`, :ref:`MultiMeshes <class_MultiMesh>` (with a
:ref:`MeshInstance <class_meshinstance>`, but you can also use :ref:`GPUParticles3D
<class_GPUParticles3D>`, :ref:`MultiMeshes <class_MultiMesh>` (with a
:ref:`MultiMeshInstance <class_multimeshinstance>`), or others.
Typically, a material is associated with a given surface in a mesh, but some