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

96 Commits

Author SHA1 Message Date
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
Rémi Verschelde
68d188d521 Merge pull request #95888 from clayjohn/Lightmap-SH-coefficients
Use correct lightmap coefficients to ensure that the directional lightmap mode looks correct
2024-08-25 20:18:18 +02:00
BlueCube3310
4aa145624e LightmapGI: Fix shader data alignment after #89919 2024-08-21 21:37:13 +02:00
clayjohn
f4ccba7508 Use correct lightmap coefficients to ensure that the directional lightmap mode looks correct
Also remove the metallic option from directional lightmap as it is guaranteed to return negative numbers in many cases
2024-08-21 10:24:32 -07:00
Stuart Carnie
2d0165574d Add Metal support for macOS (arm64) and iOS 2024-08-20 12:11:06 +02:00
Rémi Verschelde
8acd82f70e Merge pull request #89919 from BlueCube3310/bicubic-lightmap
Implement bicubic sampling for lightmaps
2024-08-20 10:01:41 +02:00
Rémi Verschelde
333f0f910f Merge pull request #86000 from jsjtxietian/add-missing-model_normal_matrix
Add `model_normal_matrix` for fragment shader
2024-08-20 10:01:36 +02:00
jsjtxietian
e698351db2 Add model_normal_matrix for fragment shader 2024-08-20 12:39:29 +08:00
Rémi Verschelde
824a97120e Merge pull request #92213 from clayjohn/ambient-disabled
Disable all sources of ambient light when `ambient_light_disabled` render mode is used
2024-08-19 12:08:31 +02:00
BlueCube3310
ef9bb1a207 Implement support for bicubic lightmap filtering
Co-authored-by: Calinou <hugo.locurcio@hugo.pro>
2024-08-19 09:52:09 +02:00
jsjtxietian
970a237c20 Fix undefined alpha_scissor in standard shader 2024-08-15 11:44:11 +08:00
Pedro J. Estébanez
0064532c1e Fix position from vertex shader partially uninitialized 2024-07-23 09:04:54 +02:00
clayjohn
d61fae36f3 Various fixes for transmittance effect
Use correct shadow sampling for omni and spot lights

Disable transmittance if shadows are disabled

Correct DirectionalLight transmittance bias to match shadow bias (its still pretty sensitive though)
2024-06-21 18:15:27 -07:00
clayjohn
6fbef0669d Disable all sources of ambient light when ambient_light_disabled render mode is used 2024-05-21 10:42:12 -07:00
QbieShay
e41064388e reverted naming to premul alpha (no T)
Initially 3d had premulT alpha as a keyword.
Since Canvas item uses mixed premul and premult as keywords,
3D is changed as well to keep consistency with 2D.
Unfortunately this keeps inconsistency with the internal ENUM.
2024-05-01 22:24:49 +02:00
QbieShay
41a2b0e83e Added premult alpha blending to 3D (spatial) shaders.
Co-authored-by: jitspoe <jitspoe@yahoo.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2024-05-01 00:53:29 +02:00
Bastiaan Olij
d2d22748b4 Fix issue in shadow to opacity 2024-04-26 21:54:26 +10:00
clayjohn
4e5e81c7d4 Properly calculate penumbra for soft shadows with reverse z
Also fix a related bug where the DirectionalLight3D size was ignored unless a positional light with soft shadows touched the mesh
2024-04-25 17:06:49 -07:00
Rob Blanckaert
ffe0b869f5 Add LIGHT_VERTEX to fragment shader
Adds a new variable to the fragment shader to specify
the vertex position used when calculating lighting.
2024-04-25 06:56:02 -07:00
Khasehemwy
d950f5f838 Use Reverse Z for the depth buffer 2024-04-04 13:54:15 +02:00
Eidolon
08f4560e69 Add optional depth fog 2024-02-17 22:39:34 -03:00
Bastiaan Olij
1066f01607 Add ivec variants to multiview_uv for stereo rendering 2024-01-23 16:13:31 +11:00
clayjohn
43cf21cb71 Use best fit normals for storing screen space normals 2023-12-21 14:41:29 -07:00
Yuri Sizov
c1d8b53ca0 Merge pull request #82668 from mrjustaguy/master
Improve split blending logic for Vulkan
2023-12-18 18:17:36 +01:00
clayjohn
a5399ab5af Reduce the number of samplers used by the scene shaders
The hard limit for Apple devices is 16 samplers per stage. So we need to ensure we use less than that
2023-12-15 17:13:44 -07:00