Commit graph

1833 commits

Author SHA1 Message Date
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