Commit Graph

145 Commits

Author SHA1 Message Date
10f6c01b9c Remove ABS in favor of Math::abs 2025-03-19 13:52:40 +01:00
5e1fe8040a rendering: compositor has is_opengl API; minor optimisations 2025-03-13 15:41:44 +11:00
f31ddce6d1 MetalFX: change fallback behaviour
Closes #103782
2025-03-08 15:35:45 +11:00
aea559b39a Allow to compile the engine without XR support 2025-02-25 17:07:21 -03:00
3014eec40d Merge pull request #99407 from devloglogan/rec-resolution
Allow using custom `Rect2i` for rendering with OpenXR
2025-01-10 23:05:46 +01:00
e7f6b7ea0b Allow using custom Rect2i for rendering with OpenXR 2025-01-09 09:46:15 -06:00
abd0e6990c Renderer: minor optimisation when running gl_compatibility mode 2025-01-08 09:43:35 -07:00
0f76ee4688 Merge pull request #101110 from clayjohn/light2d-rect-fix
Update Light2D `rect_cache` even when not using shadows.
2025-01-06 22:49:01 +01:00
11dc4f2e5e Metal: Add MetalFX upscaling support
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-01-06 06:03:18 -07:00
7e8facc526 Update Light2D rect_cache even when not using shadows.
This also cleans up how the rect_cache is updated to make the steps more clear
2025-01-03 16:17:58 -08:00
30801af298 Properly transform light rect and occluder rect to perform light2d culling in canvas space 2024-12-20 16:58:02 -07:00
190ae9f9dc Merge pull request #100302 from clayjohn/light2d-optimize
Optimize PointLight2D shadow rendering by reducing draw calls and RD state changes
2024-12-17 22:59:54 +01:00
7c61252dd7 Optimize PointLight2D shadow rendering by reducing draw calls and RD state changes.
This dramatically reduces the CPU time spent on rendering shadows for PointLight2Ds
2024-12-17 07:41:09 -08:00
d60c0e21a6 Merge pull request #88313 from wagnerfs/run-time-anisotropic-filtering
Allow changing the anisotropic filter level at run-time per Viewport
2024-12-17 16:18:38 +01:00
3deb5884d7 Renderer agnostic motion vector rendering/OpenXR changes 2024-12-10 15:59:17 -06:00
6995b6a03e Allow changing the anisotropic filter level at run-time per Viewport 2024-11-30 00:50:45 -03:00
1bd66af54c Apply snap 2D transforms to pixel to viewport
We shall not leave the viewport transform to be rounded by the code for
rounding canvas items. Since the viewport transform is inverse to the
camera transform, we get incorrect rounding at the halfway point that
misaligns the viewport and the canvas item which the camera is
following.

Instead, reintroduce viewport rounding, but do it in a way that matches
the rounding of canvas items. Also take into account the half-pixel
offset of the centre point when viewport dimension is not divisible by
two.  For `CanvasLayer`s that follows viewport, take into account the
scale when rounding. Overall this should work better compared to the
rounding in Godot 4.2 (and earlier).
2024-09-23 20:34:11 +08:00
5cfacc8767 [Editor,Servers]: Minor optimizations 2024-09-12 06:22:04 +10:00
f4037d6f6c Merge pull request #92496 from clayjohn/HDR-2D-sRGB
Ensure MovieWriter output is in gamma space when using HDR 2D
2024-08-19 12:08:40 +02:00
1eb0039b6e Fix regression around OpenGL swapchain optimisation for OpenXR 2024-07-29 12:46:58 +10:00
46ed290fef Add warning when use FSR1 on renderer other than forward plus 2024-07-18 12:10:18 +08:00
fa3e00e2c4 Ensure Motion Vectors are enabled by particles and skeletons when using the Motion Vector debug draw option 2024-06-11 12:46:56 -07:00
3b9d074fd7 Ensure MovieWriter output is in gamma space when using HDR 2D 2024-05-28 15:30:13 -07:00
1589433e8f Apply additional fixes to servers' threading 2024-05-08 17:41:40 +02:00
955d5affa8 Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
9042ddf19f Improvements to VRS/Foveated rendering 2024-05-03 17:20:30 +10:00
0c71ba7801 Merge pull request #89880 from dsnopek/openxr-composition-layers-node3d-drs
Add support for OpenXR composition layers
2024-04-04 17:09:07 +02:00
0f2b804059 Add support for OpenXR composition layers
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
2024-04-04 09:20:23 -05:00
d14a84a166 Add early return when setting transparent_bg
Fix memory leak on Mac.
2024-03-30 22:33:54 +01:00
2ed2ccc2d8 Fixed Timestep Interpolation (2D)
Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-03-23 12:28:36 +01:00
9e0b38ecd3 Disable XR server when compiling without 3D 2024-03-13 09:02:10 -07:00
9050ee1542 Merge pull request #87297 from adamscott/2d-pixel-art-stability
Stabilize snapping 2D transforms to pixel
2024-02-12 23:53:51 +01:00
35b640107f Stabilize snapping 2D transforms to pixel
Co-authored-by: Danni <34800072+KeyboardDanni@users.noreply.github.com>
2024-02-12 11:04:01 -05:00
73eff10c76 Finish splitting functionality of the Vulkan and D3D12 backends into RenderingDeviceDriver. 2024-02-12 10:02:18 -03:00
d6caa69e11 Skip swapchain logic if there is nothing to present (Android OpenXR) 2024-01-08 21:51:04 +11:00
342531597b Merge pull request #85811 from clayjohn/2D-render-info
Implement render info counters for the 2D renderer
2023-12-12 10:41:06 +01:00
ee1bf15924 Merge pull request #84637 from clayjohn/RD-sampler-bias
Use render pass uniform set to store viewport samplers.
2023-12-08 15:23:18 +01:00
528b4a3283 Implement render info counters for the 2D renderer
This provides information for the debug monitors
2023-12-06 14:39:33 -07:00
bd74d92ef7 Merge pull request #84957 from BastiaanOlij/fix_msaa2d_when_no_2d
Ensure 2D MSAA resolve is performed when 3D content but no 2D content in scene
2023-11-22 21:56:23 +01:00
47983e30c5 Ensure 2D MSAA resolve is performed when 3D content but no 2D content in scene 2023-11-16 13:34:34 +11:00
367079ffee Renderer Viewport correct sizeof usage.
The current usage.

In viewport_find_from_screen_attachment
- Allocates a list of pointers, eg sizeof(RID*) * ridcount.

We need fill that buffer
viewport_owner.fill_owned_buffer(rids);
...
 p_rid_buffer[idx] = _make_from_id((validator << 32) | i);

_make_from_id returns an RID object, not a pointer.

Since there isn't a copy constructor, a bitwise copy of the object occurs.

This issue will only present itself under 32bit builds.
sizeof(RID)  : 8
sizeof(RID*) : 4

whereas 64bit builds they are both 8.
2023-11-16 11:02:12 +11:00
2b9e6d2972 Use render pass uniform set to store viewport samplers.
This fixes a bugs where per-viewport samplers were being used for internal texture fetches (probes, sky, etc.).

This also fixes a bug when using multiple viewports in the same scene.

This also fixes a bug where the texture bias would override the bias from 3D scale.
2023-11-08 23:26:08 +01:00
425e943576 Skip 2D rendering if stereo enabled and fix MSAA2D with 3D issue. 2023-10-20 14:02:55 +11:00
ccbb91137f Merge pull request #82766 from BastiaanOlij/fix_debanding_issue
Forgot to add debanding to config object
2023-10-04 15:45:39 +02:00
03ff9fedb6 Merge pull request #82101 from bruvzg/x11_gles
[X11] Add support for using EGL/GLES instead of GLX.
2023-10-04 15:35:05 +02:00
af00c4a54a [X11] Add support for using EGL/GLES instead of GLX. 2023-10-04 14:15:36 +03:00
480fe5767e Forgot to add debanding to config object 2023-10-04 16:24:09 +11:00
77d8372285 Fix drawing of viewports without swapping buffers 2023-10-03 13:51:47 +02:00
fdd3d36c6d [Servers] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-25 18:45:30 +02:00
057367bf4f Add FidelityFX Super Resolution 2.2 (FSR 2.2.1) support.
Introduces support for FSR2 as a new upscaler option available from the project settings. Also introduces an specific render list for surfaces that require motion and the ability to derive motion vectors from depth buffer and camera motion.
2023-09-25 10:37:47 -03:00