Commit Graph

2458 Commits

Author SHA1 Message Date
jsjtxietian a365c070b3 Add shader_cache_dir_valid check to _save_to_cache 2024-01-12 17:34:33 +08:00
Rémi Verschelde c5025ea157
Merge pull request #87057 from clayjohn/RD-32-bit-depth
Default to 32-bit depth map on Forward+ renderer and 24-bit only on Mobile renderer
2024-01-11 17:42:38 +01:00
Rémi Verschelde bf4fb987e6
Merge pull request #87035 from Mickeon/deprecate-RenderingServer-has-feature
Deprecate RenderingServer's `has_feature` and Features enum
2024-01-11 17:41:50 +01:00
clayjohn 7b355a128c Default to 32-bit depth map on Forward+ renderer and 24-bit only on Mobile renderer 2024-01-10 12:23:59 -08:00
Micky 63a08f2493 Deprecate RenderingServer's `has_feature` and Features enum 2024-01-10 12:26:04 +01:00
Rémi Verschelde 74f3d168c8
Merge pull request #87022 from DarioSamo/clear_region_continue_fix
Fix incorrect mapping of initial action as clear region continue to clear.
2024-01-10 12:03:45 +01:00
Rémi Verschelde a40a134a1e
Merge pull request #86996 from BastiaanOlij/fix_stereo_ssr
Fix SSR not working properly in stereo
2024-01-10 12:03:37 +01:00
Dario 80eacf1b7a Fix incorrect mapping of initial action as clear region continue to clear. 2024-01-09 22:03:21 -03:00
Patrick Dawson a0f9bcc826 Fix usage of index offsets in RenderingDevice 2024-01-09 15:47:52 +01:00
Rémi Verschelde 673102ffd8
Merge pull request #85520 from YuriSizov/rendering-gracefully-leak-canvas-items
Avoid crashes when engine leaks canvas items and friends
2024-01-09 15:30:55 +01:00
Bastiaan Olij 10a8b88165 Fix SSR not working properly in stereo 2024-01-09 23:19:57 +11:00
Dario cc4d39b0c1 Acyclic Command Graph for RenderingDevice.
Adds a new system to automatically reorder commands, perform layout transitions and insert synchronization barriers based on the commands issued to RenderingDevice.
2024-01-08 14:54:56 -03:00
Rémi Verschelde 25011e9144
Merge pull request #84244 from BastiaanOlij/skip_present_if_needed
Skip swapchain logic if there is nothing to present (Android OpenXR)
2024-01-08 14:52:07 +01:00
Rémi Verschelde 5ac5be4744
Merge pull request #86507 from jsjtxietian/fix-msvc-2017
Fix MSVC 14.1 complaining about "attempting to reference a deleted function" in RenderPassClearValue
2024-01-08 11:54:17 +01:00
Rémi Verschelde 798632422d
Merge pull request #86245 from ecmjohnson/fix-skeleton-culling
Check skeleton RID when using cached AABB
2024-01-08 11:52:41 +01:00
Bastiaan Olij d6caa69e11 Skip swapchain logic if there is nothing to present (Android OpenXR) 2024-01-08 21:51:04 +11:00
Muller-Castro 96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
clayjohn 7f1863f83d Tune TAA disocclusion scale to avoid rejecting all samples during motion. 2024-01-04 17:06:57 -08:00
Rémi Verschelde 6c390b620d
Merge pull request #84445 from Rubonnek/add-const-references-clang-tidy
Add const references detected by clang-tidy
2024-01-04 14:25:33 +01:00
Rémi Verschelde 7abaac631b
Fixup SDFGI shader compilation error after #80390
My mistake, I added this when rebasing and didn't notice that it was a
.glsl file and thus the availability of Math was not confirmed by the
C++ compiler.
2024-01-03 08:51:08 +01:00
Rémi Verschelde 07b88600b7
Merge pull request #86522 from RandomShaper/fix_uset_rebind
RenderingDevice: Fix uniform sets wrongly assumed to be bound
2024-01-02 21:32:25 +01:00
Rémi Verschelde e42d615471
Merge pull request #85421 from xiongyaohua/fix_parameter_names
Unify parameter names for 'RendererCanvasCull'
2024-01-02 15:08:53 +01:00
EddieBreeg 8747c67d9e
Fix potential integer underflow in rounded up divisions
A new `Math::division_round_up()` function was added, allowing for easy
and correct computation of integer divisions when the result needs to
be rounded up.

Fixes #80358.

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-01-02 14:14:47 +01:00
Pedro J. Estébanez 1c5c8cf6ff RenderingDevice: Fix uniform sets wrongly assumed to be bound 2023-12-26 13:12:32 +01:00
jsjtxietian 89d7a2f0a5 Fix incorrect CAMERA_DIRECTION_WORLD calculation 2023-12-26 14:09:44 +08:00
jsjtxietian 5d361a9e39 Fix msvc 14.1 complains about "atempting to reference a deleted function"
in RenderPassClearValue
2023-12-25 18:52:06 +08:00
Yaohua Xiong 795fe74143 unify parameter names for 'RendererCanvasCull' 2023-12-24 10:18:34 +08:00
Yuri Sizov 44ded3eaa4 Merge pull request #86316 from clayjohn/RD-BFN-normals
Use best fit normals for storing screen space normals
2023-12-22 17:19:58 +01:00
clayjohn 43cf21cb71 Use best fit normals for storing screen space normals 2023-12-21 14:41:29 -07:00
Yuri Sizov 3a8524dd92
Merge pull request #83452 from RandomShaper/rd_common
Split `RenderingDevice` into API-agnostic and `RenderingDeviceDriver` parts
2023-12-20 20:09:18 +01:00
Pedro J. Estébanez 12a519bae2 Split RenderingDevice into API-agnostic and RenderingDeviceDriver parts
Credit and thanks to @bruzvg for multiple build fixes, update of 3rd-party items and MinGW support.

Co-authored-by: bruvzg <7645683+bruvzg@users.noreply.github.com>
2023-12-20 19:18:08 +01:00
Yuri Sizov 34ecfff672 Avoid crashes when engine leaks canvas items and friends 2023-12-20 13:19:46 +01: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
Erik Johnson d874ead58d Check skeleton RID when using cached AABB 2023-12-17 11:43:49 -05:00
Wilson E. Alvarez a3cb1b096f
Add const references detected by clang-tidy 2023-12-16 13:36:44 -05:00
Yuri Sizov 2d0ee20ff3 Merge pull request #86219 from clayjohn/RD-samplers-hotfix
Reduce the number of samplers used by the scene shaders
2023-12-16 17:50:10 +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
Bastiaan Olij 22cd145177 Merge passes in Vulkan mobile renderer 2023-12-16 09:51:35 +11:00
Yuri Sizov 4269a57b0c Merge pull request #85387 from jsjtxietian/fix-forward-plus-crash
Use render method from OS instead of project settings in compositor RD
2023-12-14 17:38:43 +01:00
jsjtxietian 453c2246b6 Use render method from OS in compositor RD; Update related UI 2023-12-14 11:38:46 +08:00
Wilson E. Alvarez 80fb8db31f
Remove unnecessary assignments
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2023-12-13 11:06:26 -05:00
Rémi Verschelde 342531597b
Merge pull request #85811 from clayjohn/2D-render-info
Implement render info counters for the 2D renderer
2023-12-12 10:41:06 +01:00
Rémi Verschelde 4943b6e6b3
Merge pull request #84451 from ShirenY/FixSkeletonMeshCulling
Transform mesh's AABB to skeleton's space when calculating mesh's bounds
2023-12-12 00:16:51 +01:00
ShirenY 27f71c4e78 Transform mesh's AABB to skeleton's space when calculate mesh's bounds. 2023-12-09 11:41:15 +08:00
Yuri Sizov 5c95fd5905 Merge pull request #85793 from Lasuch69/expose-compute
Expose `copy_effects` compute shader in Mobile backend
2023-12-08 18:46:03 +01:00
Yuri Sizov 74b6fad3c8 Merge pull request #85822 from bruvzg/maco_dbl
Fix CanvasOcclusionShaderRD format error with double precision build.
2023-12-08 16:58:59 +01:00
Yuri Sizov ee1bf15924 Merge pull request #84637 from clayjohn/RD-sampler-bias
Use render pass uniform set to store viewport samplers.
2023-12-08 15:23:18 +01:00
Yuri Sizov dfe0f584b4 Merge pull request #82953 from jsjtxietian/document-forcedraw-can-only-be-called-from-main-thread
Add thread guard for `force_draw` and update related documentation
2023-12-08 15:22:53 +01:00
clayjohn 528b4a3283 Implement render info counters for the 2D renderer
This provides information for the debug monitors
2023-12-06 14:39:33 -07:00
bruvzg c0a1c5ae61
Fix CanvasOcclusionShaderRD format error with double precision build. 2023-12-06 23:03:12 +02:00
Lasuch 608d41a969 Expose copy_effects copy compute shader in Mobile backend 2023-12-05 21:22:46 +01:00
Rémi Verschelde 4c3d95e02c
Merge pull request #85635 from clayjohn/RD-ReflectionProbes-mobile
Set ReflectionProbe frame before mapping id in mobile renderer
2023-12-04 23:20:47 +01:00
Rémi Verschelde 7113050e0b
Merge pull request #84241 from jsjtxietian/fix-render-method-crash-on-bad-input
Fix bad parameter for `rendering_method` crashes Godot
2023-12-04 23:02:21 +01:00
Rémi Verschelde 6f4da7a976
Merge pull request #83736 from darksylinc/matias-broken_buffer_update
Fix buffer updates going to the wrong cmd buffer if barriers were 0
2023-12-04 22:58:24 +01:00
clayjohn 394edf8288 Set ReflectionProbe frame before mapping id in mobile renderer 2023-12-01 16:52:50 -07:00
Rémi Verschelde bd74d92ef7
Merge pull request #84957 from BastiaanOlij/fix_msaa2d_when_no_2d
Ensure 2D MSAA resolve is performed when 3D content but no 2D content in scene
2023-11-22 21:56:23 +01:00
clayjohn e2a5d2bf46 Enable non-multiview advanced shader group whenever advanced shaders are requested
This is needed because xr_enabled does not guarantee that we won't use the non-multiview variants
2023-11-21 15:16:25 -07:00
Rémi Verschelde c2f8fb3015
Merge pull request #85039 from RandomShaper/mingwthreads
Use mingw-std-threads in MinGW builds
2023-11-21 15:44:18 +01:00
Pedro J. Estébanez 5c25fa4c78 Fix potential double-close of draw command label 2023-11-20 18:59:06 +01:00
Rémi Verschelde ac29e8e3fe
Merge pull request #85086 from clayjohn/shaders-amount-ratio
Make `AMOUNT_RATIO` constant in the shader language specification.
2023-11-20 14:14:46 +01:00
clayjohn 8a95b2956f Make AMOUNT_RATIO constant in the shader language specification.
Writing to it doesn't do anything and will crash the compatibility backend.
2023-11-19 14:36:26 +01:00
Pedro J. Estébanez fe4850c0d0 Use mingw-std-threads in MinGW builds 2023-11-18 11:56:05 +01:00
Bastiaan Olij 47983e30c5 Ensure 2D MSAA resolve is performed when 3D content but no 2D content in scene 2023-11-16 13:34:34 +11:00
Alistair Leslie-Hughes 367079ffee Renderer Viewport correct sizeof usage.
The current usage.

In viewport_find_from_screen_attachment
- Allocates a list of pointers, eg sizeof(RID*) * ridcount.

We need fill that buffer
viewport_owner.fill_owned_buffer(rids);
...
 p_rid_buffer[idx] = _make_from_id((validator << 32) | i);

_make_from_id returns an RID object, not a pointer.

Since there isn't a copy constructor, a bitwise copy of the object occurs.

This issue will only present itself under 32bit builds.
sizeof(RID)  : 8
sizeof(RID*) : 4

whereas 64bit builds they are both 8.
2023-11-16 11:02:12 +11:00
Bastiaan Olij b1c4d4e55b Ensure optional variants are loaded last. 2023-11-15 14:31:25 +11:00
clayjohn ead36fdcc4 Store ArrayMesh path in RenderingServer for use in error messages 2023-11-14 16:27:10 +01:00
jsjtxietian b88b84ce18 Add thread guard for force_draw and update relared doc
force_draw must be called from main thread
2023-11-10 18:57:31 +08:00
jsjtxietian b6bee1c21e Fix bad parameter of rendering_method crashes Godot
Print error and default to forward plus
2023-11-10 10:38:12 +08:00
clayjohn 2b9e6d2972 Use render pass uniform set to store viewport samplers.
This fixes a bugs where per-viewport samplers were being used for internal texture fetches (probes, sky, etc.).

This also fixes a bug when using multiple viewports in the same scene.

This also fixes a bug where the texture bias would override the bias from 3D scale.
2023-11-08 23:26:08 +01:00
clayjohn a74cfc2629 Use default samplers in base uniform set when rendering to reflection probes 2023-11-07 17:46:05 +01:00
clayjohn d1043a5f93 Enhance checks and user experience around tangents.
Ensure `ensure_tangents` option actually creates tangent array. Even if it is just a dummy array.

Allow mesh to generate its own tangents when using compression. This allows users to compress meshes without tangents.

Warn users if they are trying to read from tangents without providing tangents.
2023-11-01 22:40:42 +01:00
Rémi Verschelde 2bc35308fc
Merge pull request #81494 from jsjtxietian/Fix-int-to-uint-implicit-cast-error-when-use-uniform-mat3-in-gles3
Fix int to uint implicit cast error when use mat3 uniform in compatibility renderer
2023-10-31 20:14:14 +01:00
Bastiaan Olij e3b8af723e Fix cubemap downsampler logic 2023-10-31 10:36:42 +11:00
clayjohn 57ba7ded87 Fix bug with alpha to coverage by enabling depth discard when using alpha to coverage 2023-10-30 23:07:30 +01:00
jsjtxietian 967e0e6485 Fix int to uint implicit cast error when use uniform mat in gles3 2023-10-27 10:46:52 +08:00
Rémi Verschelde 2dafd06114
Merge pull request #83906 from clayjohn/GL-vertex-padding
Add padding to normal attribute in Compatibility renderer to match the RD renderers
2023-10-26 16:00:56 +02:00
Rémi Verschelde 815b24d280
Merge pull request #83491 from jsjtxietian/pass-screen-size-when-render-shadow
Pass viewport size to shadow pass instead of using Vector2i(1,1)
2023-10-26 12:09:21 +02:00
jsjtxietian 26d32554bd Pass viewport size to shadow pass instead of using vector2i(1,1) 2023-10-26 15:25:22 +08:00
Rémi Verschelde 9f49da24da
Merge pull request #83830 from jsjtxietian/fix-varying-assign-swizzle-check
Fix assign with swizzle in shader not doing varying validation check
2023-10-25 10:30:22 +02:00
Rémi Verschelde 4cc8f0f36d
Merge pull request #83649 from BastiaanOlij/no_2d_stereo
Skip 2D rendering if stereo enabled and fix couple of MSAA issues
2023-10-25 10:29:09 +02:00
Rémi Verschelde 9798ae3d6a
Merge pull request #82974 from mrjustaguy/Split-fix
Directional 2 Split Shadow Stabilization Fix
2023-10-25 10:28:21 +02:00
Rémi Verschelde f021d33940
Merge pull request #81167 from bitsawer/fix_sdfgi_editor_change
Reset SDFGI when changing editor scene tabs
2023-10-25 10:27:03 +02:00
clayjohn a88e519f18 Add padding to normal attribute in Compatibility renderer to match the RD renderers 2023-10-24 22:32:34 +02:00
Rémi Verschelde 261fe7ce6a
Merge pull request #83704 from clayjohn/misc-mesh-fixes
Some more fixes for compressed meshes
2023-10-24 10:54:23 +02:00
Rémi Verschelde 64f80295e5
Merge pull request #83199 from Repiteo/texture-storage-default-scale
Fix `TextureStorage` not assigning default scale
2023-10-24 10:53:56 +02:00
clayjohn 8f9cd4e1e3 Some more fixes for compressed meshes
This cleans up a few more cases of uint32_t->uint64_t

Importantly this fixes an edge case in the axis-angle compression by
using the pre-existing Basis methods instead
2023-10-24 09:38:12 +02:00
Rémi Verschelde 50d17f6b8c
Merge pull request #83613 from clayjohn/surface_upgrade_tool
Add an editor tool to automatically upgrade and re-save meshes
2023-10-24 00:10:37 +02:00
clayjohn 318ef8461f Implementation of tool to automatically upgrade and re-save meshes 2023-10-23 22:39:48 +02:00
Rémi Verschelde 17aa5c5170
Merge pull request #83780 from jsjtxietian/prevent-null-variant-crash
Prevent `_allocate_placeholders` crash if `p_version->variants` is null
2023-10-23 12:42:04 +02:00
Rémi Verschelde 814de86494
Merge pull request #83493 from clayjohn/light-pair-bug
Ensure that only visible paired lights are used
2023-10-23 12:40:07 +02:00
jsjtxietian 089e7f473d Fix assign with swizzle in shader not doing varying validation check 2023-10-23 17:52:50 +08:00
jsjtxietian 5f85a042b6 Prevent `_allocate_placeholders` crash if `p_version->variants` is null 2023-10-22 23:19:00 +08:00
Hugo Locurcio 0012478ecb
Add property hint for 2D shadow size project setting
Previously, it was possible to use zero or negative values, which are
invalid.

This also prevents crashing the engine by setting a shadow size of
0 or lower from a script.
2023-10-22 00:28:19 +02:00
Matias N. Goldberg c9ec1f7727 Fix buffer updates going to the wrong cmd buffer if barriers were 0
From what I could see only SSAO & SSIL were affected when they both
call:

int zero[1] = { 0 };
RD::get_singleton()->buffer_update(ssao.importance_map_load_counter, 0,
sizeof(uint32_t), &zero, 0);

int zero[1] = { 0 };
RD::get_singleton()->buffer_update(ssil.importance_map_load_counter, 0,
sizeof(uint32_t), &zero, 0);

Also documented what setup_command_buffer & draw_command_buffer are for.
2023-10-21 13:14:38 -03:00
Rémi Verschelde 2a995c09ac
Merge pull request #83639 from stoofin/frustum-buffer-size
Fix shadow map debug visualization camera frustum index buffer size
2023-10-20 15:12:34 +02:00
Bastiaan Olij 425e943576 Skip 2D rendering if stereo enabled and fix MSAA2D with 3D issue. 2023-10-20 14:02:55 +11:00
stoofin 1a2b66d4fc Fix shadow debug frustum index buffer size 2023-10-19 13:48:11 -07:00
Dario 4890e96556 Add an extra backbuffer color texture that can be used when an upscaler is in use.
Fixes issue #83152. Due to how BLUR_0 is reused for multiple purposes and requires being at native resolution for some post-processing effects to work, FSR2 will use an alternate texture at internal size to use as the screen texture read by shaders instead. The rendering pipeline will prefer using this texture if it exists.
2023-10-17 13:36:27 -03:00
Clay 623a050269 Ensure that only visible paired lights are used
This is a longstanding issue in both the Mobile and GL Compatibility renderer.

Meshes pair with all lights that touch them, and then at draw time, we send all paired lights indices to the shader (even if that light isn't visible). The problem is that non-visible lights aren't uploaded to the GPU and don't have an index. So we end up using a bogus index
2023-10-17 13:02:46 +02:00
bitsawer f0a178cbdb Fix Mobile renderer shader instance uniform access 2023-10-15 18:09:54 +03:00
Thaddeus Crews 9ee41c707e
Fix texture storage not assigning default scale
• Print errors if an invalid value is passed
2023-10-12 12:02:24 -05:00
Rémi Verschelde b1371806ad
Merge pull request #82431 from bitsawer/fix_gpuparticles_free
Fix errors when freeing GPUParticles
2023-10-12 00:22:33 +02:00
Rémi Verschelde 09b92a144d
Merge pull request #79921 from mandryskowski/ssr_transparency
Make Fresnel darken SSR instead of blending with specular
2023-10-11 22:37:02 +02:00
mandryskowski 5b2e54c17b Fresnel should darken the SSR reflections instead of blending them with specular light. 2023-10-11 18:58:22 +01:00
kobewi 41fa6c32b4 Disable update spinner when debug redraw is active 2023-10-11 13:21:29 +02:00
Rémi Verschelde 4b7cc99bc1
Merge pull request #79169 from reduz/debug-canvas-item-redraw
Debug CanvasItem redraw
2023-10-11 08:40:05 +02:00
Rémi Verschelde 55282ddc10
Merge pull request #79527 from QbieShay/qbe/particles-rework
Particle internal refactor and additions for more artistic control
2023-10-10 22:48:50 +02:00
QbieShay c228fe1a0d Particle internal refactor and additions for more artistic control
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Raul Santos <raulsntos@gmail.com>
Co-authored-by: Mew Pur Pur <85438892+MewPurPur@users.noreply.github.com>
Co-authored-by: Clay John <claynjohn@gmail.com>
2023-10-10 20:03:35 +02:00
Rémi Verschelde b4214b1686
Merge pull request #83004 from Chaosus/shader_language_fix_typo
Fix typo in `shader_language.cpp`
2023-10-09 23:23:35 +02:00
Rémi Verschelde a1d7c62df7
Merge pull request #83003 from AThousandShips/null_check_extra
Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-10-09 15:37:14 +02:00
Yuri Rubinsky f4bc779c4e Fix typo in `shader_language.cpp` 2023-10-08 18:55:40 +03:00
A Thousand Ships f18aa00e85 Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-10-08 17:23:33 +02:00
A Thousand Ships 034c0f1624 Replace `sanity` with `safety` for checks 2023-10-08 16:22:24 +02:00
mrjustaguy 45948dc2c9 Directional 2 Split Shadow Stabilization Fix 2023-10-07 17:55:26 +02:00
Rémi Verschelde c05f521e16
Merge pull request #82892 from clayjohn/tangent-binormal-transform
Only perform modelview transform on tangent and binormal when vertex shader is in local space
2023-10-06 12:53:05 +02:00
clayjohn af1d81d95a Only perform modelview transform on tangent and binormal when vertex shader is in local space 2023-10-05 22:08:36 -06:00
clayjohn 04846c1d6d Avoid default fallback material when using world_vertex_coords
This avoids z-fighting between the opaque shader and the depth prepass shader
2023-10-05 19:11:48 -06:00
Rémi Verschelde f2ba8ec6ca
Merge pull request #81124 from bitsawer/fix_voxelgi_static_lights
Fix VoxelGI static light pairing
2023-10-06 00:24:29 +02:00
Rémi Verschelde d351d40e29
Merge pull request #82877 from tomissj2/master
Fog shader: Fix undeclared identifier `global_variables`
2023-10-05 22:51:48 +02:00
Rémi Verschelde 950139e489
Merge pull request #82546 from viksl/volumetric-fog-spot-light-artifacts
Fix cluster artifacts and negative light
2023-10-05 22:50:12 +02:00
Rémi Verschelde f02695cc04
Merge pull request #81138 from clayjohn/attribute-compression
Vertex and attribute compression
2023-10-05 22:48:55 +02:00
Rémi Verschelde 7ee2eb5c92
Merge pull request #80992 from viksl/volumetric-fog-NaN-issues
Fix volumetric fog NaN values in textures from starting at a zero Vector2.
2023-10-05 22:48:31 +02:00
tomissj2 e906eb8433
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
2023-10-05 22:12:50 +02:00
clayjohn 51ed3aef63 Vertex and attribute compression to reduce the size of the vertex format.
This allows Godot to automatically compress meshes to save a lot of bandwidth.

In general, this requires no interaction from the user and should result in
no noticable quality loss.

This scheme is not backwards compatible, so we have provided an upgrade
mechanism, and a mesh versioning mechanism.

Existing meshes can still be used as a result, but users can get a
performance boost by reimporting assets.
2023-10-05 12:02:23 -06:00
kobewi 09b30be86d Add vararg call() method to C++ Callable 2023-10-05 11:35:29 +02:00
Rémi Verschelde 829d9bb6ba
Merge pull request #82451 from DarioSamo/mesh-storage-vertex-array-taa-fix
Fix mismatch between surface vertex array generation inside the function and the caller.
2023-10-05 10:08:34 +02:00
Rémi Verschelde c255acebe8
Merge pull request #81607 from Rindbee/fix-UPDATE_WHEN_VISIBLE-not-work-in-exported-project
Fix `SubViewport` with `UPDATE_WHEN_VISIBLE` not working properly in exported project
2023-10-05 10:07:16 +02:00
Rémi Verschelde ccbb91137f
Merge pull request #82766 from BastiaanOlij/fix_debanding_issue
Forgot to add debanding to config object
2023-10-04 15:45:39 +02:00
Rémi Verschelde 03ff9fedb6
Merge pull request #82101 from bruvzg/x11_gles
[X11] Add support for using EGL/GLES instead of GLX.
2023-10-04 15:35:05 +02:00
Rémi Verschelde 5680d729f2
Merge pull request #80939 from RandomShaper/fix_onion
Revive onion skinning
2023-10-04 15:33:25 +02:00
bruvzg af00c4a54a
[X11] Add support for using EGL/GLES instead of GLX. 2023-10-04 14:15:36 +03:00
Bastiaan Olij 480fe5767e Forgot to add debanding to config object 2023-10-04 16:24:09 +11:00
Rémi Verschelde 24c166dfe2
Merge pull request #81619 from Chaosus/fix_shader_const
Re-allows constants in global space to be initialized with function call
2023-10-03 17:20:23 +02:00
Pedro J. Estébanez 77d8372285 Fix drawing of viewports without swapping buffers 2023-10-03 13:51:47 +02:00
mrjustaguy dd3d380a01 Improve Split Blending
Improve Split Blending Logic
2023-10-02 13:22:51 +02:00
viksl 8a2d345a85 Fixes spotlight's cluster artifacts and negative light. 2023-10-01 09:13:30 +02:00
Dario 1e2c28b7fe Use internal texture at internal resolution for calculating luminance.
Fixes an error where the exposure was calculated incorrectly if a lower resolution scale was used while using FSR2. Now the behavior is consistent regardless of the resolution scale.
2023-09-29 13:41:40 -03:00
Yuri Sizov 7ae0fa1083 Merge pull request #77496 from clayjohn/GLES3-shadows
Implement 3D shadows in the GL Compatibility renderer
2023-09-28 20:03:53 +02:00
clayjohn cb7200b028 Implement 3D shadows in the GL Compatibility renderer 2023-09-28 09:39:26 +02:00
Yuri Sizov 3c8465c240 Merge pull request #82445 from RandomShaper/fix_fsr2_little_thing
Avoid trying to free null RIDs in FSR2 teardown
2023-09-27 19:08:08 +02:00
Yuri Sizov 54c7a26a3b Merge pull request #81356 from pkdawson/rd-compat
Add compatibility methods for RenderingDevice BarrierMask
2023-09-27 19:07:55 +02:00
Dario c3d1b52254 Fix mismatch between surface vertex array generation inside the function and the caller.
Fixes #82446.
2023-09-27 14:02:48 -03:00
Patrick Dawson d80dc0ff58 Add compatibility methods for RenderingDevice BarrierMask 2023-09-27 10:22:03 -04:00
Pedro J. Estébanez f84c3d4477 Avoid trying to free null RIDs in FSR2 teardown 2023-09-27 16:07:41 +02:00
bitsawer 898d1a2d5f Fix errors when freeing GPUParticles 2023-09-27 11:46:31 +03:00
Rémi Verschelde 92ac0e54fe
Merge pull request #82353 from RPicster/optimizing-glow
Optimizing glow behaviour
2023-09-26 16:36:53 +02:00
Rémi Verschelde 2c8c7b95aa
Merge pull request #82313 from AThousandShips/null_check_servers
[Servers] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable
2023-09-26 13:45:31 +02:00
Raffaele Picca de42258154 Optimizing glow behaviour 2023-09-26 11:56:28 +02:00
Rémi Verschelde e25408df4b
Merge pull request #81381 from bitsawer/fix_shader_include_markers
Fix shader language preprocessor include marker handling
2023-09-26 08:19:40 +02:00
A Thousand Ships fdd3d36c6d [Servers] Replace `ERR_FAIL_COND` with `ERR_FAIL_NULL` where applicable 2023-09-25 18:45:30 +02:00
Dario 057367bf4f Add FidelityFX Super Resolution 2.2 (FSR 2.2.1) support.
Introduces support for FSR2 as a new upscaler option available from the project settings. Also introduces an specific render list for surfaces that require motion and the ability to derive motion vectors from depth buffer and camera motion.
2023-09-25 10:37:47 -03:00
Rémi Verschelde 64cde8ae8b
Merge pull request #82168 from Supreeeme/ext-fix
Expose `texture_create_from_extension` to GDExtension
2023-09-24 23:34:06 +02:00
Rémi Verschelde 8788b20ea0
Merge pull request #81775 from darksylinc/matias-taa-msaa
Fix massive validation errors when enabling TAA + MSAA
2023-09-24 23:32:31 +02:00
Shawn Wallace b12ed82c04 Expose texture_create_from_extension to GDExtension 2023-09-23 16:57:12 -04:00
Rémi Verschelde 525c72ec6d
Merge pull request #81350 from DarioSamo/mipmap-bias
Fix mipmap bias behavior by refactoring how samplers are created by Material Storage.
2023-09-22 22:04:22 +02:00
bruvzg 1887a9df19
[macOS/Windows] Add optional ANGLE backed OpenGL renderer support. Add EGL_ANDROID_blob_cache caching.
Co-authored-by: Riteo <riteo@posteo.net>
2023-09-21 14:21:00 +03:00
bitsawer dda8846dea Fix LightmapGI shading sometimes being unlit or black 2023-09-20 01:41:32 +03:00
Rémi Verschelde 9a1b4f338b
Merge pull request #81160 from paddy-exe/canvas-uv-world-space
Add render mode to use world coordinates in canvas item shader
2023-09-19 09:03:18 +02:00
Matias N. Goldberg 4de0ed4adf 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
2023-09-16 19:31:04 -03:00
Yuri Roubinski d3d20f15bf Re-allows constants in global space to be initialized with function call 2023-09-13 21:04:29 +03:00
风青山 59d0fdbacc 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.
2023-09-13 16:02:10 +08:00
Rémi Verschelde 3815b2f98e
Merge pull request #81315 from conorlawton/z-billboard-y-velocity-no-scale
Fix z-billboard + y to velocity transform alignment to correctly respect non-uniform scale
2023-09-08 23:14:27 +02:00
Conor Lawton 9ecafcc491 Fixed z-billboard-y-velocity to correctly respect non-uniform scale instead of averaging scale 2023-09-08 20:01:57 +01:00
Rémi Verschelde 7663c69922
Merge pull request #81388 from YuriSizov/core-gdvirtual-but-less-confused-about-itself
Extract `ScriptInstance` into its own file to simplify includes
2023-09-07 13:53:45 +02:00
Rémi Verschelde 698df41dac
Merge pull request #81333 from dalexeev/fix-rd-pcbs-attachments-setter
Fix `RDPipelineColorBlendState.attachments` setter
2023-09-07 13:52:33 +02:00
Yuri Sizov d8ff69d53c Extract ScriptInstance to simplify includes
This allows to include script_instance.h directly in the
generated gdvirtual.gen.inc, and remove excessive includes
from the codebase.

This should also allow Resource to use GDVIRTUAL macros,
which wasn't possible previously due to a circular dependency.
2023-09-06 22:54:38 +02:00
Dario 9b91750fb1 Fix mipmap bias behavior by refactoring how samplers are created by Material Storage.
Introduces a new structure to store samplers created with certain parameters instead of storing a 'custom' set of samplers. Allows viewports to correctly configure the mipmap bias and use it when rendering the scene.
2023-09-06 11:24:19 -03:00
bitsawer 3c042fb99f Fix shader language preprocessor include marker handling 2023-09-06 16:57:40 +03:00
Yuri Sizov c5562d1058 Merge pull request #81288 from darksylinc/matias-index16
Use 16-bit index buffers instead of 32 when unnecessary
2023-09-06 14:49:20 +02:00
Milan Gruner 45a33cc749 Implement render mode fog_disabled and BaseMaterial3D setting Disable Fog 2023-09-05 18:15:02 +02:00
Danil Alexeev f2f0375e10
Fix `RDPipelineColorBlendState.attachments` setter 2023-09-05 15:29:56 +03:00
Rémi Verschelde dd4fae6162
Merge pull request #74809 from Chaosus/completion_color_xyzw
Add coloring for completion of vector components
2023-09-04 09:06:57 +02:00
Matias N. Goldberg 53837adc00 Use 16-bit index buffers instead of 32 when unnecessary 2023-09-03 19:59:10 -03:00
Rémi Verschelde aa9f3583e8
Merge pull request #80933 from ChibiDenDen/clear_color_mobile_fix
Fix clear color on mobile renderer
2023-08-31 08:53:41 +02:00
Yuri Rubinsky 35802374ac Add coloring for completion of vector components 2023-08-30 21:13:25 +03:00
bitsawer 836705d7a9 Reset SDFGI when changing editor scene tabs 2023-08-30 19:50:05 +03:00
Patrick c98ab5aba3 Add option to use world coordinates in canvas item shader
By using the render mode `world_vertex_coords` you can automatically use the vertex coordinates in world space
2023-08-30 15:32:18 +02:00
ChibiDenDen df25e87842 fix clear color on mobile renderer 2023-08-30 00:57:59 +03:00
bitsawer 5e22ded4c9 Fix VoxelGI static light pairing 2023-08-29 14:58:56 +03:00
Rémi Verschelde 7792f9e6ef
Merge pull request #81081 from RandomShaper/fixup_cluster_special
Fixup special case of cluster render
2023-08-29 12:47:07 +02:00
Rémi Verschelde a6c72f9829
Merge pull request #81074 from DarioSamo/flip-motion-vectors
Flip convention of motion vectors.
2023-08-29 12:46:44 +02:00
Rémi Verschelde 9d74c24232
Merge pull request #80723 from DarioSamo/debug-motion-vectors
Improve visual feedback when using the motion vectors debug view option
2023-08-29 12:44:45 +02:00
Rémi Verschelde 4b69e8be85
Merge pull request #80688 from DarioSamo/gpu-particles-motion-vectors
Add motion vector support for GPU 3D Particles
2023-08-29 12:43:58 +02:00
viksl 00c2fb4a08 Instead of Vector2() start volumetric fog at frustum_near_size to avoid INF and NaN in shaders. 2023-08-28 21:56:23 +02:00
Rémi Verschelde 22b7fcabc6
Merge pull request #80889 from bitsawer/fix_sdfgi_texture_clear
Clear SDFGI textures when created
2023-08-28 20:37:34 +02:00
Pedro J. Estébanez e9b4d25f20 Fixup special case of cluster render 2023-08-28 18:59:07 +02:00
Dario 293302ccd8 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.
2023-08-28 10:56:02 -03:00
Dario e7d3a7c2aa Improve visual feedback when using the motion vectors debug view option.
Replaces the current method of showing the raw values of the motion vectors buffer to display a grid of lines instead with a new shader.
2023-08-28 10:14:21 -03:00
Dario f14c944c21 Flip convention of motion vector to point from current pixel to the previous pixel. 2023-08-28 09:30:20 -03:00
bitsawer 09c887ce82 Clear SDFGI textures when created 2023-08-28 14:13:36 +03:00
Juan Linietsky 407b16ab00
Debug CanvasItem redraw
I wanted to add this tool for years and always forget. This command line option:

```
$ godot.exe -e --debug-canvas-item-redraw
```

Allows to see when a canvas item is redrawn. This helps find out if something
in the UI is refreshing in a way it should not. Examples as such:

* Signals causing more of the UI to redraw.
* Container resizing causes more UI elements to redraw.
* Something using a timer is redrawing all time time, which can go unnoticed.

To my surprise, the editor UI is redrawing very efficiently. There is some
weird stuff with the scene tabs, redrawing when the inspector changes but most
things for the most part are fine.
2023-08-28 12:53:56 +02:00
Bastiaan Olij 8449331f13 Fix missing decal mask in mobile renderer 2023-08-23 11:14:10 +10:00
bitsawer d6f45e4f14 Fix Vulkan crash with many Omni/SpotLights, Decals or ReflectionProbes 2023-08-21 12:46:15 +03:00
Rémi Verschelde 10b1f823bc
Merge pull request #80323 from garychia/canvas_point_size
Ensure `POINT_SIZE` takes effect in the canvas item shader
2023-08-21 08:21:14 +02:00
Dario e2984af013 Add motion vector support for animated surfaces like skeletons or blend shapes.
Extends mesh instances that required custom vertex buffers to create two alternating buffers that are written to and binds them to use them as the previous vertex buffer when generating motion vectors.
2023-08-16 11:37:42 -03:00
Rémi Verschelde 9d9043a9c8
Merge pull request #80654 from bitsawer/fix_global_uniform_texture_set
Fix global shader uniform texture loading
2023-08-16 09:17:25 +02:00
Rémi Verschelde 623156a05c
Merge pull request #80651 from clayjohn/RD-2D-HDR-MSDF
Fallback to linear color texture when using 2D HDR and MSDF font
2023-08-16 09:17:01 +02:00
Rémi Verschelde 04c2bc5a37
Merge pull request #80424 from DarioSamo/rd-buffer-copy-vulkan
Add `buffer_copy` method to RenderingDevice
2023-08-16 09:13:06 +02:00
bitsawer 41def3740a Fix global shader uniform texture loading 2023-08-15 14:18:26 +03:00
clayjohn 40d70bf9b8 Fallback to linear color texture when using 2D HDR and MSDF font 2023-08-15 11:08:29 +02:00
Dario 420f3890b0 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.
2023-08-13 09:08:20 -03:00
Dario 0d7deca4e2 Add buffer_copy method to RenderingDevice interface and an implementation for the Vulkan driver.
Direct buffer copies are required to perform certain operations more efficiently, as the only current alternative is to download the buffer to the CPU and upload it again. As the first use case, the new function is used when enabling motion vectors on multimeshes.
2023-08-12 09:38:39 -03:00
Bastiaan Olij 715ebcc3f1 Fix tonemapper, incorrect vertex count was specified 2023-08-11 10:07:16 +10:00
Dario 5155870d64 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.
2023-08-09 08:17:07 -03:00
Rémi Verschelde 00de140d46
Merge pull request #80368 from BastiaanOlij/fix_mobile_error_on_scale
Fix issue with four subpasses always been requested in mobile renderer
2023-08-08 16:58:47 +02:00
Rémi Verschelde 1163dac9e3
Merge pull request #80215 from clayjohn/HDR-2D
Add option to enable HDR rendering in 2D
2023-08-08 16:57:33 +02:00
Johan Aires Rastén 6e1f68109b Support shader preprocessor concatenation symbol 2023-08-08 10:56:20 +02:00
Rémi Verschelde 8a3a3aaebe
Merge pull request #80356 from darksylinc/voxelgi-dispatch-underflow
Fix integer underflow when rounding up in VoxelGI
2023-08-07 14:55:33 +02:00
Rémi Verschelde ff70ce158c
Merge pull request #80315 from darksylinc/matias-ssil-validation-fix
Fix validation error when enabling SSIL alone
2023-08-07 14:55:10 +02:00
Rémi Verschelde 40ca09364d
Merge pull request #80311 from darksylinc/matias-fullscreen-tri
Use fullscreen tri instead of quad
2023-08-07 14:54:21 +02:00
Rémi Verschelde f01290fa91
Merge pull request #80257 from DarioSamo/taa_double_precision_fix
Fix motion vectors being corrupted when using `precision=double`
2023-08-07 14:51:35 +02:00
Rémi Verschelde faaf27f284
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>
2023-08-07 13:09:47 +02:00
Bastiaan Olij 414df467cd Fix issue with four subpasses always been requested in mobile renderer 2023-08-07 20:26:48 +10:00
clayjohn 57eb762bae Add option to enable HDR rendering in 2D
This is needed to allow 2D to fully make use of 3D effects (e.g. glow), and can be used to substantially improve quality of 2D rendering at the cost of performance

Additionally, the 2D rendering pipeline is done in linear space (we skip linear_to_srgb conversion in 3D tonemapping) so the entire Viewport can be kept linear.
This is necessary for proper HDR screen support in the future.
2023-08-07 11:24:03 +02:00
Matias N. Goldberg e783e32108 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
2023-08-06 23:21:58 -03:00
Chia-Hsiang Cheng 0cf57e1927 Ensure POINT_SIZE takes effect 2023-08-06 16:44:16 +08:00
Matias N. Goldberg 666e91b9ff Fix validation error when enabling SSIL alone 2023-08-05 20:57:26 -03:00
Matias N. Goldberg 79c9edab3b Draw sky as a fullscreen triangle 2023-08-05 17:55:43 -03:00
Matias N. Goldberg 6e7d87fb25 Use fullscreen tri instead of quad 2023-08-05 17:09:06 -03:00
Dario 77776f5313 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).
2023-08-04 11:42:06 -03:00
Rémi Verschelde f9f5041675
Merge pull request #80222 from clayjohn/Shader-rid-init
Initialize shader placeholders up front
2023-08-03 18:33:59 +02:00
clayjohn 558f4b7559 Initialize shader placeholders up front
Then use the placeholder to create the shader instead of swapping RIDs
This fixes a false positive that reported leaked shaders
2023-08-03 16:13:33 +02:00
Rémi Verschelde 858e8748e8
Fix or workaround recent extension API compatibility issues
- Add compatibility methods for `RenderingDevice::shader_create_from_bytecode`
  and `CodeEdit::get_text_for_symbol_loopup`.
- Silence errors which now have compatibility methods.
- Acknowledge GraphEdit/GraphNode compat breakage, intended and WIP.
2023-08-03 12:07:21 +02:00
Hugo Locurcio 037975f6b6
Remove debugging print from shader cache 2023-08-01 17:55:44 +02:00
Yuri Sizov cc1ee3e599 Merge pull request #79911 from BastiaanOlij/fix_barrier_breakage
Add exceptions for breakage introduced in RD barriers
2023-08-01 17:25:40 +02:00
Yuri Sizov 13307e7efc Merge pull request #79776 from LRFLEW/mobilefog
Mobile: Uncomment code required for fog rendering on clear color
2023-08-01 17:25:29 +02:00
Yuri Sizov 1c40263665 Merge pull request #79606 from clayjohn/ShaderRD-compilation-groups
Shader rd compilation groups
2023-08-01 17:25:16 +02:00
Yuri Sizov 8b12849fef Merge pull request #79876 from LRFLEW/mobalpha
Fix transparent viewport backgrounds with custom clear color
2023-07-31 21:01:32 +02:00
Yuri Sizov 79d3468246 Merge pull request #79696 from reduz/call-on-render-thread
Add ability to call code on rendering thread
2023-07-31 21:01:21 +02:00
LRFLEW 6effd3cde7 Fix transparent viewport backgrounds with custom clear color 2023-07-30 06:19:47 -05:00
Matias N. Goldberg 472226422e Fix uninitialized variable ending up sent to Vulkan
The first time a shader is compiled Godot performs the following:

```cpp
for (uint32_t i = 0; i < SHADER_STAGE_MAX; i++) {
	if
(spirv_data.push_constant_stages_mask.has_flag((ShaderStage)(1 << i))) {
		binary_data.push_constant_vk_stages_mask |=
shader_stage_masks[i];
	}
}
```

However binary_data.push_constant_vk_stages_mask is never initialized to
0 and thus contains garbage data or'ed with the good data.

This value is used by push constants (and many other things) thus it can
be a big deal.

Fortunately because the relevant flags are always guaranteed to be set
(but not guaranteed to be unset), the damage is restricted to:

1. Performance (unnecessary flushing & over-excessive barriers)
2. Overwriting push descriptors already set (this would be serious,
doesn't seem to be an issue)
3. Driver implementations going crazy when they see bits set they don't
expect (unknown if this is an issue)

This uninitialized value is later saved into the binary cache.

Valgrind is able to detect this bug on the first run, but not on the
subsequent ones because they data comes from a file.

cache_file_version has been bumped to force rebuild of all cached
shaders. Because the ones generated so far are compromised.
2023-07-29 18:28:33 -03:00
Bastiaan Olij 10f796dae3 Add exceptions for breakage introduced in RD barriers and prevent future breakage 2023-07-28 14:21:34 +10:00
Yuri Sizov 1fe49e7271 Merge pull request #79142 from BastiaanOlij/register_render_buffers
Expose RenderSceneBuffers(RD) through ClassDB
2023-07-27 15:22:27 +02:00
Bastiaan Olij 4874b96033 Expose RenderingSceneBuffers through ClassDB 2023-07-26 23:48:30 +10:00
Bastiaan Olij 63d6e9c557 Add custom texture create function 2023-07-26 20:46:34 +10:00
Juan Linietsky c7fb6cea3d Add ability to call code on rendering thread
As more users use compute in Godot 4, the way they do is most likely incompatible when running
on separate threads and will start erroring soon as we improve the thread safety of the render thread.

To properly run code on the render thread, this function was added. Use like this:

```GDScript

func initialize_compute_code():
	....

func update_compute_code(custom_data):
	...

func _ready():
	RenderingServer.call_on_render_thread( initialize_compute_code )

func _process():
	RenderingServer.call_on_render_thread( update_compute_code.bind(with_data) )

```
2023-07-26 12:28:00 +02:00
Yuri Sizov 3f2e901633 Merge pull request #79865 from clayjohn/discard-shader
Fix use of discard in shaders
2023-07-25 21:26:27 +02:00
Yuri Sizov 08cffc128f Merge pull request #79812 from ParsleighScumble/parsleigh/init-sky-scene-state
Use defaults to initialize sky data in case of no sky
2023-07-25 21:26:23 +02:00
Yuri Sizov 0e9e373b87 Merge pull request #79603 from bitsawer/fix_instance_uniform_update
Fix instance uniform data buffer update delay
2023-07-25 21:26:02 +02:00
Clay 7c812cd7e9 Fix use of discard in shaders
discard was being included in all shaders set to depth pass opaque, which is the majority of shaders

Instead it should only be used with alpha prepass materials
2023-07-24 23:21:04 +02:00
Parsleigh Scumble 67c13fe4eb Use defaults to initialize sky data in case of no sky 2023-07-24 10:41:13 -07:00
Yuri Sizov 360633089c Merge pull request #79590 from 0010200303/master
Fix bad LOD selection when Camera in Mesh AABB
2023-07-24 19:32:54 +02:00
Yuri Sizov 372e9abcfc Merge pull request #79459 from MoltenCoffee/fix-shader-arguments-error
Add error for undefined function in shader
2023-07-24 19:32:46 +02:00
LRFLEW db17415df8 Mobile: Uncomment code required for fog rendering on clear color 2023-07-24 08:46:45 -05:00
Yuri Sizov 1e856b61ae Merge pull request #79624 from mandryskowski/patch-1
Revert the change of the limit for interpolation of F0 for dielectrics and metals for Screen Space Reflections
2023-07-21 17:54:50 +02:00
clayjohn e970f5249c Add Shader compile groups to RD Shader system
This allows us to specify a subset of variants to compile at load time and conditionally other variants later.

This works seamlessly with shader caching.

Needed to ensure that users only pay the cost for variants they use
2023-07-21 16:42:30 +02:00
Yuri Sizov dd05012122
Merge pull request #79528 from univeous/video_adapter_fix
Fix crash when calling `get_video_adapter_*` in a thread
2023-07-20 16:28:47 +02:00
Jonas Schönbrodt 26c4644b38 Fix bad LOD selection when Camera in Mesh AABB
Fixed an issue where a bad LOD would be selected although the Camera being inside the Meshes AABB.
2023-07-19 18:07:37 +02:00
univeous 0a64abe891 Fix crash when calling get_video_adapter_* in a thread
co-authored-by: Clay John <claynjohn@gmail.com>
2023-07-19 23:31:27 +09:00
mandryskowski 33e46aac13
Revert the change of the limit for interpolation of R0 with respect to metallic and SSR
Commit 2c000cb72f changed the interpolation limits from (0.04, 1.0) to (0.04, 0.37). This is incorrect, as we want to have an F0 of 0.04 for dielectrics (materials with metalness of 0.0) and an F0 of 1.0 for metals.
The Schlick approximation uses an F0 of 0.04 for all dielectrics and it's good enough.
Having it lower than 1.0 leads to an incorrect application of the Fresnel effect for metals and leads to bugs like #79549
2023-07-18 19:18:19 +02:00
bitsawer 7a9783737a Fix instance uniform data buffer update delay 2023-07-18 12:19:15 +03:00
MoltenCoffee 16c3f4be2d
Add error for undefined function in shader 2023-07-18 10:01:29 +02:00
Clay John f880892c3d
Merge pull request #79402 from Haydoggo/repeat-filter-autocomplete
Add autocomplete for filter/repeat hints on uniform arrays
2023-07-17 11:32:20 +02:00
Bastiaan Olij a22f495a3c Split raster barrier into vertex and fragment barrier 2023-07-15 12:30:32 +10:00
kleonc b7e5ea8a39 Update Y-sort position of the first item in the sorted subtree 2023-07-14 02:18:05 +02:00
Hayden Leete fc7063b2e2 Add autocomplete for filter/repeat hints on uniform arrays 2023-07-13 11:27:28 +12:00
Yuri Sizov 0fa808ba5e Merge pull request #77085 from BastiaanOlij/visualise_direction_shadowmap_frustum
Draw frustum splices ontop of direction shadow atlas for debug purposes
2023-07-12 21:02:25 +02:00
Yuri Sizov bb15241e06 Merge pull request #77740 from ChibiDenDen/simplify_vulkan
Replace sampler arrays with constant sampler elements, simplify and reuse code for all shaders
2023-07-12 17:16:12 +02:00
Yuri Sizov 5dff3c4484 Merge pull request #78538 from Sauermann/fix-code-simplifications
Remove unnecessary value assignments throughout the codebase
2023-07-12 15:09:26 +02:00
Yuri Sizov 65cc4db0ae Merge pull request #79100 from KoBeWi/[filter,_filter,_filter,_filter,_filter,_filter]
Allow more hint types for uniform arrays
2023-07-12 14:18:34 +02:00
Rémi Verschelde 7030ac555f
Merge pull request #79270 from clayjohn/particle-trails-error
Unify error condition for particles trail lifetime
2023-07-10 10:38:34 +02:00
clayjohn 78ecdb17f9 Unify error condition for particles trail lifetime 2023-07-10 10:17:27 +02:00
Rémi Verschelde 46cd84b362
Merge pull request #78839 from lewiji/normal_roughness_mobile_fix
Fix invalid shader compilation when using `hint_normal_roughness_texture` in mobile backend
2023-07-08 18:19:49 +02:00
Rémi Verschelde ea3aaeac05
Merge pull request #78624 from puchik/canvas-background-specular-ghosting
Clear specular buffer if sky mode is canvas and screen space effects are used
2023-07-08 18:16:05 +02:00
Rémi Verschelde b2ada1b690
Merge pull request #78972 from bitsawer/fix_shader_float_precision
Fix shader language float literal precision truncation
2023-07-07 08:32:09 +02:00
Rémi Verschelde 25ec523596
Merge pull request #78906 from Chaosus/shader_allow_hex_uint
Fix using uint suffix at the hex number declaration in shaders
2023-07-07 08:29:17 +02:00
kobewi 8ae2e6681e Allow more hint types for uniform arrays 2023-07-06 15:05:26 +02:00
bitsawer 356297f909 Fix shader language float literal precision truncation 2023-07-03 12:48:33 +03:00
Yuri Roubinski 1994c25701 Fix using uint suffix at the hex number declaration in shaders 2023-07-01 14:33:48 +03:00
clayjohn 35ed7c770b Initialize particles instance buffer in case it is used before being updated 2023-06-29 13:24:40 -07:00
lewiji 2a93681334 Return shader parse error when using 'hint_normal_roughness_texture' and not using the Forward+ backend 2023-06-29 16:18:31 +01:00
K. S. Ernest (iFire) Lee 39dfa8436e Varying mismatch causing shaders to fail. 2023-06-23 21:36:38 -07:00
Arman Elgudzhyan af9d1743f3 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.
2023-06-23 12:16:52 -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
ChibiDenDen 35715e510f replace sampler arrays with constant sampler elements 2023-06-22 01:11:57 +03:00
Markus Sauermann 890fdd56df Code simplifications
CPPcheck found most of them.

no need to assign the variable twice:
- AnimationTrackEditTypeAudio
- SSEffects

variable is assigned in all if-else clauses:
- EditorHelp
- AndroidInputHandler
- MenuBar
- ShaderCompiler

same if clause:
- ItemList

clearing an empty bitfield has no effect:
- Viewport
2023-06-21 22:37:26 +02: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
Bastiaan Olij d9eb9665da Draw frustum splices ontop of direction shadow atlas for debug purposes 2023-06-11 11:48:11 +10: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
Manuel Dun e2321c21db Enable the use of all builtins on the light shader
When using the light process in spatial shader,
the built-ins work as spected, now they work in forward+,
mobile and compatibility renderer.
2023-06-08 14:14:14 -04:00
Hugo Locurcio 0f82a0f569
Document the InitialAction enum in RenderingDevice
This also improves the documentation for the FinalAction enum,
and fixes an incorrect comment in the RenderingDevice header.
2023-06-08 03:54:38 +02:00
Rémi Verschelde 46c4068821
Merge pull request #77170 from lawnjelly/scu_build_master
Add support for single compilation unit builds
2023-06-06 17:58:09 +02:00
lawnjelly b69c8b4791 Single Compilation Unit build.
Adds support for simple SCU build (DEV_ENABLED only).
This speeds up compilation by compiling multiple cpp files within a single translation unit.
2023-06-06 15:36:51 +01:00
Arman Elgudzhyan 7bcc849143 Use depth pass mode with normals if required even if Environment is null
If using normal buffer debugging or if the normal texture was used, we should use PASS_MODE_DEPTH_NORMAL_ROUGHNESS regardless of whether there is a valid Environment or not. Otherwise, shaders reading the normal texture will not work without a valid Environment (and possibly other problems).
2023-06-03 07:56:47 -07:00
Pedro J. Estébanez f08f67308e Fix management of life cycle of vol. fog related uniform sets 2023-05-31 19:54:28 +02:00
bitsawer 23c375d6b4 Fix shader uniform storage conversions and crash 2023-05-29 15:17:13 +03:00
bitsawer 67038471ff Fix shader preprocessor cyclic include handling 2023-05-29 12:05:22 +03:00
Yuri Sizov f6dcd7f51a
Merge pull request #75181 from dalexeev/fix-light-only-mode
Fix "Light Only" mode of `CanvasItemMaterial`
2023-05-27 17:28:29 +02:00
Allen Pestaluky 4e19f34856 Changed Subtract blend mode of Forward+ and Mobile renderers to match behaviour of the Godot 3 and Compatibility renderers
The OpenGL implementation has used GL_FUNC_REVERSE_SUBTRACT for a long time, but the new RenderingDevice abstraction used by the Vulkan renderers had been mistakenly set to BLEND_OP_SUBTRACT instead of BLEND_OP_REVERSE_SUBTRACT.

Fixes #77448
2023-05-26 10:50:35 -04:00
Rémi Verschelde ba557aaf55
Merge pull request #77294 from puchik/lod-resolution-scaling
Take 3D resolution scaling into account for mesh LOD
2023-05-24 08:48:38 +02:00
Rémi Verschelde 0821262167
Merge pull request #77079 from kleonc/y_sort_fix_modulation_propagation
Fix modulation propagation for Y-sorted CanvasItems
2023-05-24 08:47:50 +02:00
Rémi Verschelde 852740a627
Merge pull request #76053 from MightiestGoat/fix-sky-auto-exposure
Fix the grainy sky while using debanding.
2023-05-24 08:46:28 +02:00
Rémi Verschelde 6d88c83611
Merge pull request #71684 from kleonc/draw_polyline_simplify_antialiased
`RendererCanvasCull` Simplify drawing antialiased polyline
2023-05-24 08:44:19 +02:00
Rémi Verschelde d5c1b9f883
Merge pull request #77327 from BastiaanOlij/fix_gi_and_fog_free
Conditionally free GI and FOG resources, they may not have been created
2023-05-22 22:37:12 +02:00
Rémi Verschelde c3c1909429
Merge pull request #77326 from BastiaanOlij/fix_material_dependencies
Properly clear material slots on mesh instance when material is freed
2023-05-22 22:36:48 +02:00
Bastiaan Olij 1a128fcccd Properly clear material slots on mesh instance when material is freed 2023-05-22 23:00:00 +10:00
Rémi Verschelde 1086375785
Merge pull request #77266 from Rindbee/fix-bugs-in-TextureStorage-texture_3d_update
Fix calling `TextureStorage::texture_3d_update()` could cause a crash
2023-05-22 13:49:23 +02:00
Rémi Verschelde 05ddc822fb
Merge pull request #77265 from lyuma/aabb_bone_lod_inside
Fix calculation of skinned AABB for unused bones.
2023-05-22 13:49:19 +02:00
Bastiaan Olij 57f343ab21 Conditionally free GI and FOG resources, they may not have been created 2023-05-22 12:59:34 +10:00
Rindbee ebd2b9e299 Fix calling `TextureStorage::texture_3d_update()` could cause a crash 2023-05-22 06:24:13 +08:00
Arman Elgudzhyan ac4ca89000 Take 3D resolution scaling into account for mesh LOD 2023-05-20 16:40:16 -07:00
Lyuma 791d8001db Fix AABB for unused bones
Fixes bug where bounding box of 1 unit was used in some skinned models and had wrong LODs.
(this could become very large if the mesh is scaled, such as FBX conversions)
Also fixes a mistake in calcualting bone index.
2023-05-19 19:47:52 -07:00
Markus Grafen 8a3e829930 (Re-)Implemented Light3D's property "shadow_reverse_cull_face"
The parameter shadow_reverse_cull_face is now passed to the shadow pass so that the mesh back-faces are used for shadow map calculation.
2023-05-19 19:22:10 +02:00
Bastiaan Olij dae58dd187 Fix a typo in the debug shadow split renderer 2023-05-18 10:36:12 +10:00
Rémi Verschelde b42cea1373
Merge pull request #77089 from DearthDev/lightmapgi-dynamic-objects
LightmapGI dynamic object lighting fix
2023-05-17 11:25:25 +02:00
dearthdev 53903f07dc Correctly insert lightmap captures and geometries. 2023-05-15 03:05:19 -05:00
Yuri Rubinsky d7211b371c
Merge pull request #77086 from Chaosus/shaders_fix_render_mode_completion 2023-05-15 10:58:23 +03:00
Rémi Verschelde 9ecb929da6
Merge pull request #76565 from clayjohn/debug-PSSM-splits
Re-implement the PSSM_SPLITS debug option
2023-05-15 09:33:01 +02:00
Yuri Rubinsky 719741b0eb Exclude incorrect completion options for `render_mode` in shaders 2023-05-15 08:21:16 +03:00
kleonc 5d8219b4fd Fix modulation propagation for Y-sorted CanvasItems 2023-05-15 01:32:41 +02:00
Danil Alexeev 43b0702a02
Fix "Light Only" mode of `CanvasItemMaterial` 2023-05-13 09:06:09 +03:00
Ninni Pipping 71ee65dc57 Enable shadow warnings and fix raised errors 2023-05-11 16:00:59 +02:00
Rémi Verschelde 564d1b34e0
Merge pull request #74711 from BastiaanOlij/add_texture_native_handle
Provide access to internal graphics handles for textures
2023-05-09 19:28:26 +02:00
Bastiaan Olij c328676d96 For GDExternal use, provides access to internal graphics handles for textures 2023-05-09 13:47:22 +10:00
Pedro J. Estébanez 6465432570 Save cluster render shader from being optimized out entirely 2023-05-08 18:39:49 +02:00
Rémi Verschelde 3e6a731904
Merge pull request #76418 from reduz/method-bind-validated-call
Add ValidatedCall to MethodBind
2023-05-08 13:52:42 +02:00
Clay John 610877e326
Merge pull request #72288 from MewPurPur/use-string-repeat
Use `String.repeat()` to optimize several String methods
2023-05-05 09:56:48 -07:00
Max Hilbrunner 39d85308fd
Merge pull request #76109 from paddy-exe/fix-node-position-view 2023-05-05 14:35:41 +02:00
Max Hilbrunner d481fca986
Merge pull request #75517 from BastiaanOlij/expose_render_target 2023-05-05 14:28:01 +02:00
Max Hilbrunner fa451ead91
Merge pull request #74883 from dalexeev/fix-thin-multiline-colors 2023-05-05 14:26:37 +02:00
Johan Aires Rastén 8452e6cdb3 Add SPECULAR_AMOUNT spatial light shader built-in
Light3D has a light_specular property which is used to set the
intensity of specular contributed by this light source, but it was
previously only used by the default material light shader, and not
possible to use in a custom light() shader.
2023-05-04 09:15:12 +02:00
Max Hilbrunner ba32279cd0
Merge pull request #76550 from RandomShaper/vk_gi_take_2
Fix voxel GI issues (2)
2023-05-03 20:24:05 +02:00
Patrick e35bbd76a3 Fix Rotation Issue with NODE_POSITION_VIEW Visual Shader Node 2023-05-03 19:59:43 +02:00
Pedro J. Estébanez c58e50adcc Fix additional cases of breakage of rendering effects 2023-05-03 11:57:54 +02:00
clayjohn fb77021559 Use proper UV in cubemap downsampler raster
This removes bias in cubemap downsampling shader that resulted in the bottom of cubemaps being over represented
2023-05-03 01:06:34 -07:00
VolTer 6b84e258d2 Use String.repeat() in more places 2023-05-01 02:27:46 +02:00
Juan Linietsky 1c93606e47 Add ValidatedCall to MethodBind
* This should optimize GDScript function calling _enormously_.
* It also should simplify the GDScript VM considerably.

NOTE: GDExtension calling performance has most likely been affected until going via ptrcall is fixed.
2023-04-30 20:01:26 +02:00
clayjohn ca23d06a31 Re-implement the PSSM_SPLITS debug option
This uses a render_mode instead of shadow_color to avoid adding a cost to the basic shader
2023-04-28 17:53:56 -07:00
Samuele Panzeri 4aaa2e6477 Fix wait for thread not started 2023-04-27 20:28:22 +02:00
Rémi Verschelde 5a1d4bd8ab
Merge pull request #76479 from bitsawer/fix_preprocessor_line_number
Fix Shader Preprocessor line numbering when disabled
2023-04-27 08:19:30 +02:00
Pedro J. Estébanez 09aa1bbdb3 Fix unsupported sampler filter used for voxel GI 2023-04-26 20:54:06 +02:00
bitsawer 34896d8e89 Fix Shader Preprocessor line numbering when disabled 2023-04-26 16:48:23 +03:00
Pedro J. Estébanez 2beed0d5dc Fix breakages of volumetric fog on voxel GI changes 2023-04-26 10:24:03 +02:00
Johan Aires Rastén 14a8124ffe Add LIGHT_IS_DIRECTIONAL built-in for spatial shaders 2023-04-20 14:33:30 +02:00
clayjohn ab603e347f Clamp normal when calculating 2D lighting to avoid artifacts 2023-04-18 17:26:17 -07:00
mightygoat 69f634ac78 Fix the grainy sky while using debanding 2023-04-15 10:43:46 +05:30
Rémi Verschelde 0ec2be1213
Merge pull request #76003 from clayjohn/double-particle-offset
Don't store instance transform origin in RD 3D renderer unless requested
2023-04-13 09:56:41 +02:00
Rémi Verschelde 34a842b5d1
Merge pull request #75462 from joao-pedro-braz/use_modelview_for_vertex_transform_when_double_precision_is_enabled
Use MODELVIEW_MATRIX when on double precision
2023-04-13 09:53:54 +02:00
Rémi Verschelde e6e52f9154
Merge pull request #75162 from ecmjohnson/gpuparticles_inf_translate
GPUParticles3D: Translate inactive particles to -INF
2023-04-13 09:53:04 +02:00
Erik Johnson 6229c2a1f9 Translate inactive particles to -INF 2023-04-12 19:32:39 -04:00
clayjohn 29edd277e4 Don't store instance transform in RD 3D renderer unless requested
Previously, when using doubles builds of the engine, instance transform was stored no matter what which caused world space particles to accumulate the instance transform twice
2023-04-12 14:41:17 -07:00
clayjohn 9be0a73294 Add EXPOSURE built in to spatial shaders
This allows users to restore light values to pre-pre-exposure amounts
2023-04-12 10:35:13 -07:00
Rémi Verschelde 5e34a28bd7
Merge pull request #73313 from clayjohn/particles-split
Properly calculate lifetime_split for particles
2023-04-12 17:01:17 +02:00
Rémi Verschelde 1b14e1a293
Merge pull request #75908 from Calinou/compute-pipeline-fix-typo
Fix `compute_pieline` typo in `RenderingDevice.compute_pipeline_is_valid()`
2023-04-12 09:07:43 +02:00
Yuri Rubinsky 1433c98e9f
Merge pull request #75831 from Chaosus/shader_fix_texture_array_hint_completion 2023-04-12 08:58:59 +03:00
Rémi Verschelde ef17794d17
Merge pull request #75812 from RandomCatDude/sky-fog-luminance-fix
Move sky luminance scaling to before fog is applied
2023-04-11 19:40:36 +02:00
Rémi Verschelde 347a8e20ae
Merge pull request #69324 from RedMser/advanced-settings-errors
Make it easier to solve warnings/errors referring to project settings
2023-04-11 19:39:53 +02:00
Hugo Locurcio 8eb0d0e665
Fix `compute_pieline` typo in `RenderingDevice.compute_pipeline_is_valid()` 2023-04-10 22:32:04 +02:00
Yuri Rubinsky 12142f2b50 Fix completion of `source_color` hint for texture arrays in shaders 2023-04-08 20:13:26 +03:00
RandomCatDude c118314fe8 Apply sky fog after luminance multiplier 2023-04-08 12:52:33 +05:00
Yuri Sizov cbb2e17369
Merge pull request #75368 from MightiestGoat/fix-limit-interpolation-R0
Fix the limit for interpolation of R0 with respect to metallic and the calculation of the cos theata in the Fresnel Shlick term in SSR
2023-04-07 12:40:33 +02:00
Yuri Sizov 08c1b55862
Merge pull request #74891 from jmattspartacus/OccluderPolygon2D_memLeak_53722
Fix for OccluderPolygon2D memory leak
2023-04-07 12:37:51 +02:00
mightygoat 2c000cb72f Fix the limit for interpolation of R0 with respect to metallic and SSR
Shlick term
2023-04-06 23:14:47 +05:30
Bastiaan Olij 901cd7e3fe Fix framebuffers in sky not being created on mobile renderer 2023-04-05 09:43:03 +10:00
Yuri Sizov 9dcfdc2051
Merge pull request #75366 from Chaosus/shader_compiler_fix_operator
Fix to some operators in shaders are not compiled properly
2023-04-03 22:32:31 +02:00
Rémi Verschelde 154a29d33a
Merge pull request #74808 from bradc6/feature/AllowCustomOutputShaderGenFilepaths
Allow for shaders to be generated outside of the source tree
2023-04-03 16:01:32 +02:00
Bastiaan Olij ab60d3b65c Expose viewports render targer RID 2023-03-31 11:34:09 +11:00
João Pedro Braz 63c6f0b93c Use MODELVIEW_MATRIX for vertex transform when double precision is enabled
This commit updates the double precision vertex transform code from
using the MODEL_MATRIX to now use the MODELVIEW_MATRIX instead.

This can be made possible by transforming the MODELVIEW_MATRIX
back into model space (ie, same space as the MODEL_MATRIX) and then using it as if it were the MODEL_MATRIX.

With this in place we now properly handle VERTEX transformations that
a Material Shader might do, such as billboard-ing.
2023-03-29 10:37:30 -03:00
RedMser ed960453b7 Make solving project setting errors easier
Show full project setting path in error messages.
Force filtering for advanced settings if filter is not empty.
2023-03-27 08:10:35 +02:00
Yuri Rubinsky 575e352a61 Fix to some operators in shaders are not compiled properly 2023-03-26 20:50:02 +03:00
Bradley Clemetson 2302c7102f
Allow for external python scripts to call the build python headers via external scripts
Change GLES3 to not use a relative path
Make the parameters more explicit and ensure the shaders generated are not using relative paths
2023-03-19 21:18:52 -07:00
Yuri Sizov ded38c5d75
Merge pull request #73839 from clayjohn/OUTPUT_IS_SRGB
Clean up OUTPUT_IS_SRGB redefinitions
2023-03-16 13:03:37 +01:00
James Christie 68149328f1 Set value of line_point_count outside of initialization 2023-03-16 01:20:41 -04:00
Danil Alexeev ba985ecf3f
Fix `draw_multiline_colors()` for `width < 0` 2023-03-14 09:43:56 +03:00
Rémi Verschelde 0333b4a266
Merge pull request #74708 from BastiaanOlij/fix_rd_texture
Merge duplicate rd_texture functions
2023-03-10 22:48:19 +01:00
Rémi Verschelde 0511da260f
Merge pull request #74019 from BastiaanOlij/split_last_effects
Move roughness limiter and sort into their own classes
2023-03-10 14:02:14 +01:00
Bastiaan Olij 70dca9ff55 Merge duplicate rd_texture functions 2023-03-10 21:37:01 +11:00
Bastiaan Olij a8ec72cf94 Move roughness limiter and sort into their own classes 2023-03-09 21:58:55 +11:00
Rémi Verschelde d150bb84a6
Merge pull request #74566 from clayjohn/GL-canvas-texture
Avoid copying CanvasTexture when updating proxy
2023-03-08 08:59:04 +01:00
Rémi Verschelde 23bbf6b37c
Merge pull request #74533 from SlugFiller/fix-clip-no-children
Fixes a canvas item set to clip children being drawn as black if no children are visible
2023-03-08 08:57:00 +01:00
Rémi Verschelde a0ff87f48d
Merge pull request #74416 from SlugFiller/fix-skeleton2d-aabb
Fix AABB calculation for meshes using Skeleton2D
2023-03-08 08:56:12 +01:00
Rémi Verschelde 1a5239ff1e
Merge pull request #74349 from JohanAR/fix-instance-uniforms
Fix instance uniforms breaking when setting a new mesh.
2023-03-08 08:55:48 +01:00
clayjohn 84482ef90b Avoid copying CanvasTexture when updating proxy 2023-03-07 12:48:32 -08:00
SlugFiller f25508befb Fixes a canvas item set to clip children being drawn as black if no children are visible 2023-03-07 09:53:26 +02:00
SlugFiller 06a1fe0364 Fix AABB calculation for meshes using Skeleton2D 2023-03-05 08:21:08 +02:00
Johan Aires Rastén 26aecbfe57 Fix instance uniforms breaking when setting a new mesh.
Fixes #58113
2023-03-04 11:49:18 +01:00
Fabio Iotti 528e0d095e Error on hint_normal_roughness_texture and hint_depth_texture outside of spatial shader 2023-03-03 21:36:48 +01:00
Rémi Verschelde 61d2c85511
Merge pull request #74269 from clayjohn/RD-more-timestamps
Add a few more rendering timestamps
2023-03-03 11:09:27 +01:00
clayjohn 1adc4e5875 Add a few more rendering timestamps 2023-03-02 18:15:21 -08:00
Rémi Verschelde 31eccb5501
Merge pull request #74150 from BastiaanOlij/fix_mobile_msaa_2d
Use MSAA 2D texture in multipass tonemapper
2023-03-02 11:42:13 +01:00
Rémi Verschelde 29723da272
Merge pull request #73919 from RandomCatDude/volumefog-spotlight-fix
Fix spotlight shadows in volumetric fog
2023-03-02 11:23:24 +01:00
Bastiaan Olij 903aa0e385 Use MSAA 2D texture in multipass tonemapper 2023-03-01 18:59:59 +11:00
Rémi Verschelde 0cd1483132
Merge pull request #73959 from clayjohn/GL-mobile-warnings
Add warnings for unsupported features in mobile and gl_compatibility backends
2023-02-26 21:39:06 +01:00
clayjohn c69b14e96e Add warnings for unsupported features in mobile and gl_compatibility backends 2023-02-26 12:28:02 -08:00
bitsawer 35c970f4f6 Fix shader preprocessor include resource check 2023-02-26 13:59:29 +02:00
RandomCatDude 59c31004f8 fix spotlight shadows in volumetric fog 2023-02-25 16:28:06 +05:00
Bastiaan Olij 4c2f33cfae Fixing issues with SSIL artifacts 2023-02-24 16:13:18 +11:00
clayjohn 316cf04059 Clean up OUTPUT_IS_SRGB redefinitions 2023-02-23 12:56:42 -08:00
Bastiaan Olij 467d735eb1 Fix issue with default textures requiring arrays when using multiview 2023-02-22 16:50:58 +11:00
Rémi Verschelde 1fc28fe31f
Merge pull request #73698 from clayjohn/SS-bias
Increase SSAO and SSIL bias to account for variance in mipmap generation
2023-02-21 21:16:07 +01:00
Rémi Verschelde 5e57205365
Merge pull request #73478 from NewDefectus/master
Use the original canvas to calculate light positioning
2023-02-21 21:14:51 +01:00
clayjohn db9dfb7233 Increase SSAO and SSIL bias to account for variance in mipmap generation 2023-02-21 10:25:33 -08:00
Alon Ran 2d7db30f0d Use the original canvas to calculate light positioning 2023-02-21 11:57:16 +02:00
Yuri Rubinsky 94831c7209 Forbid passing multiview sampler to the custom function in shaders 2023-02-21 11:23:17 +03:00
Rémi Verschelde b2584629c8
Merge pull request #73195 from timothyqiu/weblate-comments
Improvements and fixes based on Weblate comments
2023-02-17 09:55:39 +01:00
clayjohn c9c14410e9 Fix sampling bug when SSAO is using half size 2023-02-16 00:37:12 -08:00
clayjohn f35ca4a9c7 Properly calculate lifetime_split for particles 2023-02-14 14:37:47 -08:00
Rémi Verschelde 1a206d0e22
Merge pull request #73263 from clayjohn/render_priority
Notify mesh surface when render_priority changes
2023-02-14 11:05:28 +01:00
clayjohn d3b3419aff Notify mesh surface when render_priority changes
This ensures that the mesh properly takes render_priority into account when changed
2023-02-13 18:09:33 -08:00
Rémi Verschelde 0668e0f5a9
Merge pull request #69001 from dzil123/fix_rendering_checks
Fix various missing rendering parameter checks
2023-02-13 21:07:05 +01:00
Rémi Verschelde e78b77481e
Merge pull request #73240 from myaaaaaaaaa/worker-h
Move some `worker_thread_pool.h` includes out of header files
2023-02-13 21:05:57 +01:00
myaaaaaaaaa 6f88392d02 Move some worker_thread_pool.h includes out of header files 2023-02-13 14:02:01 -05:00
Rémi Verschelde 3815903119
Merge pull request #72838 from BastiaanOlij/update_screen_space_render_buffers
Add render buffer support to screen space effects
2023-02-13 19:15:48 +01:00
Haoyu Qiu 84aee17901 Improvements and fixes based on Weblate comments
* Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted".
* Spell out "Animation" instead of using "Anim.".
* Treat "Max" as regular word instead of writing "Max.".
* Use generic "Set %s" for action name instead of a dedicated "Set target_position".
* Add translator comment for:
    * "Inclusive" and "Self" in the profiler.
    * Places where it needs the context about being an editor progress label.
    * "Duplicated Animation Name" since it's refering to the new name of a duplicated animation.
    * Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal".
* Fix wrong undo action name for renaming an input action.
* Fix missing end quote in a shader error message.
* In class reference:
    * Fix duplicated "if" in the description of `signf()`.
    * Fix mismatched example output in `String.operator %()`.
    * Fix typo in the description of `Decal.texture_emission`.
    * Unify description of `String.match()` and `StringName.match()`.
2023-02-13 15:22:18 +08:00
Rémi Verschelde bd92f124f7
Merge pull request #73060 from clayjohn/screen_texture-size
Avoid inserting screen_texture compatibility code when using textureSize
2023-02-11 14:37:30 +01:00
clayjohn 6c1c71d68b Avoid inserting screen_texture compatibility code when using textureSize 2023-02-10 13:03:02 -08:00
clayjohn 4317f6236f Do clear request before reading from render target when using CANVAS_BG 2023-02-10 12:12:34 -08:00
Rémi Verschelde ed85a2c8ce
Merge pull request #70663 from EpEpDragon/feature_buffer_get_data_size_option
Add optional size parameter to the RenderDevice buffer_get_data method.
2023-02-10 18:49:28 +01:00
Bastiaan Olij 694c8ec273 Add render buffer support to screen space effects 2023-02-10 10:27:59 +11:00
Markus Sauermann d249370cd7 Fix crash in editor when setting `SubViewport.size` to zero
`Viewport::_set_size` now verifies, that the minimum size is at least 2x2.
Also fix `RendererViewport::viewport_set_size` fail condition.
2023-02-10 00:25:45 +01:00
Haoyu Qiu a40ccc2d7e Improve some editor strings for localization 2023-02-09 19:32:02 +08:00
clayjohn 04a9933f2e Mark fma function as high end so it isn't used with the gl_compatibility renderer 2023-02-08 12:56:15 -08:00
Markus Sauermann 826e54fa73 Some code simplifications
1. `number_width` isn't used later
2. `return_type` is used only once
3. AudioServer::get_singleton()->get_channel_count() always returns a channel_count of 1 or larger
4. negative `aa->backward` conditional
5. `current_canvas` == `find_world_2d()->get_canvas()`
6. identical if `render_shadows`
2023-02-07 14:30:16 +01:00
clayjohn 56450fb179 Implement cull_mask for decals and lights in mobile and compatibility backends 2023-02-06 12:12:47 -08:00
Yuri Sizov 2bd5302704
Merge pull request #72695 from clayjohn/CanvasGroup-shading
Avoid shading CanvasGroup nodes twice
2023-02-04 21:38:25 +03:00
clayjohn dfbf439081 Avoid shading CanvasGroup nodes twice 2023-02-03 15:40:42 -08:00
Ricardo Buring 497f5576c1 Fix MultiMesh visible_instance_count being ignored after the first frame
Co-authored-by: Clay John <claynjohn@gmail.com>
2023-02-03 11:40:39 -08:00
Rémi Verschelde ddca070bea
Merge pull request #72631 from rburing/custom_aabb_update_dependency
Notify dependencies when setting custom mesh AABB
2023-02-03 06:24:51 +01:00
Rémi Verschelde ec3adb93f7
Merge pull request #72589 from BastiaanOlij/add_layer_slice_support
Add layer slice support to render device and render buffers
2023-02-03 06:24:43 +01:00
Bastiaan Olij 093289364f Add layer slice support to render device and render buffers 2023-02-03 09:48:56 +11:00
Ricardo Buring 086b9e0c59 Notify dependencies when setting custom mesh AABB
Fixes SoftBody3D culling issues.
2023-02-02 23:31:27 +01:00
Rémi Verschelde 9caf691c89
Merge pull request #72494 from Chaosus/shader_fix_const_init
Fix shader failure when using non-const initializer on a constant
2023-02-02 21:05:27 +01:00
Rémi Verschelde e52213e2fa
More codespell fixes, do more changes from previous ignore list 2023-02-01 12:11:36 +01:00
Yuri Rubinsky e034d5f764 Fix shader failure when using non-const initializer on a constant 2023-02-01 13:03:11 +03:00
Rémi Verschelde 7990b76ad8
Merge pull request #63829 from clayjohn/VULKAN-disable-multiview
Disable multiview shader versions when xr is disabled
2023-02-01 07:58:32 +01:00
Rémi Verschelde ab4d8df163
Merge pull request #72485 from BastiaanOlij/add_eye_matrix_access
Expose EYE_OFFSET to gdshader code
2023-02-01 07:33:18 +01:00
Rémi Verschelde 0ba7e5a40a
Merge pull request #72464 from clayjohn/RD-skeleton-crash
Check if Skeleton exists before reading when calculating blend shapes
2023-02-01 07:31:42 +01:00
Rémi Verschelde 3eb1ac9fd2
Merge pull request #72075 from Maran23/extents-to-size
Replace Extents with Size in VoxelGI, ReflectionProbe, FogVolume, Decal  and GPUParticles*3D
2023-02-01 07:30:09 +01:00
Bastiaan Olij 8c77aea9ab Expose EYE_OFFSET to gdshader code 2023-02-01 12:39:13 +11:00
Marius Hanl a59819630d Replace Extents with Size in VoxelGI, ReflectionProbe, FogVolume, Decal and GPUParticles*3D
- Extents are replaced by Size (Size is Extents * 2)
- The UI text displays 'Size'
- Snapping is adjusted to work with Size
- _set and _get handle extents for compatibility

Co-authored-by: ator-dev <dominic.codedeveloper@gmail.com>
2023-01-31 20:04:11 +01:00
clayjohn cdc6c00b5f Check if Skeleton exists before reading when calculating blend shapes 2023-01-31 10:10:31 -08:00
Rémi Verschelde 97de7f39e1
Merge pull request #72404 from clayjohn/RD-sky-crash
Fix various crashes relating to low roughness_layers
2023-01-31 10:54:41 +01:00
Rémi Verschelde c24e0065b2
Merge pull request #72433 from clayjohn/Pointlight2D-crash
Avoid crash when CanvasTexture used with light decal atlas
2023-01-31 10:54:02 +01:00
Rémi Verschelde 628967e6ba
Merge pull request #72343 from clayjohn/editor-canvas-bg
Remove viewport_set_disable_environment in favor of viewport_set_environment_mode
2023-01-31 10:53:05 +01:00
clayjohn cfd5fe0f29 Avoid crash when CanvasTexture used with light decal atlas
The decal atlas is used for Light2Ds, decals, and Light3Ds
2023-01-30 20:59:53 -08:00
clayjohn 9071809021 Remove viewport_set_disable_environment in favor of viewport_set_environment_mode
This allows us to set a default value inherited by child viewports and have child viewports set the value themselves which is needed for disabling the environment in the editor
2023-01-30 12:25:49 -08:00