Commit Graph

2597 Commits

Author SHA1 Message Date
clayjohn
37be585fdf Ensure fog_sky_affect is used even when using a background color 2024-08-16 14:11:08 -07:00
kevinkuo52
3388a4a360 pass in render_info to _fill_instance_data for alpha to fix overdraw call count 2024-08-16 08:59:36 -07:00
Rémi Verschelde
664ff6f7c4
Merge pull request #95547 from Chaosus/shader_fix_for_middle_expression
Fix middle expression of `for` loop to accept not only operators
2024-08-16 14:36:10 +02:00
Rémi Verschelde
0f9925c0f9
Merge pull request #95542 from KoBeWi/go_bind_yourself
Remove empty `bind_methods()`
2024-08-16 14:35:51 +02:00
Rémi Verschelde
851d0a764d
Merge pull request #95536 from jsjtxietian/rename-alpha-scissor
Fix undefined `alpha_scissor` in standard shader
2024-08-16 14:35:38 +02:00
Rémi Verschelde
9c77f57a1d
Merge pull request #95350 from Chaosus/shader_fix_for_loop_comma_crash
Fix shader crash when the comma used in `for` loop as a trailing
2024-08-16 14:33:42 +02:00
Rémi Verschelde
d1706b0200
Merge pull request #95450 from clayjohn/RD-local-device
Fail when submit or sync called on main rendering device
2024-08-16 10:36:09 +02:00
Rémi Verschelde
afbcd0810f
Merge pull request #95438 from clayjohn/SSR-roughness-fix
Use transformed roughness instead of raw roughness to calculate roughness fade in SSR
2024-08-16 10:36:03 +02:00
Rémi Verschelde
94e9b2e2af
Merge pull request #95379 from SlashScreen/fix_dir_light_layers
Consider visual layers for DirectionalLight
2024-08-16 10:35:44 +02:00
Rémi Verschelde
b1c624beb5
Merge pull request #95270 from Lssikkes/ls-multimesh-reset-only
Fix for multimesh motion vector corruption
2024-08-16 10:35:26 +02:00
Rémi Verschelde
5098ac587e
Merge pull request #94896 from jsjtxietian/carry-subgroup
Fix uniform subgroup in shader will carry out to next group
2024-08-16 10:35:00 +02:00
Rémi Verschelde
46c6865979
Merge pull request #92391 from rburing/fti_3d
Physics interpolation (3D)
2024-08-16 10:33:37 +02:00
Chaosus
3272f00525 Fix middle expression of for loop to accept not only operators 2024-08-15 10:29:19 +03:00
kobewi
065dd099dd Remove empty bind_methods() 2024-08-15 08:24:32 +02:00
jsjtxietian
970a237c20 Fix undefined alpha_scissor in standard shader 2024-08-15 11:44:11 +08:00
clayjohn
b5fd29e7bc Avoid indexing instances without a base in scene cull phase 2024-08-13 13:02:15 -07:00
Slashscreen
4457b11ff0 Apply patch for considering visual layers for DirectionalLight
Co-authored-by: majikayogames <152851004+majikayogames@users.noreply.github.com>
2024-08-13 08:45:38 -07:00
clayjohn
b0e33aa00f Fail when submit or sync called on main rendering device
Fail if submit or sync called multiple times in a row
2024-08-12 15:50:01 -07:00
clayjohn
b99d0d778a Use transformed roughness instead of raw roughness to calculate roughness fade in SSR 2024-08-12 12:04:16 -07:00
Hannah Crawford
a54b71bbdf Add shadow_caster_mask to Light3D. 2024-08-12 00:17:11 +01:00
Chaosus
d74749fd60 Fix shader crash when the comma used in for loop as a trailing 2024-08-10 11:23:11 +03:00
Sen
52cd5acdda Fix for multimesh motion vector corruption by resetting motion vector state and filling both halves of buffer 2024-08-08 16:19:31 +02:00
Chaosus
dc6f90acd8 Forbid function declaration with a const qualifier in shaders 2024-08-08 11:23:27 +03:00
Jamie Pate
f8c99efc3b
Fix LightmapGI causes crash when using --headless
Fixes #89119

Add dummy LightmapInstance and Lightmap resources for headless rendering

Prevents the RenderingServer from crashing when it accesses
lightmap_instance->base_data
2024-08-07 11:38:05 +02:00
Rémi Verschelde
52f22902c7
Merge pull request #94902 from clayjohn/SHADER-hints
Restrict sampler hint validation to only screen texture hints
2024-07-30 12:29:04 +02:00
Yuri Rubinsky
e41048e16e Fix texture samplers to not being last in the property list 2024-07-29 09:19:09 +03:00
clayjohn
a2f2699208 Restrict sampler hint validation to only screen texture hints 2024-07-28 22:31:57 -07:00
jsjtxietian
e6c45fbe5d Fix uniform subgroup in shader will carry out to next group 2024-07-29 11:07:09 +08:00
Bastiaan Olij
1eb0039b6e Fix regression around OpenGL swapchain optimisation for OpenXR 2024-07-29 12:46:58 +10:00
clayjohn
ba3457dfff Emit normal_roughness compatibility code in custom functions 2024-07-26 10:45:36 -07:00
jsjtxietian
38fad35356 Fix editor crash when shader has incorrect global array declaration 2024-07-26 11:53:11 +08:00
BlueCube3310
eb3b217777 RenderingDevice: Use the correct amount of layers for Cubemaps for boundary checks 2024-07-24 20:26:46 +02:00
Rémi Verschelde
62c88a4052
Merge pull request #94671 from Chaosus/shader_fix_varying
Fix shader crash when using a varying in separate func before it defined
2024-07-24 09:59:31 +02:00
Rémi Verschelde
139cf025c9
Merge pull request #94629 from RandomShaper/fix_undef_position
Fix position from vertex shader partially uninitialized
2024-07-24 09:59:24 +02:00
Feiyue Zhang
6f30df4b6a
Linearize color if HDR 2D is on 2024-07-24 09:49:50 +02:00
Yuri Rubinsky
965b2f6ca4 Fix shader crash when using a varying in separate func before it defined 2024-07-23 21:55:18 +03:00
BlueCube3310
741bb152ae RenderingDevice: Fix getting cubemap data 2024-07-23 13:44:28 +02:00
Pedro J. Estébanez
0064532c1e Fix position from vertex shader partially uninitialized 2024-07-23 09:04:54 +02:00
Yuri Rubinsky
574e61a542 Fix crash when assigning more textures than expected to texture array 2024-07-22 20:51:11 +03:00
Rémi Verschelde
587f1d0cb0
Merge pull request #92817 from Alex2782/fix_glsl_Mali-G
Fix glsl shader for Android Mali-GXXx GPUs and Vulkan API 1.3.xxx
2024-07-22 17:24:04 +02:00
Alexander Hartmann
78ede4f8b6 Fix glsl shader for Android Mali-GXXx GPUs and Vulkan API 1.3.xxx 2024-07-20 22:01:35 +02:00
Garteal
2606831d71 SDFGI: fix crash if update_data is nullptr 2024-07-19 18:27:32 +02:00
Rémi Verschelde
47e99d55b3
Merge pull request #94388 from BastiaanOlij/expose_more_methods_scene_buffers_rd
Expose more state in RenderSceneBuffersRD
2024-07-19 11:10:46 +02:00
Rémi Verschelde
ceb1801db2
Merge pull request #94492 from jsjtxietian/fsr-1
Add warning when use FSR1 on renderer other than forward plus
2024-07-18 10:45:50 +02:00
Rémi Verschelde
0f1e2c38a8
Merge pull request #94069 from RandomShaper/fix_vk_vali_blocky
RenderingDevice: Leave handling of compressed block granularity to the driver
2024-07-18 10:45:27 +02:00
Rémi Verschelde
590628feda
Merge pull request #86516 from jsjtxietian/fix-camera-direction
Fix incorrect `CAMERA_DIRECTION_WORLD` calculation
2024-07-18 10:45:20 +02:00
jsjtxietian
46ed290fef Add warning when use FSR1 on renderer other than forward plus 2024-07-18 12:10:18 +08:00
RedMser
f9258ff928 Fix typos 2024-07-17 18:53:03 +02:00
Rémi Verschelde
a963f111cb
Merge pull request #94462 from jsjtxietian/more-type
Make ShaderLanguage's parser recognize sampler passed in from array
2024-07-17 12:24:11 +02:00
Rémi Verschelde
c5e5fa3d9f
Merge pull request #94289 from clayjohn/MOBILE-multimesh-spec-constant
Use a spec constant to control whether the MultiMesh branch is used in the vertex shader.
2024-07-17 12:24:01 +02:00
Rémi Verschelde
c2375d0b12
Merge pull request #94184 from mertkasar/ssr-rotation-fix
Fix SSR orientation issues when using orthogonal camera
2024-07-17 11:43:25 +02:00
Rémi Verschelde
0268ceaa5c
Merge pull request #94064 from bruvzg/lcd_aa_modulate
Fix LCD font AA modulation in RendererRD.
2024-07-17 11:43:03 +02:00
jsjtxietian
3859817614 Make shaderLanguage's parser recognize sampler passed in from array 2024-07-17 16:52:44 +08:00
Yuri Rubinsky
eb4bbbb02d Fix multiple ternary expressions to be used without parenthesis 2024-07-17 10:34:17 +03:00
Alvin Wong
4091abd727 Respect integrated GPU preference in Windows Settings 2024-07-16 23:46:37 +08:00
Bastiaan Olij
9442eb8194 Expose more state in RenderSceneBuffersRD 2024-07-15 22:04:10 +10:00
Robert Borghese
1052985b00 Add hint_enum for uniform int in gdshader 2024-07-13 14:30:08 -04:00
clayjohn
4cbc967f50 Use a spec constant to control whether the MultiMesh branch is used in the vertex shader.
This works around a bug on the Quest3 and slightly improves performance on all mobile devices at the cost of increased pipeline count.
2024-07-12 15:44:06 -07:00
Mert Kasar
56ed2cb6d1 Fix SSR orientation issues when using orthogonal camera
- Use negative clip space values to fix reversed rotations in reflections
- Use constant -z view vector when raymarching to fix perspective in reflections
2024-07-12 21:56:31 +03:00
Rémi Verschelde
198e55e402
Merge pull request #94153 from clayjohn/SSAO-linearize
Properly linearize depth buffer for SSAO when using orthogonal camera
2024-07-11 00:27:43 +02:00
Rémi Verschelde
f5bb5db8ae
Merge pull request #94135 from Calinou/vulkan-swapchain-resize-error-fail-silently
Silence Vulkan "Unable to acquire framebuffer." swapchain error
2024-07-11 00:27:36 +02:00
Rémi Verschelde
46e8377a5e
Merge pull request #93960 from BastiaanOlij/fix_mobile_compositor
Pre transparent compositor effects needs to run later
2024-07-11 00:27:06 +02:00
clayjohn
e0f736ec10 Properly linearize depth buffer for SSAO when using orthogonal camera 2024-07-09 15:29:45 -07:00
Hugo Locurcio
cf2d2e2dd8
Silence Vulkan "Unable to acquire framebuffer." swapchain error
This error is harmless and can be safely ignored.
2024-07-09 17:12:54 +02:00
Rémi Verschelde
40cb283dd7
Merge pull request #93866 from Chaosus/shader_fix_global_func_set
Improve code for setup of `global_func_set` in `ShaderLanguage`
2024-07-09 16:47:13 +02:00
Rémi Verschelde
6f9c0aa40d
Merge pull request #93630 from BastiaanOlij/scene_data_projection_correction
Make RenderSceneData take projection correction into account
2024-07-09 00:03:14 +02:00
Pedro J. Estébanez
00e89229bf RenderingDevice: Leave handling of compressed block granularity to the driver 2024-07-08 11:58:51 +02:00
bruvzg
4790e12f66
Fix LCD font AA modulation in RendererRD. 2024-07-08 11:17:31 +03:00
Ricardo Buring
2f8ab4a654 Fixed Timestep Interpolation (3D)
Adds 3D fixed timestep interpolation to the rendering server.
This does not yet include support for multimeshes or particles.

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-07-07 22:15:23 +02:00
Rémi Verschelde
7197678df2
Merge pull request #91551 from m4rr5/configure_timestamp_query_elements
Add a project setting to configure the maximum number of timestamps.
2024-07-07 12:38:19 +02:00
Bastiaan Olij
e42870b4d1 Pre transparent compositor effects needs to run later 2024-07-05 12:37:26 +10:00
Yuri Rubinsky
4f657f5c6d Improve code for setup of global_func_set in ShaderLanguage 2024-07-02 18:16:04 +03:00
Yuri Rubinsky
dc78ef1722 Fix orphan StringName's in ShaderLanguage 2024-07-02 09:27:40 +03:00
Yuri Rubinsky
4bf9f3eb58 Prevent shader crash when doing invalid operation on boolean vector 2024-06-30 22:24:25 +03:00
Mark DiBarry
6b17d51425 Add alternative pixel rounding 2024-06-29 10:33:39 -04:00
Pedro J. Estébanez
32d9c93af3 Improve handling of rendering startup errors 2024-06-28 19:31:50 +02:00
Rémi Verschelde
a365cf59c8
Merge pull request #93635 from Chaosus/shader_fix_vec4_uniform
Use `PackedVector4Array` instead of float array for vec4 array uniform
2024-06-28 14:42:57 +02:00
Yuri Rubinsky
72c7e51905 Use PackedVector4Array instead of float array for vec4 array uniform 2024-06-28 13:34:43 +03:00
clayjohn
27b040dc61
Remove warning when project setting requests a larger global shader uniform buffer than the hardware supports.
Instead provide a better error message when the limit is exceeded and avoid crash with a small limit.
2024-06-28 10:38:18 +02:00
ze2j
37479cfad5 Remove useless instantiation in RDShaderFile::parse_versions_from_text 2024-06-27 08:57:06 +02:00
Bastiaan Olij
6ed6212949 Make RenderSceneData take projection correction into account 2024-06-27 10:44:30 +10:00
Rémi Verschelde
ba3bb44194
Merge pull request #93617 from jsjtxietian/protect-enum
Add safety check when setting several rendering effect quality
2024-06-26 14:51:25 +02:00
jsjtxietian
a313fa13fd Add safety check when setting several rendering effect quality 2024-06-26 17:06:21 +08:00
ueshita
e1d6ab4c80 Fix userdata not copied when trails started 2024-06-25 23:33:26 +09:00
Rémi Verschelde
2e8ebb4a5e
Merge pull request #93469 from Chaosus/shader_fix_crash
Fix crash on shader constant initialization on MinGW compiler
2024-06-25 10:01:46 +02:00
Yuri Rubinsky
d5b393a268 Fix crash on shader constant initialization on MinGW compiler 2024-06-22 16:36:54 +03: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
Yuri Rubinsky
ae95531e64 Forbid calling of derivative functions in incorrect functions 2024-06-21 20:47:21 +03:00
Rémi Verschelde
a57c7208eb
Merge pull request #93376 from stuartcarnie/sgc/canvasrd_dead_code
Remove unused flag and code from canvas renderer
2024-06-20 16:18:53 +02:00
Stuart Carnie
98e9578d66
Remove unused flag and code
Related #48894
2024-06-20 13:50:20 +10:00
ChristopheClaustre
c46bb775e9 Disable camera_effects on some debug draw mode 2024-06-19 16:45:58 +02:00
Rémi Verschelde
76a8fa6fed
Merge pull request #93292 from rune-scape/singleton-cleanup
Fix missing cleanup and null checks for various singletons
2024-06-18 14:09:01 +02:00
rune-scape
6adcb1373a fix missing cleanup and null checks for various singletons 2024-06-18 01:05:30 -07:00
Yuri Rubinsky
3d2b70c1ec Prevent changing some built-ins in spatial shaders 2024-06-17 19:18:14 +03:00
markdibarry
95813793b4 Add repeats in ysort child collection 2024-06-15 10:53:32 -04:00
Rémi Verschelde
756102828e
Merge pull request #93055 from clayjohn/MV-debug
Ensure Motion Vectors are enabled by particles and skeletons when using the Motion Vector debug draw option
2024-06-12 18:17:03 +02:00
Rémi Verschelde
7571f82bea
Merge pull request #92763 from markdibarry/parallax2d_cull_fix
Fix incorrect cull boundary for scaled and repeated Parallax2D children
2024-06-12 11:01:05 +02:00
Bastiaan Olij
1690ede988 Track compositor effects that use motion vectors so we enable required logic 2024-06-12 12:37:18 +10:00
clayjohn
fa3e00e2c4 Ensure Motion Vectors are enabled by particles and skeletons when using the Motion Vector debug draw option 2024-06-11 12:46:56 -07:00
markdibarry
f0983f1b1c Add cull fix for scale repeat 2024-06-04 11:52:34 -04:00
Rémi Verschelde
705b7a0b0b
Merge pull request #92587 from RandomShaper/validate_tex_usage
RenderingDevice: Reject creation of textures with no usage
2024-05-31 14:16:55 +02:00
Rémi Verschelde
8b044da396
Merge pull request #92474 from Rudolph-B/fix-collided-particles-jittering
Fix collided 3D GPU particles sometimes jittering
2024-05-31 14:16:46 +02:00
Rémi Verschelde
138f334316
Merge pull request #92444 from clayjohn/RD-srgb-uniform-buffer
Separate linear and sRGB uniform buffers in RD rendering backends
2024-05-31 14:16:43 +02:00
Rémi Verschelde
f2796fa06d
Merge pull request #91769 from DarioSamo/d3d12_enhanced_barriers
Add support for enhanced barriers in D3D12.
2024-05-31 14:15:49 +02:00
Pedro J. Estébanez
3e5865660b RenderingDevice: Reject creation of textures with no usage 2024-05-31 12:00:58 +02:00
Yuri Rubinsky
aecc4cbc47 Prevent using built-ins for func names in shaders 2024-05-30 21:33:21 +03:00
clayjohn
3b9d074fd7 Ensure MovieWriter output is in gamma space when using HDR 2D 2024-05-28 15:30:13 -07:00
Rémi Verschelde
1e6b11dcd4
Merge pull request #92287 from clayjohn/LOD-safe-fixes
Fix LOD selection in compatibility backend and clean up LOD code
2024-05-28 18:06:45 +02:00
Rudolph Bester
f666c76a9c Fixed collided 3D GPU particles sometimes jittering 2024-05-28 14:09:08 +02:00
Yuri Rubinsky
246a760323 Fix completion of functions with struct param/return type in shaders 2024-05-28 12:13:25 +03:00
clayjohn
c6b08d462a Separate linear and sRGB uniform buffers in RD rendering backends 2024-05-27 13:38:49 -07:00
Rémi Verschelde
abfe8ba7d6
Merge pull request #92258 from DarioSamo/render_list_pass_alloc
Reduce allocations each time a render pass begins in RenderingDevice.
2024-05-23 23:25:51 +02:00
Rémi Verschelde
68c8e2eaf3
Merge pull request #92244 from jsjtxietian/blend-shape-shadow
Fix mesh instance not updated when changing blend shape values
2024-05-23 23:25:48 +02:00
clayjohn
267ea14616 Fix LOD selection in compatibility backend and clean up LOD code 2024-05-23 11:30:22 -07:00
Dario
ce4f19a034 Switch vectors in each render pass to use TLS. 2024-05-23 10:52:29 -03:00
bruvzg
628c81d2d9
[DisplayServer] Add method to check if window transparency is supported and enabled. 2024-05-23 15:23:18 +03:00
jsjtxietian
97af135f1b Fix mesh instance not updated when changing blend shape values 2024-05-23 12:36:31 +08:00
Rémi Verschelde
8e2141eac5
Merge pull request #92232 from clayjohn/RD-mobile-LOD
Only apply LOD when camera is outside the AABB of mesh in mobile renderer.
2024-05-22 09:27:03 +02:00
clayjohn
c5346a62b0 Only apply LOD when camera is outside the AABB of mesh in mobile renderer.
This copies the existing logic from the Forward+ renderer
2024-05-21 18:32:04 -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
Rémi Verschelde
008fd5fee6
Merge pull request #92078 from lawnjelly/increase_tight_cull_epsilon
Tight shadow culling - increase epsilon to prevent flickering
2024-05-21 11:22:47 +02:00
Dario
adabd14d08 Add support for enhanced barriers in D3D12.
Enables support for enhanced barriers if available.

Gets rid of the implementation of [CROSS_FAMILY_FALLBACK] in the D3D12 driver. The logic has been reimplemented at a higher level in RenderingDevice itself.

This fallback is only used if the RenderingDeviceDriver reports the API traits and the capability of sharing texture formats correctly. Aliases created in this way can only be used for sampling: never for writing. In most cases, the formats that do not support sharing do not support unordered access/storage writes in the first place.
2024-05-20 13:04:44 -03:00
Rémi Verschelde
6aece8e1b6
Merge pull request #92045 from RandomShaper/context_getter
Add context getter to RenderingDevice
2024-05-18 17:41:38 +02:00
lawnjelly
512b0f16a3 Tight shadow culling - increase epsilon to prevent flickering
Near colinear triangles were still causing inaccuracy in culling planes, so the threshold for colinearity is bumped up.
2024-05-18 14:14:27 +01:00
Rémi Verschelde
d3e261523f
Merge pull request #88289 from DarioSamo/rd_minimized_window
Fix swap chain errors when application starts minimized.
2024-05-17 11:13:31 +02:00
Pedro J. Estébanez
ffa791c41f Add context getter to RenderingDevice 2024-05-17 09:56:03 +02:00
Rémi Verschelde
5708a3a02e
Merge pull request #92000 from clayjohn/vram-debugger
Increase coverage of VRAM debugger and add support to RD backends
2024-05-16 09:32:11 +02:00
clayjohn
c84616c2d2 Increase coverage of VRAM debugger and add support to RD backends 2024-05-15 16:30:19 -07:00
Dario
61cd007cf4 Rewrite implementation for prepare for use commands to be skipped when not required by the API. 2024-05-15 14:34:52 -03:00
Rémi Verschelde
c9fdcde20f
Merge pull request #91642 from BastiaanOlij/fix_transparent_sky
Skip rendering sky if viewport is set to transparent background
2024-05-14 12:06:44 +02:00
Rémi Verschelde
db3c4a4612
Merge pull request #91514 from DarioSamo/adreno_workaround
Add optional driver workaround to RenderingDevice for Adreno 6XX.
2024-05-14 12:06:37 +02:00
Dario
d5789e09eb Add optional driver workaround to RenderingDevice for Adreno 6XX.
Co-authored-by: Clay John <claynjohn@gmail.com>
2024-05-13 10:20:31 -03:00
Yaohua Xiong
ed3d311687 Add antialias support for CanvasItem draw primitives
including
- rect, circle; both filled and unfilled.
- polyline, multiline
2024-05-13 19:03:31 +08:00
Rémi Verschelde
c322a9b7ee
Merge pull request #91808 from DarioSamo/debug_mv_msaa
Do not use MSAA versions of textures on debug views.
2024-05-13 12:05:46 +02:00
Bastiaan Olij
6efaaecde2 Skip rendering sky if viewport is set to transparent background 2024-05-13 11:04:06 +10:00
Dario
a3ecc86f47 Do not use MSAA versions of textures on debug views. 2024-05-10 14:01:58 -03:00
Dario
3f64eeb393 Rewrite reprojection for FSR2 to work correctly with Reverse-Z. 2024-05-10 11:57:27 -03:00
lawnjelly
a76243a549 Tighter light culling - fix directional lights colinear case
Exactly the same fix as done already for non-directional lights.
2024-05-10 09:13:05 +01:00
Pedro J. Estébanez
1589433e8f Apply additional fixes to servers' threading 2024-05-08 17:41:40 +02:00
A Thousand Ships
a0dbdcc3ab
Replace find with contains/has where applicable
* Replaces `find(...) != -1` with `contains` for `String`
* Replaces `find(...) == -1` with `!contains` for `String`
* Replaces `find(...) != -1` with `has` for containers
* Replaces `find(...) == -1` with `!has` for containers
2024-05-08 12:37:42 +02:00
Rémi Verschelde
7d03b1de0b
Style: Trim trailing whitespace and ensure newline at EOF
Found by apply the file_format checks again via #91597.
2024-05-08 10:12:46 +02:00
Rémi Verschelde
259d576f6e
Merge pull request #91480 from clayjohn/Mobile-mipmaps-bug
Use a full screen triangle for mipmap calculations in mobile renderer
2024-05-07 14:25:42 +02:00
Rémi Verschelde
4b070e8031
Fix various typos with codespell
Using 2.2.7.dev217+g10c2abcf.

Had to add `colour` to the ignore list as we used it as an alias/keyword for the
documentation of color-related APIs.
Also ignore recommendations to change `thirdparty` to either `third-party` or
`third party`, which are correct but we use the former fairly consistently.
2024-05-07 10:08:42 +02:00
Rémi Verschelde
e63252b421
Merge pull request #90705 from AThousandShips/foreach_list
Reduce and prevent unnecessary random-access to `List`
2024-05-07 09:04:44 +02:00
Marcel Offermans
2bb34a4489 Added a project setting to configure the maximum amount of timestamps, with a description and a reference to the setting when the limit is hit and an ERR_FAIL_COND is hit. 2024-05-05 09:09:04 +02:00
Rob Blanckaert
64c04d95aa Fix shader error on mobile when using LIGHT_VERTEX 2024-05-04 11:02:05 -07:00
A Thousand Ships
955d5affa8
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
Rémi Verschelde
7ebc866418
Merge pull request #91545 from clayjohn/RD-shadow-atlas
Properly set size of shadow atlas quadrant when subdivision is 8 or higher.
2024-05-04 11:52:45 +02:00
Rémi Verschelde
f236b9badc
Merge pull request #91530 from DarioSamo/timestamp_validation
Add draw and dispatch count to timestamp validation.
2024-05-04 11:52:41 +02:00
Rémi Verschelde
a2fc5e2d78
Merge pull request #89894 from BastiaanOlij/improve_foveated_rendering
Improvements to VRS/Foveated rendering
2024-05-04 11:52:15 +02:00
clayjohn
caeef3473b Properly set size of shadow atlas quadrant when subdivision is 8 or higher.
Also fix renderpass rect validation
2024-05-03 17:11:05 -07:00
Dario
c41e407e61 Add draw and dispatch count to timestamp validation. 2024-05-03 14:23:38 -03:00
Rémi Verschelde
03e6fbb010
Merge pull request #85474 from fire/packedvector4array
Add `PackedVector4Array` Variant type
2024-05-03 12:25:26 +02:00
Bastiaan Olij
9042ddf19f Improvements to VRS/Foveated rendering 2024-05-03 17:20:30 +10:00
A Thousand Ships
6ff6a11424
[Rendering] Add hints to some uniform PropertyInfos
* Enforce range on `int/uint`
* Use flags for `bvec2/3/4` arrays
2024-05-03 08:56:47 +02:00
K. S. Ernest (iFire) Lee
f9b488508c
Add PackedVector4Array Variant type
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2024-05-03 00:58:27 +02:00
clayjohn
bebf85487e Use a full screen triangle for mipmap calculations in mobile renderer 2024-05-02 13:17:09 -07:00
A Thousand Ships
308dbb8c63
[Core] Add scalar versions of Vector* min/max/clamp/snap(ped)
Convenience for a number of cases operating on single values
2024-05-02 10:31:13 +02:00
Rémi Verschelde
f91db3dc58
Merge pull request #91399 from QbieShay/qbe/fix-pmul-name
Revert premul alpha to spell without the T
2024-05-01 23:47:46 +02: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
Chris Clyne
44364faee5 Ensure global shader sampler parameters are initialized when loading the editor 2024-05-01 18:12:46 +01:00
Rémi Verschelde
7733ecd1ee
Merge pull request #91344 from tactical-fluke/vk_fix_unshaded_sdfgi
Fix SDFGI being used in unshaded debug draw
2024-05-01 09:55:18 +02:00
Rémi Verschelde
70247adf25
Merge pull request #89734 from BastiaanOlij/openxr_reorder_wait_frame
OpenXR: Change timing of xrWaitFrame and fix XR multithreading issues
2024-05-01 09:54:51 +02:00
Bastiaan Olij
cbab7dc049 OpenXR: Change timing of xrWaitFrame and add thread safety features to OpenXR 2024-05-01 14:24:41 +10: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
tactical-fluke
216c9a6bd9 Fix SDFGI being used in unshaded debug draw
Fixes #62758
2024-04-30 11:28:29 +08:00
Dario
21bd59cdaa Fix incorrect memory read when capacity changes in RD Graph. 2024-04-29 10:48:48 -03:00
Rémi Verschelde
947f5a8741
Merge pull request #91247 from AThousandShips/callable_fix
Fix unsafe uses of `Callable.is_null()`
2024-04-29 10:10:32 +02:00
Rémi Verschelde
9f336a2953
Merge pull request #91219 from Lateasusual/particle-height-field-upside-down
Fix inverted GPUParticlesCollisionHeightField3D
2024-04-29 10:10:12 +02:00
Rémi Verschelde
7cd6ea0f7e
Merge pull request #91183 from KoBeWi/small_stuff
Misc code cleanup
2024-04-29 10:09:57 +02:00
A Thousand Ships
31e7ee63f2
Fix unsafe uses of Callable.is_null()
`Callable.is_null()` is not equivalent to `!Callable.is_valid()` and
doesn't guarantee the call is valid.
2024-04-27 16:22:57 +02:00
Chris Clyne
1ca0eeac28 Fix inverted GPUParticlesCollisionHeightField3D 2024-04-26 17:30:50 +01:00
kobewi
914528180f Misc code cleanup 2024-04-26 15:30:21 +02:00
Bastiaan Olij
d2d22748b4 Fix issue in shadow to opacity 2024-04-26 21:54:26 +10:00
Rémi Verschelde
853740e2ad
Merge pull request #91191 from clayjohn/RD-soft-shadows
Properly calculate penumbra for soft shadows with reverse z
2024-04-26 11:09:02 +02:00
Rémi Verschelde
a07f89bfb2
Merge pull request #91176 from clayjohn/GL-adjustments
Add adjustments and color correction to Compatibility renderer
2024-04-26 11:08:56 +02:00
Rémi Verschelde
22c8a2785d
Merge pull request #90920 from clayjohn/2D-light-cull
Exit light calculation early when pixel outside of light bounding rectangle
2024-04-26 11:08:29 +02: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
clayjohn
e8bb0a5719 Add adjustments and color correction to Compatibility renderer 2024-04-25 12:24:51 -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
Rémi Verschelde
a754bbc565
Merge pull request #91059 from BastiaanOlij/fix_multiview_copy
Fix issue with copy shader not working in multiview
2024-04-23 19:12:24 +02:00
Rémi Verschelde
258be6d762
Merge pull request #90911 from clayjohn/RD-tex-copy
Ensure minimum block size is respected when doing GPU to CPU copies of compressed textures
2024-04-23 19:11:51 +02:00
Rémi Verschelde
99cff796ea
Merge pull request #90883 from cosparks/fix-sdf-collision-2d
Fix LightOccluder2D SDF Collision Enable/Disable
2024-04-23 19:11:40 +02:00
Rémi Verschelde
a55ffba31b
Merge pull request #90620 from thimenesup/fix_push_constant
Fix incorrect bounds check in RenderingDevice push constant
2024-04-23 19:11:17 +02:00
Bastiaan Olij
226ca2f04c Fix issue with copy shader not working in multiview 2024-04-23 21:46:39 +10:00
cosparks
6d0dca76c0 Fixes SDF Collision Enable/Disable
- sets LightOccluderInstance field when sdf collision is updated
- adds check for light occluder sdf_collision field in 2d renderers
2024-04-22 20:27:56 -07:00
clayjohn
506e93a207 Exit light calculation early when pixel outside of light bounding rectangle
This hugely improves the performance of rendering PointLight2Ds
2024-04-19 16:10:11 -07:00
clayjohn
c52e217cd3 Ensure minimum block size is respected when doing GPU to CPU copies of compressed textures 2024-04-19 10:17:17 -07:00
Rémi Verschelde
993d15da17
Merge pull request #90821 from clayjohn/RD-clip-children-rect
Use a src rect for copying from screen with CanvasGroup in the mobile backend
2024-04-19 16:27:41 +02:00
clayjohn
eb62c5b27f Revert change to default depth clear value in draw_list_begin 2024-04-17 19:08:22 -07:00
clayjohn
adfc9ccc44 Use a src rect for copying from screen with CanvasGroup in the mobile backend 2024-04-17 15:19:20 -07:00
Oxi
1815871b90 Fixed unshaded mode lightmaps 2024-04-17 10:38:54 +01:00
Rémi Verschelde
ce13f0c033
Merge pull request #90749 from kleonc/y-sort-branch-root-transform-fix
Fix rendering transform of Y-sorted branch-root
2024-04-17 10:58:58 +02:00
kleonc
983cdb2f54 Fix transform of Y-sorted branch-root 2024-04-16 14:26:47 +02:00
Rémi Verschelde
8901e8776a
Merge pull request #90587 from clayjohn/reversez-shader-warn
Warn users when assigning `VERTEX` directly to `POSITION` due to compatibility breakage from Reverse Z changes
2024-04-16 13:30:47 +02:00
thimenesup
1ab5a47347 Fix incorrect bounds check in rendering device push constant 2024-04-13 14:53:19 +02:00
clayjohn
2f83b400a8 Warn users when assigning VERTEX directly to POSITION due to compatibility breakage from reverse z changes 2024-04-12 10:38:35 -07:00
Juan Linietsky
65686dedf9 Use WorkerThreadPool for Server threads
* Servers now use WorkerThreadPool for background computation.
* This helps keep the number of threads used fixed at all times.
* It also ensures everything works on HTML5 with threads.
* And makes it easier to support disabling threads for also HTML5.

CommandQueueMT now syncs with the servers via the WorkerThreadPool
yielding mechanism, which makes its classic main sync semaphore
superfluous.

Also, some warnings about calls that kill performance when using
threaded rendering are removed because there's a mechanism that
warns about that in a more general fashion.

Co-authored-by: Pedro J. Estébanez <pedrojrulez@gmail.com>
2024-04-10 18:47:42 +02:00
Pedro J. Estébanez
c28f5901c7 Polish interaction between windowing, input and rendering
- Adapt GL make/release API to the current architecture.
- Fix DisplayServer being locked while dispatching input (prevent deadlocks).
2024-04-10 18:47:42 +02:00
Rémi Verschelde
5c75fa260f
Merge pull request #90458 from clayjohn/RD-weight-buffer
Clear RIDs of weight buffers when freeing to avoid double free
2024-04-10 14:22:37 +02:00
Rémi Verschelde
258f2705f6
Merge pull request #90440 from Calinou/geometryinstance3d-fix-custom-aabb-assignment
Fix GeometryInstance3D Custom AABB assignment in the editor not working
2024-04-10 14:22:33 +02:00
Rémi Verschelde
50b89e6c56
Merge pull request #89752 from ze2j/fix_false_positive_errors_in_gdshaderinc_files
Fix false positive errors in gdshaderinc files
2024-04-10 14:22:00 +02:00
Rémi Verschelde
c59f493620
Merge pull request #89729 from jitspoe/master.shadow_distance_fade_optimization
Shadow fade for omni lights actually stops the shadow from updating while faded out to improve performance.
2024-04-10 14:21:56 +02:00
clayjohn
bafbde9f4b Clear RIDs of weight buffers when freeing to avoid double free 2024-04-09 17:52:05 -07:00
Hugo Locurcio
084b8d1246
Fix GeometryInstance3D Custom AABB assignment in the editor not working
This also fixes error spam when changing Custom AABB on a MeshInstance3D
that has no Mesh resource assigned yet (which is allowed in the editor).
This avoids pitfalls when assigning a custom AABB in a script when
loading meshes at runtime.
2024-04-09 19:02:43 +02:00
Rémi Verschelde
9cba6ec216
Merge pull request #89491 from thimenesup/compute_dispatch_indirect
Expose bindings to compute dispatch indirect of rendering device
2024-04-09 10:42:22 +02:00
thimenesup
8017c8cf21 Expose bindings to compute dispatch indirect rendering device 2024-04-08 20:46:53 +02:00
jsjtxietian
5a5453bcf2 Fixes RenderingDevice::get_driver_resource will crash or give incorrect result with certain resources 2024-04-08 12:31:22 +08:00
Rémi Verschelde
c1b2cfdced
Merge pull request #90271 from DarioSamo/pipeline_cache_setting
Add toggle for enabling or disabling RenderingDevice's pipeline cache.
2024-04-06 13:06:47 +02:00
Rémi Verschelde
10d67e590d
Merge pull request #90191 from BastiaanOlij/fix_mobile_canvas_copy
Don't use subpasses when we're using Canvas background mode in Mobile
2024-04-06 13:06:37 +02:00
Dario
ecaafa6001 Add toggle for enabling or disabling RenderingDevice's pipeline cache. 2024-04-05 13:14:07 -03:00
Rémi Verschelde
b5064a6160
Merge pull request #89714 from lawnjelly/tighter_light_cull_colinear_fix
Tighter shadow culling - fix light colinear to frustum edge
2024-04-05 12:15:53 +02:00
Rémi Verschelde
0c71ba7801
Merge pull request #89880 from dsnopek/openxr-composition-layers-node3d-drs
Add support for OpenXR composition layers
2024-04-04 17:09:07 +02:00
David Snopek
0f2b804059 Add support for OpenXR composition layers
Co-authored-by: Bastiaan Olij <mux213@gmail.com>
2024-04-04 09:20:23 -05:00
Rémi Verschelde
550f5a577f
Merge pull request #90055 from Sauermann/fix-add-tbg-check
Add early return when setting `transparent_bg`
2024-04-04 14:36:54 +02:00
Rémi Verschelde
64c4a53a2c
Merge pull request #89849 from EIREXE/cute_and_funny_decals
Fix decal modulate being passed as srgb instead of as linear color.
2024-04-04 14:31:53 +02:00
Rémi Verschelde
a28be933ee
Merge pull request #89398 from clayjohn/visual-debugger-coverage
Increase coverage of timestamps for visual profiler
2024-04-04 14:31:19 +02:00
Rémi Verschelde
69a4ff8996
Merge pull request #88328 from Khasehemwy/reversed-z
Use Reverse Z for the depth buffer
2024-04-04 14:30:53 +02:00
Khasehemwy
d950f5f838
Use Reverse Z for the depth buffer 2024-04-04 13:54:15 +02:00
Bastiaan Olij
9e9a6fb6d6 Can't use subpasses when we're using Canvas background mode in Mobile 2024-04-04 15:59:11 +11:00
clayjohn
ac6c648645 Increase coverage of timestamps for visual profiler 2024-04-03 19:29:02 -07:00
lawnjelly
691854d589 Jitter raster occlusion camera to reduce false positives.
Due to the low resolution of the occlusion buffer, small gaps between occluders can be closed and incorrectly occlude instances which should show through the gaps. To ameliorate this problem, this PR jitters the occlusion buffer over time, making it more likely an instance will be seen through a gap. This is used in conjunction with an occlusion timer per instance, to prevent instances flickering on and off rapidly.
2024-04-03 12:18:45 +01:00
Markus Sauermann
d14a84a166 Add early return when setting transparent_bg
Fix memory leak on Mac.
2024-03-30 22:33:54 +01:00
Rémi Verschelde
2597f60de1
Merge pull request #88830 from beiller/bugfix/taa_xr_fix
Add fix for TAA passes rendering black meshes on XR
2024-03-26 13:45:10 +01:00
jitspoe
a0969a0931 Shadow fade for omni lights actually stops the shadow from updating while faded out to improve performance. 2024-03-25 21:25:56 -04:00
Erik Johnson
532630e7cd Fix volumetric fog artifacts when inside the fog 2024-03-24 14:15:22 -04:00
Álex Román Núñez
2f0ba1ed3f Fix decal modulate being passed as srgb instead of as linear color. 2024-03-24 14:59:43 +01:00
Rémi Verschelde
70c05f63da
Merge pull request #89531 from sullyscience/fix-resource-leaks
Fix mobile renderer RID leaks
2024-03-24 01:16:48 +01:00
Rémi Verschelde
cd4e4c0fcc
Merge pull request #89111 from AThousandShips/vec_use
Use `Vector*` component-wise `min/max/clamp` functions where applicable
2024-03-24 01:14:51 +01:00
Ricardo Buring
2ed2ccc2d8 Fixed Timestep Interpolation (2D)
Adds fixed timestep interpolation to the rendering server (2D only).
Switchable on and off with a project setting (default is off).

Co-authored-by: lawnjelly <lawnjelly@gmail.com>
2024-03-23 12:28:36 +01:00
ze2j
993cd25ff2 Fix false positive errors in gdshaderinc files
These language features are wrongly detected as errors (not supported)
when used in gdshaderinc files:
- instance uniforms
- hint_normal_roughness_texture
- hint_depth_texture

This type of error should only occur when the shader type is not spatial
and not a gdshaderinc file.
2024-03-21 15:46:41 +01:00
lawnjelly
70cd25f3eb Tighter shadow culling - fix light colinear to frustum edge
In rare situations if a light is placed near colinear to a frustum edge, the extra culling plane derived can have an inaccurate normal due to floating point error.
This PR detects colinear triangles, and prevents adding a culling plane in this situation.
2024-03-20 16:47:54 +00:00
A Thousand Ships
79ba22a73f
Use Vector* component-wise min/max/clamp functions where applicable 2024-03-20 13:47:42 +01:00
David Sullivan
dfa326ef55 Fix: Address mobile resource leaks in render
Update render_forward_mobile destructor to include instance buffers.
Update render_scene_buffers_rd cleanup to include weight buffers / blur
textures.
2024-03-15 14:48:12 -04:00
Rémi Verschelde
3e79cdbee2
Merge pull request #89450 from RandomShaper/fix_inside_lights
Fix missed light clusters when inside clipped lights
2024-03-14 22:34:56 +01:00
Rémi Verschelde
453485aede
Merge pull request #89270 from Repiteo/enforce-typename-in-templates
Enforce template syntax `typename` over `class`
2024-03-14 22:34:37 +01:00
Pedro J. Estébanez
605fdb655c Fix missed light clusters when inside clipped lights 2024-03-13 23:38:46 +01:00
Aaron Franke
9e0b38ecd3 Disable XR server when compiling without 3D 2024-03-13 09:02:10 -07:00
Pedro J. Estébanez
49625beac2 Ensure specialization constants come sorted from reflection 2024-03-12 14:42:01 +01:00
Rémi Verschelde
f040a351c2
Merge pull request #89381 from aaronfranke/disable-3d
Disable all 3D nodes, physics, and resources when compiling without 3D
2024-03-11 14:02:57 +01:00
Aaron Franke
6aac3e4a16 Disable all 3D nodes, physics, and resources when compiling without 3D 2024-03-11 01:00:55 -07:00
Bastiaan Olij
df8ff797b7 Consistantly use USE_MULTIVIEW as the define in shaders 2024-03-11 14:40:00 +11:00
Rémi Verschelde
5c6614fd52
Merge pull request #89281 from permelin/fix-lm-capture-octant
Fix lightmap captures not applied in one octant
2024-03-09 00:52:19 +01:00
Rémi Verschelde
ffc41fb76d
Merge pull request #89277 from RandomShaper/rdd_public_shader_desc
Make `ShaderDescription` and related types public
2024-03-08 13:09:50 +01:00
Rémi Verschelde
f8140a4e9a
Merge pull request #89253 from Calinou/debug-draw-modes-ignore-decals-2
Make Overdraw, Lighting and Shadow Splits debug draw modes ignore decals
2024-03-08 13:09:40 +01:00
Rémi Verschelde
cebaf9dac5
Merge pull request #89042 from permelin/fix-particle-trail-activation
Fix early activation of particle trail sections
2024-03-08 13:09:25 +01:00
Per Melin
46610117d3 Fix lightmap capture not applied in one octant
GI from probe captures was not applied to dynamic objects in the (-,-,-)
octant of the lightmap. If the object had traveled from a different part
of the lightmap, it would simply not update anymore and kept whatever
ambient light it had from before. If the object on the other hand came
from outside of the lightmap into this octant, it would receive no
ambient light at all.
2024-03-08 12:43:38 +01:00
Pedro J. Estébanez
560e79c67f Make ShaderDescription and related types public 2024-03-08 09:55:44 +01:00
Thaddeus Crews
9903e6779b
Enforce template syntax typename over class 2024-03-07 22:39:09 -06:00
Hugo Locurcio
26a220bd31
Make Overdraw, Lighting and Shadow Splits debug draw modes ignore decals
This also makes the Overdraw and Shadow Splits debug draw modes ignore fog.
The Lighting debug draw mode still displays fog as that debug draw mode
is intended to preview scene lighting, and fog has an impact on how
lighting is perceived.
2024-03-07 17:40:49 +01:00