Commit graph

3058 commits

Author SHA1 Message Date
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
Rémi Verschelde
45ec0e31c3 Remove last editor code dependencies in template build
SConstruct change also makes it possible to outright delete the `editor`
folder in a `tools=no` build, which we use in CI to ensure no invalid
cross-dependencies are added.
2022-03-28 21:13:01 +02:00
Rémi Verschelde
143d13717b
Merge pull request #59553 from reduz/script-extension-support 2022-03-28 13:35:21 +02: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
Markus Sauermann
0494e024d8 Rename warp mouse functions to warp_mouse 2022-03-27 14:12:01 +02:00
nevarek
cc196393e3 Fix shader undefined variable 2022-03-25 01:40:04 -07:00
lawnjelly
109d08c84a Add protective checks for invalid handle use in BVH
Adds DEV_ASSERTS that will halt at runtime if the BVH is misused with invalid IDs, and adds ERR_FAIL macros to prevent calling with invalid IDs.

Any such misuse is a bug in the physics, but this should flag any errors quickly.
2022-03-23 09:19:26 +00:00
bruvzg
595995a5a7
[macOS] Add missing global menu features. 2022-03-22 12:38:14 +02:00
Bastiaan Olij
0fe06e9467 Extract Decal and Decal atlas from Storage class 2022-03-21 12:22:43 +11:00
Rémi Verschelde
5901d91458
Merge pull request #59345 from BastiaanOlij/call_correct_texture_free
Call the correct texture free method on texture storage cleanup
2022-03-20 12:03:19 +01:00
Rémi Verschelde
b05e56e90d
Merge pull request #59346 from rburing/raycast_from_inside_global
Raycasts hitting from inside: return collision point in global coordinates
2022-03-20 12:03:01 +01:00
Ricardo Buring
3d4be5d4c2 Raycasts hitting from inside: return collision point in global coordinates 2022-03-20 10:31:03 +01: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
Rémi Verschelde
ef24e95f4a
Merge pull request #59268 from Chaosus/shader_renames2
Rename several transform built-ins in shaders
2022-03-18 19:24:38 +01:00
Rémi Verschelde
5c8bd6fd71
Merge pull request #58233 from bruvzg/gde_ts 2022-03-18 14:29:58 +01:00
Yuri Roubinsky
0d9aecd967 Rename several transform built-ins in shaders 2022-03-18 12:10:55 +03:00
Rémi Verschelde
5d23613836
Merge pull request #49738 from Calinou/ssao-gi-default-half-resolution
Compute SSAO at half resolution by default
2022-03-18 07:14:23 +01: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
Rémi Verschelde
f995f47965
Merge pull request #59062 from BastiaanOlij/storagerd_texture 2022-03-17 10:08:33 +01:00
bruvzg
f19cd44346
Unify TextServer built-in module and GDExtension code. 2022-03-17 08:15:29 +02:00
Rémi Verschelde
c950db6652
Merge pull request #59209 from rburing/fix_pinjoint2d_inertia_tensor
`PinJoint2D`: fix inertia tensor, taking center of mass into account
2022-03-16 23:48:09 +01:00
Ricardo Buring
7ce4a1d9f3 PinJoint2D: fix inertia tensor, taking center of mass into account 2022-03-16 22:57:38 +01:00
bruvzg
6079e14396
Cleanup and fix native struct definitions. 2022-03-16 20:14:15 +02:00
Rémi Verschelde
c9d764e14a
Merge pull request #59140 from reduz/physics-server-extension 2022-03-16 17:11:40 +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
reduz
8b547331be Create GDExtension clases for PhysicsServer3D
* Allows creating a GDExtension based 3D Physics Server (for Bullet, PhysX, etc. support)
* Some changes on native struct binding for PhysicsServer

This allows a 3D Physics server created entirely from GDExtension. Once it works, the idea is to port the 2D one to it.
2022-03-15 18:39:31 +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
972bca75a8
Merge pull request #59107 from otonashixav/expose-add-animation-slice 2022-03-13 17:18:42 +01:00
bruvzg
aada395354
Fix text clipping on the right side. 2022-03-13 17:26:00 +02:00
Xavier Loh
a0e720efb2 Expose RenderingServer::canvas_item_add_animation_slice in GDScript 2022-03-13 22:53:24 +08: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
bruvzg
b32e8d63d8
Add options to embolden and transform font outlines to simulate bold and italic typefaces. 2022-03-11 14:02:30 +02:00
Rémi Verschelde
1c51fd48db
Merge pull request #58781 from BastiaanOlij/openxr_signals_and_events
Adding signals and events to OpenXR interface
2022-03-10 18:10:26 +01:00
reduz
6f51eca1e3 Discern between virtual and abstract class bindings
* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
2022-03-10 12:28:11 +01:00
Bastiaan Olij
d11cb5fe98 Adding signals and events to OpenXR interface
Improving interaction profile logic
2022-03-10 17:14:56 +11:00
kobewi
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
Rémi Verschelde
9b05f29894 Remove unused GDNative code
This has been superseded by GDExtension so this code is no longer useful
nor usable.

There's still some GDNative-related stuff in platform export code which
needs to be adapted for GDExtension (e.g. to include GDExtension libraries
in exports).
2022-03-09 13:59:03 +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
Rémi Verschelde
ffd64505c5
Merge pull request #58832 from reduz/uniform-set-cache
Add a UniformSet cache
2022-03-07 07:19:58 +01:00
lawnjelly
f199d2c33c [4.x] BVH - Fix area-area collision regression
Minimal approach to fixing regression whereby static areas where not detect dynamic areas.
2022-03-06 14:03:19 +00: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
bruvzg
e88522f5b5
[TextServer] Improve word breaking when there are multiple spaces between words. 2022-03-05 22:31:58 +02: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
Rémi Verschelde
0d1e3893d9
Merge pull request #57630 from lawnjelly/bvh4_templated_checks
[4.x] BVH - Sync BVH with 3.x
2022-03-04 23:29:38 +01:00
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
dae0135ae5
Revert "PitchShift effect quality and performance tweaks for different pitch scale values" 2022-03-02 00:11:33 +01: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
Rémi Verschelde
babac6e08c
Merge pull request #58549 from floppyhammer/fix-particle-trail
Fix particle trail glitch
2022-02-28 07:17:59 +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
bruvzg
74ff5921d6 Improve popup window handling.
Add window FLAG_POPUP and a platform specific routines to control popup auto-hiding and event forwarding.
2022-02-25 09:33:27 +02: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
Rémi Verschelde
1f3916e0b6
Merge pull request #56394 from BastiaanOlij/OpenXR_Core4 2022-02-23 13:36:07 +01:00
Rémi Verschelde
96261838c5
Merge pull request #57956 from Eoin-ONeill-Yokai/audio_stream_hotfix 2022-02-23 13:04:47 +01:00
Bastiaan Olij
a78a9fee71 Implementing OpenXR driver 2022-02-23 12:02:24 +01:00
clayjohn
fe49244611 Use Filament specular models and parametrization 2022-02-22 19:39:41 -08:00
Eoin O'Neill
ded9dc1e82 Add missing binding to AudioStream class
This allows for the extension of AudioStream where you can call
`instance_plackback` on child AudioStream instances within gdscript,
much like the implementation of some child classes in C++.

See `AudioStreamRandomPitch` for an example of how this can be used.
2022-02-22 18:11:40 -08:00
floppyhammer
0d5472dd1a Fix GPUParticles2D emission offset in global coords 2022-02-22 17:50:01 +08:00
Rémi Verschelde
c77348b468
Merge pull request #58419 from clayjohn/Vulkan-anisotropy-crash 2022-02-22 09:09:16 +01:00
clayjohn
2da35d2b94 Fix shader compilation error with anisotropy 2022-02-21 22:58:33 -08:00
clayjohn
9d104ad839 Use properly use non-perceptual roughness when filtering radiance 2022-02-21 22:53:12 -08:00
Ricardo Buring
d525ea2614 In final phase of test_body_motion, move and cull AABB for body once, instead of for every shape 2022-02-18 19:45:25 +01:00
Rémi Verschelde
7a68ee5134
Merge pull request #58266 from clayjohn/revert-sky-change 2022-02-18 12:07:40 +01:00
Pierre-Thomas Meisels
fd02f529fa Fix default value for DisplayServer::virtual_keyboard_show Rect2 parameter 2022-02-18 09:43:02 +01:00
Rémi Verschelde
48b61159b2
Merge pull request #58106 from Calinou/audioserver-capture-device-property 2022-02-18 09:07:36 +01:00
Rémi Verschelde
488116e4d8
Merge pull request #58236 from bruvzg/win_min_fix 2022-02-18 09:07:10 +01:00
clayjohn
e0384fb70e Revert "Fix default sky process mode not being Real-Time"
This reverts commit aa1cba1d53.
2022-02-17 23:13:10 -08:00
Hugo Locurcio
1d35b37499
Expose AudioServer.capture_device as a property
This is more consistent with `AudioServer.device` (for output),
which is already exposed as a property.
2022-02-17 19:35:46 +01:00
Rémi Verschelde
e1b8a86b2b
Merge pull request #58177 from clayjohn/VULKAN-prefiltered-radiance 2022-02-17 17:53:42 +01:00
bruvzg
0c27667124 [Windows] Fix Vulkan driver crash on sub-window minimization. 2022-02-17 13:34:08 +02:00
clayjohn
48728a79b6 Use prefiltered radiance 2022-02-16 21:37:18 -08:00
Rémi Verschelde
b8b4580448
Style: Cleanup single-line blocks, semicolons, dead code
Remove currently unused implementation of TextureBasisU, could be re-added
later on if needed and ported.
2022-02-16 14:06:29 +01:00
Yuri Roubinsky
a85b000967 Fix antialiasing for beginning/end of line in canvas_item_add_polyline 2022-02-16 14:34:42 +03:00
clayjohn
a38c3a763a Properly exclude lights that are marked as sky only 2022-02-16 00:16:56 -08:00