Commit graph

382 commits

Author SHA1 Message Date
lawnjelly
bc607fb607 Fix signed distance field font rendering
This fix works in both GLES3 and GLES2.

The rendering formula in the shader was adjusted to further improve the
sharpness/antialiasing quality balance.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2024-02-05 17:50:33 +00:00
lawnjelly
ed3d029f5d GLES2 / GLES3 - Use gl_FragColor temporary
On some hardware, modifying gl_FragColor multiple times can cause large performance drops. This PR writes to a standard temporary variable instead, and copies across to gl_FragColor once only at the end of the fragment shader.

This could potentially lead to large gains in performance on affected hardware.
2023-11-07 11:53:25 +00:00
Ansraer
54bc6a300e add support for 3 dir shadow splits 2023-03-29 13:40:17 +02:00
clayjohn
f1bafe8131
Take FXAA samples from half-pixel coordinates to improve quality
(cherry picked from commit dbcc0fa2a6)
2022-11-30 15:39:00 +01:00
Hugo Locurcio
6d0d9037cd
Fix debanding strength being affected by environment adjustments 2022-09-26 14:46:09 +02:00
Rémi Verschelde
f9b91d8d24 Style: Ensure consistent formatting with clang-format 15 2022-09-21 13:23:17 +02:00
Jordan Schidlowsky
1ed1a3067b workaround for angle project issue 7245, safari, iOS 2022-08-24 09:23:05 -06:00
Pedro J. Estébanez
edb140839e Fix GI probes not working in the ubershader 2022-08-08 10:55:59 +02:00
Pedro J. Estébanez
ea6ed9658d Fix emission not working in the ubershader 2022-08-07 23:11:44 +02:00
Rémi Verschelde
772d071863 SCons: Properly track codegen script dependency for generated GLES headers 2022-07-02 15:52:42 +02:00
Pedro J. Estébanez
d3d8ccea60 Use signed integers for async shader conditionals 2022-06-19 20:16:27 +02:00
clayjohn
f92141be13 Disable Alpha throughout Glow and FXAA code in order to avoid issues with transparent viewports 2022-05-26 11:15:35 -07:00
clayjohn
9927515254 Disable alpha in post process when using opaque framebuffer 2022-05-24 14:11:09 -07:00
clayjohn
3374bae953 Fixed Bug where DoF incorrectly wrote to alpha channel amd bug with tonemap shaders 2022-05-18 13:19:42 -07:00
Kinwailo
b1a50ad805 fix post procressing with transparent bg and keep alpha channel of the tonemap shader output 2022-05-12 16:32:31 +08:00
Rémi Verschelde
3eee2f45a3
Merge pull request #57674 from RandomShaper/fix_ubershader_android
Improve ubershader compatibility
2022-03-13 00:53:48 +01:00
Rémi Verschelde
d0b446c6d5
Merge pull request #45372 from Firepal/prepass-nightmares 2022-02-11 15:19:26 +01:00
Firepal
ff55157d3f Don't use prepass threshold with alpha scissor 2022-02-11 12:01:15 +01:00
Rémi Verschelde
7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
Pedro J. Estébanez
0d1ec9a7cf Improve ubershader compatibility
- Prevent debug enforced use of ubershader on shaders not supporting it
- Use unsigned integer for ubershader flags
- Add project setting for disabling async shader compilation on mobile
- Stop sampling some textures through different kinds of samplers at the same time
2022-02-05 22:12:31 +01:00
Hugo Locurcio
a80187f5bc
Fix visible background line in intersections in screen-space reflections
Adjusting the step grading by one resolves the issue without affecting
performance or introducing adverse artifacts.
2022-01-16 18:00:13 +01:00
Jason Neufeld
36c3b87883 Fixes shader compile due to undefined 'diffuse_color' variable with Oren Nayer + Vertex Lighting 2022-01-14 13:09:30 -08:00
Omar El Sheikh
50ed674ec2 Fix Blend Shapes when Octahedral Compression is Used
Blend shapes did not take into account octahedral compressed vertex
attribute layouts and this resulted in incorrect lighting on the
resulting blended mesh

Now make the blend_shapes shader octahedral compression aware!
2021-12-22 10:00:12 -05:00
Haoyu Qiu
e614a0e9fc Fix incompatible addition in auto exposure shader 2021-12-16 16:06:31 +08:00
Rémi Verschelde
caf39c9e7d
Merge pull request #54160 from Calinou/shadow-filter-use-early-bailing 2021-11-16 14:11:38 +01:00
Pedro J. Estébanez
4c710780d4 Implement async shader compilation plus caching for GL ES 3
Async. compilation via ubershader is currently available in the scene and particles shaders only.

Bonus:
- Use `#if defined()` syntax for not true conditionals, so they don't unnecessarily take a bit in the version flagset.
- Remove unused `ENABLE_CLIP_ALPHA` from scene shader.
- Remove unused `PARTICLES_COPY` from the particles shader.
- Remove unused uniform related code.
- Shader language/compiler: use ordered hash maps for deterministic code generation (needed for caching).
2021-11-09 12:19:12 +01:00
Rémi Verschelde
ecedc7df0b
Merge pull request #54197 from clayjohn/GLES3-irradiance-map
Fudge irradiance map lookup to avoid precision issues
2021-10-29 14:11:53 +02:00
Rémi Verschelde
42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
clayjohn
3f03b60718 Fudge irradiance map lookup to avoid precision issues 2021-10-24 12:03:54 -07:00
Hugo Locurcio
e534343914
Use early bailing to improve 3D shadow filtering performance in GLES3
This makes PCF13 much faster than it previously was. The performance
difference between PCF5 and PCF13 is now much lower.
2021-10-23 22:50:51 +02:00
clayjohn
a4e8ba8cfd Only add emission on base pass in GLES3 2021-10-17 15:58:57 -07:00
Hugo Locurcio
2826bec5d4
Fix lights flickering in GLES3 when new light attenuation is disabled
Co-authored-by: Clay John <claynjohn@gmail.com>
2021-10-12 21:59:23 +02:00
Rémi Verschelde
302ad4e600
Merge pull request #52918 from Calinou/add-new-light-attenuation-3.x 2021-10-08 23:08:49 +02:00
Hugo Locurcio
85e080fcc0
Backport new 3D point light attenuation as an option
This provides more realistic lighting with a very small performance cost.
The option is available in both GLES3 and GLES2, and can be enabled in
the Project Settings. This goes well with the ACES Fitted tonemapping mode
that was recently added.

When enabled, this also makes upgrading Godot 3.x projects to Godot 4.0 easier,
since lighting in 3.x will better match how it'll look in Godot 4.0.
2021-10-08 22:15:22 +02:00
Rémi Verschelde
06fc2378de
Merge pull request #51491 from Calinou/glow-add-high-quality-mode-3.x
Add high quality glow mode (3.x)
2021-10-08 07:47:07 +02:00
Rémi Verschelde
37fab65e00
Merge pull request #52477 from Lauson1ex/3.x
Add a new high quality tonemapper: ACES Fitted (3.x)
2021-09-13 17:37:22 +02:00
Rémi Verschelde
600f2a8d5d
Merge pull request #51927 from 20kdc/issue-51897-sp1
Fix issue #51897 (horizon occlusion causing black blob), fix ver. SP1
2021-09-13 11:44:55 +02:00
Endri Lauson
077083938e Add a new high quality tonemapper: ACES Fitted 2021-09-08 19:12:09 -03:00
Bastiaan Olij
73722f3c65 Convert output of GLES2 to linear color space if keep_3d_linear is enabled 2021-08-23 15:59:56 +10:00
20kdc
324c487c63 Fix issue #51897 (horizon occlusion causing black blob), fix ver. SP1
No, not service pack 1. Removes comments from the original fix commit.
2021-08-20 19:04:27 +01:00
Hugo Locurcio
663af7ff03
Fix tonemap exposure not being taken into account by sharpening
The same fix as FXAA was applied to the CAS filter.
2021-08-18 16:44:41 +02:00
clayjohn
8ac85e6a9e Normalize the results of octahedral decompression 2021-08-16 22:17:38 -07:00
Rémi Verschelde
51dd4d0c6c
Merge pull request #49509 from Chaosus/shader_time_3.x 2021-08-16 19:42:55 +02:00
clayjohn
81dc6a7688 Define normal_attrib when not using octahedral compression in GLES3 2021-08-15 22:27:46 -07:00
Rémi Verschelde
9e3e7b03e4
Merge pull request #51376 from The-O-King/vertex_buffer_alignment
Align Vertex Buffer to 4 Bytes
2021-08-12 07:13:45 +02:00
Hugo Locurcio
0e0af7fa83
Add high quality glow mode
This backports the high quality glow mode from the `master` branch.

Previously, during downsample, every second row was ignored.
Now, when high-quality is used, we sample two rows at once to ensure
that no pixel is missed. It is slower, but looks much better and has
a much high stability while moving.

High quality also takes an additional horizontal sample the width of the
horizontal blur matches the height of the vertical blur.
2021-08-11 17:00:41 +02:00
Rémi Verschelde
7c6bdea33c
Merge pull request #47416 from Calinou/add-contrast-adaptive-sharpening-3.x
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
2021-08-10 10:08:24 +02:00
Rémi Verschelde
5116855637
Merge pull request #51439 from Calinou/tonemap-clamp-negative-colors-3.x
Clamp negative colors regardless of the tonemapper to avoid artifacts
2021-08-10 09:56:18 +02:00
Rémi Verschelde
dad5d09d1b
Merge pull request #51416 from clayjohn/GLES-horizon-occlusion
[3.x] Add horizon specular occlusion
2021-08-10 09:55:46 +02:00
Rémi Verschelde
6518a61bd4
Merge pull request #51410 from clayjohn/GLES-blinn-phong 2021-08-10 09:52:28 +02:00