Commit graph

176 commits

Author SHA1 Message Date
Bastiaan Olij
e15358dc67 Fix incorrect HTC action map entries 2023-03-15 14:11:13 +11:00
Bastiaan Olij
cdd9de28a8 Fix typo in OpenXR pose orientation check 2023-03-15 13:40:44 +11:00
Bastiaan Olij
e31c2e4277 Add a get_system_info method to XRInterface 2023-03-15 13:11:48 +11:00
Zac Luzader
d3b26b3261 OpenXR: Enable access to the Valve Index grip force sensing 2023-03-12 07:55:25 -06:00
Haoyu Qiu
03fcac3aa5 Fix various typos in the classref 2023-03-09 14:56:23 +08:00
Rémi Verschelde
1c1524a651
Bump version to 4.1-dev
Can't stop, won't stop, they said, huh?
2023-03-01 01:44:37 +01:00
Malcolm Nixon
d91e75b6f7 Added render target size multiplier option.
Fix formatting
2023-02-18 10:58:06 -05:00
Chris Hutchinson
cb8e919243 Replaced operating system alert dialog with a warning log message,
toggled by a project setting.
Fixes #73141
2023-02-13 18:42:43 -05:00
Rémi Verschelde
8ef01ee5df
Merge pull request #72604 from rbessems/rbessems/env_blend_mode
Add XR Environment Blend Mode Support
2023-02-03 06:24:30 +01:00
Ron Bessems
d7d171c45c Add XR Environment Blend Mode Support 2023-02-02 12:18:42 -05:00
Ron Bessems
e78088cc3a Add Magic Leap 2 OpenXR Interaction Profile 2023-02-02 06:45:43 -05:00
Bastiaan Olij
d3ec17e9ae Added methods to OpenXR interface to set which action sets are active 2023-01-31 10:20:19 +11:00
Rémi Verschelde
5b1df48c6c
Convert en_GB spelling to en_US with codespell 2023-01-23 11:02:20 +01:00
Rémi Verschelde
822edfdb40
Merge pull request #71708 from dsnopek/openxr-opengl-steamvr-2
Get OpenXR with OpenGL working on SteamVR
2023-01-20 08:50:10 +01:00
David Snopek
481369760b Add depth and color formats to get OpenXR with OpenGL working on SteamVR 2023-01-19 21:22:34 -06:00
Rémi Verschelde
bcb57b42f6
Merge pull request #71450 from BastiaanOlij/fix_openxr_init_failure
Fixes issue where failed start of OpenXR causes issues
2023-01-19 10:08:50 +01:00
kobewi
b58111588a Add EditorUndoRedoManager singleton 2023-01-16 01:11:52 +01:00
Bastiaan Olij
909ec66ca3 Fixes issue where failed start of OpenXR causes issues 2023-01-15 16:57:42 +11:00
Rémi Verschelde
dd1b3ff089
Merge pull request #71224 from rsjtdrjgfuzkfg/openxr-opengl
OpenXR: Do not use SRGB swapchains with OpenGL
2023-01-12 09:07:46 +01:00
rsjtdrjgfuzkfg
17a957e214 OpenXR: Do not use SRGB swapchains with OpenGL
This commit removes SRGB swapchain options for use with OpenGL, to avoid
the hardware doing an additional SRGB conversion and thus causing colors
to differ from other rendering paths.
2023-01-11 15:47:53 +01:00
rsjtdrjgfuzkfg
b51acac638 OpenXR: Fix initialization warning on Android
This commit adds proper checking for XR_KHR_loader_init support and
fixes the warning regarding missing extensions on Android to only appear
if neither XR_KHR_loader_init nor XR_KHR_loader_init_android are
supported by the runtime.
2023-01-11 15:00:22 +01:00
Rémi Verschelde
62b023ecd3
Merge pull request #70167 from rsjtdrjgfuzkfg/pico
OpenXR: Add Pico controller profile
2023-01-11 09:49:16 +01:00
Rémi Verschelde
6a86dfad29
Fix typos with codespell
Also includes #71080.

Co-authored-by: Psychpsyo <60073468+Psychpsyo@users.noreply.github.com>
2023-01-09 08:39:07 +01:00
rsjtdrjgfuzkfg
e6370a45d8 OpenXR: Add preliminary Pico controller profile
This commit adds the Pico controller used in the Pico 4 as implemented
in current versions of the OpenXR runtime on the device itself. Note
that the extension and paths used in this commit might become obsolete
once there is official support for the Pico 4 in the OpenXR standard.
2023-01-06 14:02:41 +01:00
Rémi Verschelde
d95794ec8a
One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
Bastiaan Olij
b6550c46ee Removed member variables from OpenXRExtensionWrapper
Made extension container in OpenXRAPI static
Moved controller meta data into extensions where applicable
2023-01-04 11:34:58 +11:00
Bastiaan Olij
b5e205a57c Fix missing undo/redo object and issue with removing actions 2022-12-19 19:35:06 +11:00
rsjtdrjgfuzkfg
20c192cc2d OpenXR: fix casts and loop in action map editor
This commit replaces potentially unsafe static casts with
Object::cast_to and fixes the order in which UI elements are looped over
when removing controls. This fixes crashes and wrong data being
displayed in the OpenXR action map editor when saving or resetting
action maps.
2022-12-16 21:32:43 +01:00
Rémi Verschelde
346efd29e0
Fix typos with codespell 2022-12-15 12:24:08 +01:00
Rémi Verschelde
cd855f6516
Merge pull request #68528 from BastiaanOlij/openxr_actionmap_changes
Various fixes for OpenXR action map meta data and editing
2022-12-13 10:16:19 +01:00
Rémi Verschelde
62f7f378d4
Merge pull request #69690 from BastiaanOlij/display_refresh_type
Fix property type for OpenXR display refresh rate
2022-12-07 13:25:48 +01:00
Rémi Verschelde
a565ddcd09
Merge pull request #69654 from BastiaanOlij/openxr_submit_depth_optional
Make submitting depth buffer in OpenXR optional
2022-12-07 13:25:42 +01:00
Bastiaan Olij
0b48ca0303 Fix property type for OpenXR display refresh rate 2022-12-07 10:17:34 +11:00
Bastiaan Olij
484cd90d29 Make submitting depth buffer in OpenXR optional 2022-12-06 22:37:33 +11:00
Bastiaan Olij
a35d792e65 Fix typo that resulted in left eye depth buffer being submitted for the right eye 2022-12-06 21:30:55 +11:00
David Snopek
61cec0b023 Clean up DisplayServerAndroid::window_get_native_handle() with the GLES3 renderer 2022-12-04 13:07:51 -06:00
Rémi Verschelde
75d5dfe591
SCons: Disable openxr module with disable_3d=yes
Fixes #69470.
2022-12-02 11:40:24 +01:00
David Snopek
aa5b42946c Fix OpenXR on the Meta Quest: XR_KHR_loader_init_android is not reported as available (but it works anyway) 2022-11-29 20:45:01 -06:00
clayjohn
9141984e7e Enable GLES3 on Android
Add necessary build flags and switch from using a
GLES2 context to a GLES3 one.

This also enables building for OpenXR

Co-authored-by: m4gr3d <fhuyakou@gmail.com>
Co-authored-by: dsnopek <dsnopek@gmail.com>
2022-11-29 14:18:24 -08:00
Bastiaan Olij
96bbdf7249 Various fixes for OpenXR action map meta data and editing 2022-11-25 20:26:30 +11:00
Jens Nolte
67f31f571e Fix GLAD-related build problems on Linux
- Use gl.h provided by GLAD in the OpenXR module
- Use non-EXT variants of some OpenGL defines
- Remove libGL-related code paths
2022-11-25 02:52:17 +01:00
Rémi Verschelde
c39c251255
Merge pull request #68023 from rsjtdrjgfuzkfg/pico
Partial support for Pico 4
2022-11-24 10:43:15 +01:00
Rémi Verschelde
dfcb2d4fb8
Merge pull request #64250 from raulsntos/openxr-string-arrays
Expose string array properties in OpenXR module as PackedStringArray
2022-11-22 21:41:24 +01:00
Markus Sauermann
28af870750 Code simplifications found by cppcheck
They are based on:
- Boolean arithmetic simplifications
- setting variables that are not accessed
- constant variables
2022-11-21 08:43:36 +01:00
dzil123
2ba5aaa2fc Fix -Wtype-limits warning in openxr_interface.cpp 2022-11-12 20:46:24 -08:00
avemort
8ef1719945 Add index check to OpenXRInterface::get_projection_for_view and OpenXRInterface::get_transform_for_view 2022-11-11 11:00:34 -03:00
David Snopek
c767cc16ea [openxr] Remove unnecessary fallbacks for native handles on X11 2022-11-09 08:09:07 -06:00
David Snopek
23603e409c Add support for OpenGL to OpenXR 2022-11-08 18:47:11 -06:00
rsjtdrjgfuzkfg
4243b85990 OpenXR: support XR_KHR_android_create_instance
This commit adds support for the OpenXR extension
XR_KHR_android_create_instance, which seems to be required on Pico
devices.
2022-11-04 01:57:48 +01:00
Rémi Verschelde
c98d6142d0
Merge pull request #68102 from BastiaanOlij/fix_render_issues_xr
Fix several render issues found while debugging XR
2022-11-03 22:37:42 +01:00
Rémi Verschelde
f7c611ab71
Style: Misc docs and comment style and language fixes
- Removed empty paragraphs in XML.
- Consistently use bold style for "Example:", on a new line.
- Fix usage of `[code]` when hyperlinks could be used (`[member]`, `[constant]`).
- Fix invalid usage of backticks for inline code in BBCode.
- Fix some American/British English spelling inconsistencies.
- Other minor fixes spotted along the way, including typo fixes with codespell.
- Don't specify `@GlobalScope` for `enum` and `constant`.
2022-11-02 19:01:18 +01:00
Bastiaan Olij
a4e58ec84a Fix several render issues found while debugging XR 2022-11-01 13:27:03 +11:00
Rémi Verschelde
5947f22be9
Merge pull request #67578 from KoBeWi/GEDITOR
Unify usage of GLOBAL/EDITOR_GET
2022-10-31 13:15:58 +01:00
Rémi Verschelde
420eb1aa34
Merge pull request #67445 from Zylann/rename_queue_delete
Rename queue_delete => queue_free
2022-10-31 10:51:18 +01:00
Bastiaan Olij
91945c3077 Change default OpenXR pose to aim pose 2022-10-28 01:56:06 +11:00
Marc Gilleron
7543a5e014 Rename queue_delete => queue_free
# Conflicts:
#	editor/plugins/tiles/tiles_editor_plugin.cpp
2022-10-24 22:07:02 +01:00
Max Hilbrunner
5f7906a289
Merge pull request #67527 from BastiaanOlij/fix_tracker_names
Fix two typos in tracker names and a bug in OpenXR haptic feedback
2022-10-19 18:18:36 +02:00
kobewi
e48c5daddf Unify usage of GLOBAL/EDITOR_GET 2022-10-18 19:01:48 +02:00
Bastiaan Olij
4a96fce801
Merge pull request #67529 from BastiaanOlij/filter_out_htc_paths
Filter out HTC OpenXR paths based on extension
2022-10-19 01:53:56 +11:00
Bastiaan Olij
19f9fe1dec Filter out HTC OpenXR paths based on extension 2022-10-19 00:09:54 +11:00
Bastiaan Olij
45ce45c001 Fix missing itos for OpenXR logging 2022-10-18 13:55:39 +11:00
Rémi Verschelde
667bc202b5 Merge pull request #67179 from BastiaanOlij/openxr_add_refresh_rate_extension
Adding support for the OpenXR Display Refresh Rate extension
2022-10-17 17:32:01 +02:00
Bastiaan Olij
1e7f009492 Fix two typos in tracker names and a bug in OpenXR haptic feedback 2022-10-17 20:29:19 +11:00
Bastiaan Olij
e14717bb2e Adding support for the OpenXR Display Refresh Rate extension 2022-10-10 20:41:46 +11:00
Bastiaan Olij
7f6c00f41a Cleanup a bunch of debug messages in OpenXR and change the ones we want to keep to print_verbose 2022-10-10 20:19:18 +11:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Bastiaan Olij
c6ba626af4 Fixing an incorrect error message in OpenXR reporting missing OpenGL support 2022-10-06 11:15:57 +11:00
Rémi Verschelde
3a2b0ab73d Merge pull request #66898 from aaronfranke/proj-mat-columns
Rename Projection `matrix` to `columns`
2022-10-05 08:35:26 +02:00
Bastiaan Olij
c7656978ba Adding getters to RenderTarget and implementing override functionality for XR 2022-10-05 11:37:49 +11:00
Aaron Franke
2cea42cc7f
Rename Projection matrix to columns 2022-10-04 12:34:19 -05:00
Rémi Verschelde
f47979f087
Merge pull request #66242 from akien-mga/scons-unify-tools-target 2022-09-30 12:28:50 +02:00
Gabor Koncz
72203a4da4 Add Passthrough extension wrapper 2022-09-27 12:26:53 +02:00
Rémi Verschelde
809927862b Merge pull request #66282 from BastiaanOlij/openxr_palm_pose
Add OpenXR palm pose extension support
2022-09-27 10:03:56 +02:00
Rémi Verschelde
39facb35a0 SCons: Unify tools/target build type configuration
Implements https://github.com/godotengine/godot-proposals/issues/3371.

New `target` presets
====================

The `tools` option is removed and `target` changes to use three new presets,
which match the builds users are familiar with. These targets control the
default optimization level and enable editor-specific and debugging code:

- `editor`: Replaces `tools=yes target=release_debug`.
  * Defines: `TOOLS_ENABLED`, `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_debug`: Replaces `tools=no target=release_debug`.
  * Defines: `DEBUG_ENABLED`, `-O2`/`/O2`
- `template_release`: Replaces `tools=no target=release`.
  * Defines: `-O3`/`/O2`

New `dev_build` option
======================

The previous `target=debug` is now replaced by a separate `dev_build=yes`
option, which can be used in combination with either of the three targets,
and changes the following:

- `dev_build`: Defines `DEV_ENABLED`, disables optimization (`-O0`/`/0d`),
  enables generating debug symbols, does not define `NDEBUG` so `assert()`
  works in thirdparty libraries, adds a `.dev` suffix to the binary name.

Note: Unlike previously, `dev_build` defaults to off so that users who
compile Godot from source get an optimized and small build by default.
Engine contributors should now set `dev_build=yes` in their build scripts or
IDE configuration manually.

Changed binary names
====================

The name of generated binaries and object files are changed too, to follow
this format:

`godot.<platform>.<target>[.dev][.double].<arch>[.<extra_suffix>][.<ext>]`

For example:
- `godot.linuxbsd.editor.dev.arm64`
- `godot.windows.template_release.double.x86_64.mono.exe`

Be sure to update your links/scripts/IDE config accordingly.

More flexible `optimize` and `debug_symbols` options
====================================================

The optimization level and whether to generate debug symbols can be further
specified with the `optimize` and `debug_symbols` options. So the default
values listed above for the various `target` and `dev_build` combinations
are indicative and can be replaced when compiling, e.g.:

`scons p=linuxbsd target=template_debug dev_build=yes optimize=debug`
will make a "debug" export template with dev-only code enabled, `-Og`
optimization level for GCC/Clang, and debug symbols. Perfect for debugging
complex crashes at runtime in an exported project.
2022-09-26 16:31:46 +02:00
Bastiaan Olij
23d32c0e16 Adding OpenXR hand tracking support 2022-09-26 19:47:06 +10:00
Rémi Verschelde
3472bdd6b6 Merge pull request #65798 from kisg/dynamic_openxr_loader
Dynamic loading of OpenXR Loader on Android
2022-09-26 08:27:24 +02:00
Gergely Kis
d5445c25a6 Dynamic loading of OpenXR Loader on Android
This change implements dynamic loading of the OpenXR Loader library
on Android. If an OpenXR Loader library is not found,
Godot will still function with OpenXR disabled.

Also, on every platform, the OpenXR symbols are resolved at runtime
using xrGetInstanceProcAddr.

On Windows and Linux the OpenXR loader is included in the main
engine binary.

On Android, the OpenXR Loader is not built with the engine. Separately
distributed Android plugins will be provided with the correct loader
library for each device.

Co-authored-by: Gábor Pál Korom <gabor.p.korom@migeran.com>
Co-authored-by: Gábor Koncz <gabor.koncz@migeran.com>
2022-09-24 13:57:03 +02:00
Bastiaan Olij
6da6e1690e Add OpenXR palm pose extension support 2022-09-23 13:20:12 +10:00
Gabor Koncz
8972600146 Fix OpenXR layer composition blending 2022-09-16 12:52:01 +02:00
Yuri Sizov
43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
Rémi Verschelde
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
This reverts commit 4b817a565c.

Fixes #64988.
Fixes #64997.

This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:

- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
  `NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
  member variables (e.g. `style_normal`, etc.), and use those member
  variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
  notification is now deferred, they end up accessing invalid state and this
  can lead to not applying theme properly (e.g. for EditorHelp) or crashing
  (e.g. for EditorLog or CodeEdit).

So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?

Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
  variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
  bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
  does arrive for the first time. But that means having a temporary invalid
  (and possibly still crashing) state, and doing some computations twice
  which might be heavy (e.g. `EditorHelp::_update_doc()`).
2022-08-29 11:11:29 +02:00
Rémi Verschelde
f7f8af232c
Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
Aaron Record
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky
ef5b9a06a9 Rename hint_tooltip to tooltip_text & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
Yuri Sizov
d953d9590b Improve the make_rst.py parser for BBCode tags 2022-08-15 17:45:10 +03:00
Raul Santos
232f1161f5
Expose string array properties in OpenXR module as PackedStringArray 2022-08-11 00:59:47 +02:00
Yuri Sizov
c5d7115038 Rename the argument tag to param in XML documentation 2022-08-08 22:34:31 +03:00
kobewi
c3606cb5f3 Swap arguments of ResourceSaver.save() 2022-07-29 19:53:09 +02:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
Bastiaan Olij
1dd671014b Add startup flag to override XR mode settings 2022-07-28 11:50:34 +10:00
RedMser
7b834c8bfd Fix unnamed arguments in XML docs 2022-07-26 20:42:38 +02:00
Rémi Verschelde
90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
python273
f78d06c9fe Fix tutorial links in XR classes docs 2022-07-22 15:05:31 +03:00
Riteo
a21f8b7c13 Improve linuxbsd headless building, cleanup build scripts
Now the `linuxbsd` platform can be built headlessly (e.g. without X11
development libraries).

I also cleaned up some weird (old?) usages of the `env` variable which
seem to make no difference and are used nowhere else.
2022-07-20 19:48:35 +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
Bastiaan Olij
95f75b232f Adding HTC tracker support 2022-06-16 16:52:13 +10:00
K. S. Ernest (iFire) Lee
10131eb6f2 Expose XRPose's get angular velocity. 2022-06-14 07:33:22 -07:00
FireForge
eb573da2b5 Use "odd" style for TabContainers on base BG color
- Use the "odd" style for TabContainers that are on a background with the same color as the default TabContainer background color to add contrast
2022-05-26 21:19:15 -05:00
Nathan Franke
77c8f271e7
use ERR_FAIL_INDEX when preferred 2022-05-25 13:36:45 -05:00