1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +00:00
Commit Graph

624 Commits

Author SHA1 Message Date
Thaddeus Crews
3c1e479290 Merge pull request #110077 from clayjohn/mobile-glow
Overhaul and optimize Glow in the mobile renderer
2025-10-31 09:23:32 -05:00
clayjohn
2e59cb41f4 Optimize glow and tonemap gather step in the mobile renderer
Mobile devices are typically bandwidth bound which means we need to do as few texture samples as possible.

They typically use TBDR GPUs which means that all rendering takes place on special optimized tiles. As a side effect, reading back memory from tile to VRAM is really slow, especially on Mali devices.

This commit uses a technique where you do a small blur while downsampling, and then another small blur while upsampling to get really high quality glow. While this doesn't reduce the renderpass count very much, it does reduce the texture read bandwidth by almost 10 times. Overall glow was more texture-read bound than memory write, bound, so this was a huge win.

A side effect of this new technique is that we can gather the glow as we upsample instead of gathering the glow in the final tonemap pass. Doing so allows us to significantly reduce the cost of the tonemap pass as well.
2025-10-30 21:56:26 -07:00
Rudolph Bester
ebd32c15ec Fix Light2D none shadow filter to use nearest sampling 2025-10-30 19:12:17 +02:00
Colby Klein
bdbbed8ea9 Revise fog blending to fix over-darkening/borders.
This can result in low fog densities being a bit brighter, which may need slight adjustment in your scenes.

In exchange, volumetrics now blend smoothly together with the scene and regular fog.

Fixes #101514
2025-10-24 13:15:26 -07:00
Thaddeus Crews
da593d0c16 Merge pull request #111897 from allenwp/environment-adj-prioritize-old-behaviour
Improve `Environment` adjustments (favor old behavior and quality).
2025-10-23 11:03:56 -05:00
Allen Pestaluky
0c7f013c55 Improve Environment color adjustments; specifically brightness and HDR 2D contrast.
This commit changes adjustments to behave as follows for all rendering configurations:

- Apply brightness to linear-encoded values, preventing contrast, saturation, and hue from being affected.
- Apply contrast to perceptually uniform (nonlinear sRGB-encoded) values, matching existing behavior when HDR 2D is disabled and producing optimal visual quality.
- Apply saturation with even color channel weights. This causes brightness of certain colors to change, but matches existing behavior when HDR 2D is disabled.

Adjustments are applied after glow and tonemapping to match existing behavior.
2025-10-23 11:08:49 -04:00
clayjohn
f61ee7bdf6 Use half float precision buffer for 3D when HDR2D is enabled
This is necessary for Environment effects like Glow to work correctly.
2025-10-21 13:44:46 -07:00
Skyth
c128886c63 Overhaul screen space reflections. 2025-10-21 19:23:38 +03:00
Clay John
36b92128b1 Merge pull request #110671 from allenwp/environment-glow-consistent
Blend glow before tonemapping and change default to screen.
2025-10-14 21:29:43 -07:00
Kaleb Reid
8173f43770 Apply luminance multiplier in copy_cubemap_to_panorama 2025-10-13 21:41:03 -07:00
Allen Pestaluky
cafc012b05 Blend Environment glow before tonemapping and change default blend mode to screen.
Additionally, change the minimum `tonemap_white` parameter to `1.0`; users can increase `tonemap_exposure` for a similar effect to decreasing `tonemap_white` below `1.0`.

Co-authored-by: Hei <40064911+Lielay9@users.noreply.github.com>
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-10-10 12:08:08 -04:00
Allen Pestaluky
bd9d1bf070 Add material debanding for use in Mobile rendering method.
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
2025-10-08 16:22:41 -04:00
clayjohn
c7276273d8 Fix scene shader crash due to rename of view matrix and inverse view matrix 2025-10-07 13:36:23 -07:00
clayjohn
14b60f2264 Optimize vertex shader using mat3x4 to reduce bandwidth, load/store operations and ALUs 2025-09-26 23:20:08 -07:00
Thaddeus Crews
8c7c96e2c4 Merge pull request #108636 from clayjohn/MSAA-depth-mobile
Add depth resolve to the mobile renderer
2025-09-17 11:34:13 -05:00
Thaddeus Crews
e504943212 Merge pull request #110184 from Namey5/vertex-lighting-issue
Fix rounding error in clustered vertex light culling
2025-09-17 11:34:11 -05:00
Thaddeus Crews
6efa557e9b Merge pull request #109567 from Flarkk/fix_spotlight_fog
Fix spotlight's shadow peter-panning with volumetric fog
2025-09-16 11:44:55 -05:00
clayjohn
0576b12699 Increase precision of SpotLight attenuation calculation to avoid driver bug on Intel devices 2025-09-09 13:18:55 -07:00
Alex Threlfo
60a7bed19c Fix rounding error in clustered vertex light culling 2025-09-02 11:33:38 +10:00
Pāvels Nadtočajevs
f766e401db [MSDF] Fix outline bleed out at small sizes. 2025-08-31 23:35:33 +03:00
Thaddeus Crews
aa0c7bb840 Merge pull request #109970 from allenwp/add-debanding-smaa-before-spatial-upscaler
Add debanding to SMAA and apply debanding before spatial upscalers.
2025-08-26 19:01:11 -05:00
clayjohn
4b84207d2f Use vertex shader workaround for Mali GXX GPUs for glow shader
We applied this same workaround to the tonemap shader and DoF, but didn't apply it to glow since the bug didn't manifest on our test devices.
2025-08-26 11:31:22 -07:00
Allen Pestaluky
5a3e69d16e Add debanding to SMAA and apply debanding before spatial upscalers. 2025-08-25 16:55:36 -04:00
Stuart Carnie
90c9134875 Metal: Read gl_ViewIndex for multi-view subpasses
This is necessary to ensure the SpvCapabilityMultiView is included in
the SPIR-V, informing downstream transpilers, like Metal, that it should
enable multi-view capabilities in the generated Metal shader source.
2025-08-23 09:12:17 +10:00
Pāvels Nadtočajevs
6a3941b5d9 Fix MSDF outline size clamping. 2025-08-19 08:28:33 +03:00
Florent Guiocheau
199161f023 Fix spotlight's shadow with volumetric fog 2025-08-13 09:28:06 +02:00
devloglogan
fb829bdd08 Fix mobile renderer motion vectors regression 2025-08-12 16:45:31 -05:00
Pāvels Nadtočajevs
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
Dario
b962b38e74 Check for Vulkan Memory Model support and make it a variant. 2025-07-25 09:24:58 -03:00
Allen Pestaluky
a033656eda Fix debanding for Mobile rendering method with HDR 2D. 2025-07-24 16:11:49 -04:00
Juan Manuel Costello
5dc25db6da Fix lightmap dynamic objects with physical lights 2025-07-17 20:58:03 -03:00
clayjohn
a8efa55bed Add depth resolve to the mobile renderer 2025-07-16 20:37:39 -07:00
Thaddeus Crews
2be2cbb720 Merge pull request #107782 from allenwp/vulkan-nonlinear-color-correction-dithering
Always perform color correction and debanding on nonlinear sRGB values.
2025-07-14 10:30:28 -05:00
Pāvels Nadtočajevs
a8873727ac [macOS] Selectively bake specific shader variants for MoltenVK. 2025-07-09 20:09:56 +03:00
Allen Pestaluky
a1591512f8 Always perform color correction and debanding on nonlinear sRGB values.
Fixes #107730

Co-authored-by: LuoZhihao <luo_zhihao@outlook.com>
2025-07-08 13:44:53 -04:00
Mingxi Zhang
2096e4c007 Fix division by zero in clearcoat
Prevents the clearcoat model from generating NaN values at grazing angles
2025-07-08 01:58:37 +00:00
Stuart Carnie
5230f6c60c Apple: Use image atomic operations on supported Apple hardware
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2025-07-05 05:59:00 +10:00
Dario
4921a3e711 Fix VVL errors by changing frag_color to FP32 and dFdx/y. 2025-06-26 13:42:17 -03:00
Thaddeus Crews
01410f19f8 Merge pull request #107876 from clayjohn/vs-data-issues
Fix a few improper memory accesses in the clustered forward vertex shader
2025-06-24 18:34:25 -05:00
celyk
7f9b8dae4f Use double emulation on modelview 2025-06-24 15:37:18 +10:00
LuoZhihao
ea75954575 Vulkan Mobile: Fix writing vertex color in spatial shader 2025-06-23 21:30:48 +08:00
clayjohn
b4adaa291a Fix a few improper memory accesses in the clustered forward vertex shader
draw_call.instance_index should not be used directly since it doesn't take into account auto-batching

scene_data_block.data should not be used directly in the vertex shader since it can change between frames and impact motion vector generation

IN_SHADOW_PASS can only be accessed inside functions, so it needs to be a global and not a constant
2025-06-22 23:41:03 -07:00
LuoZhihao
8a2fd98004 Forward+: Fix builtins in light shader 2025-06-17 20:14:53 +08:00
Rémi Verschelde
9eda3c682d Merge pull request #107404 from beicause/mobile-spatial-light-shader-builtins
Vulkan Mobile: Fix reading builtins in `light()` of spatial shader
2025-06-12 22:48:58 +02:00
Dario
8804c88443 Change all interpolators to FP32 in mobile renderer. 2025-06-11 15:36:22 -03:00
LuoZhihao
2a1d2afaca Vulkan Mobile: Fix reading builtins in light() of spatial shader 2025-06-11 21:32:59 +08:00
Rémi Verschelde
a1ef1130ad Merge pull request #107364 from DarioSamo/adreno-fix-interpolators
Upgrade normal interpolators to FP32 to fix Adreno.
2025-06-10 17:56:29 +02:00
Dario
e53b67df03 Upgrade normal interpolators to FP32 to fix Adreno. 2025-06-10 12:26:58 -03:00
David Snopek
951ca21f02 Vulkan Mobile: Fix crash from shader compilation with USE_RADIANCE_CUBEMAP_ARRAY 2025-06-10 09:19:32 -05:00
Dario
46277836a6 Optimize Mobile renderer by using FP16 explicitly. 2025-06-09 14:39:35 -03:00