Commit Graph

1815 Commits

Author SHA1 Message Date
风青山 7c3ac4d170 Fix `SubViewport` with `UPDATE_WHEN_VISIBLE` not working properly in exported project
The issue is primarily due to `RSG::texture_storage->render_target_was_used()`
returning inconsistent results in the editor and exported projects.

(cherry picked from commit 59d0fdbacc)
2023-11-01 15:30:00 +01:00
bitsawer dac7049e16 Fix errors when freeing GPUParticles
(cherry picked from commit 898d1a2d5f)
2023-10-24 19:00:16 +02:00
clayjohn 51fd44318f Avoid default fallback material when using world_vertex_coords
This avoids z-fighting between the opaque shader and the depth prepass shader

(cherry picked from commit 04846c1d6d)
2023-10-24 19:00:16 +02:00
bitsawer efe99e5479 Fix VoxelGI static light pairing
(cherry picked from commit 5e22ded4c9)
2023-10-24 19:00:15 +02:00
viksl ee6bdce5a1 Instead of Vector2() start volumetric fog at frustum_near_size to avoid INF and NaN in shaders.
(cherry picked from commit 00c2fb4a08)
2023-10-24 18:29:41 +02:00
viksl c9e5f90813 Fixes spotlight's cluster artifacts and negative light.
(cherry picked from commit 8a2d345a85)
2023-10-24 18:29:41 +02:00
tomissj2 ecd098341a Fog Shader bugfix: 'global_variables' : undeclared identifier
If user try to use a global shader variable in a fog type shader we are getting shader error. The reason of this there is a typo in the fog.cpp. I other well working shaders types like sky the "action.global_buffer_array_variable" is "global_shader_uniforms.data".
The investigation tracked here:
https://discord.com/channels/212250894228652034/1158918161337434172

(cherry picked from commit e906eb8433)
2023-10-24 18:29:40 +02:00
bitsawer 4f04d3191e Fix LightmapGI shading sometimes being unlit or black
(cherry picked from commit dda8846dea)
2023-10-24 17:05:02 +02:00
Matias N. Goldberg b7498aeb5d Fix massive validation errors when enabling TAA + MSAA
TAA + MSAA would make Godot request unnecessary flags for an MSAA
velocity texture. flags that were not even actually needed.

This was causing:
 1. Unsupported GPUs to fail completely (e.g. Intel Arc 770)
 2. Wrong codepaths to be followed (causing validation errors, possibly
crashes or glitches)
 3. Unnecessary performance impact in all GPUs.

See
https://github.com/godotengine/godot/issues/71929#issuecomment-1722274359

(cherry picked from commit 4de0ed4adf)
2023-10-24 16:52:59 +02:00
Pedro J. Estébanez d3d5531658 Fixup special case of cluster render
(cherry picked from commit e9b4d25f20)
2023-10-24 16:06:28 +02:00
Bastiaan Olij 82846a7e6d Fix missing decal mask in mobile renderer
(cherry picked from commit 8449331f13)
2023-10-24 16:05:00 +02:00
Chia-Hsiang Cheng 1588eae8fa Ensure POINT_SIZE takes effect
(cherry picked from commit 0cf57e1927)
2023-10-19 21:49:01 +02:00
Bastiaan Olij ed94e3eb79 Fix issue with four subpasses always been requested in mobile renderer
(cherry picked from commit 414df467cd)
2023-10-19 21:45:12 +02:00
Matias N. Goldberg 1f4a5c2c15 Fix validation error when enabling SSIL alone
(cherry picked from commit 666e91b9ff)
2023-10-19 21:45:11 +02:00
LRFLEW 3df5907c87 Mobile: Uncomment code required for fog rendering on clear color
(cherry picked from commit db17415df8)
2023-10-19 21:17:46 +02:00
Rémi Verschelde aae20e5b10
Fix various typos with codespell
Also includes typo fixes from #79993, #80068, #80276, and #80303.

Co-authored-by: betalars <contact@betalars.de>
Co-authored-by: spaceyjase <429978+spaceyjase@users.noreply.github.com>
Co-authored-by: Swarkin <102416174+Swarkin@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>

(cherry picked from commit faaf27f284)
2023-10-03 20:45:35 +02:00
Dario fc130b26f8 Fix motion vectors being corrupted when using precision=double and resulting in the TAA pass being completely broken.
See Issue #69528. When building with precision=double, the TAA pass would break due to the motion vectors being corrupted. It was apparent the origin of the camera itself was corrupted in the UBO for the previous frame because the camera origin was only being split correctly for the current block but not for the previous block (to effectively support the double precision float on the shader).

(cherry picked from commit 77776f5313)
2023-09-21 15:28:23 +02:00
Dario 1bcb77fb15 Add motion vector support for GPU 3D Particles.
Add the capability of resizing the transforms buffer for particles to be double its size and alternate where the current output is written to. Only works for particles that use index as their draw order.

(cherry picked from commit 293302ccd8)
2023-09-21 14:20:04 +02:00
Dario 1f18125652 Fix incorrect error checking and notifications introduced in PR #80414.
There was an error in the other branch of the refactored function where the size of the array was not properly multiplied by the size of the float to check against the buffer size. This was only an error in the error-checking itself and not the functionality. There was also an error where the proper notification was not emitted whenever the buffer for the multimesh is recreated to invalidate the previous references the renderer might've created to it. This fixes CPU Particles getting corrupted when they're created without emission being enabled.

(cherry picked from commit 420f3890b0)
2023-09-21 14:20:04 +02:00
Dario b447e1baaf Improve handling of motion vectors for multimesh instances.
Fixes #67287. There was a subtle error where due to how enabling motion vectors for multi-meshes was handled, only the first instance would have a valid transforms buffer and the rest would point to an invalid buffer. This change moves over the responsibility of enabling motion vectors only when changes happen to the individual 3D transforms or the entire buffer itself. It also fixes an unnecessary download of the existing buffer that'd get overwritten by the current cache if it exists. Another fix is handling the case where the buffer was not set, and enabling motion vectors would not cause the buffer to be recreated correctly.

(cherry picked from commit 5155870d64)
2023-09-21 14:20:04 +02:00
Matias N. Goldberg efbe9237cc Fix integer underflow when rounding up in VoxelGI
The code wanted to divide and round up:
 - 0 / 64 = 0
 - 63 / 64 = 1
 - 64 / 64 = 1
 - 65 / 64 = 2

However when the dividend was exactly 0 it would underflow and produce
67108864 instead.

This caused TDRs on empty scenes or extremely slow performance

Fix #80286

(cherry picked from commit e783e32108)
2023-09-21 14:09:19 +02:00
bitsawer bc95b36fbf Clear SDFGI textures when created
(cherry picked from commit 09c887ce82)
2023-09-21 14:09:19 +02:00
bitsawer 3c5f715053 Fix Vulkan crash with many Omni/SpotLights, Decals or ReflectionProbes
(cherry picked from commit d6f45e4f14)
2023-09-20 22:44:04 +02:00
univeous 7627337d63 Fix crash when calling get_video_adapter_* in a thread
co-authored-by: Clay John <claynjohn@gmail.com>
(cherry picked from commit 0a64abe891)
2023-08-31 20:19:30 +02:00
Hayden Leete a9a27c7ea5 Add autocomplete for filter/repeat hints on uniform arrays
(cherry picked from commit fc7063b2e2)
2023-08-31 19:48:16 +02:00
kobewi 271e08e543 Allow more hint types for uniform arrays
(cherry picked from commit 8ae2e6681e)
2023-08-31 19:48:16 +02:00
clayjohn d6d8f6a637 Unify error condition for particles trail lifetime
(cherry picked from commit 78ecdb17f9)
2023-07-10 18:09:57 +02:00
Arman Elgudzhyan 361c0d53f3 Clear specular buffer if bg mode is canvas and ss effects are used
Explicitly clear the separate specular buffer when the background mode is canvas and screen space effects (and thus a separate specular buffer) are used.

(cherry picked from commit af9d1743f3)
2023-07-10 17:46:09 +02:00
lewiji a084f0568f Return shader parse error when using 'hint_normal_roughness_texture' and not using the Forward+ backend
(cherry picked from commit 2a93681334)
2023-07-10 17:46:07 +02:00
bitsawer 0dec3d6485 Fix shader language float literal precision truncation
(cherry picked from commit 356297f909)
2023-07-10 17:26:14 +02:00
Yuri Roubinski 6255a64e03 Fix using uint suffix at the hex number declaration in shaders
(cherry picked from commit 1994c25701)
2023-07-10 17:11:22 +02:00
clayjohn bc9bc236c0 Initialize particles instance buffer in case it is used before being updated
(cherry picked from commit 35ed7c770b)
2023-07-10 17:11:22 +02:00
K. S. Ernest (iFire) Lee 39dfa8436e Varying mismatch causing shaders to fail. 2023-06-23 21:36:38 -07:00
bitsawer ef00de99b4 Fix error spam when a mesh with bone weights has an invalid skeleton 2023-06-22 15:58:52 +03:00
Bastiaan Olij 952b4b3f38 Apply reprojection in multiview for our cluster lookup 2023-06-21 11:17:01 +10:00
Rémi Verschelde dca1e0bef7
Merge pull request #78436 from BastiaanOlij/fix_stereo_fog
Fix volumetric fog in stereo by projection vertex in combined space
2023-06-20 09:21:39 +02:00
Bastiaan Olij 66272ea26e Fix volumetric fog in stereo by projection vertex in combined space 2023-06-20 14:36:14 +10:00
bitsawer dab0871d41 Fix invalid RID errors when freeing a mesh with blend shapes 2023-06-19 11:07:15 +03:00
clayjohn 36a005fafc
Add RENDERING_INFO parameters to GL Compatibility renderer
This also fixes RENDERING_INFO_TOTAL_PRIMITIVES_IN_FRAME for the RD renderers as it was incorrectly reporting vertex/index count at times

This also adds memory tracking to textures and buffers to catch memory leaks.

This also cleans up some memory leaks that the new system caught.
2023-06-16 09:10:00 +02:00
Rémi Verschelde 16c2fede71
Merge pull request #78200 from prominentdetail/patch-3
Properly handle wireframe mode in RendererRD pipeline cache
2023-06-14 09:27:10 +02:00
Rémi Verschelde e0651ed4b5
Merge pull request #78199 from clayjohn/detect_3d
Ensure that "detect 3D" is only called when using 3D shaders
2023-06-14 09:26:47 +02:00
Rémi Verschelde 41776634b6
Merge pull request #78161 from BastiaanOlij/expose_texture_native_handle
Expose `RD::texture_get_native_handle`
2023-06-14 09:25:59 +02:00
Alex f74464b767
Properly handle wireframe mode in RendererRD pipeline cache
Makes wireframe get cached properly so that it doesn't keep being recreated.
Fixes #76237.
2023-06-14 09:14:34 +02:00
Bastiaan Olij 6dd47e232b Expose RD::texture_native_handle 2023-06-14 09:58:08 +10:00
clayjohn 0b7e2dfdfc Ensure that "detect 3D" is only called when using 3D shaders 2023-06-13 13:20:11 -07:00
Rémi Verschelde 2d6b880987
i18n: Sync translations with Weblate (now tracking 4.1 strings) 2023-06-12 14:57:08 +02:00
kleonc bbb2a889d8 Fix Y-sort modulate for top-most Y-sorted CanvasItem 2023-06-12 13:33:26 +02:00
Rémi Verschelde 7c71844999
Merge pull request #77703 from RandomShaper/fix_vol_fog_thingy
Fix management of life cycle of vol. fog related uniform sets
2023-06-09 11:05:11 +02:00
Rémi Verschelde 9ce42d176d
Merge pull request #76977 from manueldun/light-shader-builtins
Enable the use of all supported builtins on the light shader
2023-06-09 11:04:46 +02:00
Rémi Verschelde 166643df32
Merge pull request #74937 from bitsawer/fix_uniform_storage
Fix shader uniform storage conversions and crash
2023-06-09 11:04:16 +02:00