Commit Graph

109 Commits

Author SHA1 Message Date
f766e401db [MSDF] Fix outline bleed out at small sizes. 2025-08-31 23:35:33 +03:00
6a3941b5d9 Fix MSDF outline size clamping. 2025-08-19 08:28:33 +03:00
86e61a311f Use MSDF instead of MTSDF for font rendering.
Co-authored-by: K. S. Ernest (iFire) Lee <ernest.lee@chibifire.com>
2025-08-09 10:41:16 +03:00
4e68f277c6 add REGION_RECT
fix formatting

fix shader compile (region_rect after draw_data)

fix formatting

fix formatting

Review fix (move region_rect in main + remove useless visual shader options)

fix formatting

fix alphabetic order (+ remove useless action for spatial shaders)

typo + remove TYPE_LIGHT option for  region_rect
2025-04-30 11:07:22 +02:00
03c83cea1e Style: Enable clang-format's InsertBraces config
This was part of our style guide since we started using clang-format
but the feature was only added in clang-format 15, and we hadn't
noticed it yet.
2025-01-09 16:46:51 +01: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
f8827271d7 Remove positional light mask from directional lights in Canvas Item shaders. 2024-12-12 00:20:07 -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
d720eb80e1 Clamp UV-coordinates to centers of outermost texels when configured to do so
In addition, fix region_filter_clip_enabled documentation to be consistent with AtlasTexture.xml, since that is the option whose behavior was fixed
2024-09-29 05:57:19 -04:00
e75900e1ad Calculate pixel snap in canvas space instead of world space
This ensures that you are actually snapping to pixels in the viewport and not an arbitrary amount
2024-09-20 17:43:33 -07:00
98e9578d66 Remove unused flag and code
Related #48894
2024-06-20 13:50:20 +10:00
8ad878f06b Fix ubo tag placement in canvas.glsl gles3 fragment shader 2024-06-19 12:52:52 +03:00
506e93a207 Exit light calculation early when pixel outside of light bounding rectangle
This hugely improves the performance of rendering PointLight2Ds
2024-04-19 16:10:11 -07:00
4df39dc140 Fix CPU/GPUParticles2D bugs on Compatibility Rendering (GLES3) on Adreno 3XX devices. 2024-04-02 11:24:13 +02:00
e17cecf54a Fix Compatibility Rendering (GLES3) on old and low budget devices.
Co-Authored-By: joined72 <19651914+joined72@users.noreply.github.com>
2024-02-22 00:24:08 +01: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
f1781fe9d1 Significantly improve the speed of shader compilation in compatibility backend
Compile the unlit version by default to save on both cache size and compile time
2024-01-24 14:05:03 -08:00
bb83c4adec Add custom shader attributes to Canvas Item Shaders 2024-01-23 14:36:39 -05:00
0fe7eead02 Fix 2D normals for transposed texture 2024-01-15 17:34:29 +01:00
c98ab5aba3 Add option to use world coordinates in canvas item shader
By using the render mode `world_vertex_coords` you can automatically use the vertex coordinates in world space
2023-08-30 15:32:18 +02:00
43b0702a02 Fix "Light Only" mode of CanvasItemMaterial 2023-05-13 09:06:09 +03:00
ab603e347f Clamp normal when calculating 2D lighting to avoid artifacts 2023-04-18 17:26:17 -07:00
2bd5302704 Merge pull request #72695 from clayjohn/CanvasGroup-shading
Avoid shading CanvasGroup nodes twice
2023-02-04 21:38:25 +03:00
dfbf439081 Avoid shading CanvasGroup nodes twice 2023-02-03 15:40:42 -08:00
bf0cc8f52a Ignore instance color and instance custom_data when not used in the OpenGL renderer 2023-02-03 10:34:30 -08:00
faea9f5c10 Remove SCREEN_TEXTURE, DEPTH_TEXTURE, and NORMAL_ROUGHNESS_TEXTURE
in favour of texture hints
2023-01-18 19:52:47 -08:00
226daf9b59 GLES3: Fix canvas shader use of undefined draw_data
Fixes #71551.
2023-01-17 13:17:53 +01:00
390f83bf5a fix normal map not flipping in sprite2D 2023-01-14 11:51:56 +05:30
b6a1aa15b1 Use instanced array buffer instead of UBO for canvas item batching
This simplifies the generated shader code which increases both performance and compile time on low end devices
2022-12-15 08:25:44 -08:00
975a8f9ada Clean up specialization constants in OpenGL scene renderer
Also add support for disabling omni and spot lights when not used
2022-12-05 18:10:13 -08:00
7bc11b5fe8 Exposure emulated *Unorm4x8 glsl functions in non-android builds
Originally these functions were exposed on all GLSL ES 300 devices. However, that causes a build error as Android devices expose the *Unorm4x8 functions despite them not being in the ES 300 spec
2022-12-04 14:05:14 -08:00
f33ffd9ab4 Add Skeletons and Blend Shapes to the OpenGL renderer
This uses a similar multipass approach to blend shapes
as Godot 3.x, the major difference here is that we
need to convert the normals and tangents to octahedral
for rendering.

Skeletons work the same as the Vulkan renderer except the bones
are stored in a texture as they were in 3.x.
2022-11-29 09:45:03 -08:00
0e5a98cdd8 Fix drawing of 2D skeletons in the RD renderer.
Also clean up skeleton code in preparation for adding them to GLES3

Properly update Mesh2D AABBs when skeleton is updated
2022-11-18 23:36:40 -08:00
2ec234ff67 Add 2D shadows and canvas SDF to OpenGL3 renderer
This is an initial implementation based on the current RD implementation

Performance will improve later
2022-10-28 11:33:23 -07:00
978aa05a99 Fix error in Web builds that resulting in 2D
objects not drawing in the GLES3 backend.

Issue came from not binding a light UBO when using the DISABLE_LIGHTING
code path
2022-10-14 11:18:27 -07:00
e600fb93a5 Add 2D lights to OpenGL3 canvas renderer
This is an initial implementation using the same single-pass approach as the RenderingDevice.
2022-10-12 17:55:01 -07:00
154b9c1c91 Use a giant UBO to optimize performance in 2D
This removes the countless small UBO writes we had before
and replaces them with a single large write per render pass.

This results in much faster rendering on low-end devices
but improves speed on all devices.
2022-10-06 11:24:45 -07:00
c8f0f27a0b Properly expose TEXTURE_PIXEL_SIZE in Opengl3 renderer 2022-10-03 19:13:17 -07:00
fea48cdfc6 Fix rendering when using WebGL2.
Fixes include using proper depth buffer format in 3D (this had previously been fixed already but the changes were lost in a rebase), Remove unused lighting and shadowing code in 2D, and update 2D UBOs using glBufferSubData so that they remain the appropriate size.
2022-09-06 14:42:08 -07:00
bcc3643989 Add font LCD sub-pixel anti-aliasing support. 2022-08-23 08:47:21 +03:00
5f52936350 Implement MultiMesh in 3D and flesh out MultiMesh functions 2022-06-14 21:23:20 -07:00
fb860265e0 Implement 2D Meshes and MultiMeshes in GLES3 backend 2022-05-25 15:46:24 -07:00
652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
3bb8e6a9fe SkyShaders working 2022-05-11 21:00:21 -07:00
f394388aa2 Merge pull request #60503 from clayjohn/OPENGL-3D 2022-04-28 19:56:16 +02:00
2f2064fe3d Overhaul GLES3: Add basis for 3D renderer, overhaul materials and textures 2022-04-26 11:48:39 -07:00
be611c1c05 Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +03:00
0d9aecd967 Rename several transform built-ins in shaders 2022-03-18 12:10:55 +03:00
99064d57db New OpenGL batching canvas renderer 2022-01-11 22:26:18 -08:00