Commit Graph

252 Commits

Author SHA1 Message Date
30801af298 Properly transform light rect and occluder rect to perform light2d culling in canvas space 2024-12-20 16:58:02 -07:00
d3e5b62ea2 Merge pull request #99230 from paddy-exe/instance_uniforms_compatability_renderer
Implement 2D instance uniforms
2024-12-19 19:59:37 -06:00
ceefc0d38a Implement 2D instance shader parameters
Co-authored-by: kobewi <kobewi4e@gmail.com>
Co-authored-by: yesfish <huwpascoe@users.noreply.github.com>
Co-authored-by: Álex Román Núñez <eirexe123@gmail.com>
2024-12-17 23:59:16 +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
2b68c63a88 Mask out shadows on CanvasItems that don't have a matching item_shadow_mask
This restores the behavior from 3.x
2024-11-21 22:15:54 -08:00
c810ea4c1b Reduce shader permutations in the compatibility backend 2024-11-15 23:13:33 -08:00
62516df757 Precompute projection matrices when rendering 2D shadows 2024-10-18 11:55:00 -07:00
0305e437ff Clean up two recently introduced WebGL errors 2024-09-23 12:18:33 -07:00
d2f5c1a552 Only use backbuffer mipmaps in SCREEN_TEXTURE when generated. 2024-09-02 17:04:17 -07:00
7db24a9ad5 Simplify and fix Rect2/AABB get_support function 2024-08-19 23:55:31 -07:00
1bd8372813 Fix Parallax2D repeats being not relative to its transform 2024-08-19 11:43:16 +02:00
7eac9e855b Remove linearization of canvas modulate in GLES3 backend
The GLES3 renderer is always in sRGB space, even when using an HDR format
2024-07-24 10:27:25 -07:00
6f30df4b6a Linearize color if HDR 2D is on 2024-07-24 09:49:50 +02:00
ed5f33ef07 Make query for GL_MAX_VIEWPORT_DIMS compatible with web exports 2024-06-14 01:53:12 +02:00
6d0dca76c0 Fixes SDF Collision Enable/Disable
- sets LightOccluderInstance field when sdf collision is updated
- adds check for light occluder sdf_collision field in 2d renderers
2024-04-22 20:27:56 -07: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
3b3e2374c9 clang-tidy: Enforce modernize-use-nullptr 2024-03-12 10:59:53 -05:00
a62870956a Add new Parallax2D node 2024-03-03 15:46:40 -05:00
2c7dd35822 Ensure proper vertex input masks are used in 2D compatibility renderer 2024-02-27 15:39:20 -08:00
294f16c862 Consistently use system_fbo instead of binding 0 as it is needed for iOS devices 2024-02-25 13:52:41 -08:00
4a30fe5e7c Merge pull request #86564 from Giwayume/feature/canvas-item-shader-custom-data
Support CUSTOM shader attributes in 2D
2024-02-08 10:53:24 +01:00
bb83c4adec Add custom shader attributes to Canvas Item Shaders 2024-01-23 14:36:39 -05:00
062e8802b7 Disable scissor test after rendering batches in compatibility renderer 2024-01-22 14:55:20 -08:00
ac87d5f9a2 Fix issue where the UV's were off in Compatibility
Fixes a bug where CanvasTexture's UVs were off when using the Compatibility mode's renderer.

Fixes #86746
2024-01-11 13:26:57 +01: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
777d6ae1c6 Ensure that 2D meshes use a proper input mask
The input mask was wrongly ignored in earlier versions. Now it is actually used so the input mask variable needs to be a valid number
2023-12-09 12:15:59 -07: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
51dcb38840 GLES3: Skip batches with zero instance count while rendering 2023-12-05 18:49:59 +09:00
a1d7c62df7 Merge pull request #83003 from AThousandShips/null_check_extra
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-10-09 15:37:14 +02:00
f18aa00e85 Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-10-08 17:23:33 +02:00
034c0f1624 Replace sanity with safety for checks 2023-10-08 16:22:24 +02:00
51ed3aef63 Vertex and attribute compression to reduce the size of the vertex format.
This allows Godot to automatically compress meshes to save a lot of bandwidth.

In general, this requires no interaction from the user and should result in
no noticable quality loss.

This scheme is not backwards compatible, so we have provided an upgrade
mechanism, and a mesh versioning mechanism.

Existing meshes can still be used as a result, but users can get a
performance boost by reimporting assets.
2023-10-05 12:02:23 -06:00
6f88ed73be Fix GLES3 instanced rendering color and custom data defaults 2023-09-29 11:44:37 +03:00
1887a9df19 [macOS/Windows] Add optional ANGLE backed OpenGL renderer support. Add EGL_ANDROID_blob_cache caching.
Co-authored-by: Riteo <riteo@posteo.net>
2023-09-21 14:21:00 +03:00
3565d1bf7e [Drivers,Platform] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-12 20:13:32 +02:00
e21a485dbc Fix clear color's alpha value will affects 2D editor in Compatibility mode
When the rt's transparency is false, force the alpha of the clear color to one
2023-09-07 12:56:34 +08:00
d48b95a305 fix glMapBufferRange return null when r_index + last_item_index > max_instances 2023-08-27 18:00:35 +08:00
2987dd0c71 fix GLES3 changing 2d shadow atlas size is broken 2023-08-16 15:58:23 +00:00
36a005fafc Add RENDERING_INFO parameters to GL Compatibility renderer
This also fixes RENDERING_INFO_TOTAL_PRIMITIVES_IN_FRAME for the RD renderers as it was incorrectly reporting vertex/index count at times

This also adds memory tracking to textures and buffers to catch memory leaks.

This also cleans up some memory leaks that the new system caught.
2023-06-16 09:10:00 +02:00
a2abea8b98 [OpenGL] Fix LCD blend mode color caching. 2023-06-07 10:55:38 +03:00
43b0702a02 Fix "Light Only" mode of CanvasItemMaterial 2023-05-13 09:06:09 +03:00
579ca03e88 Check for instancing without relying on instance_count when drawing 2D meshes
This ensures that Particles and MultiMeshes still draw when instance_count is 1
2023-04-11 16:58:42 -07:00
f25508befb Fixes a canvas item set to clip children being drawn as black if no children are visible 2023-03-07 09:53:26 +02:00
5e57205365 Merge pull request #73478 from NewDefectus/master
Use the original canvas to calculate light positioning
2023-02-21 21:14:51 +01:00
2d7db30f0d Use the original canvas to calculate light positioning 2023-02-21 11:57:16 +02:00
aeab31b13a Fix bufSize parameter for glGetSynciv
According to the docs:
https://registry.khronos.org/OpenGL-Refpages/es3.0/html/glGetSynciv.xhtml
Bufsize is in integers, not bytes.
The current code overflows data unto other stack variables.
2023-02-20 11:35:28 +02:00
5bbf5b8e72 Avoid unecessary binding of occlusion polygon vertex array
By binding this and unbinding it, the state was getting modified in other parts of the pipeline
2023-02-17 13:11:25 -08:00
ab4e79cd03 Store blend mode between CanvasItems to preserve batching 2023-02-13 14:46:26 -08:00
f6d22df072 Properly reset blend mode when resetting canvas in compatibility renderer 2023-02-09 15:50:17 -08:00
76caf3fbae Set instancing flags when using GPUParticles in OpenGL renderer 2023-02-07 10:45:34 -08:00