From d29c88d0a0a892a220aa2ecbcb84b0aad939eb8d Mon Sep 17 00:00:00 2001 From: Patrick Exner Date: Thu, 15 Aug 2024 19:11:25 +0200 Subject: [PATCH 01/87] Fix project structure diagram in gdextension docs system docs --- tutorials/scripting/gdextension/gdextension_docs_system.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tutorials/scripting/gdextension/gdextension_docs_system.rst b/tutorials/scripting/gdextension/gdextension_docs_system.rst index 0a5f09338ca..aa23fab44e8 100644 --- a/tutorials/scripting/gdextension/gdextension_docs_system.rst +++ b/tutorials/scripting/gdextension/gdextension_docs_system.rst @@ -18,6 +18,8 @@ XML files (one per class) to document the exposed constructors, properties, meth We are assuming you are using the project files explained in the :ref:`GDExtension C++ Example ` with the following structure: +.. code-block:: none + gdextension_cpp_example/ # GDExtension directory | +--demo/ # game example/demo to test the extension From 8be74fd9ac9fba140071a0b46edbc6c9ce1bcb32 Mon Sep 17 00:00:00 2001 From: tetrapod00 <145553014+tetrapod00@users.noreply.github.com> Date: Thu, 15 Aug 2024 10:46:51 -0700 Subject: [PATCH 02/87] Fix glTF capitalization in manual --- getting_started/first_3d_game/02.player_input.rst | 4 ++-- tutorials/platform/android/android_library.rst | 10 +++++----- tutorials/xr/openxr_hand_tracking.rst | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/getting_started/first_3d_game/02.player_input.rst b/getting_started/first_3d_game/02.player_input.rst index 282b722cab3..a9d49650ec7 100644 --- a/getting_started/first_3d_game/02.player_input.rst +++ b/getting_started/first_3d_game/02.player_input.rst @@ -51,10 +51,10 @@ You can rename it to ``Character``. .. note:: - The ``.glb`` files contain 3D scene data based on the open source GLTF 2.0 + The ``.glb`` files contain 3D scene data based on the open source glTF 2.0 specification. They're a modern and powerful alternative to a proprietary format like FBX, which Godot also supports. To produce these files, we designed the - model in `Blender 3D `__ and exported it to GLTF. + model in `Blender 3D `__ and exported it to glTF. As with all kinds of physics nodes, we need a collision shape for our character to collide with the environment. Select the ``Player`` node again and add a child node diff --git a/tutorials/platform/android/android_library.rst b/tutorials/platform/android/android_library.rst index a962e6fa481..634df4fc558 100644 --- a/tutorials/platform/android/android_library.rst +++ b/tutorials/platform/android/android_library.rst @@ -45,11 +45,11 @@ These APIs can also be used to provide bidirectional communication between the h Godot instance allowing for greater control over the desired experience. We showcase how this is done using a sample Android app that embeds the Godot Engine as an Android view, -and uses it to render 3D GLTF models. +and uses it to render 3D glTF models. The `GLTF Viewer `_ sample app uses an `Android RecyclerView component `_ to create -a list of GLTF items, populated from `Kenney's Food Kit pack `_. -When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected GLTF item as a 3D model. +a list of glTF items, populated from `Kenney's Food Kit pack `_. +When an item on the list is selected, the app's logic interacts with the embedded Godot Engine to render the selected glTF item as a 3D model. .. image:: img/gltf_viewer_sample_app_screenshot.webp @@ -146,7 +146,7 @@ Below we break-down the steps used to create the GLTF Viewer app. - Add any additional logic that will be used by your application - - For the sample app, this includes adding the `ItemsSelectionFragment fragment `_ (and related classes), a fragment used to build and show the list of GLTF items + - For the sample app, this includes adding the `ItemsSelectionFragment fragment `_ (and related classes), a fragment used to build and show the list of glTF items - Open the ``AndroidManifest.xml`` file, and configure the orientation if needed using the `android:screenOrientation attribute `_ @@ -191,7 +191,7 @@ Below we break-down the steps used to create the GLTF Viewer app. - Update the Godot project script logic as needed - For the sample app, the `script logic `_ queries for the runtime ``GodotPlugin`` instance and uses it to register for signals fired by the app logic - - The app logic fires a signal every time an item is selected in the list. The signal contains the filepath of the GLTF model, which is used by the ``gdscript`` logic to render the model. + - The app logic fires a signal every time an item is selected in the list. The signal contains the filepath of the glTF model, which is used by the ``gdscript`` logic to render the model. .. code-block:: gdscript diff --git a/tutorials/xr/openxr_hand_tracking.rst b/tutorials/xr/openxr_hand_tracking.rst index 9f0da10f5db..5d91708ca97 100644 --- a/tutorials/xr/openxr_hand_tracking.rst +++ b/tutorials/xr/openxr_hand_tracking.rst @@ -127,7 +127,7 @@ For this Godot uses the hand bone structure as defined for the :ref:`Godot Human but optionally supporting an extra tip bone for each finger. The `OpenXR hand tracking demo `_ -contains example GLTF files of properly rigged hands. +contains example glTF files of properly rigged hands. We will be using those here and add them as a child to our ``XRNode3D`` node. We also need to enable editable children to gain access to our :ref:`Skeleton3D ` node. From 47327606b06572fd093e2c07e9fc61aca3cdaa38 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Tue, 20 Aug 2024 16:51:48 +0200 Subject: [PATCH 03/87] C#: Remove references to GODOT_SERVER and GODOT_HTML5 defines - The `GODOT_SERVER` preprocessor define is no longer available in Godot 4, since the dedicated server platform was removed. - Replaced a reference to `GODOT_HTML5` with `GODOT_WEB` since that platform was also renamed in Godot 4. - Remove note about `` that only really applies to Godot 3. --- tutorials/scripting/c_sharp/c_sharp_features.rst | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tutorials/scripting/c_sharp/c_sharp_features.rst b/tutorials/scripting/c_sharp/c_sharp_features.rst index b3d8d1e8b43..94e9d539d77 100644 --- a/tutorials/scripting/c_sharp/c_sharp_features.rst +++ b/tutorials/scripting/c_sharp/c_sharp_features.rst @@ -102,10 +102,6 @@ Preprocessor defines Godot has a set of defines that allow you to change your C# code depending on the environment you are compiling to. -.. note:: If you created your project before Godot 3.2, you have to modify - or regenerate your `csproj` file to use this feature - (compare ```` with a new 3.2+ project). - Examples ~~~~~~~~ @@ -115,10 +111,7 @@ For example, you can change code based on the platform: public override void _Ready() { - #if GODOT_SERVER - // Don't try to load meshes or anything, this is a server! - LaunchServer(); - #elif GODOT_32 || GODOT_MOBILE || GODOT_WEB + #if (GODOT_32 || GODOT_MOBILE || GODOT_WEB) // Use simple objects when running on less powerful systems. SpawnSimpleObjects(); #else @@ -167,7 +160,7 @@ Full list of defines * One of ``GODOT_64`` or ``GODOT_32`` is defined depending on if the architecture is 64-bit or 32-bit. * One of ``GODOT_LINUXBSD``, ``GODOT_WINDOWS``, ``GODOT_OSX``, - ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_HTML5``, or ``GODOT_SERVER`` + ``GODOT_ANDROID``, ``GODOT_IOS``, ``GODOT_WEB`` depending on the OS. These names may change in the future. These are created from the ``get_name()`` method of the :ref:`OS ` singleton, but not every possible OS From c14a6216e81f40a26b5b10991b4339c973b2e93c Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Thu, 15 Aug 2024 23:43:05 +0300 Subject: [PATCH 04/87] [GDExtension] Add missing iOS instructions and build/config example code. --- .../gdextension/files/cpp_example/SConstruct | 11 ++++++++++ .../gdextension/gdextension_cpp_example.rst | 22 +++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/tutorials/scripting/gdextension/files/cpp_example/SConstruct b/tutorials/scripting/gdextension/files/cpp_example/SConstruct index 691f8131944..a1ce2492dff 100644 --- a/tutorials/scripting/gdextension/files/cpp_example/SConstruct +++ b/tutorials/scripting/gdextension/files/cpp_example/SConstruct @@ -23,6 +23,17 @@ if env["platform"] == "macos": ), source=sources, ) +elif env["platform"] == "ios": + if env["ios_simulator"]: + library = env.StaticLibrary( + "demo/bin/libgdexample.{}.{}.simulator.a".format(env["platform"], env["target"]), + source=sources, + ) + else: + library = env.StaticLibrary( + "demo/bin/libgdexample.{}.{}.a".format(env["platform"], env["target"]), + source=sources, + ) else: library = env.SharedLibrary( "demo/bin/libgdexample{}{}".format(env["suffix"], env["SHLIBSUFFIX"]), diff --git a/tutorials/scripting/gdextension/gdextension_cpp_example.rst b/tutorials/scripting/gdextension/gdextension_cpp_example.rst index f89754b77bc..d444a13e40c 100644 --- a/tutorials/scripting/gdextension/gdextension_cpp_example.rst +++ b/tutorials/scripting/gdextension/gdextension_cpp_example.rst @@ -344,6 +344,18 @@ structure alongside ``godot-cpp``, ``src`` and ``demo``, then run: You should now be able to find the module in ``demo/bin/``. +When building for iOS, package the module as a static `.xcframework`, you can use +following commands to do so: + +:: + # compile simulator and device modules + scons arch=universal ios_simulator=yes platform=ios target= + scons arch=arm64 ios_simulator=no platform=ios target= + + # assembe xcframeworks + xcodebuild -create-xcframework -library demo/bin/libgdexample.ios..a -library demo/bin/libgdexample.ios..simulator.a -output demo/bin/libgdexample.ios..xcframework + xcodebuild -create-xcframework -library godot-cpp/bin/libgodot-cpp.ios..arm64.a -library godot-cpp/bin/libgodot-cpp.ios..universal.simulator.a -output demo/bin/libgodot-cpp.ios..xcframework + .. note:: Here, we've compiled both godot-cpp and our gdexample library as debug @@ -371,6 +383,8 @@ loaded for each platform and the entry function for the module. It is called ``g macos.debug = "res://bin/libgdexample.macos.template_debug.framework" macos.release = "res://bin/libgdexample.macos.template_release.framework" + ios.debug = "res://bin/libgdexample.ios.template_debug.xcframework" + ios.release = "res://bin/libgdexample.ios.template_release.xcframework" windows.debug.x86_32 = "res://bin/libgdexample.windows.template_debug.x86_32.dll" windows.release.x86_32 = "res://bin/libgdexample.windows.template_release.x86_32.dll" windows.debug.x86_64 = "res://bin/libgdexample.windows.template_debug.x86_64.dll" @@ -386,6 +400,14 @@ loaded for each platform and the entry function for the module. It is called ``g android.debug.arm64 = "res://bin/libgdexample.android.template_debug.arm64.so" android.release.arm64 = "res://bin/libgdexample.android.template_release.arm64.so" + [dependencies] + ios.debug = { + "res://bin/libgodot-cpp.ios.template_debug.xcframework": "" + } + ios.release = { + "res://bin/libgodot-cpp.ios.template_release.xcframework": "" + } + This file contains a ``configuration`` section that controls the entry function of the module. You should also set the minimum compatible Godot version with ``compatability_minimum``, which prevents older version of Godot from trying to load your extension. From 63470c02d76af99d228cedd8a9f16547937ae422 Mon Sep 17 00:00:00 2001 From: Sam Freed Date: Wed, 21 Aug 2024 16:40:58 -0700 Subject: [PATCH 05/87] Fix out of date comment about depth buffer --- tutorials/shaders/advanced_postprocessing.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tutorials/shaders/advanced_postprocessing.rst b/tutorials/shaders/advanced_postprocessing.rst index d562e8fd790..8c900b7cecd 100644 --- a/tutorials/shaders/advanced_postprocessing.rst +++ b/tutorials/shaders/advanced_postprocessing.rst @@ -93,11 +93,10 @@ Once defined, the depth texture can be read with the ``texture()`` function. possible when reading from the current viewport. The depth texture cannot be accessed from another viewport to which you have rendered. -The values returned by ``depth_texture`` are between ``0.0`` and ``1.0`` and are nonlinear. +The values returned by ``depth_texture`` are between ``1.0`` and ``0.0`` (corresponding to +the near and far plane, respectively, because of using a "reverse-z" depth buffer) and are nonlinear. When displaying depth directly from the ``depth_texture``, everything will look almost -white unless it is very close. This is because the depth buffer stores objects closer -to the camera using more bits than those further, so most of the detail in depth -buffer is found close to the camera. In order to make the depth value align with world or +black unless it is very close due to that nonlinearity. In order to make the depth value align with world or model coordinates, we need to linearize the value. When we apply the projection matrix to the vertex position, the z value is made nonlinear, so to linearize it, we multiply it by the inverse of the projection matrix, which in Godot, is accessible with the variable From 52d823115b8b0b181661c45c0cb2d8fc450fb02f Mon Sep 17 00:00:00 2001 From: Sai Nane Date: Wed, 21 Aug 2024 04:06:43 +0000 Subject: [PATCH 06/87] Fix comment directive to prevent webpage display `..` immediately following paragraph text at the same indentation is interpreted as a continuation of that text, as seen on the website: https://docs.godotengine.org/en/stable/contributing/how_to_contribute.html#technical-contributions > Upload your plugins to the Godot Asset Library to make them available to others. .. update to talk about Asset Store later I feel the intent was still clear, but it does look a bit weird at the moment. Further information: - There must be a blank line between the text block and the comment for the comment to be properly interpreted as a comment. - There must not be two blank lines between the two list items, once the comment is ignored. Otherwise, the generated output produces two separate lists. This a perceptibly different amount of padding compared to when they were structurally part of the same list in HTML output, since Godot adds extra padding around `