Commit graph

932 commits

Author SHA1 Message Date
bruvzg
9381acb6a4
Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Bastiaan Olij
b8be7903f3 Move storage for Mesh, MeshInstance, MultiMesh and Skeleton into MeshStorage 2022-04-02 16:29:04 +11:00
Yuri Rubinsky
9c5818d212
Merge pull request #59774 from Chaosus/shader_fix 2022-04-01 21:37:44 +03:00
jfons
e69d762dd0 Add color pass flags to Forward Clustered renderer
This commit removes a lot of enum values related to the color render pass in favor of a new flag-bases approach. This means instead of hard-coding all the possible option combinations into enums, we can write our logic by checking a bit-mask.

The changes in rendering_device_vulkan.cpp add support for unused attachments. That means RenderingDeviceVulkan::framebuffer_create() can take null RIDs in the attachments vector, which will result in VK_ATTACHMENT_UNUSED entries in the render pass.

This is used in this same PR to establish fixed locations for the color pass attachments (only color and separate specular so far, but TAA will add motion vectors as well). This way the attachment locations in the shader can stay the same regardless of which attachments are actually used.

Right now all the combinations of flags are generated, but we will need to add a way to limit the amount of combinations in the future.
2022-04-01 12:12:49 +02:00
Yuri Roubinsky
d47035a6fb Fix shader crashing when attempting to access length() at global space 2022-04-01 08:39:29 +03:00
Rémi Verschelde
155a94fabe
Merge pull request #59385 from BastiaanOlij/extract_shader_storage 2022-03-31 19:19:03 +02:00
Rémi Verschelde
a647fb3e62 Fix typos with codespell
Using codespell 2.2-dev from current git.

Fix a couple incorrect uses of gendered pronouns.
2022-03-31 14:07:29 +02:00
Bastiaan Olij
36defd1179 Extract global variable, shader and material storage 2022-03-31 21:49:42 +11:00
Dimitris Nikolaidis
02572884f4 Fix canvas_group not being freed in RendererCanvasCull::free 2022-03-29 15:45:27 +03:00
Yuri Roubinsky
509598e8c0 Remove SHADOW_ATTENUATION spatial light shader built-in 2022-03-29 08:43:31 +03:00
reduz
360dea5348 Add GDExtension support to Script
* Ability to create script languages from GDExtension
* Some additions to gdnative_extension.h to make this happen
* Moved the GDExtension binder to core

This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x.
Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
2022-03-27 16:13:00 +02:00
nevarek
cc196393e3 Fix shader undefined variable 2022-03-25 01:40:04 -07:00
Bastiaan Olij
0fe06e9467 Extract Decal and Decal atlas from Storage class 2022-03-21 12:22:43 +11:00
Bastiaan Olij
0b5a9e4f6e Call the correct texture free method on texture storage cleanup 2022-03-20 20:10:44 +11:00
nevarek
7543e22358 Add inverse projection matrix to fragment shader globals 2022-03-18 20:44:51 -07:00
Yuri Roubinsky
0d9aecd967 Rename several transform built-ins in shaders 2022-03-18 12:10:55 +03:00
Rémi Verschelde
756178d342
Merge pull request #59087 from clayjohn/sky-mode
Replace DirectionalLight3D's `use_in_sky_only` with `sky_mode` enum
2022-03-18 00:09:35 +01:00
Rémi Verschelde
9263e4e63b
Merge pull request #58954 from Ansraer/alpha_scissor
[4.0] Fix alpha scissor support
2022-03-17 22:27:43 +01:00
Hugo Locurcio
c45d2c242b Replace DirectionalLight3D's use_in_sky_only with sky_mode enum
3 options are available:

- Light and Sky (default)
- Light Only (new)
- Sky Only (equivalent to `use_in_sky_only = true`)

Co-authored by: clayjohn <claynjohn@gmail.com>
2022-03-17 14:00:02 -07:00
Rémi Verschelde
6228063972
Another -Wsign-compare fix
Fixing CI while afk, fun.
2022-03-17 21:42:35 +01:00
Rémi Verschelde
0e9764607a
Fix -Wsign-compare warning after #58993 2022-03-17 21:22:32 +01:00
Rémi Verschelde
e142c10fc5
Merge pull request #58993 from notSanil/device-limit-exceeded-fix 2022-03-17 19:55:40 +01:00
Ansraer
30a89b3f98 Fix alpha scissor support 2022-03-17 16:17:27 +01:00
notSanil
36fa7059ed Fix device limit exceeding for uniform buffer 2022-03-16 16:52:35 +05:30
Bastiaan Olij
57e5a33623 Split dummy renderer classes into separate files
Split canvas_texture_storage and texture_storage from render_storage class
2022-03-16 17:43:10 +11:00
Rémi Verschelde
cfd21adf64
Merge pull request #49092 from BastiaanOlij/multiview_clustered
Add multiview support to the clustered forward renderer
2022-03-16 00:17:57 +01:00
Rémi Verschelde
51bbcbdec2
Merge pull request #45263 from KoBeWi/😕 2022-03-15 13:18:27 +01:00
snowapril
b6f72f2b4a Fix D_GGX code which can cause divide-by-zero val
When given roughness is lower than 0.01, d value in original code will
be zero. This can make last return value as NAN because of
divide-by-zero. This is well addressed in issue #56373.

Modified code is referenced on D_GGX function of google/filament
(https://github.com/google/filament/blob/main/shaders/src/brdf.fs#L54-L79)

Signed-off-by: snowapril <sinjihng@gmail.com>
2022-03-14 13:25:05 +09:00
Rémi Verschelde
7ed8d52fb2
Merge pull request #58819 from vreon/fix-eyedir-z
Fix flipped EYEDIR.z in sky shaders
2022-03-13 00:55:32 +01:00
kobewi
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
Jesse Dubay
d437355f55 Sky renderer: Only flip Z when calculating panorama_coords 2022-03-08 19:51:43 -08:00
Rémi Verschelde
1561737055
Merge pull request #49447 from Calinou/remove-shadow-color-property
Remove unused `shadow_color` property from Light3D
2022-03-08 07:48:05 +01:00
Rémi Verschelde
f488a841c7
Merge pull request #58779 from techiepriyansh/forward-mobile-ambient-accum 2022-03-07 16:46:33 +01:00
Jesse Dubay
ff2a5c04b1 Sky renderer: Don't invert Z component of light direction 2022-03-06 23:58:54 -08:00
reduz
b0ca03b0a2 Add a UniformSet cache
* Changed syntax usage for RD::Uniform to create faster with a single RID
* Converted render pass setup to use this in clustered renderer to test.

This is the first step into creating a proper uniform set cache system to simplify large parts of the codebase.
2022-03-06 13:03:33 +01:00
Jesse Dubay
80345f7d4e Fix flipped EYEDIR.z in sky shaders 2022-03-05 17:49:32 -08:00
Priyansh Rathi
8c37cfa5bb
use the computed value ambient_accum for ambient_light in scene_forward_mobile.glsl 2022-03-05 14:24:40 +05:30
Hugo Locurcio
aea104deb7
Remove unused shadow_color property from Light3D
This shadow color property was no longer effective since the shaders
were optimized to improve occupancy.
2022-03-04 23:12:18 +01:00
Rémi Verschelde
c787f59931
Merge pull request #58734 from Calinou/tweak-render-timestamp-names
Tweak render timestamp names for explicitness and consistency
2022-03-04 20:43:08 +01:00
Rémi Verschelde
3078b92dff
Merge pull request #58512 from Calinou/light3d-add-distance-fade 2022-03-04 12:26:29 +01:00
Hugo Locurcio
c509a3a3a5
Tweak render timestamp names for explicitness and consistency
- Add 2D and 3D in timestamp names when needed to avoid ambiguity.
- Use present tense in all render timestamp names.
- Add a space after ">" (begin) and "<" (end) symbols.
- Remove redundant "End" in render timestamp names (indicated by "<").
2022-03-04 08:46:12 +01:00
Bastiaan Olij
e4b7a69bb6 Add multiview/stereoscopic rendering support to the clustered forward renderer 2022-03-03 20:06:14 +11:00
Rémi Verschelde
0036a41a10
Revert "Fix particle trail glitch" 2022-03-01 20:16:10 +01:00
Rémi Verschelde
e7176e6c85
Merge pull request #58614 from Calinou/ssr-roughness-quality-enum-fix-typo
Fix typo in SSR roughness quality enum value names
2022-02-28 10:51:20 +01:00
Hugo Locurcio
83efe4d8b0
Fix typo in SSR roughness quality enum value names 2022-02-28 01:06:26 +01:00
floppyhammer
1675c5375e Fix particle trail glitch 2022-02-26 13:53:06 +08:00
Hugo Locurcio
b1a295b739
Implement distance fade properties in OmniLight3D and SpotLight3D
This can be used to fade lights and their shadows in the distance,
similar to Decal nodes. This can bring significant performance
improvements, especially for lights with shadows enabled and when
using higher-than-default shadow quality settings.

While lights can be smoothly faded out over distance, shadows are
currently "all or nothing" since per-light shadow color is no longer
customizable in the Vulkan renderer. This may result in noticeable
pop-in when leaving the shadow cutoff distance, but depending on the
scene, it may not always be that noticeable.
2022-02-25 15:17:35 +01:00
Darryl Ryan
3ce5cceef9 Filament specular fix. Clamp dot product between normal and view vectors. Fixes #58459. 2022-02-23 18:16:52 +00:00