Fixes shear effect with `BILLBOARD_FIXED_Y` when the camera is rotated around the z-axis by rotating the mesh correctly into view space.
Also removes shearing effects that occur when rotating the mesh by excluding the model rotation and scale from the billboard matrix.
(cherry picked from commit d3850a0954)
Fixes#43733: "creating SpatialMaterial in a separate thread creates invalid
shaders (temporarily)."
The bug occurred because various setters called in materials' constructors add
materials to queues that are processed on the main thread. This means that
when the materials are created in another thread, they can be processed on the
main thread before the constructor has finished.
The fix adds a flag to affected materials that prevents them from being added
to the queue until their constructors have finished initialising all the
members.
This comment is useful to determine the origin of ShaderMaterials
converted from built-in material types (such as CanvasItemMaterial
or SpatialMaterial).
The Godot version is also included in case the shader needs to be
regenerated with a newer engine version.
- Based on C++11's `mutex`
- No more need to allocate-deallocate or check for null
- No pointer anymore, just a member variable
- Platform-specific implementations no longer needed
- Simpler for `NO_THREADS`
- `BinaryMutex` added for special cases as the non-recursive version
- `MutexLock` now takes a reference. At this point the cases of null `Mutex`es are rare. If you ever need that, just don't use `MutexLock`.
- `ScopedMutexLock` is dropped and replaced by `MutexLock`, because they were pretty much the same.
This commit adds a view-dependant fade to the 3D viewport grid. It fades out
at steep view angles to hide the solid regions that appear far from the camera.
I also included a fade to hide the grid borders.
I added some improvements to the dynamic grid when the camera is in orthogonal mode.
It properly handles zoom now, and the grid center is now set to the intersection point
between the grid plane and the camera forward ray, keeping the grid
always visible.
(cherry picked from commit 73e62dffb9)
Happy new year to the wonderful Godot community!
2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.
We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)
Here's to a great year 2021 for all Godot users 🎆
(cherry picked from commit b5334d14f7)
Happy new year to the wonderful Godot community!
We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.
Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
To follow the glTF 2.0 specification in all cases (including outside
of imported glTF scenes), the blue channel is now used for metallic
and the green channel is now used for roughness.