Fixes#26637.
Fixes#19900.
The viewport_size returned by get_viewport_size was previously incorrect, being half the correct value. The function is renamed to get_viewport_half_extents, and now returns a Vector2.
Code which called this function has also been modified accordingly.
This PR also fixes shadow culling when using ortho cameras, because the correct input for CameraMatrix::set_orthogonal should be the full HEIGHT from get_viewport_half_extents, and not half the width.
It also fixes state.ubo_data.viewport_size in rasterizer_scene_gles3.cpp to be the width and the height of the viewport in pixels as stated in the documentation, rather than the current value which is half the viewport extents in worldspace, presumed to be a bug.
Some cases were not handled properly for Polygon2D after making changes in common code to fix Line2D antialiasing. Added an option for drawing polygons to differentiate the two use cases.
Fixes#34568
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.
Polygon2D:
The property wasn't used anymore after switching from canvas_item_add_polygon() to canvas_item_add_triangle_array() for drawing.
Line2D:
Added the same property as for Polygon2D & fixed smooth line drawing to use indices correctly.
Fixes#26823
Make sure particles are processed during the same frame when visibility is set to on, in case they are still active from before and need to be restarted.
Fixed#33476
The list of allowed shader types is now displayed if any
`shader_type`-related error is emitted.
This makes it easier to remember which shader types are allowed
when creating a new shader.
In 2.1 and 3.0, light_vec could be modified for altering shadow_computations.
But it broke shadows when rotating light. shadow_vec would do the same, but without breaking
shadows in rotated lights if not used.
Add inverse light transformation to shadow vec, so it's not affected when rotating lights;
Added usage define for shadow vec.
For shadow vec working properly when rotating a light, it's needed to multiply it by light_matrix normalized. Added usage define in order to don't do that if shadow_vec not used.