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

120 Commits

Author SHA1 Message Date
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
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
clayjohn
14b60f2264 Optimize vertex shader using mat3x4 to reduce bandwidth, load/store operations and ALUs 2025-09-26 23:20:08 -07:00
Alex Threlfo
60a7bed19c Fix rounding error in clustered vertex light culling 2025-09-02 11:33:38 +10:00
Juan Manuel Costello
5dc25db6da Fix lightmap dynamic objects with physical lights 2025-07-17 20:58:03 -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
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
Dario
46277836a6 Optimize Mobile renderer by using FP16 explicitly. 2025-06-09 14:39:35 -03:00
SaracenOne
761d5474dc Shader compilation fix:
Fix shader compilation crash on custom shaders
using VIEW_INDEX on Vulkan Clustered Forward
renderer.
2025-06-08 03:29:47 +01:00
Thaddeus Crews
de37627404 Merge pull request #102552 from DarioSamo/shader-baker
Add shader baker to project exporter.
2025-05-28 17:09:38 -05:00
Dario
5a30a7e7cd Add shader baker to project exporter.
Metal Support contributed by Migeran (https://migeran.com) and Stuart Carnie.

Co-authored-by: Stuart Carnie <stuart.carnie@gmail.com>
Co-authored-by: Gergely Kis <gergely.kis@migeran.com>
2025-05-27 12:45:27 -03:00
Alfonso Grimaldo
e1e1933244 fix missing ibl reconstruction from dfg multiscattering 2025-05-24 20:10:02 -06:00
clayjohn
9a1def8da1 Add new StandardMaterial properties to allow users to control FPS-style objects (hands, weapons, tools close to the camera)
Add new shader built in Z_CLIP_SCALE to easily adjust clipping distance to avoid clipping walls etc.

Add fov_override to StandardMaterial3D to easily have a custom FOV for FPS objects

Add IN_SHADOW_PASS built-in to shaders for tweaking materials without impacting shadow maps
2025-05-21 10:16:05 -03:00
Thaddeus Crews
d0693d6867 Merge pull request #89988 from LunaCapra/specular-occlusion
Add support for bent normal maps for specular occlusion and indirect lighting
2025-05-14 09:44:06 -05:00
landervr
be01c7f5a4 fix reflection probe box projection stretching 2025-05-14 00:02:06 +02:00
Capry
9828c365c3 Add support for bent normals for indirect lighting and specular occlusion 2025-05-12 12:52:04 +02:00
Thaddeus Crews
dda0562f2f Merge pull request #103934 from LiveTrower/dfg-lut
Forward+: Replace the current BRDF approximation with a DFG LUT and add multiscattering energy compensation
2025-05-09 11:29:16 -05:00
landervr
56730d0cb2 Add specular occlusion from ambient light
Co-authored-by: guerro323 <kaltobattle@gmail.com>
2025-05-08 23:52:01 +02:00
LiveTrower
44408eabaa Replace BRDF approximation with a DFG LUT 2025-05-08 10:23:35 -06:00
landervr
e3dbf74634 Fix reflection probe dark borders 2025-04-29 17:18:52 +02:00
BlueCube3310
5640ddd0a5 Scene shader: Improve and document SH evaluation for light probes 2025-04-19 15:08:02 +02:00
BlueCube3310
8714b36171 Fix rendering material when UV2 is compressed 2025-02-06 20:24:46 +01:00
clayjohn
a525e30c27 Avoid flipping normal based on facing direction when calculation SDF. This shader runs for multiple directions, so the flip direction won't be accurate and just creates bad normals 2025-01-27 16:48:29 -08:00
Rémi Verschelde
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
Rémi Verschelde
084da581be Merge pull request #100241 from lander-vr/reflection-probe-priority
Add priority-based blending to reflection probes.
2025-01-07 10:14:38 +01:00
Stayd
40f17127ef Fix User-supplied Normals Being Ignored
Moves the initialization of the geo_normal value
to after the user shader code, so that the normal
supplied by the user is actually used instead of
the interpolated vertex normal.
2024-12-27 13:01:20 -07:00
landervr
1637736c20 ReflectionProbe priority 2024-12-23 21:58:11 +01:00
Thaddeus Crews
1536e0e236 Merge pull request #100441 from StaydMcMuffin/scene-shaders-tbn-fixes
Scene Shaders - TBN Vector Fixes
2024-12-19 19:59:58 -06:00
Thaddeus Crews
2fcd8223e8 Merge pull request #99538 from Geometror/lightmap-gi-transparent-surface
Add transparency support for LightmapGI
2024-12-19 19:59:52 -06:00
Hendrik Brucker
a3525bc015 Add transparency support for LightmapGI
Co-authored-by: Guerro323 <kaltobattle@gmail.com>
2024-12-18 19:36:16 +01:00
Stayd
ed0e3d7da8 Scene Shaders - TBN Fixes
Fixes two errors related to the normal, tangent,
and bitangent vectors, namely normals not always
being inverted on backfaces, and normalization
being reversed from what MikkTSpace expects.
2024-12-16 22:36:23 -07:00
Andrew_Shobbrook
e42def12d0 Implement per-light Specular property in DirectionalLight3D 2024-12-16 19:18:18 +01:00
BlueCube3310
189c8eb671 Implement shadowmasks for LightmapGI
Co-authored-by: dearthdev <nathandearthdev@gmail.com>
2024-12-12 11:00:28 +01:00
clayjohn
9320865796 Avoid calculating dynamic lights when lights are baked into LightmapGI using the static bake mode 2024-12-06 10:17:44 -08:00
Dario
0ce4c6dac3 Improve performance of shader lighting code in Forward renderers.
- Skip sampling shadows if attenuation is very small.
- Skip computing diffuse and specular light if attenuation and shadow are very small.
2024-11-27 12:20:31 -03:00
Chaosus
a64b3fd3f8 Allow SCREEN_UV to be used in light function of spatial shader 2024-11-19 11:39:49 +03:00
Dario
53099c56f0 Add multiple specialization constants to Forward+ and Mobile. 2024-11-04 14:35:40 -03:00
Dario
427ba09efc Fix soft shadows by increasing the bit count for specialization constants. 2024-10-28 10:26:50 -03:00
Dario
e2c6daf7ef Implement asynchronous transfer queues, thread guards on RenderingDevice. Add ubershaders and rework pipeline caches for Forward+ and Mobile.
- Implements asynchronous transfer queues from PR #87590.
- Adds ubershaders that can run with specialization constants specified as push constants.
- Pipelines with specialization constants can compile in the background.
- Added monitoring for pipeline compilations.
- Materials and shaders can now be created asynchronously on background threads.
- Meshes that are loaded on background threads can also compile pipelines as part of the loading process.
2024-10-02 15:11:58 -03:00
ywmaa
0a9ad8f9de Implement vertex shading
This adds support in all backends, but the Compatibility renderer works the best.
Mobile and Forward+ can only support one directional light shader (the first in the tree)
While the Compatibility renderer supports any number of shadows.

Co-authored-by: Clay John <claynjohn@gmail.com>
2024-09-29 00:36:09 +02:00
Rémi Verschelde
bfe74eca3b Merge pull request #97428 from clayjohn/shadow-filter-jitter-rebase
Jitter shadow map dithering pattern across frames when TAA is enabled
2024-09-26 12:45:50 +02:00
Thaddeus Crews
9f9ee0c813 SCons: Add unobtrusive type hints in SCons files 2024-09-25 09:34:35 -05:00
Hugo Locurcio
0eb06da057 Jitter shadow map dithering pattern across frames when TAA is enabled
This improves shadow quality by reducing the visibility of the noisy
pattern caused by dithering.

This jittering also applies when FSR2 is enabled, as it provides its own
form of temporal antialiasing.

Co-authored-by: Clay John <claynjohn@gmail.com>
2024-09-24 15:52:07 -07:00
Thaddeus Crews
b37fc1014a Style: Apply new clang-format changes 2024-09-20 08:09:48 -05:00
BlueCube3310
a89f4fa5a9 LightmapGI: Pack L1 SH coefficients for directional lightmaps 2024-09-05 22:46:58 +02:00
Rémi Verschelde
667778cf4d Merge pull request #93448 from clayjohn/transmittance-fixes
Various fixes for transmittance effect
2024-09-03 11:42:57 +02:00
Chaosus
f538376c3b Add CLIP_SPACE_FAR built-in to spatial shader 2024-08-27 08:48:46 +03:00