Applying overlay materials into multi-surface meshes currently
requires adding a next pass material to all the surfaces, which
might be cumbersome when the material is to be applied to a range
of different geometries. This also makes it not trivial to use
AnimationPlayer to control the material in case of visual effects.
The material_override property is not an option as it works
replacing the active material for the surfaces, not adding a new pass.
This commit adds the material_overlay property to GeometryInstance3D
(and therefore MeshInstance3D), having the same reach as
material_override (that is, all surfaces) but adding a new material
pass on top of the active materials, instead of replacing them.
Each file in Godot has had multiple contributors who co-authored it over the
years, and the information of who was the original person to create that file
is not very relevant, especially when used so inconsistently.
`git blame` is a much better way to know who initially authored or later
modified a given chunk of code, and most IDEs now have good integration to
show this information.
Some assets are loaded based on OS/server feature detection, namely
textures (but potentially others).
The ResourceImporter will fail to load a texture if the OS reports not
supporting it. The OS, in turn, checks texture format support via the
RenderingServer.
This commit makes the dummy rasterizer report known texture formats as
supported (although unused), so that scenes can be correctly loaded when
they include references to imported textures.
Always build with the GUI subsystem.
Redirect stdout and stderr output to the parent process console.
Use CreateProcessW for blocking `execute` calls with piped stdout and stderr (prevent console windows for popping up when used with the GUI subsystem build, and have more consistent behavior with `create_process`).
Add `open_console` argument to the `execute` and `create_process` to open a new console window.
Remove `interface/editor/hide_console_window` editor setting.
Remove `Toggle System Console` menu option.
Remove `set_console_visible` and `is_console_visible` functions.
For 2D:
Raycast CCD now works the same as in 3D, it changes the body's velocity
to place it at the impact position instead of generating a contact point
that causes a wrong push back.
For both 2D and 3D:
The raycast CCD process reads and modifies body velocities, so it needs
to be moved to pre_solve() instead of setup() to be processed linearly
on the main thread, otherwise multithreading can cause some CCD results
to be randomly lost when multiple collisions occur.
Makes the API for forces and impulses more flexible, easier to
understand and harmonized between 2D and 3D.
Rigid bodies now have 3 sets of methods for forces and impulses:
-apply_impulse() for impulses (one-shot and time independent)
-apply_force() for forces (time dependent) applied for the current step
-add_constant_force() for forces that keeps being applied each step
Also updated the documentation to clarify the different methods and
parameters in rigid body nodes, body direct state and physics servers.
This can be used to distinguish between integrated, dedicated, virtual
and software-emulated GPUs. This in turn can be used to automatically
adjust graphics settings, or warn users about features that may run
slowly on their hardware.
Margin needs to have a high enough value for test body motion to work
properly (separate using the margin, move without then gather rest info
with the margin again).
Fixes issues with test motion returning no collision in some cases with
margin equal to 0.
This reduces visible banding in indirect lighting and reflections.
Sharp reflections now match more closely the original scene.
The downside of this change is that clipping may appear in reflections
in extremely bright scenes, but this should not be a concern in most
scenes.
Helps with discovery and setup of physics solver settings, in a specific
project settings section for both 2D and 3D.
Other changes for cleanup:
-Removed unused space parameters in 3D
SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO
SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS
-Added custom solver bias for Shape3D (same as Shape2D)
-Improved documentation for solver settings
The message about SpatialMaterial conversion was turned into a warning,
as it can potentially interfere with porting projects from Godot 3.x
(if there's a bug in the conversion code).
Clarified space parameters for contacts and added missing ones.
List of changes:
-Add contact bias to space parameters
-Add solver iterations to space parameters, instead of a specific
physics server function
-Renamed BODY_MAX_ALLOWED_PENETRATION to CONTACT_MAX_ALLOWED_PENETRATION
to make it consistent with other contact parameters
Changed the algorithm for solving contacts to keep previous contacts as
long as they are under the max separation threshold to keep contact
impulses more consistent and contacts more stable.
Also made 2D consistent with 3D and changed some default parameters:
-Contact bias is now 0.8 instead of 0.3 to avoid springy contacts
-Solver iterations are 16 instead of 8 by default for better stability
Performance considerations:
Tested with stress tests that include lots of contacts from overlapping
bodies.
3D: There's no measurable difference in performance.
2D: Performance is a bit lower (close to 10% slower in extreme cases)
The benefit for 2D physics to be much more stable outweighs the slight
decrease in performance, and this could be alleviated by changing the
algorithm to use jacobians for contact solving to help with cache
efficiency and memory allocations.
We prefer to prevent using chained assignment (`T a = b = c = T();`) as this
can lead to confusing code and subtle bugs.
According to https://en.wikipedia.org/wiki/Assignment_operator_(C%2B%2B), C++
allows any arbitrary return type, so this is standard compliant.
This could be re-assessed if/when we have an actual need for a behavior more
akin to that of the C++ STL, for now this PR simply changes a handful of
cases which were inconsistent with the rest of the codebase (`void` return
type was already the most common case prior to this commit).
In scenes that have little to no overdraw, disabling the depth prepass
can give a small performance boost. Nonetheless, in most other scenarios,
the depth prepass should be left enabled as it improves performance
significantly.