Commit graph

265 commits

Author SHA1 Message Date
Hei
ce0a74bfe2 Break batch on Compatibility when primitive texture changes. 2025-08-01 16:13:17 +03:00
Lukas Tenbrink
2b36c79f7b Use Span<uint8_t> in RenderingDevice allocation APIs to avoid intermediary arrays on calls. 2025-06-18 12:31:48 +02:00
chocola-mint
101dc9868f Implement the count parameter in RenderingServer.canvas_item_add_triangle_array() 2025-05-14 22:52:30 +09:00
Thaddeus Crews
94282d88f9
Core: Use Math namespace for constants 2025-04-10 16:29:30 -05:00
Yufeng Ying
4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +08:00
kobewi
10f6c01b9c Remove ABS in favor of Math::abs 2025-03-19 13:52:40 +01:00
Thaddeus Crews
729c4e9e88
Merge pull request #102905 from kleonc/render_info_fix_primitive_count_per_triangle_strip
Fix render info primitive count per `TRIANGLE_STRIP`
2025-03-05 12:07:47 -06:00
kleonc
b3769129cb Fix 2D quad primitive missing lighting data in GLES3 renderer 2025-02-16 01:51:24 +01:00
kleonc
b691a997a3 Fix render info primitive count per TRIANGLE_STRIP 2025-02-15 23:50:07 +01:00
Stuart Carnie
0a9cd5ede9 2D: Fix clip children and rendering artefacts
Fixes both GLES3 and RendererRD implementations

Closes #102147
2025-01-30 07:19:47 +11:00
Stuart Carnie
2510fefebd 2D: Fix rendering artefacts when using BackBufferCopy.
Fixes both GLES3 and RendererRD implementations
2025-01-25 10:22:07 +11:00
clayjohn
b8252196df Avoid leaking ninepatch state to other draw commands in GLES backend 2025-01-17 10:13:04 -08:00
Yufeng Ying
33817b186f Remove unused header in drivers and modules.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>
2024-12-24 00:40:47 +08:00
clayjohn
30801af298 Properly transform light rect and occluder rect to perform light2d culling in canvas space 2024-12-20 16:58:02 -07:00
Thaddeus Crews
d3e5b62ea2
Merge pull request #99230 from paddy-exe/instance_uniforms_compatability_renderer
Implement 2D instance uniforms
2024-12-19 19:59:37 -06:00
kobewi
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
clayjohn
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
clayjohn
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
clayjohn
c810ea4c1b Reduce shader permutations in the compatibility backend 2024-11-15 23:13:33 -08:00
clayjohn
62516df757 Precompute projection matrices when rendering 2D shadows 2024-10-18 11:55:00 -07:00
clayjohn
0305e437ff Clean up two recently introduced WebGL errors 2024-09-23 12:18:33 -07:00
clayjohn
d2f5c1a552 Only use backbuffer mipmaps in SCREEN_TEXTURE when generated. 2024-09-02 17:04:17 -07:00
Aaron Franke
7db24a9ad5
Simplify and fix Rect2/AABB get_support function 2024-08-19 23:55:31 -07:00
kleonc
1bd8372813 Fix Parallax2D repeats being not relative to its transform 2024-08-19 11:43:16 +02:00
clayjohn
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
Feiyue Zhang
6f30df4b6a
Linearize color if HDR 2D is on 2024-07-24 09:49:50 +02:00
patwork
ed5f33ef07 Make query for GL_MAX_VIEWPORT_DIMS compatible with web exports 2024-06-14 01:53:12 +02:00
cosparks
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
Ricardo Buring
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
Thaddeus Crews
3b3e2374c9
clang-tidy: Enforce modernize-use-nullptr 2024-03-12 10:59:53 -05:00
markdibarry
a62870956a Add new Parallax2D node 2024-03-03 15:46:40 -05:00
clayjohn
2c7dd35822 Ensure proper vertex input masks are used in 2D compatibility renderer 2024-02-27 15:39:20 -08:00
clayjohn
294f16c862 Consistently use system_fbo instead of binding 0 as it is needed for iOS devices 2024-02-25 13:52:41 -08:00
Rémi Verschelde
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
Giwayume
bb83c4adec Add custom shader attributes to Canvas Item Shaders 2024-01-23 14:36:39 -05:00
clayjohn
062e8802b7 Disable scissor test after rendering batches in compatibility renderer 2024-01-22 14:55:20 -08:00
Jordi Scharp
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
Rémi Verschelde
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
clayjohn
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
clayjohn
528b4a3283 Implement render info counters for the 2D renderer
This provides information for the debug monitors
2023-12-06 14:39:33 -07:00
HolySkyMin
51dcb38840 GLES3: Skip batches with zero instance count while rendering 2023-12-05 18:49:59 +09:00
Rémi Verschelde
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
A Thousand Ships
f18aa00e85 Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-10-08 17:23:33 +02:00
A Thousand Ships
034c0f1624 Replace sanity with safety for checks 2023-10-08 16:22:24 +02:00
clayjohn
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
bitsawer
6f88ed73be Fix GLES3 instanced rendering color and custom data defaults 2023-09-29 11:44:37 +03:00
bruvzg
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
A Thousand Ships
3565d1bf7e [Drivers,Platform] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-12 20:13:32 +02:00
jsjtxietian
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
jsjtxietian
d48b95a305 fix glMapBufferRange return null when r_index + last_item_index > max_instances 2023-08-27 18:00:35 +08:00