Commit graph

2819 commits

Author SHA1 Message Date
Aaron Franke 97df94ae90
Update comments in vulkan_context.cpp
Co-authored-by: Quinn Leavitt <59779489+QuinnLeavitt@users.noreply.github.com>
2022-07-17 12:45:17 -05:00
Bastiaan Olij d139131aab Adding Variable Rate Shading support to Godot
Improve GI renderer and add VRS support
Implement render device has_feature and move subgroup settings to limit_get
2022-07-17 15:42:24 +10:00
Fabian Keller 2bf9e6090c rename translate(d) to translate(d)_local in Transform 2D/3D 2022-07-16 11:47:54 +02:00
sakrel 16a8967757 Fix DirectionalLight2D and PointLight2D shadows not rendering correctly 2022-07-15 23:55:15 +02:00
Hugo Locurcio 21ea1c3835
Rename soft shadow quality project settings for easier searching
`rendering/quality/shadows` is now `rendering/quality/positional_shadow`
to explicitly denote that the settings only affect positional light shadows,
not directional light shadows.

Shadow atlas settings now contain the word "atlas" for easier searching.

Soft shadow quality settings were renamed to contain the word "filter".
This makes the settings appear when searching for "filter" in the
project settings dialog, like in Godot 3.x.
2022-07-13 19:56:02 +02:00
bruvzg 0c5431644d
Allows parsing of invalid UTF-16 surrogates (can be encountered in Windows filenames) and some non-standard UTF-8 variants, makes Unicode parse errors more verbose. 2022-07-07 11:07:18 +03:00
Yuri Rubinsky 3dc1a1dbfb Prevent possible crash when mesh is freed 2022-07-06 19:52:54 +03:00
Rémi Verschelde 55fca1cb94
Merge pull request #62344 from BastiaanOlij/extract_dependencies 2022-07-06 13:24:46 +02:00
Hugo Locurcio c9037a8d2c
Remove unused anisotropy setter/getter methods in VoxelGI
These methods weren't exposed to the scripting API.

Anisotropy was used in earlier iterations of VoxelGI, but it was
removed as it was too expensive.
2022-07-06 02:40:49 +02:00
Shlomi 22da234eb6 Add Desktop to file dialog drive on Unix 2022-07-05 13:10:15 +02:00
Fredia Huya-Kouadio f9c19298ce Add full support for Android scoped storage.
This was done by refactoring directory and file access handling for the Android platform so that any general filesystem access type go through the Android layer.
This allows us to validate whether the access is unrestricted, or whether it falls under scoped storage and thus act appropriately.
2022-07-05 03:00:37 -07:00
Rémi Verschelde 08044aa2e3 Vulkan: Make loader_get_json "error" a verbose message on Windows
In far most cases it seems like it's going to message about bogus manifests
in the Windows registry which point to JSON files which have since been
uninstalled, but without clearing the registry.

This happens with bogus Vulkan overlays from Twitch, Epic Online Services,
NVIDIA Nsight Systems, OBS Studio, Rockstar Games... fix your mess folks.

Fixes #56089.
2022-07-02 19:25:01 +02:00
Rémi Verschelde 6bbfd160b0 SCons: Properly track codegen script dependency for generated GLSL headers 2022-07-02 16:01:48 +02:00
Pedro J. Estébanez 95ac9081d6 Use a more robust method of determining writability of bindings 2022-06-30 20:07:30 +02:00
Pedro J. Estébanez a82352c7e3 Avoid manual memory management of certain arrays in Vulkan RD 2022-06-28 10:01:46 +02:00
Pedro J. Estébanez 3d58b79792 Fix confusion between Vulkan and RD storage buffer usage values 2022-06-28 10:01:46 +02:00
Pedro J. Estébanez 525de52b08 Stop debug time full barriers preventing layout transitions in Vulkan RD 2022-06-28 10:01:45 +02:00
Pedro J. Estébanez e1645567a6 Optimize texture update in Vulkan RD 2022-06-28 10:01:45 +02:00
Pedro J. Estébanez 509c0eb86b Apply some small fixes/enhancements to the Vulkan RD
- Initialize queue indices to values meaning 'unset'
- Remove unused parameters & members
- Make texture update access flags consistent with texture copy
- Fix style and pass type of some parameters
- Synchronize setup-draw in flush with a semaphore
- Add no current list validation to draw_list_begin_splits()
- Update texture usage flags on destination of copy
- Fix misuse of Vulkan flag
2022-06-28 10:01:45 +02:00
Pedro J. Estébanez fc6ac4a155 Consider uniform writability part of the interface of the set 2022-06-27 21:56:18 +02:00
Bastiaan Olij ecfcfd97fa Split dependency logic
Split FOG
Split visibility notifier
Final cleanup of storage classes
2022-06-28 00:10:29 +10:00
clayjohn 88830509d1 Precompute on the CPU as much as possible for the Cubemap filter shader 2022-06-22 16:46:27 -07:00
Bastiaan Olij 997810e417 Split GI effects and fix stereoscopic rendering of GI effects 2022-06-22 12:50:17 +10:00
reduz 141c375581 Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934
* Clean up usage of murmur3
* Fixed usages of binary murmur3 on floats (this is invalid)
* Changed DJB2 to use xor (which seems to be better)
2022-06-20 12:54:19 +02:00
Bastiaan Olij b4821fe2e0 Introduce eye_offset for correcting stereoscopic reflections
Use view instead of vertex for reflections.
2022-06-17 19:39:34 +10:00
clayjohn 5f52936350 Implement MultiMesh in 3D and flesh out MultiMesh functions 2022-06-14 21:23:20 -07:00
jfons ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
Bastiaan Olij 69b66ec425 Ensure has_os_features is safely called as it can't be called from within the construct of RenderingServerDefault on which it relies 2022-06-01 20:47:32 +10:00
clayjohn ae64b4967c Implement NinePatchRects in GLES3 renderer 2022-05-25 16:51:40 -07:00
Rémi Verschelde 20a1b85589
Merge pull request #61425 from clayjohn/GLES3-2D 2022-05-26 01:16:52 +02:00
clayjohn fb860265e0 Implement 2D Meshes and MultiMeshes in GLES3 backend 2022-05-25 15:46:24 -07:00
Rémi Verschelde 12ddaa36a6
Merge pull request #60641 from clayjohn/Sky-ign
Use IGN instead of white noise for sky dithering
2022-05-24 23:34:41 +02:00
clayjohn 3e20c1347d Add clipping, backbuffer, and CanvasGroups to 2D GLES3 renderer
As well as significant consequent cleanup in the RenderTarget, Texture, and Canvas renderer code
2022-05-24 11:00:34 -07:00
clayjohn 4f82b1bd20 Use IGN instead of white noise for sky dithering 2022-05-24 10:57:07 -07:00
Rémi Verschelde 1314e6cbcc
Merge pull request #60803 from Chaosus/shader_hint_rename
Rename `hint_albedo`, `hint_white/black` in shaders
2022-05-24 08:15:33 +02:00
reduz 45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
clayjohn 39f1be760f Fix sky updating when DirectionalLight mode changed and shader compatibility for certain drivers 2022-05-19 17:44:38 -07:00
Aaron Record 900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Yuri Rubinsky 5322b171de Fix tonemapper shader to correctly apply alpha channel 2022-05-18 06:43:07 +03:00
clayjohn 9b61c855ef Add basic lighting to GLES3 renderer.
This includes all three light types and IBL, but does not include shadows or any form of GI
2022-05-16 15:07:09 -07:00
reduz 746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Somnath Sarkar 52aeaf5d16 Fix computation of screen_uv 2022-05-16 00:00:01 -04:00
Rémi Verschelde 349aa9c884
Merge pull request #60894 from derammo/derammo_opengl3_windows 2022-05-13 15:07:13 +02:00
Rémi Verschelde ff30a09993
Merge pull request #60643 from clayjohn/GLES3-3D 2022-05-12 21:08:02 +02:00
clayjohn 652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
reduz 8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
clayjohn 2bf8831dd6 SceneShader compiling 2022-05-11 21:00:21 -07:00
clayjohn 3bb8e6a9fe SkyShaders working 2022-05-11 21:00:21 -07:00
derammo 96c21bc749 opengl3 driver now works on windows including multi window
fixed and simplified gl_manager_windows
swap buffers now called for all windows
fixed missing pixel format setting in additional windows
    this makes them work in OpenGL contexts
changed verbose error printing to write once
    this error message happens very frequently while opengl3 is not finished
removed dead code no longer needed after changes
fixed comments that were misinformation
window messages during window creation now handled
    these were previously discarded
    messages now tunnel the required context
changed failure to create opengl3 window on windows to be more fatal
marked a problem with pen code
conditional compilation of vulkan and opengl3 on windows fixed
windows debug builds now show messages on debug console also
rendering driver selection box now shows only compiled drivers
marked some problematic code
thanks to akien-mga for patiently rewriting my style mistakes
2022-05-11 16:12:40 -04:00
Fabio Alessandrelli d2bb5b88cc [GL] Fix HTML5 builds.
Safer guards for debug functions.
GL_FRAMEBUFFER_INCOMPLETE_* functions seem to be OpenGL 4.
2022-05-11 00:26:26 +02:00
bruvzg ffe61e0895
[macOS / iOS] Fix text-to-speech build with older macOS / iOS SDK.
Add __has_include check for AVFAudio include.
Add some explicit casts to avoid conflicts.
Change all `include`s to `import`s for consistency.
2022-05-10 21:11:34 +03:00
Rémi Verschelde 9db20ccb38
Merge pull request #60596 from clayjohn/GLES3-LightStorage
Add LightStorage functions to GLES3 renderer
2022-05-10 08:18:51 +02:00
Yuri Roubinsky a8bbe570ca Rename hint_albedo, hint_white/black in shaders 2022-05-09 22:50:18 +03:00
Rémi Verschelde 84f64ddde9
Merge pull request #60723 from reduz/refactor-module-initialization 2022-05-04 19:08:43 +02:00
reduz de0ca3b999 Refactor module initialization
* Changed to use the same stages as extensions.
* Makes the initialization more coherent, helping solve problems due to lack of stages.
* Makes it easier to port between module and extension.
* removed the DRIVER initialization level (no longer needed).
2022-05-04 17:34:51 +02:00
mdavisprog f3c1232c59 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.
2022-05-03 17:27:17 -07:00
Aaron Franke fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
Rémi Verschelde 6530d46d67
Merge pull request #51102 from Calinou/renderingserver-add-api-version-getter
Add `get_video_adapter_api_version()` to RenderingServer
2022-05-03 14:44:55 +02:00
Rémi Verschelde 931838b330
Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
Rémi Verschelde 297241f368
Merge pull request #60714 from Calinou/typedef-remove-ref
Remove `RES` and `REF` typedefs in favor of spelled out `Ref<>`
2022-05-03 14:28:18 +02:00
Rémi Verschelde c9ce4069a3
Merge pull request #60601 from touilleMan/gdextension_get_library_path
Add GDNativeInterface::get_library_path to GDExtension
2022-05-03 08:13:34 +02:00
Hugo Locurcio 180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Hugo Locurcio 31194f5b1c
Add get_video_adapter_api_version() to RenderingServer
This method can be used to get the graphics API version currently in
use (such as Vulkan). It can be used by projects for troubleshooting
or statistical purposes.
2022-05-03 01:18:35 +02:00
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
Yuri Roubinsky 5eb3a0ef4a Add hint_color support for vec3 in shaders 2022-05-01 09:47:35 +03:00
Aaron Franke 1bf94dff3a
Rename Basis "elements" to "rows" 2022-04-29 08:02:56 -05:00
Aaron Franke b831fb0a54
Rename Transform2D "elements" to "columns" 2022-04-29 08:02:39 -05:00
Emmanuel Leblond 80f61352fb
Add GDNativeInterface::get_library_path to GDExtension 2022-04-29 00:51:04 +02:00
clayjohn fefa4a573a Add LightStorage functions to GLES3 renderer 2022-04-28 13:51:47 -07:00
clayjohn 1182c95533 Add MeshStorage to GLES3 2022-04-28 11:22:20 -07:00
Rémi Verschelde d9b4ab3797 Fix typo after #60503 2022-04-28 20:00:40 +02:00
Rémi Verschelde f394388aa2
Merge pull request #60503 from clayjohn/OPENGL-3D 2022-04-28 19:56:16 +02:00
Markus Sauermann a793960a10 Fix cppcheck const parameters
Convert method signature parameters to const where it is possible

# Conflicts:
#	drivers/gles3/rasterizer_canvas_gles3.cpp
#	drivers/gles3/rasterizer_canvas_gles3.h
#	editor/plugins/animation_state_machine_editor.cpp
#	editor/plugins/animation_state_machine_editor.h
2022-04-28 11:35:39 +02:00
Rémi Verschelde 8dfa12cae7
Merge pull request #59979 from bruvzg/cpp_check2 2022-04-27 10:08:26 +02:00
Hugo Locurcio eb497bbaa7
Fix "ortogonal" -> "orthogonal" typo in rasterizer code 2022-04-26 21:49:44 +02:00
clayjohn 2f2064fe3d Overhaul GLES3: Add basis for 3D renderer, overhaul materials and textures 2022-04-26 11:48:39 -07:00
Rémi Verschelde 63a052d96b
Merge pull request #60386 from bruvzg/label3d 2022-04-25 15:51:31 +02:00
Shnazzy 4ef7372d9e Fixed ambiguous reference to "Shader" and "Material" classes in drivers/gles3/storage/material_storage.cpp 2022-04-22 19:50:19 -04:00
bruvzg be611c1c05
Implement Label3D node.
Add "generate_mipmap" font import option.
Add some missing features to the Sprite3D.
Move BiDi override code from Control to TextServer.
Add functions to access TextServer font cache textures.
Add MSDF related flags and shader to the standard material.
Change standard material cache to use HashMap instead of Vector.
2022-04-22 12:08:46 +03:00
bruvzg de4c97758a
Fix more issues found by cppcheck. 2022-04-20 10:34:00 +03:00
Yuri Rubinsky f4b0c7a1ea
Merge pull request #60175 from Geometror/visual-shader-vector4 2022-04-20 08:33:42 +03:00
clayjohn 3a4b9b47fd Initialize OpenGL before rasterizers in GLES3 2022-04-19 11:27:14 -07:00
Bastiaan Olij 0b4fd92a17 Moved particles into ParticlesStorage 2022-04-17 13:13:22 +10:00
Bastiaan Olij b6faf6c6c0 Move light, reflection probe and lightmap into LightStorage 2022-04-17 13:13:18 +10:00
Bastiaan Olij 6b28d94e77 Merge canvas and decal into TextureStorage and add render target 2022-04-17 12:59:50 +10:00
Hendrik Brucker cf58d23a72 Add Vector4 to VisualShader 2022-04-12 19:09:29 +02:00
bruvzg d2ebac3a30
Remove or make private FileAccess close() methods. 2022-04-12 14:50:14 +03:00
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 b78aa4fe19 Style: Apply clang-tidy to current code, add readability-redundant-member-init 2022-04-04 21:49:51 +02: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
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
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
Pedro J. Estébanez 171e31de68 vk_mem_alloc: Update to upstream + Replace use of deprecated items 2022-03-29 11:28:09 +02:00
Bastiaan Olij 0fe06e9467 Extract Decal and Decal atlas from Storage class 2022-03-21 12:22:43 +11:00
Yuri Roubinsky 0d9aecd967 Rename several transform built-ins in shaders 2022-03-18 12:10:55 +03: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