diff --git a/.github/workflows/static_checks.yml b/.github/workflows/static_checks.yml index 8dc5e0fbff1..84066808c1c 100644 --- a/.github/workflows/static_checks.yml +++ b/.github/workflows/static_checks.yml @@ -28,14 +28,18 @@ jobs: - name: Get changed files id: changed-files + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | if [ "${{ github.event_name }}" == "pull_request" ]; then - files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }} 2> /dev/null || true) + files=$(gh pr diff ${{ github.event.pull_request.number }} --name-only) elif [ "${{ github.event_name }}" == "push" -a "${{ github.event.forced }}" == "false" -a "${{ github.event.created }}" == "false" ]; then files=$(git diff-tree --no-commit-id --name-only -r ${{ github.event.before }}..${{ github.event.after }} 2> /dev/null || true) fi echo "$files" >> changed.txt cat changed.txt + files=$(echo "$files" | grep -v 'thirdparty' | xargs -I {} sh -c 'echo "./{}"' | tr '\n' ' ') + echo "CHANGED_FILES=$files" >> $GITHUB_ENV - name: File formatting checks (file_format.sh) run: | @@ -98,9 +102,9 @@ jobs: fi - name: Spell checks via codespell + if: github.event_name == 'pull_request' && env.CHANGED_FILES != '' uses: codespell-project/actions-codespell@v1 with: - skip: ./.*,./**/.*,./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md,./core/input/gamecontrollerdb.txt,./core/string/locales.h,./editor/project_converter_3_to_4.cpp,./misc/scripts/codespell.sh,./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json - check_hidden: false - ignore_words_list: curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,nd,numer,ot,te - only_warn: true + skip: "./bin,./thirdparty,*.desktop,*.gen.*,*.po,*.pot,*.rc,./AUTHORS.md,./COPYRIGHT.txt,./DONORS.md,./core/input/gamecontrollerdb.txt,./core/string/locales.h,./editor/project_converter_3_to_4.cpp,./misc/scripts/codespell.sh,./platform/android/java/lib/src/com,./platform/web/node_modules,./platform/web/package-lock.json" + ignore_words_list: "curvelinear,doubleclick,expct,findn,gird,hel,inout,lod,nd,numer,ot,te,vai" + path: ${{ env.CHANGED_FILES }} diff --git a/.gitignore b/.gitignore index 17c9a6c95af..060f5696b87 100644 --- a/.gitignore +++ b/.gitignore @@ -63,6 +63,10 @@ tests/data/*.translation # Binutils tmp linker output of the form "stXXXXXX" where "X" is alphanumeric st[A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9][A-Za-z0-9] +# Python development +.venv +venv + # Python generated __pycache__/ *.pyc diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d51181a451..8e9f9920fca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,9 +10,14 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea ### Added +#### 2D + +- Add info label to TileMap editor ([GH-68800](https://github.com/godotengine/godot/pull/68800)). + #### Documentation - Create an "Editor-only" section in the online class reference ([GH-76410](https://github.com/godotengine/godot/pull/76410)). +- Improve RenderingServer, RenderingDevice, ShaderGlobalsOverride documentation ([GH-76008](https://github.com/godotengine/godot/pull/76008)). #### Editor @@ -26,12 +31,17 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Navigation -- Navigation: Expose NavigationAgent path postprocessing and pathfinding algorithm options ([GH-75326](https://github.com/godotengine/godot/pull/75326)). +- Expose NavigationAgent path postprocessing and pathfinding algorithm options ([GH-75326](https://github.com/godotengine/godot/pull/75326)). #### Physics - Warn when a concave polygon is assigned to ConvexPolygonShape2D ([GH-56671](https://github.com/godotengine/godot/pull/56671)). +#### Rendering + +- Expose viewports render target RID ([GH-75517](https://github.com/godotengine/godot/pull/75517)). +- Allow creation of rendering buffers at any time ([GH-75937](https://github.com/godotengine/godot/pull/75937)). + ### Changed #### 3D @@ -40,11 +50,8 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Buildsystem -- Wait for static check results before starting other CI builds ([GH-65232](https://github.com/godotengine/godot/pull/65232)). - Err when trying to build the editor without its required modules ([GH-74980](https://github.com/godotengine/godot/pull/74980)). -- Remove obsolete 'tools' in a CI workflow name ([GH-75687](https://github.com/godotengine/godot/pull/75687)). -- Visibly print trailing whitespace when static checks fail ([GH-75700](https://github.com/godotengine/godot/pull/75700)). -- CI: Speed up static checks by checking only changed files ([GH-76263](https://github.com/godotengine/godot/pull/76263)). +- Enable shadow warnings and fix raised errors ([GH-76946](https://github.com/godotengine/godot/pull/76946)). #### C#/.NET @@ -53,8 +60,8 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Core - Lift restriction that resource load thread requester has to be the initiator ([GH-73862](https://github.com/godotengine/godot/pull/73862)). -- Use HashMap instead of RBMap for ids in Windows TTS ([GH-75933](https://github.com/godotengine/godot/pull/75933)). - Rename internal root canvas group to start with underscore ([GH-76149](https://github.com/godotengine/godot/pull/76149)). +- Make acos and asin safe ([GH-76906](https://github.com/godotengine/godot/pull/76906)). #### Editor @@ -66,6 +73,10 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Adjust size of some dialogs ([GH-75895](https://github.com/godotengine/godot/pull/75895)). - Change cursor consistently when panning in the 2D Editor ([GH-75997](https://github.com/godotengine/godot/pull/75997)). - Validate renderer selection in project manager and expose default renderer setting as an enum ([GH-76331](https://github.com/godotengine/godot/pull/76331)). +- Improve the UX of ViewportTexture in the editor ([GH-64388](https://github.com/godotengine/godot/pull/64388)). +- Close built-in shaders when closing scene ([GH-75864](https://github.com/godotengine/godot/pull/75864)). +- Command Palette search now also uses original English command names ([GH-76523](https://github.com/godotengine/godot/pull/76523)). +- Preserve scene unique names when saving branch as scene ([GH-76609](https://github.com/godotengine/godot/pull/76609)). #### GUI @@ -82,6 +93,8 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - gltf: Remove obsolete hack to embed gltf textures in advanced import ([GH-75636](https://github.com/godotengine/godot/pull/75636)). - Expose more compression formats in Image and fix compress check ([GH-76014](https://github.com/godotengine/godot/pull/76014)). +- Use DXT1 when compressing PNGs with RGB format ([GH-76516](https://github.com/godotengine/godot/pull/76516)). +- gltf: Permit sparse accessors without a bufferView ([GH-76875](https://github.com/godotengine/godot/pull/76875)). #### Network @@ -90,31 +103,37 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Particles - Translate inactive GPUParticles3D particles to -INF ([GH-75162](https://github.com/godotengine/godot/pull/75162)). -- Use angle_rand to calculate base_angle in particles process material ([GH-75999](https://github.com/godotengine/godot/pull/75999)). +- Use `angle_rand` to calculate `base_angle` in particles process material ([GH-75999](https://github.com/godotengine/godot/pull/75999)). - Don't store instance transform origin in RD 3D renderer unless requested ([GH-76003](https://github.com/godotengine/godot/pull/76003)). #### Physics -- Modify contact_max_allowed_penetration precision to 3 significant digits ([GH-75665](https://github.com/godotengine/godot/pull/75665)). +- Modify `contact_max_allowed_penetration` precision to 3 significant digits ([GH-75665](https://github.com/godotengine/godot/pull/75665)). #### Porting - Android: Downgrade Android gradle plugin to version 7.2.1 ([GH-76325](https://github.com/godotengine/godot/pull/76325)). +- Linux: Ensure WindowData minimized/maximized are mutually exclusive ([GH-76868](https://github.com/godotengine/godot/pull/76868)). +- Linux: Don't use udev for joypad hotloading when running in a sandbox ([GH-76961](https://github.com/godotengine/godot/pull/76961)). +- Windows: Support long path in file access ([GH-76739](https://github.com/godotengine/godot/pull/76739)). #### Rendering - Recreate swap chain when suboptimal to avoid error spam ([GH-72859](https://github.com/godotengine/godot/pull/72859)). -- Use MODELVIEW_MATRIX when on double precision ([GH-75462](https://github.com/godotengine/godot/pull/75462)). -- Check for instancing without relying on instance_count when drawing 2D meshes ([GH-75954](https://github.com/godotengine/godot/pull/75954)). +- Use `MODELVIEW_MATRIX` when on double precision ([GH-75462](https://github.com/godotengine/godot/pull/75462)). +- Check for instancing without relying on `instance_count` when drawing 2D meshes ([GH-75954](https://github.com/godotengine/godot/pull/75954)). #### Shaders -- Write out render_mode even when mode is set to default in VisualShaders ([GH-75957](https://github.com/godotengine/godot/pull/75957)). +- Write out `render_mode` even when mode is set to default in VisualShaders ([GH-75957](https://github.com/godotengine/godot/pull/75957)). #### Thirdparty -- thorvg updated to 0.8.4. +- astcenc updated to 4.4.0. +- doctest updated to 2.4.11. - mbedtls updated to 2.28.3. +- thorvg updated to 0.9.0. +- CA root certificates updated to 2023-03-23 bundle from Mozilla. ### Fixed @@ -124,19 +143,25 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Fix rendering odd-sized tiles ([GH-74814](https://github.com/godotengine/godot/pull/74814)). - Fix TouchScreenButton not redrawn when texture changes ([GH-75016](https://github.com/godotengine/godot/pull/75016)). +#### 3D + +- 3D: Fixes to CSG robustness ([GH-74771](https://github.com/godotengine/godot/pull/74771)). +- 3D: Fix infinite loop in CSG `Build2DFaces::_find_edge_intersections` ([GH-76521](https://github.com/godotengine/godot/pull/76521)). +- 3D: Fix `SurfaceTool::create_from_blend_shape()` ([GH-76669](https://github.com/godotengine/godot/pull/76669)). + #### Animation -- Fix blend_shape (shapekey) empty name import ([GH-75990](https://github.com/godotengine/godot/pull/75990)). +- Fix `blend_shape` (shapekey) empty name import ([GH-75990](https://github.com/godotengine/godot/pull/75990)). #### Audio -- Fix crash caused by invalid mix_rate assignment due to bogus project settings ([GH-69833](https://github.com/godotengine/godot/pull/69833)). +- Fix crash caused by invalid `mix_rate` assignment due to bogus project settings ([GH-69833](https://github.com/godotengine/godot/pull/69833)). - Fix AudioStreamPlayer2D crash when PhysicsServer2D runs on thread ([GH-75728](https://github.com/godotengine/godot/pull/75728)). #### Buildsystem -- Fix the Python type error when creating the .sln file ([GH-75309](https://github.com/godotengine/godot/pull/75309)). -- Fix forced optimization in dev_build ([GH-75909](https://github.com/godotengine/godot/pull/75909)). +- Fix the Python type error when creating the `.sln` file ([GH-75309](https://github.com/godotengine/godot/pull/75309)). +- Fix forced optimization in `dev_build` ([GH-75909](https://github.com/godotengine/godot/pull/75909)). #### Core @@ -145,6 +170,9 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Fix moving position indicator out of bounds in FileAccessMemory ([GH-75641](https://github.com/godotengine/godot/pull/75641)). - Fix expected argument count in Callable call error text ([GH-76259](https://github.com/godotengine/godot/pull/76259)). - Fix lerp error message ([GH-76314](https://github.com/godotengine/godot/pull/76314)). +- Make `LocalVector` respect its `tight` template parameter ([GH-64120](https://github.com/godotengine/godot/pull/64120)). +- Prevent errors when using ViewportTexture ([GH-75751](https://github.com/godotengine/godot/pull/75751)). +- Fix size error in `BitMap.opaque_to_polygons` ([GH-76536](https://github.com/godotengine/godot/pull/76536)). #### Editor @@ -154,15 +182,22 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Initialize editor values on first launch ([GH-75799](https://github.com/godotengine/godot/pull/75799)). - Fix connect signal dialog not allowing Unicode method name ([GH-75814](https://github.com/godotengine/godot/pull/75814)). - Fix method dialog label ([GH-75844](https://github.com/godotengine/godot/pull/75844)). -- Fix editor spin slider remaining editable if set read_only while editing ([GH-76122](https://github.com/godotengine/godot/pull/76122)). +- Fix editor spin slider remaining editable if set `read_only` while editing ([GH-76122](https://github.com/godotengine/godot/pull/76122)). - Fix layout list not resizing in editor layout dialog ([GH-76364](https://github.com/godotengine/godot/pull/76364)). - Fix `line_spacing` in code editor will not take effect immediately on change ([GH-76396](https://github.com/godotengine/godot/pull/76396)). - Fix inconsistent file dialog settings usage ([GH-76421](https://github.com/godotengine/godot/pull/76421)). +- Fix Node arrays appear as Object arrays in the inspector ([GH-76530](https://github.com/godotengine/godot/pull/76530)). +- Fix CollisionShape2D editor crashes ([GH-76546](https://github.com/godotengine/godot/pull/76546), [GH-76798](https://github.com/godotengine/godot/pull/76798)). +- Fix 2D shader preview draws over uniform ([GH-76555](https://github.com/godotengine/godot/pull/76555)). #### Export - Fix validation of codesigning certificate password on macOS ([GH-74326](https://github.com/godotengine/godot/pull/74326)). +#### GDExtension + +- Add missing bindings and documentation for MultiplayerPeerExtension ([GH-75116](https://github.com/godotengine/godot/pull/75116)). + #### GDScript - Add missing member type check when resolving `extends` ([GH-75879](https://github.com/godotengine/godot/pull/75879)). @@ -172,25 +207,27 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Fix mixed tabs and spaces issues ([GH-76286](https://github.com/godotengine/godot/pull/76286)). - Fix wrong file name on function call error ([GH-76404](https://github.com/godotengine/godot/pull/76404)). - Don't fail when freed object is returned ([GH-76483](https://github.com/godotengine/godot/pull/76483)). +- Don't send empty LSP completion command ([GH-76790](https://github.com/godotengine/godot/pull/76790)). #### GUI -- Fixed RichTextLabel wrong selection offset in padded table cell ([GH-71742](https://github.com/godotengine/godot/pull/71742)). +- Fix RichTextLabel wrong selection offset in padded table cell ([GH-71742](https://github.com/godotengine/godot/pull/71742)). - Fix commenting collapsed function issue ([GH-75070](https://github.com/godotengine/godot/pull/75070)). - Fix fill align and trim with enabled dropcap in `RichTextLabel` ([GH-75504](https://github.com/godotengine/godot/pull/75504)). - Fix descriptions not showing for theme properties ([GH-75559](https://github.com/godotengine/godot/pull/75559)). - Fix some theme values affect the editor by setting a default value for them ([GH-75566](https://github.com/godotengine/godot/pull/75566)). - Fix several GraphEdit operations at zoom levels other than 100% ([GH-75595](https://github.com/godotengine/godot/pull/75595)). -- Fix uninitialized member in CodeEdit ([GH-75829](https://github.com/godotengine/godot/pull/75829)). - Fix offset calculation in Tree when there are hidden items ([GH-75977](https://github.com/godotengine/godot/pull/75977)). - Add missing LineEdit constants in editor theme ([GH-76123](https://github.com/godotengine/godot/pull/76123)). - Fix blurry borders on antialiased StyleBoxFlat ([GH-76132](https://github.com/godotengine/godot/pull/76132)). - Fix fractional ascent for image fonts with odd height ([GH-76136](https://github.com/godotengine/godot/pull/76136)). +- Fix right click in selection of additional caret ([GH-76472](https://github.com/godotengine/godot/pull/76472)). #### Import -- SVG: fix tvg::Picture->size() and scale based errors. ([GH-75034](https://github.com/godotengine/godot/pull/75034)). +- SVG: Fix `tvg::Picture->size()` and scale based errors ([GH-75034](https://github.com/godotengine/godot/pull/75034)). - Fix OBJ mesh importer smoothing handling ([GH-75315](https://github.com/godotengine/godot/pull/75315)). +- Fix animation silhouette using incorrect index ([GH-76499](https://github.com/godotengine/godot/pull/76499)). #### Input @@ -216,25 +253,37 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea #### Porting - Android: Fix issue with resizing the display when using the compatibility renderer ([GH-76464](https://github.com/godotengine/godot/pull/76464)). +- Android: Allow concurrent buffering and dispatch of input events ([GH-76399](https://github.com/godotengine/godot/pull/76399)). +- Android: Fix double tap & drag on Android ([GH-76791](https://github.com/godotengine/godot/pull/76791)). - iOS: Fix splash screen rotation ([GH-76037](https://github.com/godotengine/godot/pull/76037)). +- iOS: Fix loading of GDExtension dylibs auto converted to framework ([GH-76510](https://github.com/godotengine/godot/pull/76510)). - Windows: Fix clipboard relying on focused window ([GH-73878](https://github.com/godotengine/godot/pull/73878)). - Windows: Fix queuing utterances in rapid succession ([GH-75880](https://github.com/godotengine/godot/pull/75880)). - Windows: Cleanup COM library initialization/uninitialization ([GH-75881](https://github.com/godotengine/godot/pull/75881)). - Windows: Fix StringFileInfo structure ([GH-76001](https://github.com/godotengine/godot/pull/76001)). +- Windows: Add mono audio support to WASAPI ([GH-76541](https://github.com/godotengine/godot/pull/76541)). #### Rendering - Fix interpolation of R0 for metallic and calculation of the Fresnel Shlick term in SSR ([GH-75368](https://github.com/godotengine/godot/pull/75368)). - Fix `get_test_texture()` returning an almost fully white texture ([GH-75632](https://github.com/godotengine/godot/pull/75632)). - Ensure that depth write state is updated before transparent pass in OpenGL3 renderer ([GH-75968](https://github.com/godotengine/godot/pull/75968)). -- Fix editor lock on sdf collision bake on error ([GH-76257](https://github.com/godotengine/godot/pull/76257)). +- Fix editor lock on SDF collision bake on error ([GH-76257](https://github.com/godotengine/godot/pull/76257)). - Fix issues with Vulkan layout transitions ([GH-76315](https://github.com/godotengine/godot/pull/76315)). - Fix breakages of volumetric fog on voxel GI changes ([GH-76437](https://github.com/godotengine/godot/pull/76437)). +- Fix GLES3 rendering on Android studio emulator ([GH-74945](https://github.com/godotengine/godot/pull/74945)). +- Fix more voxel GI issues ([GH-76550](https://github.com/godotengine/godot/pull/76550)). +- Use proper UV in cubemap downsampler raster (Fixes reflections in mobile renderer) ([GH-76692](https://github.com/godotengine/godot/pull/76692)). #### Shaders - Fix crashes caused due to missing type specifier on visual shader editor ([GH-75809](https://github.com/godotengine/godot/pull/75809)). - Fix Shader Preprocessor line numbering when disabled ([GH-76479](https://github.com/godotengine/godot/pull/76479)). +- Fix rotation issue with `NODE_POSITION_VIEW` shader built-in ([GH-76109](https://github.com/godotengine/godot/pull/76109)). + +#### XR + +- Fix incorrect HTC action map entries ([GH-74930](https://github.com/godotengine/godot/pull/74930)). ## [4.0.2] - 2023-04-04 @@ -257,7 +306,7 @@ See the [release announcement](https://godotengine.org/article/maintenance-relea - Android: Use the new API for virtual keyboard height detection on Android, bugfix for old API ([GH-74398](https://github.com/godotengine/godot/pull/74398)). - Android: Configure maven central snapshot versions for the Godot Android library ([GH-74470](https://github.com/godotengine/godot/pull/74470)). - Android: Add "filesRoot" path to Android provider paths xml ([GH-74673](https://github.com/godotengine/godot/pull/74673)). -- macOS: Re-add support for the `_sc_` inside app bundle. ([GH-73429](https://github.com/godotengine/godot/pull/73429)). +- macOS: Re-add support for the `_sc_` inside app bundle ([GH-73429](https://github.com/godotengine/godot/pull/73429)). #### Project converter @@ -1943,7 +1992,7 @@ See the [release announcement](https://godotengine.org/article/godot-3-3-has-arr - Support for automatically building Android templates before exporting. - This makes 3rd-party SDK integration easier. - Support for [texture atlases in 2D](https://godotengine.org/article/atlas-support-returns-godot-3-2). -- Major improvements to the visual shader system. ([News post 1](https://godotengine.org/article/major-update-for-visual-shader-in-godot-3-2), [News post 2](https://godotengine.org/article/major-update-visual-shaders-godot-3-2-part-2)) +- Major improvements to the visual shader system ([News post 1](https://godotengine.org/article/major-update-for-visual-shader-in-godot-3-2), [News post 2](https://godotengine.org/article/major-update-visual-shaders-godot-3-2-part-2)). - Redesigned visual shader editor with drag-and-drop capability. - Textures can be dragged from the FileSystem dock to be added as nodes. - Most functions available in GLSL are now exposed. diff --git a/COPYRIGHT.txt b/COPYRIGHT.txt index a3e06c545fc..9e30f9050b9 100644 --- a/COPYRIGHT.txt +++ b/COPYRIGHT.txt @@ -169,7 +169,7 @@ License: Expat Files: ./thirdparty/doctest/ Comment: doctest -Copyright: 2016-2021, Viktor Kirilov +Copyright: 2016-2023, Viktor Kirilov License: Expat Files: ./thirdparty/embree/ diff --git a/SConstruct b/SConstruct index cb4bf954673..403304f49fe 100644 --- a/SConstruct +++ b/SConstruct @@ -686,7 +686,8 @@ if selected_platform in platform_list: if env["warnings"] == "extra": env.Append(CCFLAGS=["/W4"]) elif env["warnings"] == "all": - env.Append(CCFLAGS=["/W3"]) + # C4458 is like -Wshadow. Part of /W4 but let's apply it for the default /W3 too. + env.Append(CCFLAGS=["/W3", "/w34458"]) elif env["warnings"] == "moderate": env.Append(CCFLAGS=["/W2"]) # Disable warnings which we don't plan to fix. @@ -715,7 +716,7 @@ if selected_platform in platform_list: common_warnings = [] if methods.using_gcc(env): - common_warnings += ["-Wshadow-local", "-Wno-misleading-indentation"] + common_warnings += ["-Wshadow", "-Wno-misleading-indentation"] if cc_version_major == 7: # Bogus warning fixed in 8+. common_warnings += ["-Wno-strict-overflow"] if cc_version_major < 11: @@ -725,6 +726,7 @@ if selected_platform in platform_list: if cc_version_major >= 12: # False positives in our error macros, see GH-58747. common_warnings += ["-Wno-return-type"] elif methods.using_clang(env) or methods.using_emcc(env): + common_warnings += ["-Wshadow-field-in-constructor", "-Wshadow-uncaptured-local"] # We often implement `operator<` for structs of pointers as a requirement # for putting them in `Set` or `Map`. We don't mind about unreliable ordering. common_warnings += ["-Wno-ordered-compare-function-pointers"] diff --git a/core/input/input.cpp b/core/input/input.cpp index e74523e0598..2b3e0b56e4f 100644 --- a/core/input/input.cpp +++ b/core/input/input.cpp @@ -35,6 +35,10 @@ #include "core/input/input_map.h" #include "core/os/os.h" +#ifdef DEV_ENABLED +#include "core/os/thread.h" +#endif + static const char *_joy_buttons[(size_t)JoyButton::SDL_MAX] = { "a", "b", @@ -486,6 +490,10 @@ Vector3 Input::get_gyroscope() const { } void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_emulated) { + // This function does the final delivery of the input event to user land. + // Regardless where the event came from originally, this has to happen on the main thread. + DEV_ASSERT(Thread::get_caller_id() == Thread::get_main_id()); + // Notes on mouse-touch emulation: // - Emulated mouse events are parsed, that is, re-routed to this method, so they make the same effects // as true mouse events. The only difference is the situation is flagged as emulated so they are not @@ -537,7 +545,9 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em touch_event->set_position(mb->get_position()); touch_event->set_double_tap(mb->is_double_click()); touch_event->set_device(InputEvent::DEVICE_ID_EMULATION); + _THREAD_SAFE_UNLOCK_ event_dispatch_function(touch_event); + _THREAD_SAFE_LOCK_ } } @@ -563,7 +573,9 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em drag_event->set_velocity(get_last_mouse_velocity()); drag_event->set_device(InputEvent::DEVICE_ID_EMULATION); + _THREAD_SAFE_UNLOCK_ event_dispatch_function(drag_event); + _THREAD_SAFE_LOCK_ } } @@ -664,7 +676,9 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em if (ge.is_valid()) { if (event_dispatch_function) { + _THREAD_SAFE_UNLOCK_ event_dispatch_function(ge); + _THREAD_SAFE_LOCK_ } } @@ -687,7 +701,9 @@ void Input::_parse_input_event_impl(const Ref &p_event, bool p_is_em } if (event_dispatch_function) { + _THREAD_SAFE_UNLOCK_ event_dispatch_function(p_event); + _THREAD_SAFE_LOCK_ } } @@ -831,6 +847,7 @@ bool Input::is_emulating_touch_from_mouse() const { // Calling this whenever the game window is focused helps unsticking the "touch mouse" // if the OS or its abstraction class hasn't properly reported that touch pointers raised void Input::ensure_touch_mouse_raised() { + _THREAD_SAFE_METHOD_ if (mouse_from_touch_index != -1) { mouse_from_touch_index = -1; @@ -937,8 +954,15 @@ void Input::flush_buffered_events() { _THREAD_SAFE_METHOD_ while (buffered_events.front()) { - _parse_input_event_impl(buffered_events.front()->get(), false); + // The final delivery of the input event involves releasing the lock. + // While the lock is released, another thread may lock it and add new events to the back. + // Therefore, we get each event and pop it while we still have the lock, + // to ensure the list is in a consistent state. + List>::Element *E = buffered_events.front(); + Ref e = E->get(); buffered_events.pop_front(); + + _parse_input_event_impl(e, false); } } diff --git a/core/io/dir_access.h b/core/io/dir_access.h index 51eb68eaea0..52ed688debf 100644 --- a/core/io/dir_access.h +++ b/core/io/dir_access.h @@ -68,7 +68,7 @@ protected: virtual String _get_root_string() const; AccessType get_access_type() const; - String fix_path(String p_path) const; + virtual String fix_path(String p_path) const; template static Ref _create_builtin() { diff --git a/core/io/file_access.h b/core/io/file_access.h index 47770cad870..3374dca7a12 100644 --- a/core/io/file_access.h +++ b/core/io/file_access.h @@ -80,7 +80,7 @@ protected: static void _bind_methods(); AccessType get_access_type() const; - String fix_path(const String &p_path) const; + virtual String fix_path(const String &p_path) const; virtual Error open_internal(const String &p_path, int p_mode_flags) = 0; ///< open a file virtual uint64_t _get_modified_time(const String &p_file) = 0; virtual void _set_access_type(AccessType p_access); diff --git a/core/math/basis.cpp b/core/math/basis.cpp index 95a4187062f..bfd902c7e28 100644 --- a/core/math/basis.cpp +++ b/core/math/basis.cpp @@ -807,8 +807,8 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const { z = (rows[1][0] - rows[0][1]) / s; r_axis = Vector3(x, y, z); - // CLAMP to avoid NaN if the value passed to acos is not in [0,1]. - r_angle = Math::acos(CLAMP((rows[0][0] + rows[1][1] + rows[2][2] - 1) / 2, (real_t)0.0, (real_t)1.0)); + // acos does clamping. + r_angle = Math::acos((rows[0][0] + rows[1][1] + rows[2][2] - 1) / 2); } void Basis::set_quaternion(const Quaternion &p_quaternion) { diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index a03438a339c..76b30629448 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -596,9 +596,9 @@ private: } }; - enum Orientation { NONE, - CLOCKWISE, - COUNTER_CLOCKWISE }; + enum Orientation { ORIENTATION_NONE, + ORIENTATION_CLOCKWISE, + ORIENTATION_COUNTER_CLOCKWISE }; Vector3 scaling; Vector3 center; @@ -1140,13 +1140,13 @@ ConvexHullInternal::Orientation ConvexHullInternal::get_orientation(const Edge * CHULL_ASSERT(!m.is_zero()); int64_t dot = n.dot(m); CHULL_ASSERT(dot != 0); - return (dot > 0) ? COUNTER_CLOCKWISE : CLOCKWISE; + return (dot > 0) ? ORIENTATION_COUNTER_CLOCKWISE : ORIENTATION_CLOCKWISE; } - return COUNTER_CLOCKWISE; + return ORIENTATION_COUNTER_CLOCKWISE; } else if (p_prev->prev == p_next) { - return CLOCKWISE; + return ORIENTATION_CLOCKWISE; } else { - return NONE; + return ORIENTATION_NONE; } } @@ -1176,7 +1176,7 @@ ConvexHullInternal::Edge *ConvexHullInternal::find_max_angle(bool p_ccw, const V } else if ((cmp = cot.compare(p_min_cot)) < 0) { p_min_cot = cot; min_edge = e; - } else if ((cmp == 0) && (p_ccw == (get_orientation(min_edge, e, p_s, t) == COUNTER_CLOCKWISE))) { + } else if ((cmp == 0) && (p_ccw == (get_orientation(min_edge, e, p_s, t) == ORIENTATION_COUNTER_CLOCKWISE))) { min_edge = e; } } @@ -1375,7 +1375,7 @@ void ConvexHullInternal::merge(IntermediateHull &p_h0, IntermediateHull &p_h1) { int64_t dot = (*e->target - *c0).dot(normal); CHULL_ASSERT(dot <= 0); if ((dot == 0) && ((*e->target - *c0).dot(t) > 0)) { - if (!start0 || (get_orientation(start0, e, s, Point32(0, 0, -1)) == CLOCKWISE)) { + if (!start0 || (get_orientation(start0, e, s, Point32(0, 0, -1)) == ORIENTATION_CLOCKWISE)) { start0 = e; } } @@ -1390,7 +1390,7 @@ void ConvexHullInternal::merge(IntermediateHull &p_h0, IntermediateHull &p_h1) { int64_t dot = (*e->target - *c1).dot(normal); CHULL_ASSERT(dot <= 0); if ((dot == 0) && ((*e->target - *c1).dot(t) > 0)) { - if (!start1 || (get_orientation(start1, e, s, Point32(0, 0, -1)) == COUNTER_CLOCKWISE)) { + if (!start1 || (get_orientation(start1, e, s, Point32(0, 0, -1)) == ORIENTATION_COUNTER_CLOCKWISE)) { start1 = e; } } diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 078320d6203..f96d3a909fb 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -74,11 +74,13 @@ public: static _ALWAYS_INLINE_ double tanh(double p_x) { return ::tanh(p_x); } static _ALWAYS_INLINE_ float tanh(float p_x) { return ::tanhf(p_x); } - static _ALWAYS_INLINE_ double asin(double p_x) { return ::asin(p_x); } - static _ALWAYS_INLINE_ float asin(float p_x) { return ::asinf(p_x); } + // Always does clamping so always safe to use. + static _ALWAYS_INLINE_ double asin(double p_x) { return p_x < -1 ? (-Math_PI / 2) : (p_x > 1 ? (Math_PI / 2) : ::asin(p_x)); } + static _ALWAYS_INLINE_ float asin(float p_x) { return p_x < -1 ? (-Math_PI / 2) : (p_x > 1 ? (Math_PI / 2) : ::asinf(p_x)); } - static _ALWAYS_INLINE_ double acos(double p_x) { return ::acos(p_x); } - static _ALWAYS_INLINE_ float acos(float p_x) { return ::acosf(p_x); } + // Always does clamping so always safe to use. + static _ALWAYS_INLINE_ double acos(double p_x) { return p_x < -1 ? Math_PI : (p_x > 1 ? 0 : ::acos(p_x)); } + static _ALWAYS_INLINE_ float acos(float p_x) { return p_x < -1 ? Math_PI : (p_x > 1 ? 0 : ::acosf(p_x)); } static _ALWAYS_INLINE_ double atan(double p_x) { return ::atan(p_x); } static _ALWAYS_INLINE_ float atan(float p_x) { return ::atanf(p_x); } diff --git a/core/math/quaternion.cpp b/core/math/quaternion.cpp index 34e212a5b65..e4ad17c8ef8 100644 --- a/core/math/quaternion.cpp +++ b/core/math/quaternion.cpp @@ -35,7 +35,8 @@ real_t Quaternion::angle_to(const Quaternion &p_to) const { real_t d = dot(p_to); - return Math::acos(CLAMP(d * d * 2 - 1, -1, 1)); + // acos does clamping. + return Math::acos(d * d * 2 - 1); } Vector3 Quaternion::get_euler(EulerOrder p_order) const { diff --git a/core/math/static_raycaster.h b/core/math/static_raycaster.h index 1bafc29c576..c53868e12d7 100644 --- a/core/math/static_raycaster.h +++ b/core/math/static_raycaster.h @@ -59,15 +59,15 @@ public: /*! Constructs a ray from origin, direction, and ray segment. Near * has to be smaller than far. */ - _FORCE_INLINE_ Ray(const Vector3 &org, - const Vector3 &dir, - float tnear = 0.0f, - float tfar = INFINITY) : - org(org), - tnear(tnear), - dir(dir), + _FORCE_INLINE_ Ray(const Vector3 &p_org, + const Vector3 &p_dir, + float p_tnear = 0.0f, + float p_tfar = INFINITY) : + org(p_org), + tnear(p_tnear), + dir(p_dir), time(0.0f), - tfar(tfar), + tfar(p_tfar), mask(-1), u(0.0), v(0.0), diff --git a/core/os/time.cpp b/core/os/time.cpp index 12e6f085257..038e4adc036 100644 --- a/core/os/time.cpp +++ b/core/os/time.cpp @@ -382,10 +382,10 @@ String Time::get_time_string_from_system(bool p_utc) const { Dictionary Time::get_time_zone_from_system() const { OS::TimeZoneInfo info = OS::get_singleton()->get_time_zone_info(); - Dictionary timezone; - timezone["bias"] = info.bias; - timezone["name"] = info.name; - return timezone; + Dictionary ret_timezone; + ret_timezone["bias"] = info.bias; + ret_timezone["name"] = info.name; + return ret_timezone; } double Time::get_unix_time_from_system() const { diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index 5311a94987f..22db3a57443 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -59,11 +59,7 @@ public: _FORCE_INLINE_ void push_back(T p_elem) { if (unlikely(count == capacity)) { - if (capacity == 0) { - capacity = 1; - } else { - capacity <<= 1; - } + capacity = tight ? (capacity + 1) : MAX((U)1, capacity << 1); data = (T *)memrealloc(data, capacity * sizeof(T)); CRASH_COND_MSG(!data, "Out of memory"); } @@ -87,7 +83,7 @@ public: } /// Removes the item copying the last value into the position of the one to - /// remove. It's generally faster than `remove`. + /// remove. It's generally faster than `remove_at`. void remove_at_unordered(U p_index) { ERR_FAIL_INDEX(p_index, count); count--; @@ -143,12 +139,7 @@ public: count = p_size; } else if (p_size > count) { if (unlikely(p_size > capacity)) { - if (capacity == 0) { - capacity = 1; - } - while (capacity < p_size) { - capacity <<= 1; - } + capacity = tight ? p_size : nearest_power_of_2_templated(p_size); data = (T *)memrealloc(data, capacity * sizeof(T)); CRASH_COND_MSG(!data, "Out of memory"); } diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 73f1fe9ad6d..8c84a55ba03 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -65,7 +65,7 @@ - Returns the arc cosine of [param x] in radians. Use to get the angle of cosine [param x]. [param x] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method acos] will return [constant @GDScript.NAN]. + Returns the arc cosine of [param x] in radians. Use to get the angle of cosine [param x]. [param x] will be clamped between [code]-1.0[/code] and [code]1.0[/code] (inclusive), in order to prevent [method acos] from returning [constant @GDScript.NAN]. [codeblock] # c is 0.523599 or 30 degrees if converted with rad_to_deg(c) var c = acos(0.866025) @@ -76,7 +76,7 @@ - Returns the arc sine of [param x] in radians. Use to get the angle of sine [param x]. [param x] must be between [code]-1.0[/code] and [code]1.0[/code] (inclusive), otherwise, [method asin] will return [constant @GDScript.NAN]. + Returns the arc sine of [param x] in radians. Use to get the angle of sine [param x]. [param x] will be clamped between [code]-1.0[/code] and [code]1.0[/code] (inclusive), in order to prevent [method asin] from returning [constant @GDScript.NAN]. [codeblock] # s is 0.523599 or 30 degrees if converted with rad_to_deg(s) var s = asin(0.5) diff --git a/doc/classes/AudioStreamGenerator.xml b/doc/classes/AudioStreamGenerator.xml index c8f081215d5..c2aac99cb88 100644 --- a/doc/classes/AudioStreamGenerator.xml +++ b/doc/classes/AudioStreamGenerator.xml @@ -1,16 +1,36 @@ - Audio stream that generates sounds procedurally. + An audio stream with utilities for procedural sound generation. - This audio stream does not play back sounds, but expects a script to generate audio data for it instead. See also [AudioStreamGeneratorPlayback]. + [AudioStreamGenerator] is a type of audio stream that does not play back sounds on its own; instead, it expects a script to generate audio data for it. See also [AudioStreamGeneratorPlayback]. + Here's a sample on how to use it to generate a sine wave: + [codeblock] + var playback # Will hold the AudioStreamGeneratorPlayback. + @onready var sample_hz = $AudioStreamPlayer.stream.mix_rate + var pulse_hz = 440.0 # The frequency of the sound wave. + + func _ready(): + $AudioStreamPlayer.play() + playback = $AudioStreamPlayer.get_stream_playback() + fill_buffer() + + func fill_buffer(): + var phase = 0.0 + var increment = pulse_hz / sample_hz + var frames_available = playback.get_frames_available() + + for i in range(frames_available): + playback.push_frame(Vector2.ONE * sin(phase * TAU)) + phase = fmod(phase + increment, 1.0) + [/codeblock] + In the example above, the "AudioStreamPlayer" node must use an [AudioStreamGenerator] as its stream. The [code]fill_buffer[/code] function provides audio data for approximating a sine wave. See also [AudioEffectSpectrumAnalyzer] for performing real-time audio spectrum analysis. [b]Note:[/b] Due to performance constraints, this class is best used from C# or from a compiled language via GDExtension. If you still want to use this class from GDScript, consider using a lower [member mix_rate] such as 11,025 Hz or 22,050 Hz. https://godotengine.org/asset-library/asset/526 - https://godotengine.org/article/godot-32-will-get-new-audio-features diff --git a/doc/classes/BaseMaterial3D.xml b/doc/classes/BaseMaterial3D.xml index 1d951521037..c42b796fc3e 100644 --- a/doc/classes/BaseMaterial3D.xml +++ b/doc/classes/BaseMaterial3D.xml @@ -356,13 +356,13 @@ [b]Note:[/b] [member specular_mode] only applies to the specular blob. It does not affect specular reflections from the sky, screen-space reflections, [VoxelGI], SDFGI or [ReflectionProbe]s. To disable reflections from these sources as well, set [member metallic_specular] to [code]0.0[/code] instead. - If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. + If [code]true[/code], subsurface scattering is enabled. Emulates light that penetrates an object's surface, is scattered, and then emerges. Subsurface scattering quality is controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality]. If [code]true[/code], subsurface scattering will use a special mode optimized for the color and density of human skin, such as boosting the intensity of the red channel in subsurface scattering. - The strength of the subsurface scattering effect. + The strength of the subsurface scattering effect. The depth of the effect is also controlled by [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale], which is set globally. Texture used to control the subsurface scattering strength. Stored in the red texture channel. Multiplied by [member subsurf_scatter_strength]. diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index 572963b4069..e2a43093eef 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -237,7 +237,7 @@ - Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors]. + Draws a solid polygon of any number of points, convex or concave. Unlike [method draw_colored_polygon], each point's color can be changed individually. See also [method draw_polyline] and [method draw_polyline_colors]. If you need more flexibility (such as being able to use bones), use [method RenderingServer.canvas_item_add_triangle_array] instead. @@ -279,7 +279,7 @@ - Draws a rectangle. If [param filled] is [code]true[/code], the rectangle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the rectangle will be drawn as a stroke with the [param color] and [param width] specified. + Draws a rectangle. If [param filled] is [code]true[/code], the rectangle will be filled with the [param color] specified. If [param filled] is [code]false[/code], the rectangle will be drawn as a stroke with the [param color] and [param width] specified. See also [method draw_texture_rect]. If [param width] is negative, then two-point primitives will be drawn instead of a four-point ones. This means that when the CanvasItem is scaled, the lines will remain thin. If this behavior is not desired, then pass a positive [param width] like [code]1.0[/code]. [b]Note:[/b] [param width] is only effective if [param filled] is [code]false[/code]. [b]Note:[/b] Unfilled rectangles drawn with a negative [param width] may not display perfectly. For example, corners may be missing or brighter due to overlapping lines (for a translucent [param color]). @@ -380,7 +380,7 @@ - Draws a textured rectangle at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. + Draws a textured rectangle at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. See also [method draw_rect] and [method draw_texture_rect_region]. @@ -392,7 +392,7 @@ - Draws a textured rectangle region at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. + Draws a textured rectangle from a texture's region (specified by [param src_rect]) at a given position, optionally modulated by a color. If [param transpose] is [code]true[/code], the texture will have its X and Y coordinates swapped. See also [method draw_texture_rect]. @@ -423,6 +423,7 @@ Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is in using the coordinate system of the [CanvasLayer]. + [b]Note:[/b] For screen-space coordinates (e.g. when using a non-embedded [Popup]), you can use [method DisplayServer.mouse_get_position]. @@ -502,7 +503,7 @@ - Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see [method _draw]). + Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree, and is consequently not drawn (see [method _draw]). @@ -597,7 +598,7 @@ The rendering layer in which this [CanvasItem] is rendered by [Viewport] nodes. A [Viewport] will render a [CanvasItem] if it and all its parents share a layer with the [Viewport]'s canvas cull mask. - If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). + If [code]true[/code], this [CanvasItem] is drawn. The node is only visible if all of its ancestors are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). [b]Note:[/b] For controls that inherit [Popup], the correct way to make them visible is to call one of the multiple [code]popup*()[/code] functions instead. diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 65a6668f430..310d98aaae4 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -537,7 +537,7 @@ Marks the option as a member. - Marks the option as a enum entry. + Marks the option as an enum entry. Marks the option as a constant. diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index a4b5764c3b8..4996c6fe018 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -209,6 +209,7 @@ Marks an input event as handled. Once you accept an input event, it stops propagating, even to nodes listening to [method Node._unhandled_input] or [method Node._unhandled_key_input]. + [b]Note:[/b] This does not affect the methods in [Input], only the way events are propagated. diff --git a/doc/classes/CurveTexture.xml b/doc/classes/CurveTexture.xml index 03e008d7386..ce7645026bf 100644 --- a/doc/classes/CurveTexture.xml +++ b/doc/classes/CurveTexture.xml @@ -15,7 +15,7 @@ - The format the texture should be generated with. When passing a CurveTexture as a input to a [Shader], this may need to be adjusted. + The format the texture should be generated with. When passing a CurveTexture as an input to a [Shader], this may need to be adjusted. The width of the texture (in pixels). Higher values make it possible to represent high-frequency data better (such as sudden direction changes), at the cost of increased generation time and memory usage. diff --git a/doc/classes/Decal.xml b/doc/classes/Decal.xml index 824416e4d48..ff9911f132e 100644 --- a/doc/classes/Decal.xml +++ b/doc/classes/Decal.xml @@ -107,7 +107,7 @@ [Texture2D] storing ambient occlusion, roughness, and metallic for the decal. Use this to add extra detail to decals. [b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a per-material basis, the filter mode for [Decal] textures is set globally with [member ProjectSettings.rendering/textures/decals/filter]. - [b]Note:[/b] Setting this texture alone will not result in a visible decal, as [member texture_albedo] must also be set. To create a ORM-only decal, load an albedo texture into [member texture_albedo] and set [member albedo_mix] to [code]0.0[/code]. The albedo texture's alpha channel will be used to determine where the underlying surface's ORM map should be overridden (and its intensity). + [b]Note:[/b] Setting this texture alone will not result in a visible decal, as [member texture_albedo] must also be set. To create an ORM-only decal, load an albedo texture into [member texture_albedo] and set [member albedo_mix] to [code]0.0[/code]. The albedo texture's alpha channel will be used to determine where the underlying surface's ORM map should be overridden (and its intensity). Sets the curve over which the decal will fade as the surface gets further from the center of the [AABB]. Only positive values are valid (negative values will be clamped to [code]0.0[/code]). See also [member lower_fade]. diff --git a/doc/classes/DirAccess.xml b/doc/classes/DirAccess.xml index 8e1528f1c65..ed93f09a0d0 100644 --- a/doc/classes/DirAccess.xml +++ b/doc/classes/DirAccess.xml @@ -173,6 +173,7 @@ Returns a [PackedStringArray] containing filenames of the directory contents, excluding directories. The array is sorted alphabetically. Affected by [member include_hidden]. + [b]Note:[/b] When used on a [code]res://[/code] path in an exported project, only the files actually included in the PCK at the given folder level are returned. In practice, this means that since imported resources are stored in a top-level [code].godot/[/code] folder, only paths to [code]*.gd[/code] and [code]*.import[/code] files are returned (plus a few files such as [code]project.godot[/code] or [code]project.binary[code] and the project icon). In an exported project, the list of returned files will also vary depending on whether [member ProjectSettings.editor/export/convert_text_resources_to_binary] is [code]true[/code]. diff --git a/doc/classes/DisplayServer.xml b/doc/classes/DisplayServer.xml index 5e898de976a..4c7297f75c3 100644 --- a/doc/classes/DisplayServer.xml +++ b/doc/classes/DisplayServer.xml @@ -462,7 +462,7 @@ - Returns number of states of an multistate item. See [method global_menu_add_multistate_item] for details. + Returns number of states of a multistate item. See [method global_menu_add_multistate_item] for details. [b]Note:[/b] This method is implemented on macOS. @@ -471,7 +471,7 @@ - Returns the state of an multistate item. See [method global_menu_add_multistate_item] for details. + Returns the state of a multistate item. See [method global_menu_add_multistate_item] for details. [b]Note:[/b] This method is implemented on macOS. @@ -648,7 +648,7 @@ - Sets number of state of an multistate item. See [method global_menu_add_multistate_item] for details. + Sets number of state of a multistate item. See [method global_menu_add_multistate_item] for details. [b]Note:[/b] This method is implemented on macOS. @@ -669,7 +669,7 @@ - Sets the state of an multistate item. See [method global_menu_add_multistate_item] for details. + Sets the state of a multistate item. See [method global_menu_add_multistate_item] for details. [b]Note:[/b] This method is implemented on macOS. @@ -815,7 +815,7 @@ - Returns the mouse cursor's current position. + Returns the mouse cursor's current position in screen coordinates. @@ -1694,7 +1694,7 @@ [b]Note:[/b] Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. - The window can't be resizing by dragging its resize grip. It's still possible to resize the window using [method window_set_size]. This flag is ignored for full screen windows. + The window can't be resized by dragging its resize grip. It's still possible to resize the window using [method window_set_size]. This flag is ignored for full screen windows. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. diff --git a/doc/classes/EditorSettings.xml b/doc/classes/EditorSettings.xml index b2ccaa3e60b..e7fe8d60bc1 100644 --- a/doc/classes/EditorSettings.xml +++ b/doc/classes/EditorSettings.xml @@ -295,7 +295,7 @@ If [code]true[/code], render the grid on an XZ plane. - If [code]true[/code], render the grid on an YZ plane. This can be useful for 3D side-scrolling games. + If [code]true[/code], render the grid on a YZ plane. This can be useful for 3D side-scrolling games. If [code]true[/code], enables 3-button mouse emulation mode. This is useful on laptops when using a trackpad. @@ -695,7 +695,7 @@ If [code]true[/code], colors the background of the line the caret is currently on with [member text_editor/theme/highlighting/current_line_color]. - The shape of the caret to use in the script editor. [b]Line[/b] displays a vertical line to the left of the current character, whereas [b]Block[/b] displays a outline over the current character. + The shape of the caret to use in the script editor. [b]Line[/b] displays a vertical line to the left of the current character, whereas [b]Block[/b] displays an outline over the current character. The column at which to display a subtle line as a line length guideline for scripts. This should generally be greater than [member text_editor/appearance/guidelines/line_length_guideline_soft_column]. diff --git a/doc/classes/FontFile.xml b/doc/classes/FontFile.xml index a349c2b7b74..a82816aac82 100644 --- a/doc/classes/FontFile.xml +++ b/doc/classes/FontFile.xml @@ -12,7 +12,7 @@ - Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary (version 3) format variants. - Monospace image font importer: All supported image formats. [b]Note:[/b] A character is a symbol that represents an item (letter, digit etc.) in an abstract way. - [b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. + [b]Note:[/b] A glyph is a bitmap or shape used to draw one or more characters in a context-dependent manner. Glyph indices are bound to the specific font data source. [b]Note:[/b] If a none of the font data sources contain glyphs for a character used in a string, the character in question will be replaced with a box displaying its hexadecimal code. [codeblocks] [gdscript] diff --git a/doc/classes/GPUParticlesCollisionHeightField3D.xml b/doc/classes/GPUParticlesCollisionHeightField3D.xml index c8ed78b85e0..006759bad09 100644 --- a/doc/classes/GPUParticlesCollisionHeightField3D.xml +++ b/doc/classes/GPUParticlesCollisionHeightField3D.xml @@ -50,7 +50,7 @@ Represents the size of the [enum Resolution] enum. - Only update the heightmap when the [GPUParticlesCollisionHeightField3D] node is moved, or when the camera moves if [member follow_camera_enabled] is [code]true[/code]. An update can be forced by slightly moving the [GPUParticlesCollisionHeightField3D] in any direction. + Only update the heightmap when the [GPUParticlesCollisionHeightField3D] node is moved, or when the camera moves if [member follow_camera_enabled] is [code]true[/code]. An update can be forced by slightly moving the [GPUParticlesCollisionHeightField3D] in any direction, or by calling [method RenderingServer.particles_collision_height_field_update]. Update the heightmap every frame. This has a significant performance cost. This update should only be used when geometry that particles can collide with changes significantly during gameplay. diff --git a/doc/classes/GeometryInstance3D.xml b/doc/classes/GeometryInstance3D.xml index 2bb55a1f408..9e939280c83 100644 --- a/doc/classes/GeometryInstance3D.xml +++ b/doc/classes/GeometryInstance3D.xml @@ -33,7 +33,7 @@ The selected shadow casting flag. See [enum ShadowCastingSetting] for possible values. - Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have fine control over the [MeshInstance3D]'s bounding box. To remove this, set value to an [AABB] with all fields set to zero. + Overrides the bounding box of this node with a custom one. This can be used to avoid the expensive [AABB] recalculation that happens when a skeleton is used with a [MeshInstance3D] or to have fine control over the [MeshInstance3D]'s bounding box. To use the default AABB, set value to an [AABB] with all fields set to [code]0.0[/code]. To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. To disable all forms of culling (including occlusion culling), call [method RenderingServer.instance_set_ignore_culling] on the [GeometryInstance3D]'s [RID]. The extra distance added to the GeometryInstance3D's bounding box ([AABB]) to increase its cull box. @@ -47,6 +47,7 @@ If [code]true[/code], disables occlusion culling for this instance. Useful for gizmos that must be rendered even when occlusion culling is in use. + [b]Note:[/b] [member ignore_occlusion_culling] does not affect frustum culling (which is what happens when an object is not visible given the camera's angle). To avoid frustum culling, set [member custom_aabb] to a very large AABB that covers your entire game world such as [code]AABB(-10000, -10000, -10000, 20000, 20000, 20000)[/code]. Changes how quickly the mesh transitions to a lower level of detail. A value of 0 will force the mesh to its lowest level of detail, a value of 1 will use the default settings, and larger values will keep the mesh in a higher level of detail at farther distances. @@ -70,14 +71,14 @@ Margin for the [member visibility_range_begin] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_begin] threshold by this amount. - If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. + If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as a hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. Distance from which the GeometryInstance3D will be hidden, taking [member visibility_range_end_margin] into account as well. The default value of 0 is used to disable the range check. Margin for the [member visibility_range_end] threshold. The GeometryInstance3D will only change its visibility state when it goes over or under the [member visibility_range_end] threshold by this amount. - If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. + If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_DISABLED], this acts as a hysteresis distance. If [member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade transition distance and must be set to a value greater than [code]0.0[/code] for the effect to be noticeable. Controls which instances will be faded when approaching the limits of the visibility range. See [enum VisibilityRangeFadeMode] for possible values. diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index ab9ed47b853..58d3f6dc666 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -5,6 +5,7 @@ A singleton that deals with inputs. This includes key presses, mouse buttons and movement, joypads, and input actions. Actions and their events can be set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or with the [InputMap] class. + [b]Note:[/b] The methods here reflect the global input state and are not affected by [method Control.accept_event] or [method Viewport.set_input_as_handled], which only deal with the way input is propagated in the [SceneTree]. $DOCS_URL/tutorials/inputs/index.html diff --git a/doc/classes/Light3D.xml b/doc/classes/Light3D.xml index 2a0b2da46cb..4502c74dd41 100644 --- a/doc/classes/Light3D.xml +++ b/doc/classes/Light3D.xml @@ -204,7 +204,7 @@ Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([member Environment.sdfgi_enabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off. - Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [constant BAKE_STATIC]. This has a greater performance cost compared to [constant BAKE_STATIC]. + Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [constant BAKE_STATIC]. This has a greater performance cost compared to [constant BAKE_STATIC]. When using SDFGI, the update speed of dynamic lights is affected by [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights]. diff --git a/doc/classes/MultiplayerPeerExtension.xml b/doc/classes/MultiplayerPeerExtension.xml index 5717135b80d..c7d46f136d3 100644 --- a/doc/classes/MultiplayerPeerExtension.xml +++ b/doc/classes/MultiplayerPeerExtension.xml @@ -49,6 +49,18 @@ Called when a packet needs to be received by the [MultiplayerAPI], with [param r_buffer_size] being the size of the binary [param r_buffer] in bytes. + + + + Called to get the channel over which the next available packet was received. See [method MultiplayerPeer.get_packet_channel]. + + + + + + Called to get the [enum MultiplayerPeer.TransferMode] the remote peer used to send the next available packet. See [method MultiplayerPeer.get_packet_mode]. + + @@ -76,7 +88,7 @@ - Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). + Called when the unique ID of this [MultiplayerPeer] is requested (see [method MultiplayerPeer.get_unique_id]). The value must be between [code]1[/code] and [code]2147483647[/code]. @@ -91,6 +103,12 @@ Called when the "is server" status is requested on the [MultiplayerAPI]. See [method MultiplayerAPI.is_server]. + + + + Called to check if the server can act as a relay in the current configuration. See [method MultiplayerPeer.is_server_relay_supported]. + + diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 62d708618a8..ead022ecb36 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -500,6 +500,13 @@ Returns [code]true[/code] if the local system is the multiplayer authority of this node. + + + + Returns [code]true[/code] if the node is ready, i.e. it's inside scene tree and all its children are initialized. + [method request_ready] resets it back to [code]false[/code]. + + diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 581cb68c92d..07ab6a8b49a 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -105,7 +105,7 @@ - Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its antecedents are also visible. If any antecedent is hidden, this node will not be visible in the scene tree. + Returns [code]true[/code] if the node is present in the [SceneTree], its [member visible] property is [code]true[/code] and all its ancestors are also visible. If any ancestor is hidden, this node will not be visible in the scene tree. @@ -315,7 +315,7 @@ Defines the visibility range parent for this node and its subtree. The visibility parent must be a GeometryInstance3D. Any visual instance will only be visible if the visibility parent (and all of its visibility ancestors) is hidden by being closer to the camera than its own [member GeometryInstance3D.visibility_range_begin]. Nodes hidden via the [member Node3D.visible] property are essentially removed from the visibility dependency tree, so dependent instances will not take the hidden node or its ancestors into account. - If [code]true[/code], this node is drawn. The node is only visible if all of its antecedents are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). + If [code]true[/code], this node is drawn. The node is only visible if all of its ancestors are visible as well (in other words, [method is_visible_in_tree] must return [code]true[/code]). diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 10818e0decc..86b9c582b97 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -91,7 +91,7 @@ - Executes a command. The file specified in [param path] must exist and be executable. Platform path resolution will be used. The [param arguments] are used in the given order and separated by a space. If an [param output] [Array] is provided, the complete shell output of the process will be appended as a single [String] element in [param output]. If [param read_stderr] is [code]true[/code], the output to the standard error stream will be included too. + Executes a command. The file specified in [param path] must exist and be executable. Platform path resolution will be used. The [param arguments] are used in the given order, separated by spaces, and wrapped in quotes. If an [param output] [Array] is provided, the complete shell output of the process will be appended as a single [String] element in [param output]. If [param read_stderr] is [code]true[/code], the output to the standard error stream will be included too. On Windows, if [param open_console] is [code]true[/code] and the process is a console app, a new terminal window will be opened. This is ignored on other platforms. If the command is successfully executed, the method will return the exit code of the command, or [code]-1[/code] if it fails. [b]Note:[/b] The Godot thread will pause its execution until the executed command terminates. Use [Thread] to create a separate thread that will not pause the Godot thread, or use [method create_process] to create a completely independent process. @@ -416,7 +416,7 @@ Returns an array of the system substitute font file paths, which are similar to the font with [param font_name] and style for the specified text, locale and script. Returns empty array if no matching fonts found. The following aliases can be used to request default fonts: "sans-serif", "serif", "monospace", "cursive", and "fantasy". - [b]Note:[/b] Depending on OS, it's not guaranteed that any of the returned fonts is suitable for rendering specified text. Fonts should be loaded and checked in the order they are returned, and the first suitable one used. + [b]Note:[/b] Depending on OS, it's not guaranteed that any of the returned fonts will be suitable for rendering specified text. Fonts should be loaded and checked in the order they are returned, and the first suitable one used. [b]Note:[/b] Returned fonts might have different style if the requested style is not available or belong to a different font family. [b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and Windows. @@ -471,7 +471,7 @@ - Returns the video adapter driver name and version for the user's currently active graphics card. + Returns the video adapter driver name and version for the user's currently active graphics card. See also [method RenderingServer.get_video_adapter_api_version]. The first element holds the driver name, such as [code]nvidia[/code], [code]amdgpu[/code], etc. The second element holds the driver version. For e.g. the [code]nvidia[/code] driver on a Linux/BSD platform, the version is in the format [code]510.85.02[/code]. For Windows, the driver's format is [code]31.0.15.1659[/code]. [b]Note:[/b] This method is only supported on the platforms Linux/BSD and Windows when not running in headless mode. It returns an empty array on other platforms. diff --git a/doc/classes/ParticleProcessMaterial.xml b/doc/classes/ParticleProcessMaterial.xml index 50886d96068..ad2464005cb 100644 --- a/doc/classes/ParticleProcessMaterial.xml +++ b/doc/classes/ParticleProcessMaterial.xml @@ -282,7 +282,8 @@ Minimum equivalent of [member tangential_accel_max]. - Enables and disables Turbulence for the particle system. + If [code]true[/code], enables turbulence for the particle system. Turbulence can be used to vary particle movement according to its position (based on a 3D noise pattern). + [b]Note:[/b] Enabling turbulence has a high performance cost on the GPU. Only enable turbulence on a few particle systems at once at most, and consider disabling it when targeting mobile/web platforms. Maximum turbulence influence on each particle. @@ -296,11 +297,11 @@ Each particle's amount of turbulence will be influenced along this [CurveTexture] over its life time. - Maximum displacement of each particles spawn position by the turbulence. + Maximum displacement of each particle's spawn position by the turbulence. The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. - Minimum displacement of each particles spawn position by the turbulence. + Minimum displacement of each particle's spawn position by the turbulence. The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between [member turbulence_initial_displacement_min] and [member turbulence_initial_displacement_max]. @@ -312,10 +313,10 @@ A value of [code]Vector3(0.0, 0.0, 0.0)[/code] will freeze the turbulence pattern in place. - Use to influence the noise speed in a random pattern. This helps to break up visible movement patterns. + Use to influence the noise speed in a random pattern. This helps break up visible movement patterns. - The turbulence noise strength. Increasing this will result in a stronger, more contrasting, noise pattern. + The turbulence noise strength. Increasing this will result in a stronger, more contrasting noise pattern. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 16c485c0bcc..12db089503d 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -731,7 +731,8 @@ Changing this value allows setting up a multi-project scenario where there are multiple [code].csproj[/code]. Keep in mind that the Godot project is considered one of the C# projects in the workspace and it's root directory should contain the [code]project.godot[/code] and [code].csproj[/code] next to each other. - If [code]true[/code] text resources are converted to binary format on export. + If [code]true[/code], text resources are converted to a binary format on export. This decreases file sizes and speeds up loading slightly. + [b]Note:[/b] If [member editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to return the converted files in an exported project. Some file paths within the exported PCK will also change, such as [code]project.godot[/code] becoming [code]project.binary[/code]. If you rely on run-time loading of files present within the PCK, set [member editor/export/convert_text_resources_to_binary] to [code]false[/code]. @@ -821,6 +822,7 @@ Default value for [member ScrollContainer.scroll_deadzone], which will be used for all [ScrollContainer]s unless overridden. + If [code]true[/code], snaps [Control] node vertices to the nearest pixel to ensure they remain crisp even when the camera moves or zooms. If [code]true[/code], swaps [b]Cancel[/b] and [b]OK[/b] buttons in dialogs on Windows and UWP to follow interface conventions. [method DisplayServer.get_swap_cancel_ok] can be used to query whether buttons are swapped at run-time. @@ -1952,23 +1954,34 @@ [b]Note:[/b] Only [member physics/common/max_physics_steps_per_frame] physics ticks may be simulated per rendered frame at most. If more physics ticks have to be simulated per rendered frame to keep up with rendering, the project will appear to slow down (even if [code]delta[/code] is used consistently in physics calculations). Therefore, it is recommended to also increase [member physics/common/max_physics_steps_per_frame] if increasing [member physics/common/physics_ticks_per_second] significantly above its default value. + Controls how much of the original viewport size should be covered by the 2D signed distance field. This SDF can be sampled in [CanvasItem] shaders and is used for [GPUParticles2D] collision. Higher values allow portions of occluders located outside the viewport to still be taken into account in the generated signed distance field, at the cost of performance. If you notice particles falling through [LightOccluder2D]s as the occluders leave the viewport, increase this setting. + The percentage specified is added on each axis and on both sides. For example, with the default setting of 120%, the signed distance field will cover 20% of the viewport's size outside the viewport on each side (top, right, bottom, left). + [b]Note:[/b] This property is only read when the project starts. To change the 2D SDF oversizing percentage at runtime, use [method RenderingServer.viewport_set_sdf_oversize_and_scale] instead. + The resolution scale to use for the 2D signed distance field. Higher values lead to a more precise and more stable signed distance field as the camera moves, at the cost of performance. The default value (50%) renders at half the resolution of the viewport size on each axis, which means the SDF is generated with 25% of the viewport's pixel count. + [b]Note:[/b] This property is only read when the project starts. To change the 2D SDF resolution scale at runtime, use [method RenderingServer.viewport_set_sdf_oversize_and_scale] instead. + The size of the 2D shadow atlas in pixels. Higher values result in more precise [Light2D] shadows, at the cost of performance and video memory usage. The specified value is rounded up to the nearest power of 2. + [b]Note:[/b] This property is only read when the project starts. To change the 2D shadow atlas size at runtime, use [method RenderingServer.canvas_set_shadow_texture_size] instead. - If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. + If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. + [b]Note:[/b] This property is only read when the project starts. To toggle 2D transform snapping at runtime, use [method RenderingServer.viewport_set_snap_2d_transforms_to_pixel] on the root [Viewport] instead. + [b]Note:[/b] [Control] nodes are snapped to the nearest pixel by default. This is controlled by [member gui/common/snap_controls_to_pixels]. - If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. + If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. + [b]Note:[/b] This property is only read when the project starts. To toggle 2D vertex snapping at runtime, use [method RenderingServer.viewport_set_snap_2d_vertices_to_pixel] on the root [Viewport] instead. + [b]Note:[/b] [Control] nodes are snapped to the nearest pixel by default. This is controlled by [member gui/common/snap_controls_to_pixels]. - Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. This has no effect on shader-induced aliasing or texture aliasing. + Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. This has no effect on shader-induced aliasing or texture aliasing. [b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility. - Sets the number of MSAA samples to use for 3D rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. See also bilinear scaling 3d [member rendering/scaling_3d/mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing. + Sets the number of MSAA samples to use for 3D rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware, especially integrated graphics due to their limited memory bandwidth. See also [member rendering/scaling_3d/mode] for supersampling, which provides higher quality but is much more expensive. This has no effect on shader-induced aliasing or texture aliasing. [b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility. @@ -1987,12 +2000,15 @@ [b]Note:[/b] TAA is only supported in the Forward+ rendering method, not Mobile or Compatibility. + [b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead. If [code]true[/code], enables a spatial filter to limit roughness in areas with high-frequency detail. This can help reduce specular aliasing to an extent, though not as much as enabling [member rendering/anti_aliasing/quality/use_taa]. This filter has a small performance cost, so consider disabling it if it doesn't benefit your scene noticeably. - [b]Note:[/b] TAA is only supported in the Forward+ and Mobile rendering methods, not Compatibility. + [b]Note:[/b] The screen-space roughness limiter is only supported in the Forward+ and Mobile rendering methods, not Compatibility. + [b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead. + [b]Note:[/b] This property is only read when the project starts. To control the screen-space roughness limiter at runtime, call [method RenderingServer.screen_space_roughness_limiter_set_active] instead. Sets the quality of the depth of field effect. Higher quality takes more samples, which is slower but looks smoother. @@ -2065,13 +2081,16 @@ Sets the quality of the screen-space indirect lighting effect. Higher values take more samples and so will result in better quality, at the cost of performance. Setting to [code]Ultra[/code] will use the [member rendering/environment/ssil/adaptive_target] setting. - Scales the depth over which the subsurface scattering effect is applied. A high value may allow light to scatter into a part of the mesh or another mesh that is close in screen space but far in depth. + Scales the depth over which the subsurface scattering effect is applied. A high value may allow light to scatter into a part of the mesh or another mesh that is close in screen space but far in depth. See also [member rendering/environment/subsurface_scattering/subsurface_scattering_scale]. + [b]Note:[/b] This property is only read when the project starts. To set the subsurface scattering depth scale at runtime, call [method RenderingServer.sub_surface_scattering_set_scale] instead. - Sets the quality of the subsurface scattering effect. Higher values are slower but look nicer. + Sets the quality of the subsurface scattering effect. Higher values are slower but look nicer. This affects the rendering of materials that have [member BaseMaterial3D.subsurf_scatter_enabled] set to [code]true[/code], along with [ShaderMaterial]s that set [code]SSS_STRENGTH[/code]. + [b]Note:[/b] This property is only read when the project starts. To set the subsurface scattering quality at runtime, call [method RenderingServer.sub_surface_scattering_set_quality] instead. - Scales the distance over which samples are taken for subsurface scattering effect. Changing this does not impact performance, but higher values will result in significant artifacts as the samples will become obviously spread out. A lower value results in a smaller spread of scattered light. + Scales the distance over which samples are taken for subsurface scattering effect. Changing this does not impact performance, but higher values will result in significant artifacts as the samples will become obviously spread out. A lower value results in a smaller spread of scattered light. See also [member rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale]. + [b]Note:[/b] This property is only read when the project starts. To set the subsurface scattering scale at runtime, call [method RenderingServer.sub_surface_scattering_set_scale] instead. Enables filtering of the volumetric fog effect prior to integration. This substantially blurs the fog which reduces fine details but also smooths out harsh edges and aliasing artifacts. Disable when more detail is required. @@ -2111,12 +2130,21 @@ [b]Note:[/b] This property is only read when the project starts. To set half-resolution GI at run-time, call [method RenderingServer.gi_set_use_half_resolution] instead. + The number of frames to use for converging signed distance field global illumination. Higher values lead to a less noisy result, at the cost of taking a longer time to fully converge. This means the scene's global illumination will be too dark for a longer period of time, especially when the camera moves fast. The actual convergence speed depends on rendered framerate. For example, with the default setting of 30 frames, rendering at 60 FPS will make SDFGI fully converge after 0.5 seconds. See also [member rendering/global_illumination/sdfgi/frames_to_update_lights] and [member rendering/global_illumination/sdfgi/probe_ray_count]. + [b]Note:[/b] This property is only read when the project starts. To control SDFGI convergence speed at runtime, call [method RenderingServer.environment_set_sdfgi_frames_to_converge] instead. + The number of frames over which dynamic lights should be updated in signed distance field global illumination. Higher values take more time to update indirect lighting coming from dynamic lights, but result in better performance when many dynamic lights are present. See also [member rendering/global_illumination/sdfgi/frames_to_converge] and [member rendering/global_illumination/sdfgi/probe_ray_count]. + [b]Note:[/b] This only affects [Light3D] nodes whose [member Light3D.light_bake_mode] is [constant Light3D.BAKE_DYNAMIC] (which is the default). Consider making non-moving lights use the [constant Light3D.BAKE_STATIC] bake mode to improve performance. + [b]Note:[/b] This property is only read when the project starts. To control SDFGI light update speed at runtime, call [method RenderingServer.environment_set_sdfgi_frames_to_update_light] instead. + The number of rays to throw per frame when computing signed distance field global illumination. Higher values lead to a less noisy result, at the cost of performance. See also [member rendering/global_illumination/sdfgi/frames_to_converge] and [member rendering/global_illumination/sdfgi/frames_to_update_lights]. + [b]Note:[/b] This property is only read when the project starts. To control SDFGI quality at runtime, call [method RenderingServer.environment_set_sdfgi_ray_count] instead. + The VoxelGI quality to use. High quality leads to more precise lighting and better reflections, but is slower to render. This setting does not affect the baked data and doesn't require baking the [VoxelGI] again to apply. + [b]Note:[/b] This property is only read when the project starts. To control VoxelGI quality at runtime, call [method RenderingServer.voxel_gi_set_quality] instead. The maximum number of rays that can be thrown per pass when baking lightmaps with [LightmapGI]. Depending on the scene, adjusting this value may result in higher GPU utilization when baking lightmaps, leading to faster bake times. @@ -2158,10 +2186,10 @@ The framerate-independent update speed when representing dynamic object lighting from [LightmapProbe]s. Higher values make dynamic object lighting update faster. Higher values can prevent fast-moving objects from having "outdated" indirect lighting displayed on them, at the cost of possible flickering when an object moves from a bright area to a shaded area. - Use 16 bits for shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. + Use 16 bits for the directional shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. - The directional shadow's size in pixels. Higher values will result in sharper shadows, at the cost of performance. The value will be rounded up to the nearest power of 2. + The directional shadow's size in pixels. Higher values will result in sharper shadows, at the cost of performance. The value is rounded up to the nearest power of 2. Lower-end override for [member rendering/lights_and_shadows/directional_shadow/size] on mobile devices, due to performance concerns or driver support. @@ -2175,7 +2203,7 @@ Lower-end override for [member rendering/lights_and_shadows/directional_shadow/soft_shadow_filter_quality] on mobile devices, due to performance concerns or driver support. - Use 16 bits for shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. + Use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. Subdivision quadrant size for shadow mapping. See shadow mapping documentation. @@ -2239,10 +2267,12 @@ [b]Note:[/b] This property is only read when the project starts. To adjust the automatic LOD threshold at runtime, set [member Viewport.mesh_lod_threshold] on the root [Viewport]. - The [url=https://en.wikipedia.org/wiki/Bounding_volume_hierarchy]BVH[/url] quality to use when rendering the occlusion culling buffer. Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. + The [url=https://en.wikipedia.org/wiki/Bounding_volume_hierarchy]Bounding Volume Hierarchy[/url] quality to use when rendering the occlusion culling buffer. Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. See also [member rendering/occlusion_culling/occlusion_rays_per_thread]. + [b]Note:[/b] This property is only read when the project starts. To adjust the BVH build quality at runtime, use [method RenderingServer.viewport_set_occlusion_culling_build_quality]. - Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. The occlusion culling buffer's pixel count is roughly equal to [code]occlusion_rays_per_thread * number_of_logical_cpu_cores[/code], so it will depend on the system's CPU. Therefore, CPUs with fewer cores will use a lower resolution to attempt keeping performance costs even across devices. + The number of occlusion rays traced per CPU thread. Higher values will result in more accurate occlusion culling, at the cost of higher CPU usage. The occlusion culling buffer's pixel count is roughly equal to [code]occlusion_rays_per_thread * number_of_logical_cpu_cores[/code], so it will depend on the system's CPU. Therefore, CPUs with fewer cores will use a lower resolution to attempt keeping performance costs even across devices. See also [member rendering/occlusion_culling/bvh_build_quality]. + [b]Note:[/b] This property is only read when the project starts. To adjust the number of occlusion rays traced per thread at runtime, use [method RenderingServer.viewport_set_occlusion_rays_per_thread]. If [code]true[/code], [OccluderInstance3D] nodes will be usable for occlusion culling in 3D in the root viewport. In custom viewports, [member Viewport.use_occlusion_culling] must be set to [code]true[/code] instead. diff --git a/doc/classes/RDAttachmentFormat.xml b/doc/classes/RDAttachmentFormat.xml index 0d5316f29f6..1e7377a10b7 100644 --- a/doc/classes/RDAttachmentFormat.xml +++ b/doc/classes/RDAttachmentFormat.xml @@ -1,17 +1,22 @@ + Attachment format (used by [RenderingDevice]). + This object is used by [RenderingDevice]. + The attachment's data format. + The number of samples used when sampling the attachment. + The attachment's usage flags, which determine what can be done with it. diff --git a/doc/classes/RDFramebufferPass.xml b/doc/classes/RDFramebufferPass.xml index bf39afd3aa0..b7ef3830ca6 100644 --- a/doc/classes/RDFramebufferPass.xml +++ b/doc/classes/RDFramebufferPass.xml @@ -1,11 +1,12 @@ - Framebuffer pass attachment description. + Framebuffer pass attachment description (used by [RenderingDevice]). This class contains the list of attachment descriptions for a framebuffer pass. Each points with an index to a previously supplied list of texture attachments. - Multipass framebuffers can optimize some configurations in mobile, on desktop they provide little to no advantage. + Multipass framebuffers can optimize some configurations in mobile. On desktop, they provide little to no advantage. + This object is used by [RenderingDevice]. @@ -28,6 +29,7 @@ + Attachment is unused. diff --git a/doc/classes/RDPipelineColorBlendState.xml b/doc/classes/RDPipelineColorBlendState.xml index 70f03fb1f3c..0f0e3ec75c6 100644 --- a/doc/classes/RDPipelineColorBlendState.xml +++ b/doc/classes/RDPipelineColorBlendState.xml @@ -1,19 +1,25 @@ + Pipeline color blend state (used by [RenderingDevice]). + This object is used by [RenderingDevice]. + The attachments that are blended together. + The constant color to blend with. See also [method RenderingDevice.draw_list_set_blend_constants]. + If [code]true[/code], performs the logic operation defined in [member logic_op]. + The logic operation to perform for blending. Only effective if [member enable_logic_op] is [code]true[/code]. diff --git a/doc/classes/RDPipelineColorBlendStateAttachment.xml b/doc/classes/RDPipelineColorBlendStateAttachment.xml index b0caca64ee7..6490c3afa7b 100644 --- a/doc/classes/RDPipelineColorBlendStateAttachment.xml +++ b/doc/classes/RDPipelineColorBlendStateAttachment.xml @@ -1,8 +1,66 @@ + Pipeline color blend state attachment (used by [RenderingDevice]). + Controls how blending between source and destination fragments is performed when using [RenderingDevice]. + For reference, this is how common user-facing blend modes are implemented in Godot's 2D renderer: + [b]Mix:[/b] + [codeblock] + var attachment = RDPipelineColorBlendStateAttachment.new() + attachment.enable_blend = true + attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + [/codeblock] + [b]Add:[/b] + [codeblock] + var attachment = RDPipelineColorBlendStateAttachment.new() + attachment.enable_blend = true + attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + [/codeblock] + [b]Subtract:[/b] + [codeblock] + var attachment = RDPipelineColorBlendStateAttachment.new() + attachment.enable_blend = true + attachment.alpha_blend_op = RenderingDevice.BLEND_OP_SUBTRACT + attachment.color_blend_op = RenderingDevice.BLEND_OP_SUBTRACT + attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_SRC_ALPHA + attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + [/codeblock] + [b]Multiply:[/b] + [codeblock] + var attachment = RDPipelineColorBlendStateAttachment.new() + attachment.enable_blend = true + attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_DST_COLOR + attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO + attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_DST_ALPHA + attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ZERO + [/codeblock] + [b]Pre-multiplied alpha:[/b] + [codeblock] + var attachment = RDPipelineColorBlendStateAttachment.new() + attachment.enable_blend = true + attachment.alpha_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.color_blend_op = RenderingDevice.BLEND_OP_ADD + attachment.src_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + attachment.dst_color_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + attachment.src_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE + attachment.dst_alpha_blend_factor = RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA + [/codeblock] @@ -10,31 +68,43 @@ + Convenience method to perform standard mix blending with straight (non-premultiplied) alpha. This sets [member enable_blend] to [code]true[/code], [member src_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA], [member dst_color_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA], [member src_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_SRC_ALPHA] and [member dst_alpha_blend_factor] to [constant RenderingDevice.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA]. + The blend mode to use for the alpha channel. + The blend mode to use for the red/green/blue color channels. + Controls how the blend factor for the alpha channel is determined based on the destination's fragments. + Controls how the blend factor for the color channels is determined based on the destination's fragments. + If [code]true[/code], performs blending between the source and destination according to the factors defined in [member src_color_blend_factor], [member dst_color_blend_factor], [member src_alpha_blend_factor] and [member dst_alpha_blend_factor]. The blend modes [member color_blend_op] and [member alpha_blend_op] are also taken into account, with [member write_r], [member write_g], [member write_b] and [member write_a] controlling the output. + Controls how the blend factor for the alpha channel is determined based on the source's fragments. + Controls how the blend factor for the color channels is determined based on the source's fragments. + If [code]true[/code], writes the new alpha channel to the final result. + If [code]true[/code], writes the new blue color channel to the final result. + If [code]true[/code], writes the new green color channel to the final result. + If [code]true[/code], writes the new red color channel to the final result. diff --git a/doc/classes/RDPipelineDepthStencilState.xml b/doc/classes/RDPipelineDepthStencilState.xml index 1f2a40b83c9..ce6d9af221d 100644 --- a/doc/classes/RDPipelineDepthStencilState.xml +++ b/doc/classes/RDPipelineDepthStencilState.xml @@ -1,8 +1,10 @@ + Pipeline depth/stencil state (used by [RenderingDevice]). + [RDPipelineDepthStencilState] controls the way depth and stencil comparisons are performed when sampling those values using [RenderingDevice]. @@ -30,6 +32,7 @@ + If [code]true[/code], enables depth testing which allows objects to be automatically occluded by other objects based on their depth. This also allows objects to be partially occluded by other objects. If [code]false[/code], objects will appear in the order they were drawn (like in Godot's 2D renderer). diff --git a/doc/classes/RDPipelineMultisampleState.xml b/doc/classes/RDPipelineMultisampleState.xml index 62725137f8a..5fde612da30 100644 --- a/doc/classes/RDPipelineMultisampleState.xml +++ b/doc/classes/RDPipelineMultisampleState.xml @@ -1,23 +1,31 @@ + Pipeline multisample state (used by [RenderingDevice]). + [RDPipelineMultisampleState] is used to control how multisample or supersample antialiasing is being performed when rendering using [RenderingDevice]. + If [code]true[/code], alpha to coverage is enabled. This generates a temporary coverage value based on the alpha component of the fragment's first color output. This allows alpha transparency to make use of multisample antialiasing. + If [code]true[/code], alpha is forced to either [code]0.0[/code] or [code]1.0[/code]. This allows hardening the edges of antialiased alpha transparencies. Only relevant if [member enable_alpha_to_coverage] is [code]true[/code]. + If [code]true[/code], enables per-sample shading which replaces MSAA by SSAA. This provides higher quality antialiasing that works with transparent (alpha scissor) edges. This has a very high performance cost. See also [member min_sample_shading]. See the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#primsrast-sampleshading]per-sample shading Vulkan documentation[/url] for more details. + The multiplier of [member sample_count] that determines how many samples are performed for each fragment. Must be between [code]0.0[/code] and [code]1.0[/code] (inclusive). Only effective if [member enable_sample_shading] is [code]true[/code]. If [member min_sample_shading] is [code]1.0[/code], fragment invocation must only read from the coverage index sample. Tile image access must not be used if [member enable_sample_shading] is [i]not[/i] [code]1.0[/code]. + The number of MSAA samples (or SSAA samples if [member enable_sample_shading] is [code]true[/code]) to perform. Higher values result in better antialiasing, at the cost of performance. + The sampleSee the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#fragops-samplemask]sample mask Vulkan documentation[/url] for more details. diff --git a/doc/classes/RDPipelineRasterizationState.xml b/doc/classes/RDPipelineRasterizationState.xml index 48599b62620..9940b90e71f 100644 --- a/doc/classes/RDPipelineRasterizationState.xml +++ b/doc/classes/RDPipelineRasterizationState.xml @@ -1,13 +1,16 @@ + Pipeline rasterization state (used by [RenderingDevice]). + This object is used by [RenderingDevice]. + The cull mode to use when drawing polygons, which determines whether front faces or backfaces are hidden. @@ -18,16 +21,21 @@ + If [code]true[/code], primitives are discarded immediately before the rasterization stage. + The winding order to use to determine which face of a triangle is considered its front face. + THe line width to use when drawing lines (in pixels). Thick lines may not be supported on all hardware. + The number of control points to use when drawing a patch with tessellation enabled. Higher values result in higher quality at the cost of performance. + If [code]true[/code], performs wireframe rendering for triangles instead of flat or textured rendering. diff --git a/doc/classes/RDPipelineSpecializationConstant.xml b/doc/classes/RDPipelineSpecializationConstant.xml index 1528b9fcc14..d0bfa8130d7 100644 --- a/doc/classes/RDPipelineSpecializationConstant.xml +++ b/doc/classes/RDPipelineSpecializationConstant.xml @@ -1,15 +1,20 @@ + Pipeline specialization constant (used by [RenderingDevice]). + A [i]specialization constant[/i] is a way to create additional variants of shaders without actually increasing the number of shader versions that are compiled. This allows improving performance by reducing the number of shader versions and reducing [code]if[/code] branching, while still allowing shaders to be flexible for different use cases. + This object is used by [RenderingDevice]. + The identifier of the specialization constant. This is a value starting from [code]0[/code] and that increments for every different specialization constant for a given shader. + The specialization constant's value. Only [bool], [int] and [float] types are valid for specialization constants. diff --git a/doc/classes/RDSamplerState.xml b/doc/classes/RDSamplerState.xml index a5cfc227d14..c4991bff97b 100644 --- a/doc/classes/RDSamplerState.xml +++ b/doc/classes/RDSamplerState.xml @@ -1,41 +1,57 @@ + Sampler state (used by [RenderingDevice]). + This object is used by [RenderingDevice]. + Maximum anisotropy that can be used when sampling. Only effective if [member use_anisotropy] is [code]true[/code]. Higher values result in a sharper sampler at oblique angles, at the cost of performance (due to memory bandwidth). This value may be limited by the graphics hardware in use. Most graphics hardware only supports values up to [code]16.0[/code]. + If [member anisotropy_max] is [code]1.0[/code], forcibly disables anisotropy even if [member use_anisotropy] is [code]true[/code]. + The border color that will be returned when sampling outside the sampler's bounds and the [member repeat_u], [member repeat_v] or [member repeat_w] modes have repeating disabled. + The compare operation to use. Only effective if [member enable_compare] is [code]true[/code]. + If [code]true[/code], returned values will be based on the comparison operation defined in [member compare_op]. This is a hardware-based approach and is therefore faster than performing this manually in a shader. For example, compare operations are used for shadow map rendering by comparing depth values from a shadow sampler. + The mipmap LOD bias to use. Positive values will make the sampler blurrier at a given distance, while negative values will make the sampler sharper at a given distance (at the risk of looking grainy). Recommended values are between [code]-0.5[/code] and [code]0.0[/code]. Only effective if the sampler has mipmaps available. + The sampler's magnification filter. + The maximum mipmap LOD bias to display (lowest resolution). Only effective if the sampler has mipmaps available. + The minimum mipmap LOD bias to display (highest resolution). Only effective if the sampler has mipmaps available. + The filtering method to use for mipmaps. + The repeat mode to use along the U axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. + The repeat mode to use along the V axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. + The repeat mode to use along the W axis of UV coordinates. This affects the returned values if sampling outside the UV bounds. Only effective for 3D samplers. + If [code]true[/code], perform anisotropic sampling. See [member anisotropy_max]. diff --git a/doc/classes/RDShaderFile.xml b/doc/classes/RDShaderFile.xml index 72bf6faaecc..b5872c210ee 100644 --- a/doc/classes/RDShaderFile.xml +++ b/doc/classes/RDShaderFile.xml @@ -1,8 +1,11 @@ + Compiled shader file in SPIR-V form (used by [RenderingDevice]). Not to be confused with Godot's own [Shader]. + Compiled shader file in SPIR-V form. + See also [RDShaderSource]. [RDShaderFile] is only meant to be used with the [RenderingDevice] API. It should not be confused with Godot's own [Shader] resource, which is what Godot's various nodes use for high-level shader programming. @@ -11,11 +14,13 @@ + Returns the SPIR-V intermediate representation for the specified shader [param version]. + Returns the list of compiled versions for this shader. @@ -23,11 +28,13 @@ + Sets the SPIR-V [param bytecode] that will be compiled for the specified [param version]. + The base compilation error message, which indicates errors not related to a specific shader stage if non-empty. If empty, shader compilation is not necessarily successful (check [RDShaderSPIRV]'s error message members). diff --git a/doc/classes/RDShaderSPIRV.xml b/doc/classes/RDShaderSPIRV.xml index 13dc2c6519f..f9bb4c48798 100644 --- a/doc/classes/RDShaderSPIRV.xml +++ b/doc/classes/RDShaderSPIRV.xml @@ -1,8 +1,11 @@ + SPIR-V intermediate representation as part of a [RDShaderFile] (used by [RenderingDevice]). + [RDShaderSPIRV] represents a [RDShaderFile]'s [url=https://www.khronos.org/spir/]SPIR-V[/url] code for various shader stages, as well as possible compilation error messages. SPIR-V a low-level intermediate shader representation. This intermediate representation is not used directly by GPUs for rendering, but it can be compiled into binary shaders that GPUs can understand. Unlike compiled shaders, SPIR-V is portable across GPU models and driver versions. + This object is used by [RenderingDevice]. @@ -11,12 +14,14 @@ + Equivalent to getting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. + Returns the compilation error message for the given shader [param stage]. Equivalent to getting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. @@ -24,6 +29,7 @@ + Sets the SPIR-V [param bytecode] for the given shader [param stage]. Equivalent to setting one of [member bytecode_compute], [member bytecode_fragment], [member bytecode_tesselation_control], [member bytecode_tesselation_evaluation], [member bytecode_vertex]. @@ -31,29 +37,40 @@ + Sets the compilation error message for the given shader [param stage] to [param compile_error]. Equivalent to setting one of [member compile_error_compute], [member compile_error_fragment], [member compile_error_tesselation_control], [member compile_error_tesselation_evaluation], [member compile_error_vertex]. + The SPIR-V bytecode for the compute shader stage. + The SPIR-V bytecode for the fragment shader stage. + The SPIR-V bytecode for the tessellation control shader stage. + The SPIR-V bytecode for the tessellation evaluation shader stage. + The SPIR-V bytecode for the vertex shader stage. + The compilation error message for the compute shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + The compilation error message for the fragment shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + The compilation error message for the tessellation control shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + The compilation error message for the tessellation evaluation shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. + The compilation error message for the vertex shader stage (set by the SPIR-V compiler and Godot). If empty, shader compilation was successful. diff --git a/doc/classes/RDShaderSource.xml b/doc/classes/RDShaderSource.xml index ddeae95e394..129567c9c06 100644 --- a/doc/classes/RDShaderSource.xml +++ b/doc/classes/RDShaderSource.xml @@ -1,8 +1,11 @@ + Shader source code (used by [RenderingDevice]). + Shader source code in text form. + See also [RDShaderFile]. [RDShaderSource] is only meant to be used with the [RenderingDevice] API. It should not be confused with Godot's own [Shader] resource, which is what Godot's various nodes use for high-level shader programming. @@ -11,6 +14,7 @@ + Returns source code for the specified shader [param stage]. Equivalent to getting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. @@ -18,21 +22,28 @@ + Sets [param source] code for the specified shader [param stage]. Equivalent to setting one of [member source_compute], [member source_fragment], [member source_tesselation_control], [member source_tesselation_evaluation] or [member source_vertex]. + The language the shader is written in. + Source code for the shader's compute stage. + Source code for the shader's fragment stage. + Source code for the shader's tessellation control stage. + Source code for the shader's tessellation evaluation stage. + Source code for the shader's vertex stage. diff --git a/doc/classes/RDTextureFormat.xml b/doc/classes/RDTextureFormat.xml index 3bfcd610a4e..9005610a1cd 100644 --- a/doc/classes/RDTextureFormat.xml +++ b/doc/classes/RDTextureFormat.xml @@ -1,8 +1,10 @@ + Texture format (used by [RenderingDevice]). + This object is used by [RenderingDevice]. @@ -22,22 +24,31 @@ + The number of layers in the texture. Only relevant for 2D texture arrays. + The texture's depth (in pixels). This is always [code]1[/code] for 2D textures. + The texture's pixel data format. + The texture's height (in pixels). + The number of mipmaps available in the texture. + The number of samples used when sampling the texture. + The texture type. + The texture's usage bits, which determine what can be done using the texture. + The texture's width (in pixels). diff --git a/doc/classes/RDTextureView.xml b/doc/classes/RDTextureView.xml index 6f7406d2aaf..c9378a30197 100644 --- a/doc/classes/RDTextureView.xml +++ b/doc/classes/RDTextureView.xml @@ -1,21 +1,28 @@ + Texture view (used by [RenderingDevice]). + This object is used by [RenderingDevice]. + Optional override for the data format to return sampled values in. The default value of [constant RenderingDevice.DATA_FORMAT_MAX] does not override the format. + The channel to sample when sampling the alpha channel. + The channel to sample when sampling the blue color channel. + The channel to sample when sampling the green color channel. + The channel to sample when sampling the red color channel. diff --git a/doc/classes/RDUniform.xml b/doc/classes/RDUniform.xml index e4b7883f027..24701b48a17 100644 --- a/doc/classes/RDUniform.xml +++ b/doc/classes/RDUniform.xml @@ -1,8 +1,10 @@ + Shader uniform (used by [RenderingDevice]). + This object is used by [RenderingDevice]. @@ -26,8 +28,10 @@ + The uniform's binding. + The uniform's data type. diff --git a/doc/classes/RDVertexAttribute.xml b/doc/classes/RDVertexAttribute.xml index 747f1f93ba3..f60063314f5 100644 --- a/doc/classes/RDVertexAttribute.xml +++ b/doc/classes/RDVertexAttribute.xml @@ -1,8 +1,10 @@ + Vertex attribute (used by [RenderingDevice]). + This object is used by [RenderingDevice]. diff --git a/doc/classes/ReflectionProbe.xml b/doc/classes/ReflectionProbe.xml index 8532bbf491d..67c5f0458d2 100644 --- a/doc/classes/ReflectionProbe.xml +++ b/doc/classes/ReflectionProbe.xml @@ -15,13 +15,13 @@ - The custom ambient color to use within the [ReflectionProbe]'s [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. + The custom ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. - The custom ambient color energy to use within the [ReflectionProbe]'s [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. + The custom ambient color energy to use within the [ReflectionProbe]'s box defined by its [member size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]. - The ambient color to use within the [ReflectionProbe]'s [member size]. The ambient color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the [ReflectionProbe]'s [member size]). + The ambient color to use within the [ReflectionProbe]'s box defined by its [member size]. The ambient color will smoothly blend with other [ReflectionProbe]s and the rest of the scene (outside the [ReflectionProbe]'s box defined by its [member size]). If [code]true[/code], enables box projection. This makes reflections look more correct in rectangle-shaped rooms by offsetting the reflection center depending on the camera's location. @@ -41,7 +41,7 @@ The maximum distance away from the [ReflectionProbe] an object can be before it is culled. Decrease this to improve performance, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. - [b]Note:[/b] The maximum reflection distance is always at least equal to the probe's extents. This means that decreasing [member max_distance] will not always cull objects from reflections, especially if the reflection probe's [member size] is already large. + [b]Note:[/b] The maximum reflection distance is always at least equal to the probe's extents. This means that decreasing [member max_distance] will not always cull objects from reflections, especially if the reflection probe's box defined by its [member size] is already large. The automatic LOD bias to use for meshes rendered within the [ReflectionProbe] (this is analog to [member Viewport.mesh_lod_threshold]). Higher values will use less detailed versions of meshes that have LOD variations generated. If set to [code]0.0[/code], automatic LOD is disabled. Increase [member mesh_lod_threshold] to improve performance at the cost of geometry detail, especially when using the [constant UPDATE_ALWAYS] [member update_mode]. @@ -66,13 +66,13 @@ Update the probe every frame. This provides better results for fast-moving dynamic objects (such as cars). However, it has a significant performance cost. Due to the cost, it's recommended to only use one ReflectionProbe with [constant UPDATE_ALWAYS] at most per scene. For all other use cases, use [constant UPDATE_ONCE]. - Do not apply any ambient lighting inside the [ReflectionProbe]'s [member size]. + Do not apply any ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. - Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s [member size]. + Apply automatically-sourced environment lighting inside the [ReflectionProbe]'s box defined by its [member size]. - Apply custom ambient lighting inside the [ReflectionProbe]'s [member size]. See [member ambient_color] and [member ambient_color_energy]. + Apply custom ambient lighting inside the [ReflectionProbe]'s box defined by its [member size]. See [member ambient_color] and [member ambient_color_energy]. diff --git a/doc/classes/RenderingDevice.xml b/doc/classes/RenderingDevice.xml index ef53b6edd79..378cd93f30d 100644 --- a/doc/classes/RenderingDevice.xml +++ b/doc/classes/RenderingDevice.xml @@ -4,13 +4,14 @@ Abstraction for working with modern low-level graphics APIs. - [RenderingDevice] is an abstraction for working with modern low-level graphics APIs such as Vulkan. - On startup, Godot creates a global [RenderingDevice] which can be retrieved using [method RenderingServer.get_rendering_device]. This global RenderingDevice performs drawing to the screen. - Internally, [RenderingDevice] is used in Godot to provide support for several modern low-level graphics APIs while reducing the amount of code duplication required. + [RenderingDevice] is an abstraction for working with modern low-level graphics APIs such as Vulkan. Compared to [RenderingServer] (which works with Godot's own rendering subsystems), [RenderingDevice] is much lower-level and allows working more directly with the underlying graphics APIs. [RenderingDevice] is used in Godot to provide support for several modern low-level graphics APIs while reducing the amount of code duplication required. [RenderingDevice] can also be used in your own projects to perform things that are not exposed by [RenderingServer] or high-level nodes, such as using compute shaders. + On startup, Godot creates a global [RenderingDevice] which can be retrieved using [method RenderingServer.get_rendering_device]. This global [RenderingDevice] performs drawing to the screen. [b]Local RenderingDevices:[/b] Using [method RenderingServer.create_local_rendering_device], you can create "secondary" rendering devices to perform drawing and GPU compute operations on separate threads. + [b]Note:[/b] [RenderingDevice] assumes intermediate knowledge of modern graphics APIs such as Vulkan, Direct3D 12, Metal or WebGPU. These graphics APIs are lower-level than OpenGL or Direct3D 11, requiring you to perform what was previously done by the graphics driver itself. If you have difficulty understanding the concepts used in this class, follow the [url=https://vulkan-tutorial.com/]Vulkan Tutorial[/url] or [url=https://vkguide.dev/]Vulkan Guide[/url]. It's recommended to have existing modern OpenGL or Direct3D 11 knowledge before attempting to learn a low-level graphics API. [b]Note:[/b] [RenderingDevice] is not available when running in headless mode or when using the Compatibility rendering method. + https://docs.godotengine.org/en/latest/tutorials/shaders/compute_shaders.html @@ -18,6 +19,7 @@ + Puts a memory barrier in place. This is used for synchronization to avoid data races. See also [method full_barrier], which may be useful for debugging. @@ -52,6 +54,7 @@ + Creates a timestamp marker with the specified [param name]. This is used for performance reporting with the [method get_captured_timestamp_cpu_time], [method get_captured_timestamp_gpu_time] and [method get_captured_timestamp_name] methods. @@ -64,6 +67,24 @@ + Starts a list of compute commands created with the [code]compute_*[/code] methods. The returned value should be passed to other [code]compute_list_*[/code] functions. + If [code]allow_draw_overlap[/code] is true, you may have one draw list running at the same time as one compute list. Multiple compute lists cannot be created at the same time; you must finish the previous compute list first using [method compute_list_end]. + A simple compute operation might look like this (code is not a complete example): + [codeblock] + var rd = RenderingDevice.new() + var compute_list = rd.compute_list_begin() + + rd.compute_list_bind_compute_pipeline(compute_list, compute_shader_dilate_pipeline) + rd.compute_list_bind_uniform_set(compute_list, compute_base_uniform_set, 0) + rd.compute_list_bind_uniform_set(compute_list, dilate_uniform_set, 1) + + for i in atlas_slices: + rd.compute_list_set_push_constant(compute_list, push_constant, push_constant.size()) + rd.compute_list_dispatch(compute_list, group_size.x, group_size.y, group_size.z) + # No barrier, let them run all together. + + rd.compute_list_end() + [/codeblock] @@ -88,12 +109,14 @@ + Submits the compute list for processing on the GPU. This is the compute equivalent to [method draw_list_draw]. + Finishes a list of compute commands created with the [code]compute_*[/code] methods. @@ -102,6 +125,7 @@ + Sets the push constant data to [param buffer] for the specified [param compute_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). @@ -109,17 +133,22 @@ + Creates a new compute pipeline. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + Returns [code]true[/code] if the compute pipeline specified by the [param compute_pieline] RID is valid, [code]false[/code] otherwise. + [b]Note:[/b] The [param compute_pieline] parameter should be named "compute_pipeline", but this typo was kept in the 4.0.x branch to preserve compatibility for C# and GDExtension. + Create a new local [RenderingDevice]. This is most useful for performing compute operations on the GPU independently from the rest of the engine. @@ -127,11 +156,14 @@ + Create a command buffer debug label region that can be displayed in third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. All regions must be ended with a [method draw_command_end_label] call. When viewed from the linear series of submissions to a single queue, calls to [method draw_command_begin_label] and [method draw_command_end_label] must be matched and balanced. + The [code]VK_EXT_DEBUG_UTILS_EXTENSION_NAME[/code] Vulkan extension must be available and enabled for command buffer debug label region to work. See also [method draw_command_insert_label] and [method draw_command_end_label]. + Ends the command buffer debug label region started by a [method draw_command_begin_label] call. @@ -139,6 +171,7 @@ + Inserts a command buffer debug label region in the current command buffer. Unlike [method draw_command_begin_label], this region should not be ended with a [method draw_command_end_label] call. @@ -154,6 +187,27 @@ + Starts a list of raster drawing commands created with the [code]draw_*[/code] methods. The returned value should be passed to other [code]draw_list_*[/code] functions. + Multiple draw lists cannot be created at the same time; you must finish the previous draw list first using [method draw_list_end]. + A simple drawing operation might look like this (code is not a complete example): + [codeblock] + var rd = RenderingDevice.new() + var clear_colors = PackedColorArray([Color(0, 0, 0, 0), Color(0, 0, 0, 0), Color(0, 0, 0, 0)] + var draw_list = rd.draw_list_begin(framebuffers[i], RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_READ, RenderingDevice.INITIAL_ACTION_CLEAR, RenderingDevice.FINAL_ACTION_DISCARD, clear_colors) + + # Draw opaque. + rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline) + rd.draw_list_bind_uniform_set(draw_list, raster_base_uniform, 0) + rd.draw_list_set_push_constant(draw_list, raster_push_constant, raster_push_constant.size()) + rd.draw_list_draw(draw_list, false, 1, slice_triangle_count[i] * 3) + # Draw wire. + rd.draw_list_bind_render_pipeline(draw_list, raster_pipeline_wire) + rd.draw_list_bind_uniform_set(draw_list, raster_base_uniform, 0) + rd.draw_list_set_push_constant(draw_list, raster_push_constant, raster_push_constant.size()) + rd.draw_list_draw(draw_list, false, 1, slice_triangle_count[i] * 3) + + rd.draw_list_end() + [/codeblock] @@ -161,6 +215,8 @@ + High-level variant of [method draw_list_begin], with the parameters automtaically being adjusted for drawing onto the window specified by the [param screen] ID. + [b]Note:[/b] Cannot be used with local RenderingDevices, as these don't have a screen. If called on a local RenderingDevice, [method draw_list_begin_for_screen] returns [constant INVALID_ID]. @@ -177,6 +233,7 @@ + Variant of [method draw_list_begin] with support for multiple splits. The [param splits] parameter determines how many splits are created. @@ -184,6 +241,7 @@ + Binds [param index_array] to the specified [param draw_list]. @@ -191,6 +249,7 @@ + Binds [param render_pipeline] to the specified [param draw_list]. @@ -199,6 +258,7 @@ + Binds [param uniform_set] to the specified [param draw_list]. A [param set_index] must also be specified, which is an identifier starting from [code]0[/code] that must match the one expected by the draw list. @@ -206,12 +266,14 @@ + Binds [param vertex_array] to the specified [param draw_list]. + Removes and disables the scissor rectangle for the specified [param draw_list]. See also [method draw_list_enable_scissor]. @@ -221,6 +283,7 @@ + Submits [param draw_list] for rendering on the GPU. This is the raster equivalent to [method compute_list_dispatch]. @@ -228,12 +291,15 @@ + Creates a scissor rectangle and enables it for the specified [param draw_list]. Scissor rectangles are used for clipping by discarding fragments that fall outside a specified rectangular portion of the screen. See also [method draw_list_disable_scissor]. + [b]Note:[/b] The specified [param rect] is automatically intersected with the screen's dimensions, which means it cannot exceed the screen's dimensions. + Finishes a list of raster drawing commands created with the [code]draw_*[/code] methods. @@ -241,7 +307,7 @@ - Sets blend constants for draw list, blend constants are used only if the graphics pipeline is created with [constant DYNAMIC_STATE_BLEND_CONSTANTS] flag set. + Sets blend constants for the specified [param draw_list] to [param color]. Blend constants are used only if the graphics pipeline is created with [constant DYNAMIC_STATE_BLEND_CONSTANTS] flag set. @@ -250,17 +316,20 @@ + Sets the push constant data to [param buffer] for the specified [param draw_list]. The shader determines how this binary data is used. The buffer's size in bytes must also be specified in [param size_bytes] (this can be obtained by calling the [method PackedByteArray.size] method on the passed [param buffer]). + Switches to the next draw pass and returns the split's ID. Equivalent to [method draw_list_switch_to_next_pass_split] with [code]splits[/code] set to [code]1[/code]. + Switches to the next draw pass, with the number of splits allocated specified in [param splits]. The return value is an array containing the ID of each split. For single-split usage, see [method draw_list_switch_to_next_pass]. @@ -269,6 +338,8 @@ + Creates a new framebuffer. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -277,6 +348,8 @@ + Creates a new empty framebuffer. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -286,6 +359,8 @@ + Creates a new multipass framebuffer. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -293,12 +368,15 @@ + Creates a new framebuffer format with the specified [param attachments] and [param view_count]. Returns the new framebuffer's unique framebuffer format ID. + If [code]view_count[/code] is greater than or equal to [code]2[/code], enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. + Creates a new empty framebuffer format with the specified number of [param samples] and returns its ID. @@ -307,6 +385,7 @@ + Creates a multipass framebuffer format with the specified [param attachments], [param passes] and [param view_count] and returns its ID. If [code]view_count[/code] is greater than or equal to [code]2[/code], enables multiview which is used for VR rendering. This requires support for the Vulkan multiview extension. @@ -314,72 +393,85 @@ + Returns the number of texture samples used for the given framebuffer [param format] ID (returned by [method framebuffer_get_format]). + Returns the format ID of the framebuffer specified by the [param framebuffer] RID. This ID is guaranteed to be unique for the same formats and does not need to be freed. + Returns [code]true[/code] if the framebuffer specified by the [param framebuffer] RID is valid, [code]false[/code] otherwise. + Tries to free an object in the RenderingDevice. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RenderingDevice directly. + Puts a [i]full[/i] memory barrier in place. This is a memory [method barrier] with all flags enabled. [method full_barrier] it should only be used for debugging as it can severely impact performance. + Returns the timestamp in CPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_gpu_time] and [method capture_timestamp]. + Returns the timestamp in GPU time for the rendering step specified by [param index] (in microseconds since the engine started). See also [method get_captured_timestamp_cpu_time] and [method capture_timestamp]. + Returns the timestamp's name for the rendering step specified by [param index]. See also [method capture_timestamp]. + Returns the total number of timestamps (rendering steps) available for profiling. + Returns the index of the last frame rendered that has rendering timestamps available for querying. + Returns the name of the video adapter (e.g. "GeForce GTX 1080/PCIe/SSE2"). Equivalent to [method RenderingServer.get_video_adapter_name]. See also [method get_device_vendor_name]. + Returns the universally unique identifier for the pipeline cache. This is used to cache shader files on disk, which avoids shader recompilations on subsequent engine runs. This UUID varies depending on the graphics card model, but also the driver version. Therefore, updating graphics drivers will invalidate the shader cache. + Returns the vendor of the video adapter (e.g. "NVIDIA Corporation"). Equivalent to [method RenderingServer.get_video_adapter_vendor]. See also [method get_device_name]. @@ -388,17 +480,20 @@ + Returns the unique identifier of the driver [param resource] for the specified [param rid]. Some driver resource types ignore the specified [param rid] (see [enum DriverResource] descriptions). [param index] is always ignored but must be specified anyway. + Returns the frame count kept by the graphics API. Higher values result in higher input lag, but with more consistent throughput. For the main [RenderingDevice], frames are cycled (usually 3 with triple-buffered V-Sync enabled). However, local [RenderingDevice]s only have 1 frame. + Returns the memory usage in bytes corresponding to the given [param type]. When using Vulkan, these statistics are calculated by [url=https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator]Vulkan Memory Allocator[/url]. @@ -407,6 +502,8 @@ + Creates a new index array. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -416,12 +513,16 @@ + Creates a new index buffer. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + Returns the value of the specified [param limit]. This limit varies depending on the current graphics hardware (and sometimes the driver version). If the given limit is exceeded, rendering errors will occur. + Limits for various graphics hardware can be found in the [url=https://vulkan.gpuinfo.org/]Vulkan Hardware Database[/url]. @@ -438,18 +539,23 @@ + Creates a new render pipeline. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + Returns [code]true[/code] if the render pipeline specified by the [param render_pipeline] RID is valid, [code]false[/code] otherwise. + Creates a new sampler. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -463,18 +569,24 @@ + Returns the screen's framebuffer format. + [b]Note:[/b] Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a format. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. + Returns the window height matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the [i]window[/i] size. See also [method screen_get_width]. + [b]Note:[/b] Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a height. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. + Returns the window width matching the graphics API context for the given window ID (in pixels). Despite the parameter being named [param screen], this returns the [i]window[/i] size. See also [method screen_get_height]. + [b]Note:[/b] Only the main [RenderingDevice] returned by [method RenderingServer.get_rendering_device] has a width. If called on a local [RenderingDevice], this method prints an error and returns [constant INVALID_ID]. @@ -482,6 +594,9 @@ + Sets the resource name for [param id] to [param name]. This is used for debugging with third-party tools such as [url=https://renderdoc.org/]RenderDoc[/url]. + The following types of resources can be named: texture, sampler, vertex buffer, index buffer, uniform buffer, texture buffer, storage buffer, uniform set buffer, shader, render pipeline and compute pipeline. Framebuffers cannot be named. Attempting to name an incompatible resource type will print an error. + [b]Note:[/b] Resource names are only set when the engine runs in verbose mode ([method OS.is_stdout_verbose] = [code]true[/code]), or when using an engine build compiled with the [code]dev_mode=yes[/code] SCons option. The graphics driver must also support the [code]VK_EXT_DEBUG_UTILS_EXTENSION_NAME[/code] Vulkan extension for named resources to work. @@ -489,6 +604,8 @@ + Compiles a binary shader from [param spirv_data] and returns the compiled binary data as a [PackedByteArray]. This compiled shader is specific to the GPU model and driver version used; it will not work on different GPU models or even different driver versions. See also [method shader_compile_spirv_from_source]. + [param name] is an optional human-readable name that can be given to the compiled shader for organizational purposes. @@ -496,12 +613,16 @@ + Compiles a SPIR-V from the shader source code in [param shader_source] and returns the SPIR-V as a [RDShaderSPIRV]. This intermediate language shader is portable across different GPU models and driver versions, but cannot be run directly by GPUs until compiled into a binary shader using [method shader_compile_binary_from_spirv]. + If [param allow_cache] is [code]true[/code], make use of the shader cache generated by Godot. This avoids a potentially lengthy shader compilation step if the shader is already in cache. If [param allow_cache] is [code]false[/code], Godot's shader cache is ignored and the shader will always be recompiled. + Creates a new shader instance from a binary compiled shader. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_binary_from_spirv] and [method shader_create_from_spirv]. @@ -509,6 +630,8 @@ + Creates a new shader instance from SPIR-V intermediate code. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. See also [method shader_compile_spirv_from_source] and [method shader_create_from_bytecode]. @@ -523,16 +646,23 @@ + Creates a [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffer[/url] with the specified [param data] and [param usage]. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + Pushes the frame setup and draw command buffers then marks the local device as currently processing (which allows calling [method sync]). + [b]Note:[/b] Only available in local RenderingDevices. + Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost. + [b]Note:[/b] Only available in local RenderingDevices. + [b]Note:[/b] [method sync] can only be called after a [method submit]. @@ -541,6 +671,8 @@ + Creates a new texture buffer. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -553,6 +685,8 @@ + Clears the specified [param texture] by replacing all of its pixels with the specified [param color]. [param base_mipmap] and [param mipmap_count] determine which mipmaps of the texture are affected by this clear operation, while [param base_layer] and [param layer_count] determine which layers of a 3D texture (or texture array) are affected by this clear operation. For 2D textures (which only have one layer by design), [param base_layer] and [param layer_count] must both be [code]0[/code]. + [b]Note:[/b] [param texture] can't be cleared while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to clear this texture. @@ -568,6 +702,12 @@ + Copies the [param from_texture] to [param to_texture] with the specified [param from_pos], [param to_pos] and [param size] coordinates. The Z axis of the [param from_pos], [param to_pos] and [param size] must be [code]0[/code] for 2-dimensional textures. Source and destination mipmaps/layers must also be specified, with these parameters being [code]0[/code] for textures without mipmaps or single-layer textures. Returns [constant @GlobalScope.OK] if the texture copy was successful or [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + [b]Note:[/b] [param from_texture] texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. + [b]Note:[/b] [param from_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. + [b]Note:[/b] [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to copy this texture. + [b]Note:[/b] [param to_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. + [b]Note:[/b] [param from_texture] and [param to_texture] must be of the same type (color or depth). @@ -576,6 +716,9 @@ + Creates a new texture. It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + [b]Note:[/b] Not to be confused with [method RenderingServer.texture_2d_create], which creates the Godot-specific [Texture2D] resource as opposed to the graphics API's own texture type. @@ -583,6 +726,7 @@ + Creates a shared texture using the specified [param view] and the texture information from [param with_texture]. @@ -594,6 +738,9 @@ + Creates a shared texture using the specified [param view] and the texture information from [param with_texture]'s [param layer] and [param mipmap]. The number of included mipmaps from the original texture can be controlled using the [param mipmaps] parameter. Only relevant for textures with multiple layers, such as 3D textures, texture arrays and cubemaps. For single-layer textures, use [method texture_create_shared] + For 2D textures (which only have one layer), [param layer] must be [code]0[/code]. + [b]Note:[/b] Layer slicing is only supported for 2D texture arrays, not 3D textures or cubemaps. @@ -601,6 +748,9 @@ + Returns the [param texture] data for the specified [param layer] as raw binary data. For 2D textures (which only have one layer), [param layer] must be [code]0[/code]. + [b]Note:[/b] [param texture] can't be retrieved while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to retrieve this texture. Otherwise, an error is printed and a empty [PackedByteArray] is returned. + [b]Note:[/b] [param texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. Otherwise, an error is printed and a empty [PackedByteArray] is returned. @@ -608,18 +758,21 @@ + Returns [code]true[/code] if the specified [param format] is supported for the given [param usage_flags], [code]false[/code] otherwise. + Returns [code]true[/code] if the [param texture] is shared, [code]false[/code] otherwise. See [RDTextureView]. + Returns [code]true[/code] if the [param texture] is valid, [code]false[/code] otherwise. @@ -628,6 +781,14 @@ + Resolves the [param from_texture] texture onto [param to_texture] with multisample antialiasing enabled. This must be used when rendering a framebuffer for MSAA to work. Returns [constant @GlobalScope.OK] if successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + [b]Note:[/b] [param from_texture] and [param to_texture] textures must have the same dimension, format and type (color or depth). + [b]Note:[/b] [param from_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. + [b]Note:[/b] [param from_texture] requires the [constant TEXTURE_USAGE_CAN_COPY_FROM_BIT] to be retrieved. + [b]Note:[/b] [param from_texture] must be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). + [b]Note:[/b] [param to_texture] can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to resolve this texture. + [b]Note:[/b] [param to_texture] texture requires the [constant TEXTURE_USAGE_CAN_COPY_TO_BIT] to be retrieved. + [b]Note:[/b] [param to_texture] texture must [b]not[/b] be multisampled and must also be 2D (or a slice of a 3D/cubemap texture). @@ -637,6 +798,10 @@ + Updates texture data with new data, replacing the previous data in place. The updated texture data must have the same dimensions and format. For 2D textures (which only have one layer), [param layer] must be [code]0[/code]. Returns [constant @GlobalScope.OK] if the update was successful, [constant @GlobalScope.ERR_INVALID_PARAMETER] otherwise. + [b]Note:[/b] Updating textures is forbidden during creation of a draw or compute list. + [b]Note:[/b] The existing [param texture] can't be updated while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to [constant FINAL_ACTION_CONTINUE]) to update this texture. + [b]Note:[/b] The existing [param texture] requires the [constant TEXTURE_USAGE_CAN_UPDATE_BIT] to be updatable. @@ -644,6 +809,8 @@ + It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -652,6 +819,8 @@ + It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. @@ -676,12 +845,15 @@ + It can be accessed with the RID that is returned. + Once finished with your RID, you will want to free the RID using the RenderingDevice's [method free_rid] method. + Creates a new vertex format with the specified [param vertex_descriptions]. Returns a unique vertex format ID corresponding to the newly created vertex format. @@ -705,478 +877,716 @@ Represents the size of the [enum DeviceType] enum. + Vulkan device driver resource. This is a "global" resource and ignores the RID passed in + Physical device (graphics card) driver resource. + Vulkan instance driver resource. + Vulkan queue driver resource. + Vulkan queue family index driver resource. + Vulkan image driver resource. + Vulkan image view driver resource. + Vulkan image native texture format driver resource. + Vulkan sampler driver resource. + Vulkan [url=https://vkguide.dev/docs/chapter-4/descriptors/]descriptor set[/url] driver resource. + Vulkan buffer driver resource. + Vulkan compute pipeline driver resource. + Vulkan render pipeline driver resource. + 4-bit-per-channel red/green channel data format, packed into 8 bits. Values are in the [code][0.0, 1.0][/code] range. + [b]Note:[/b] More information on all data formats can be found on the [url=https://registry.khronos.org/vulkan/specs/1.1/html/vkspec.html#_identification_of_formats]Identification of formats[/url] section of the Vulkan specification, as well as the [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkFormat.html]VkFormat[/url] enum. + 4-bit-per-channel red/green/blue/alpha channel data format, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + 4-bit-per-channel blue/green/red/alpha channel data format, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + Red/green/blue channel data format with 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + Blue/green/red channel data format with 5 bits of blue, 6 bits of green and 5 bits of red, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + Red/green/blue/alpha channel data format with 5 bits of red, 6 bits of green, 5 bits of blue and 1 bit of alpha, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + Blue/green/red/alpha channel data format with 5 bits of blue, 6 bits of green, 5 bits of red and 1 bit of alpha, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + Alpha/red/green/blue channel data format with 1 bit of alpha, 5 bits of red, 6 bits of green and 5 bits of blue, packed into 16 bits. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer red channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer red channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point red channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer red/green channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer red/green channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point red/green channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer red/green/blue channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point blue/green/red channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point blue/green/red channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer blue/green/red channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer blue/green/red channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point blue/green/red/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer blue/green/red/alpha channel data format. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer blue/green/red/alpha channel data format. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point blue/green/red/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the [code][0.0, 1.0][/code] range. + 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Values are in the [code][-1.0, 1.0][/code] range. + 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the [code][0.0, 255.0][/code] range. + 8-bit-per-channel signed floating-point alpha/red/green/blue channel data format with scaled value (value is converted from integer to float), packed in 32 bits. Values are in the [code][-127.0, 127.0][/code] range. + 8-bit-per-channel unsigned integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the [code][0, 255][/code] range. + 8-bit-per-channel signed integer alpha/red/green/blue channel data format, packed in 32 bits. Values are in the [code][-127, 127][/code] range. + 8-bit-per-channel unsigned floating-point alpha/red/green/blue channel data format with normalized value and non-linear sRGB encoding, packed in 32 bits. Values are in the [code][0.0, 1.0][/code] range. + Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][0.0, 1.0][/code] range. + Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][-1.0, 1.0][/code] range. + Unsigned floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][0.0, 1023.0][/code] range for red/green/blue and [code][0.0, 3.0][/code] for alpha. + Signed floating-point alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][-511.0, 511.0][/code] range for red/green/blue and [code][-1.0, 1.0][/code] for alpha. + Unsigned integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][0, 1023][/code] range for red/green/blue and [code][0, 3][/code] for alpha. + Signed integer alpha/red/green/blue channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of red, 10 bits of green and 10 bits of blue. Values are in the [code][-511, 511][/code] range for red/green/blue and [code][-1, 1][/code] for alpha. + Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][0.0, 1.0][/code] range. + Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][-1.0, 1.0][/code] range. + Unsigned floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][0.0, 1023.0][/code] range for blue/green/red and [code][0.0, 3.0][/code] for alpha. + Signed floating-point alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][-511.0, 511.0][/code] range for blue/green/red and [code][-1.0, 1.0][/code] for alpha. + Unsigned integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][0, 1023][/code] range for blue/green/red and [code][0, 3][/code] for alpha. + Signed integer alpha/blue/green/red channel data format with normalized value, packed in 32 bits. Format contains 2 bits of alpha, 10 bits of blue, 10 bits of green and 10 bits of red. Values are in the [code][-511, 511][/code] range for blue/green/red and [code][-1, 1][/code] for alpha. + 16-bit-per-channel unsigned floating-point red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 16-bit-per-channel signed floating-point red channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 16-bit-per-channel unsigned floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 65535.0][/code] range. + 16-bit-per-channel signed floating-point red channel data format with scaled value (value is converted from integer to float). Values are in the [code][-32767.0, 32767.0][/code] range. + 16-bit-per-channel unsigned integer red channel data format. Values are in the [code][0.0, 65535][/code] range. + 16-bit-per-channel signed integer red channel data format. Values are in the [code][-32767, 32767][/code] range. + 16-bit-per-channel signed floating-point red channel data format with the value stored as-is. + 16-bit-per-channel unsigned floating-point red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 16-bit-per-channel signed floating-point red/green channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 16-bit-per-channel unsigned floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 65535.0][/code] range. + 16-bit-per-channel signed floating-point red/green channel data format with scaled value (value is converted from integer to float). Values are in the [code][-32767.0, 32767.0][/code] range. + 16-bit-per-channel unsigned integer red/green channel data format. Values are in the [code][0.0, 65535][/code] range. + 16-bit-per-channel signed integer red/green channel data format. Values are in the [code][-32767, 32767][/code] range. + 16-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. + 16-bit-per-channel unsigned floating-point red/green/blue channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 16-bit-per-channel signed floating-point red/green/blue channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 16-bit-per-channel unsigned floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 65535.0][/code] range. + 16-bit-per-channel signed floating-point red/green/blue channel data format with scaled value (value is converted from integer to float). Values are in the [code][-32767.0, 32767.0][/code] range. + 16-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the [code][0.0, 65535][/code] range. + 16-bit-per-channel signed integer red/green/blue channel data format. Values are in the [code][-32767, 32767][/code] range. + 16-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. + 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. + 16-bit-per-channel unsigned floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][0.0, 65535.0][/code] range. + 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with scaled value (value is converted from integer to float). Values are in the [code][-32767.0, 32767.0][/code] range. + 16-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the [code][0.0, 65535][/code] range. + 16-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the [code][-32767, 32767][/code] range. + 16-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. + 32-bit-per-channel unsigned integer red channel data format. Values are in the [code][0, 2^32 - 1][/code] range. + 32-bit-per-channel signed integer red channel data format. Values are in the [code][2^31 + 1, 2^31 - 1][/code] range. + 32-bit-per-channel signed floating-point red channel data format with the value stored as-is. + 32-bit-per-channel unsigned integer red/green channel data format. Values are in the [code][0, 2^32 - 1][/code] range. + 32-bit-per-channel signed integer red/green channel data format. Values are in the [code][2^31 + 1, 2^31 - 1][/code] range. + 32-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. + 32-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the [code][0, 2^32 - 1][/code] range. + 32-bit-per-channel signed integer red/green/blue channel data format. Values are in the [code][2^31 + 1, 2^31 - 1][/code] range. + 32-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. + 32-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the [code][0, 2^32 - 1][/code] range. + 32-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the [code][2^31 + 1, 2^31 - 1][/code] range. + 32-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. + 64-bit-per-channel unsigned integer red channel data format. Values are in the [code][0, 2^64 - 1][/code] range. + 64-bit-per-channel signed integer red channel data format. Values are in the [code][2^63 + 1, 2^63 - 1][/code] range. + 64-bit-per-channel signed floating-point red channel data format with the value stored as-is. + 64-bit-per-channel unsigned integer red/green channel data format. Values are in the [code][0, 2^64 - 1][/code] range. + 64-bit-per-channel signed integer red/green channel data format. Values are in the [code][2^63 + 1, 2^63 - 1][/code] range. + 64-bit-per-channel signed floating-point red/green channel data format with the value stored as-is. + 64-bit-per-channel unsigned integer red/green/blue channel data format. Values are in the [code][0, 2^64 - 1][/code] range. + 64-bit-per-channel signed integer red/green/blue channel data format. Values are in the [code][2^63 + 1, 2^63 - 1][/code] range. + 64-bit-per-channel signed floating-point red/green/blue channel data format with the value stored as-is. + 64-bit-per-channel unsigned integer red/green/blue/alpha channel data format. Values are in the [code][0, 2^64 - 1][/code] range. + 64-bit-per-channel signed integer red/green/blue/alpha channel data format. Values are in the [code][2^63 + 1, 2^63 - 1][/code] range. + 64-bit-per-channel signed floating-point red/green/blue/alpha channel data format with the value stored as-is. + Unsigned floating-point blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 10 bits of blue channel, 11 bits of green channel and 11 bits of red channel. + Unsigned floating-point exposure/blue/green/red data format with the value stored as-is, packed in 32 bits. The format's precision is 5 bits of exposure, 9 bits of blue channel, 9 bits of green channel and 9 bits of red channel. + 16-bit unsigned floating-point depth data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. + 24-bit unsigned floating-point depth data format with normalized value, plus 8 unused bits, packed in 32 bits. Values for depth are in the [code][0.0, 1.0][/code] range. + 32-bit signed floating-point depth data format with the value stored as-is. + 8-bit unsigned integer stencil data format. + 16-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the [code][0.0, 1.0][/code] range. Values for stencil are in the [code][0, 255][/code] range. + 24-bit unsigned floating-point depth data format with normalized value, plus 8 bits of stencil in unsigned integer format. Values for depth are in the [code][0.0, 1.0][/code] range. Values for stencil are in the [code][0, 255][/code] range. + 32-bit signed floating-point depth data format with the value stored as-is, plus 8 bits of stencil in unsigned integer format. Values for stencil are in the [code][0, 255][/code] range. + VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). + VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel and 5 bits of blue channel. Using BC1 texture compression (also known as S3TC DXT1). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 1 bit of alpha channel. Using BC1 texture compression (also known as S3TC DXT1). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 4 bits of alpha channel. Using BC2 texture compression (also known as S3TC DXT3). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 5 bits of red channel, 6 bits of green channel, 5 bits of blue channel and 8 bits of alpha channel. Using BC3 texture compression (also known as S3TC DXT5). + VRAM-compressed unsigned red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 8 bits of red channel. Using BC4 texture compression. + VRAM-compressed signed red channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. The format's precision is 8 bits of red channel. Using BC4 texture compression. + VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). + VRAM-compressed signed red/green channel data format with normalized value. Values are in the [code][-1.0, 1.0][/code] range. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC5 texture compression (also known as S3TC RGTC). + VRAM-compressed unsigned red/green/blue channel data format with the floating-point value stored as-is. The format's precision is 8 bits of red channel and 8 bits of green channel. Using BC6H texture compression (also known as BPTC HDR). + VRAM-compressed signed red/green/blue channel data format with the floating-point value stored as-is. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Using BC7 texture compression (also known as BPTC HDR). + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. The format's precision is between 4 and 7 bits for the red/green/blue channels and between 0 and 8 bits for the alpha channel. Also known as BPTC LDR. + VRAM-compressed unsigned red/green/blue channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + VRAM-compressed unsigned red/green/blue channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. Red/green/blue use 8 bit of precision each, with alpha using 1 bit of precision. Using ETC2 texture compression. + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. + VRAM-compressed unsigned red/green/blue/alpha channel data format with normalized value and non-linear sRGB encoding. Values are in the [code][0.0, 1.0][/code] range. Red/green/blue use 8 bits of precision each, with alpha using 8 bits of precision. Using ETC2 texture compression. + 11-bit VRAM-compressed unsigned red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + 11-bit VRAM-compressed signed red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + 11-bit VRAM-compressed unsigned red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + 11-bit VRAM-compressed signed red/green channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Using ETC2 texture compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 4×4 blocks (highest quality). Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 4×4 blocks (highest quality). Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×4 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×4 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 5×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 5×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 6×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 6×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 8×8 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 8×8 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×5 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×6 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×8 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×8 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 10×10 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 10×10 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 12×10 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12×10 blocks. Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value, packed in 12 blocks (lowest quality). Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + VRAM-compressed unsigned floating-point data format with normalized value and non-linear sRGB encoding, packed in 12 blocks (lowest quality). Values are in the [code][0.0, 1.0][/code] range. Using ASTC compression. + 8-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 2 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 8-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, stored across 3 separate planes. Values are in the [code][0.0, 1.0][/code] range. + 10-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the [code][0.0, 1.0][/code] range. + 10-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the [code][0.0, 1.0][/code] range. + 10-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. + 10-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. + 10-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. + 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 10-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. + 12-bit-per-channel unsigned floating-point red channel data with normalized value, plus 6 unused bits, packed in 16 bits. Values are in the [code][0.0, 1.0][/code] range. + 12-bit-per-channel unsigned floating-point red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 2×16 bits. Values are in the [code][0.0, 1.0][/code] range. + 12-bit-per-channel unsigned floating-point red/green/blue/alpha channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. + 12-bit-per-channel unsigned floating-point green/blue/green/red channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. + 12-bit-per-channel unsigned floating-point blue/green/red/green channel data with normalized value, plus 6 unused bits after each channel, packed in 4×16 bits. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). The green channel is listed twice, but contains different values to allow it to be represented at full resolution. + 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 2 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 12-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Packed in 3×16 bits and stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. + 16-bit-per-channel unsigned floating-point green/blue/red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point blue/green/red channel data format with normalized value. Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 2 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal and vertical resolution (i.e. 2×2 adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue/red). Values are in the [code][0.0, 1.0][/code] range. Blue and red channel data is stored at halved horizontal resolution (i.e. 2 horizontally adjacent pixels will share the same value for the blue/red channel). + 16-bit-per-channel unsigned floating-point green/blue/red channel data with normalized value, plus 6 unused bits after each channel. Stored across 3 separate planes (green + blue + red). Values are in the [code][0.0, 1.0][/code] range. + Represents the size of the [enum DataFormat] enum. + Raster barrier mask. + Compute barrier mask. + Transfer barrier mask. + Barrier mask for all types (raster, compute, transfer). Equivalent to [code]BARRIER_MASK_RASTER | BARRIER_MASK_COMPUTE | BARRIER_MASK_TRANSFER[/code]. + No barrier for any type. 1-dimensional texture. @@ -1203,63 +1613,91 @@ Represents the size of the [enum TextureType] enum. + Perform 1 texture sample (this is the fastest but lowest-quality for antialiasing). + Perform 2 texture samples. + Perform 4 texture samples. + Perform 8 texture samples. Not supported on mobile GPUs (including Apple Silicon). + Perform 16 texture samples. Not supported on mobile GPUs and many desktop GPUs. + Perform 32 texture samples. Not supported on most GPUs. + Perform 64 texture samples (this is the slowest but highest-quality for antialiasing). Not supported on most GPUs. Represents the size of the [enum TextureSamples] enum. + Texture can be sampled. + Texture can be used as a color attachment in a framebuffer. + Texture can be used as a depth/stencil attachment in a framebuffer. + Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url]. + Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-storageimage]storage image[/url] with support for atomic operations. + Texture can be read back on the CPU using [method texture_get_data] faster than without this bit, since it is always kept in the system memory. + Texture can be updated using [method texture_update]. + Texture can be a source for [method texture_copy]. + Texture can be a destination for [method texture_copy]. + Texture can be used as a [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#descriptorsets-inputattachment]input attachment[/url] in a framebuffer. + Return the sampled value as-is. + Always return [code]0.0[/code] when sampling. + Always return [code]1.0[/code] when sampling. + Sample the red color channel. + Sample the green color channel. + Sample the blue color channel. + Sample the alpha channel. + Represents the size of the [enum TextureSwizzle] enum. + 2-dimensional texture slice. + Cubemap texture slice. + 3-dimensional texture slice. Nearest-neighbor sampler filtering. Sampling at higher resolutions than the source will result in a pixelated look. @@ -1268,209 +1706,311 @@ Bilinear sampler filtering. Sampling at higher resolutions than the source will result in a blurry look. + Sample with repeating enabled. + Sample with mirrored repeating enabled. When sampling outside the [code][0.0, 1.0][/code] range, return a mirrored version of the sampler. This mirrored version is mirrored again if sampling further away, with the pattern repeating indefinitely. + Sample with repeating disabled. When sampling outside the [code][0.0, 1.0][/code] range, return the color of the last pixel on the edge. + Sample with repeating disabled. When sampling outside the [code][0.0, 1.0][/code] range, return the specified [member RDSamplerState.border_color]. + Sample with mirrored repeating enabled, but only once. When sampling in the [code][-1.0, 0.0][/code] range, return a mirrored version of the sampler. When sampling outside the [code][-1.0, 1.0][/code] range, return the color of the last pixel on the edge. + Represents the size of the [enum SamplerRepeatMode] enum. + Return a floating-point transparent black color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Return a integer transparent black color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Return a floating-point opaque black color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Return a integer opaque black color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Return a floating-point opaque white color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Return a integer opaque white color when sampling outside the [code][0.0, 1.0][/code] range. Only effective if the sampler repeat mode is [constant SAMPLER_REPEAT_MODE_CLAMP_TO_BORDER]. + Represents the size of the [enum SamplerBorderColor] enum. + Vertex attribute addressing is a function of the vertex. This is used to specify the rate at which vertex attributes are pulled from buffers. + Vertex attribute addressing is a function of the instance index. This is used to specify the rate at which vertex attributes are pulled from buffers. + Index buffer in 16-bit unsigned integer format. This limits the maximum index that can be specified to [code]65535[/code]. + Index buffer in 32-bit unsigned integer format. This limits the maximum index that can be specified to [code]4294967295[/code]. + Sampler uniform. TODO: Difference between sampler and texture uniform + Sampler uniform with a texture. + Texture uniform. + Image uniform. TODO: Difference between texture and image uniform + Texture buffer uniform. TODO: Difference between texture and texture buffe uniformr + Sampler uniform with a texture buffer. TODO: Difference between texture and texture buffer uniform + Image buffer uniform. TODO: Difference between texture and image uniforms + Uniform buffer uniform. + [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]Storage buffer[/url] uniform. + Input attachment uniform. + Represents the size of the [enum UniformType] enum. Point rendering primitive (with constant size, regardless of distance from camera). - Line rendering primitive. + Line list rendering primitive. Lines are drawn separated from each other. + [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-lists-with-adjacency]Line list rendering primitive with adjacency.[/url] + [b]Note:[/b] Adjacency is only useful with geometry shaders, which Godot does not expose. + Line strip rendering primitive. Lines drawn are connected to the previous vertex. + [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-line-strips-with-adjacency]Line strip rendering primitive with adjacency.[/url] + [b]Note:[/b] Adjacency is only useful with geometry shaders, which Godot does not expose. + Triangle list rendering primitive. Triangles are drawn separated from each other. + [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-lists-with-adjacency]Triangle list rendering primitive with adjacency.[/url] + [b]Note:[/b] Adjacency is only useful with geometry shaders, which Godot does not expose. + Triangle strip rendering primitive. Triangles drawn are connected to the previous triangle. + [url=https://registry.khronos.org/vulkan/specs/1.3-extensions/html/vkspec.html#drawing-triangle-strips-with-adjacency]Triangle strip rendering primitive with adjacency.[/url] + [b]Note:[/b] Adjacency is only useful with geometry shaders, which Godot does not expose. + Triangle strip rendering primitive with [i]primitive restart[/i] enabled. Triangles drawn are connected to the previous triangle, but a primitive restart index can be specified before drawing to create a second triangle strip after the specified index. + [b]Note:[/b] Only compatible with indexed draws. + Tessellation patch rendering primitive. Only useful with tessellation shaders, which can be used to deform these patches. + Represents the size of the [enum RenderPrimitive] enum. + Do not use polygon front face or backface culling. + Use polygon frontface culling (faces pointing towards the camera are hidden). + Use polygon backface culling (faces pointing away from the camera are hidden). + Clockwise winding order to determine which face of a polygon is its front face. + Counter-clockwise winding order to determine which face of a polygon is its front face. + Keep the current stencil value. + Set the stencil value to [code]0[/code]. + Replace the existing stencil value with the new one. + Increment the existing stencil value and clamp to the maximum representable unsigned value if reached. Stencil bits are considered as an unsigned integer. + Decrement the existing stencil value and clamp to the minimum value if reached. Stencil bits are considered as an unsigned integer. + Bitwise-invert the existing stencil value. + Increment the stencil value and wrap around to [code]0[/code] if reaching the maximum representable unsigned. Stencil bits are considered as an unsigned integer. + Decrement the stencil value and wrap around to the maximum representable unsigned if reaching the minimum. Stencil bits are considered as an unsigned integer. + Represents the size of the [enum StencilOperation] enum. + "Never" comparison (opposite of [constant COMPARE_OP_ALWAYS]). + "Less than" comparison. + "Equal" comparison. + "Less than or equal" comparison. + "Greater than" comparison. + "Not equal" comparison. + "Greater than or equal" comparison. + "Always" comparison (opposite of [constant COMPARE_OP_NEVER]). + Represents the size of the [enum CompareOperator] enum. + Clear logic operation (result is always [code]0[/code]). See also [constant LOGIC_OP_SET]. + AND logic operation. + AND logic operation with the [i]destination[/i] operand being inverted. See also [constant LOGIC_OP_AND_INVERTED]. + Copy logic operation (keeps the [i]source[/i] value as-is). See also [constant LOGIC_OP_COPY_INVERTED] and [constant LOGIC_OP_NO_OP]. + AND logic operation with the [i]source[/i] operand being inverted. See also [constant LOGIC_OP_AND_REVERSE]. + No-op logic operation (keeps the [i]destination[/i] value as-is). See also [constant LOGIC_OP_COPY]. Exclusive or (XOR) logic operation. + OR logic operation. + Not-OR (NOR) logic operation. + Not-XOR (XNOR) logic operation. + Invert logic operation. + OR logic operation with the [i]destination[/i] operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. + NOT logic operation (inverts the value). See also [constant LOGIC_OP_COPY]. + OR logic operation with the [i]source[/i] operand being inverted. See also [constant LOGIC_OP_OR_REVERSE]. + Not-AND (NAND) logic operation. + SET logic operation (result is always [code]1[/code]). See also [constant LOGIC_OP_CLEAR]. + Represents the size of the [enum LogicOperation] enum. + Constant [code]0.0[/code] blend factor. + Constant [code]1.0[/code] blend factor. + Color blend factor is [code]source color[/code]. Alpha blend factor is [code]source alpha[/code]. + Color blend factor is [code]1.0 - source color[/code]. Alpha blend factor is [code]1.0 - source alpha[/code]. + Color blend factor is [code]destination color[/code]. Alpha blend factor is [code]destination alpha[/code]. + Color blend factor is [code]1.0 - destination color[/code]. Alpha blend factor is [code]1.0 - destination alpha[/code]. + Color and alpha blend factor is [code]source alpha[/code]. + Color and alpha blend factor is [code]1.0 - source alpha[/code]. + Color and alpha blend factor is [code]destination alpha[/code]. + Color and alpha blend factor is [code]1.0 - destination alpha[/code]. + Color blend factor is [code]blend constant color[/code]. Alpha blend factor is [code]blend constant alpha[/code] (see [method draw_list_set_blend_constants]). + Color blend factor is [code]1.0 - blend constant color[/code]. Alpha blend factor is [code]1.0 - blend constant alpha[/code] (see [method draw_list_set_blend_constants]). + Color and alpha blend factor is [code]blend constant alpha[/code] (see [method draw_list_set_blend_constants]). + Color and alpha blend factor is [code]1.0 - blend constant alpha[/code] (see [method draw_list_set_blend_constants]). + Color blend factor is [code]min(source alpha, 1.0 - destination alpha)[/code]. Alpha blend factor is [code]1.0[/code]. + Color blend factor is [code]second source color[/code]. Alpha blend factor is [code]second source alpha[/code]. Only relevant for dual-source blending. + Color blend factor is [code]1.0 - second source color[/code]. Alpha blend factor is [code]1.0 - second source alpha[/code]. Only relevant for dual-source blending. + Color and alpha blend factor is [code]second source alpha[/code]. Only relevant for dual-source blending. + Color and alpha blend factor is [code]1.0 - second source alpha[/code]. Only relevant for dual-source blending. + Represents the size of the [enum BlendFactor] enum. Additive blending operation ([code]source + destination[/code]). @@ -1517,68 +2057,100 @@ + Represents the size of the [enum InitialAction] enum. + Store the texture for reading and make it read-only if it has the [constant TEXTURE_USAGE_SAMPLING_BIT] bit (only applies to color, depth and stencil attachments). + Discard the texture data and make it read-only if it has the [constant TEXTURE_USAGE_SAMPLING_BIT] bit (only applies to color, depth and stencil attachments). + Store the texture and continue for further processing. Similar to [constant FINAL_ACTION_READ], but does not make the texture read-only if it has the [constant TEXTURE_USAGE_SAMPLING_BIT] bit. + Represents the size of the [enum FinalAction] enum. + Vertex shader stage. This can be used to manipulate vertices from a shader (but not create new vertices). + Fragment shader stage (called "pixel shader" in Direct3D). This can be used to manipulate pixels from a shader. + Tessellation control shader stage. This can be used to create additional geometry from a shader. + Tessellation evaluation shader stage. This can be used to create additional geometry from a shader. + Compute shader stage. This can be used to run arbitrary computing tasks in a shader, performing them on the GPU instead of the CPU. + Represents the size of the [enum ShaderStage] enum. + Vertex shader stage bit (see also [constant SHADER_STAGE_VERTEX]). + Fragment shader stage bit (see also [constant SHADER_STAGE_FRAGMENT]). + Tessellation control shader stage bit (see also [constant SHADER_STAGE_TESSELATION_CONTROL]). + Tessellation evaluation shader stage bit (see also [constant SHADER_STAGE_TESSELATION_EVALUATION]). + Compute shader stage bit (see also [constant SHADER_STAGE_COMPUTE]). + Khronos' GLSL shading language (used natively by OpenGL and Vulkan). This is the language used for core Godot shaders. + Microsoft's High-Level Shading Language (used natively by Direct3D, but can also be used in Vulkan). + Boolean specialization constant. + Integer specialization constant. + Floating-point specialization constant. + Maximum number of uniform sets that can be bound at a given time. + Maximum number of color framebuffer attachments that can be used at a given time. + Maximum number of textures that can be used per uniform set. + Maximum number of samplers that can be used per uniform set. + Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per uniform set. + Maximum number of storage images per uniform set. + Maximum number of uniform buffers per uniform set. + Maximum index for an indexed draw command. + Maximum height of a framebuffer (in pixels). + Maximum width of a framebuffer (in pixels). + Maximum number of texture array layers. Maximum supported 1-dimensional texture size (in pixels on a single axis). @@ -1593,48 +2165,70 @@ Maximum supported cubemap texture size (in pixels on a single axis of a single face). + Maximum number of textures per shader stage. + Maximum number of samplers per shader stage. + Maximum number of [url=https://vkguide.dev/docs/chapter-4/storage_buffers/]storage buffers[/url] per shader stage. + Maximum number of storage images per shader stage. + Maximum number of uniform buffers per uniform set. + Maximum size of a push constant. A lot of devices are limited to 128 bytes, so try to avoid exceeding 128 bytes in push constants to ensure compatibility even if your GPU is reporting a higher value. + Maximum size of a uniform buffer. + Maximum vertex input attribute offset. + Maximum number of vertex input attributes. + Maximum number of vertex input bindings. + Maximum vertex input binding stride. + Minimum uniform buffer offset alignment. + Maximum shared memory size for compute shaders. + Maximum number of workgroups for compute shaders on the X axis. + Maximum number of workgroups for compute shaders on the Y axis. + Maximum number of workgroups for compute shaders on the Z axis. + Maximum number of workgroup invocations for compute shaders. + Maximum workgroup size for compute shaders on the X axis. + Maximum workgroup size for compute shaders on the Y axis. + Maximum workgroup size for compute shaders on the Z axis. + Maximum viewport width (in pixels). + Maximum viewport height (in pixels). Memory taken by textures. diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 08c1cc4bd37..c5924c177f1 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -4,15 +4,14 @@ Server for anything visible. - The rendering server is the API backend for everything visible. The whole scene system mounts on it to display. - The rendering server is completely opaque, the internals are entirely implementation specific and cannot be accessed. - The rendering server can be used to bypass the scene/[Node] system entirely. + The rendering server is the API backend for everything visible. The whole scene system mounts on it to display. The rendering server is completely opaque: the internals are entirely implementation-specific and cannot be accessed. + The rendering server can be used to bypass the scene/[Node] system entirely. This can improve performance in cases where the scene system is the bottleneck, but won't improve performance otherwise (for instance, if the GPU is already fully utilized). Resources are created using the [code]*_create[/code] functions. These functions return [RID]s which are not references to the objects themselves, but opaque [i]pointers[/i] towards these objects. All objects are drawn to a viewport. You can use the [Viewport] attached to the [SceneTree] or you can create one yourself with [method viewport_create]. When using a custom scenario or canvas, the scenario or canvas needs to be attached to the viewport using [method viewport_set_scenario] or [method viewport_attach_canvas]. - In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any [Node3D] node with [method Node3D.get_world_3d]. Otherwise, a scenario can be created with [method scenario_create]. + [b]Scenarios:[/b] In 3D, all visual objects must be associated with a scenario. The scenario is a visual representation of the world. If accessing the rendering server from a running game, the scenario can be accessed from the scene tree from any [Node3D] node with [method Node3D.get_world_3d]. Otherwise, a scenario can be created with [method scenario_create]. Similarly, in 2D, a canvas is needed to draw all canvas items. - In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using [method instance_set_base]. The instance must also be attached to the scenario using [method instance_set_scenario] in order to be visible. - In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. + [b]3D:[/b] In 3D, all visible objects are comprised of a resource and an instance. A resource can be a mesh, a particle system, a light, or any other 3D object. In order to be visible resources must be attached to an instance using [method instance_set_base]. The instance must also be attached to the scenario using [method instance_set_scenario] in order to be visible. RenderingServer methods that don't have a prefix are usually 3D-specific (but not always). + [b]2D:[/b] In 2D, all visible objects are some form of canvas item. In order to be visible, a canvas item needs to be the child of a canvas attached to a viewport, or it needs to be the child of another canvas item that is eventually attached to the canvas. 2D-specific RenderingServer methods generally start with [code]canvas_*[/code]. [b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] [url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line argument[/url] disables all rendering and window management functions. Most functions from [RenderingServer] will return dummy values in this case. @@ -32,8 +31,8 @@ Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_attributes_[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [CameraAttributes] resource. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [CameraAttributes]. @@ -99,9 +98,9 @@ - Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [Camera3D] node. + Creates a 3D camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [Camera3D]. @@ -179,7 +178,7 @@ Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. Canvas has no [Resource] or [Node] equivalent. @@ -302,7 +301,7 @@ - Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_polygon]. + Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. If you need more flexibility (such as being able to use bones), use [method canvas_item_add_triangle_array] instead. See also [method CanvasItem.draw_polygon]. @@ -381,6 +380,8 @@ + Draws a triangle array on the [CanvasItem] pointed to by the [param item] [RID]. This is internally used by [Line2D] and [StyleBoxFlat] for rendering. [method canvas_item_add_triangle_array] is highly flexible, but more complex to use than [method canvas_item_add_polygon]. + [b]Note:[/b] [param count] is unused and can be left unspecified. @@ -393,9 +394,9 @@ - Creates a canvas item and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [CanvasItem] node. + Creates a new CanvasItem instance and returns its [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [CanvasItem]. @@ -407,6 +408,8 @@ + Sets the canvas group mode used during 2D rendering for the canvas item specified by the [param item] RID. For faster but more limited clipping, use [method canvas_item_set_clip] instead. + [b]Note:[/b] The equivalent node functionality is found in [CanvasGroup] and [member CanvasItem.clip_children]. @@ -414,6 +417,8 @@ + If [param clip] is [code]true[/code], makes the canvas item specified by the [param item] RID not draw anything outside of its rect's coordinates. This clipping is fast, but works only with axis-aligned rectangles. This means that rotation is ignored by the clipping rectangle. For more advanced clipping shapes, use [method canvas_item_set_canvas_group_mode] instead. + [b]Note:[/b] The equivalent node functionality is found in [member Label.clip_text], [RichTextLabel] (always enabled) and more. @@ -431,6 +436,7 @@ + If [param use_custom_rect] is [code]true[/code], sets the custom visibility rectangle (used for culling) to [param rect] for the canvas item specified by [param item]. Setting a custom visibility rect can reduce CPU load when drawing lots of 2D instances. If [param use_custom_rect] is [code]false[/code], automatically computes a visibility rectangle based on the canvas item's draw commands. @@ -438,6 +444,7 @@ + Sets the default texture filter mode for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.texture_filter]. @@ -445,6 +452,7 @@ + Sets the default texture repeat mode for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.texture_repeat]. @@ -452,6 +460,7 @@ + If [param enabled] is [code]true[/code], enables multichannel signed distance field rendering mode for the canvas item specified by the [param item] RID. This is meant to be used for font rendering, or with specially generated images using [url=https://github.com/Chlumsky/msdfgen]msdfgen[/url]. @@ -459,6 +468,7 @@ + If [param enabled] is [code]true[/code], draws the canvas item specified by the [param item] RID behind its parent. Equivalent to [member CanvasItem.show_behind_parent]. @@ -474,6 +484,7 @@ + Sets the light [param mask] for the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.light_mask]. @@ -481,7 +492,7 @@ - Sets a new material to the [CanvasItem]. + Sets a new [param material] to the canvas item specified by the [param item] RID. Equivalent to [member CanvasItem.material]. @@ -489,7 +500,7 @@ - Sets a color modulation to the [CanvasItem]. This also affects child canvas items. + Multiplies the color of the canvas item specified by the [param item] RID, while affecting its children. See also [method canvas_item_set_self_modulate]. Equivalent to [member CanvasItem.modulate]. @@ -505,7 +516,7 @@ - Sets a color self-modulation to the [CanvasItem]. It does not affect the child canvas items. + Multiplies the color of the canvas item specified by the [param item] RID, without affecting its children. See also [method canvas_item_set_modulate]. Equivalent to [member CanvasItem.self_modulate]. @@ -513,7 +524,7 @@ - Enables or disables Y-sorting of a [CanvasItem]. + If [param enabled] is [code]true[/code], child nodes with the lowest Y position are drawn before those with a higher Y position. Y-sorting only affects children that inherit from the canvas item specified by the [param item] RID, not the canvas item itself. Equivalent to [member CanvasItem.y_sort_enabled]. @@ -521,7 +532,7 @@ - Sets the transform of the [CanvasItem]. It affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform. + Sets the [param transform] of the canvas item specified by the [param item] RID. This affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform. Equivalent to [member Node2D.transform]. @@ -588,7 +599,8 @@ Creates a canvas light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [Light2D]. @@ -603,7 +615,8 @@ Creates a light occluder and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_light_occluder_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [LightOccluder2D]. @@ -795,7 +808,8 @@ Creates a new light occluder polygon and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_occluder_polygon_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [OccluderPolygon2D]. @@ -842,14 +856,15 @@ + Sets the [member ProjectSettings.rendering/2d/shadow_atlas/size] to use for [Light2D] shadow rendering (in pixels). The value is rounded up to the nearest power of 2. Creates a canvas texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_texture_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [CanvasTexture] resource. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. See also [method texture_2d_create]. + [b]Note:[/b] The equivalent resource is [CanvasTexture] and is only meant to be used in 2D rendering, not 3D. @@ -858,6 +873,7 @@ + Sets the [param channel]'s [param texture] for the canvas texture specified by the [param canvas_texture] RID. Equivalent to [member CanvasTexture.diffuse_texture], [member CanvasTexture.normal_texture] and [member CanvasTexture.specular_texture]. @@ -866,6 +882,7 @@ + Sets the [param base_color] and [param shininess] to use for the canvas texture specified by the [param canvas_texture] RID. Equivalent to [member CanvasTexture.specular_color] and [member CanvasTexture.specular_shininess]. @@ -873,7 +890,7 @@ - Sets the texture filter used by the [CanvasTexture]. + Sets the texture [param filter] mode to use for the canvas texture specified by the [param canvas_texture] RID. @@ -881,7 +898,7 @@ - Sets the texture repeat used by the [CanvasTexture]. + Sets the texture [param repeat] mode to use for the canvas texture specified by the [param canvas_texture] RID. @@ -895,8 +912,9 @@ Creates a decal and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]decal_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [Decal] node. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + To place in a scene, attach this decal to an instance using [method instance_set_base] using the returned RID. + [b]Note:[/b] The equivalent node is [Decal]. @@ -904,6 +922,7 @@ + Sets the [param albedo_mix] in the decal specified by the [param decal] RID. Equivalent to [member Decal.albedo_mix]. @@ -911,6 +930,7 @@ + Sets the cull [param mask] in the decal specified by the [param decal] RID. Equivalent to [member Decal.cull_mask]. @@ -920,6 +940,7 @@ + Sets the distance fade parameters in the decal specified by the [param decal] RID. Equivalent to [member Decal.distance_fade_enabled], [member Decal.distance_fade_begin] and [member Decal.distance_fade_length]. @@ -927,6 +948,7 @@ + Sets the emission [param energy] in the decal specified by the [param decal] RID. Equivalent to [member Decal.emission_energy]. @@ -935,6 +957,7 @@ + Sets the upper fade ([param above]) and lower fade ([param below]) in the decal specified by the [param decal] RID. Equivalent to [member Decal.upper_fade] and [member Decal.lower_fade]. @@ -942,7 +965,7 @@ - Sets the color modulation of the [Decal]. + Sets the color multiplier in the decal specified by the [param decal] RID to [param color]. Equivalent to [member Decal.modulate]. @@ -950,6 +973,7 @@ + Sets the normal [param fade] in the decal specified by the [param decal] RID. Equivalent to [member Decal.normal_fade]. @@ -957,7 +981,7 @@ - Sets the size of the [Decal]. + Sets the [param size] of the decal specified by the [param decal] RID. Equivalent to [member Decal.size]. @@ -966,22 +990,23 @@ - Sets the texture of the [Decal]. + Sets the [param texture] in the given texture [param type] slot for the specified decal. Equivalent to [method Decal.set_texture]. + Sets the texture [param filter] mode to use when rendering decals. This parameter is global and cannot be set on a per-decal basis. Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID. - This is the internal equivalent of the [DirectionalLight3D] node. + [b]Note:[/b] The equivalent node is [DirectionalLight3D]. @@ -989,12 +1014,14 @@ + Sets the [param size] of the directional light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/directional_shadow/size]. This parameter is global and cannot be set on a per-viewport basis. + Sets the filter [param quality] for directional light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/directional_shadow/soft_shadow_filter_quality]. This parameter is global and cannot be set on a per-viewport basis. @@ -1003,20 +1030,24 @@ + Generates and returns an [Image] containing the radiance map for the specified [param environment] RID's sky. This supports built-in sky material and custom sky shaders. If [param bake_irradiance] is [code]true[/code], the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also [method sky_bake_panorama]. + [b]Note:[/b] The image is saved in linear color space without any tonemapping performed, which means it will look too dark if viewed directly in an image editor. + [b]Note:[/b] [param size] should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than [member Sky.radiance_size], as it won't increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map. Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [Environment] resource. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [Environment]. + If [param enable] is [code]true[/code], enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent to [member ProjectSettings.rendering/environment/glow/upscale_mode]. @@ -1029,7 +1060,7 @@ - Sets the values to be used with the "Adjustment" post-process effect. See [Environment] for more details. + Sets the values to be used with the "adjustments" post-process effect. See [Environment] for more details. @@ -1041,6 +1072,7 @@ + Sets the values to be used for ambient light rendering. See [Environment] for more details. @@ -1048,7 +1080,7 @@ - Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment.background_mode]. + Sets the environment's background mode. Equivalent to [member Environment.background_mode]. @@ -1056,7 +1088,7 @@ - Color displayed for clear areas of the scene (if using Custom color or Color+Sky background modes). + Color displayed for clear areas of the scene. Only effective if using the [constant ENV_BG_COLOR] background mode. @@ -1089,6 +1121,7 @@ + Configures fog for the specified environment RID. See [code]fog_*[/code] properties in [Environment] for more information. @@ -1107,6 +1140,7 @@ + Configures glow for the specified environment RID. See [code]glow_*[/code] properties in [Environment] for more information. @@ -1123,24 +1157,28 @@ + Configures signed distance field global illumination for the specified environment RID. See [code]sdfgi_*[/code] properties in [Environment] for more information. + Sets the number of frames to use for converging signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_converge]. + Sets the update speed for dynamic lights' indirect lighting when computing signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights]. + Sets the number of rays to throw per frame when computing signed distance field global illumination. Equivalent to [member ProjectSettings.rendering/global_illumination/sdfgi/probe_ray_count]. @@ -1216,7 +1254,7 @@ - Sets the variables to be used with the "screen space reflections" post-process effect. See [Environment] for more details. + Sets the variables to be used with the screen-space reflections (SSR) post-process effect. See [Environment] for more details. @@ -1252,6 +1290,7 @@ + Sets the variables to be used with the volumetric fog post-process effect. See [Environment] for more details. @@ -1272,9 +1311,9 @@ - Creates a fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]fog_volume_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [FogVolume] node. + Creates a new fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]fog_volume_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [FogVolume]. @@ -1306,29 +1345,32 @@ + Forces redrawing of all viewports at once. + Forces a synchronization between the CPU and GPU, which may be required in certain cases. Only call this when needed, as CPU-GPU synchronization has a performance cost. - Tries to free an object in the RenderingServer. + Tries to free an object in the RenderingServer. To avoid memory leaks, this should be called after using an object as memory management does not occur automatically when using RendeeringServer directly. - Returns the default clear color which is used when a specific clear color has not been selected. + Returns the default clear color which is used when a specific clear color has not been selected. See also [method set_default_clear_color]. + Returns the time taken to setup rendering on the CPU in milliseconds. This value is shared across all viewports and does [i]not[/i] require [method viewport_set_measure_render_time] to be enabled on a viewport to be queried. See also [method viewport_get_measured_render_time_cpu]. @@ -1342,6 +1384,16 @@ + Returns a statistic about the rendering engine which can be used for performance profiling. See [enum RenderingServer.RenderingInfo] for a list of values that can be queried. See also [method viewport_get_render_info], which returns information specific to a viewport. + [b]Note:[/b] Only 3D rendering is currently taken into account by some of these values, such as the number of draw calls. + [b]Note:[/b] Rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, [method get_rendering_info] returns [code]0[/code]. To print rendering information in [code]_ready()[/code] successfully, use the following: + [codeblock] + func _ready(): + for _i in 2: + await get_tree().process_frame + + print(RenderingServer.get_rendering_info(RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME)) + [/codeblock] @@ -1354,19 +1406,25 @@ - Returns the ID of the test cube. Creates one if none exists. + Returns the RID of the test cube. This mesh will be created and returned on the first call to [method get_test_cube], then it will be cached for subsequent calls. See also [method make_sphere_mesh]. - Returns the ID of the test texture. Creates one if none exists. + Returns the RID of a 256×256 texture with a testing pattern on it (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_test_texture], then it will be cached for subsequent calls. See also [method get_white_texture]. + Example of getting the test texture and applying it to a [Sprite2D] node: + [codeblock] + var texture_rid = RenderingServer.get_test_texture() + var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid)) + $Sprite2D.texture = texture + [/codeblock] - Returns the version of the graphics video adapter [i]currently in use[/i] (e.g. "1.2.189" for Vulkan, "3.3.0 NVIDIA 510.60.02" for OpenGL). This version may be different from the actual latest version supported by the hardware, as Godot may not always request the latest version. + Returns the version of the graphics video adapter [i]currently in use[/i] (e.g. "1.2.189" for Vulkan, "3.3.0 NVIDIA 510.60.02" for OpenGL). This version may be different from the actual latest version supported by the hardware, as Godot may not always request the latest version. See also [method OS.get_video_adapter_driver_info]. [b]Note:[/b] When running a headless or server binary, this function returns an empty string. @@ -1394,14 +1452,20 @@ - Returns the ID of a white texture. Creates one if none exists. + Returns the ID of a 4×4 white texture (in [constant Image.FORMAT_RGB8] format). This texture will be created and returned on the first call to [method get_white_texture], then it will be cached for subsequent calls. See also [method get_test_texture]. + Example of getting the white texture and applying it to a [Sprite2D] node: + [codeblock] + var texture_rid = RenderingServer.get_white_texture() + var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid)) + $Sprite2D.texture = texture + [/codeblock] - If [param half_resolution] is [code]true[/code], renders [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. [LightmapGI] rendering is not affected by this setting. See also [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution]. + If [param half_resolution] is [code]true[/code], renders [VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) buffers at halved resolution on each axis (e.g. 960×540 when the viewport size is 1920×1080). This improves performance significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts that may be visible on polygon edges. The loss in quality becomes less noticeable as the viewport resolution increases. [LightmapGI] rendering is not affected by this setting. Equivalent to [member ProjectSettings.rendering/global_illumination/gi/use_half_resolution]. @@ -1410,29 +1474,38 @@ + Creates a new global shader uniform. + [b]Note:[/b] Global shader parameter names are case-sensitive. + Returns the value of the global shader uniform specified by [param name]. + [b]Note:[/b] [method global_shader_parameter_get] has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you're setting them as global parameters. + Returns the list of global shader uniform names. + [b]Note:[/b] [method global_shader_parameter_get] has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you're setting them as global parameters. + Returns the type associated to the global shader uniform specified by [param name]. + [b]Note:[/b] [method global_shader_parameter_get] has a large performance penalty as the rendering thread needs to synchronize with the calling thread, which is slow. Do not use this method during gameplay to avoid stuttering. If you need to read values in a script after setting them, consider creating an autoload where you store the values you need to query at the same time you're setting them as global parameters. + Removes the global shader uniform specified by [param name]. @@ -1440,6 +1513,7 @@ + Sets the global shader uniform [param name] to [param value]. @@ -1447,6 +1521,7 @@ + Overrides the global shader uniform [param name] with [param value]. Equivalent to the [ShaderGlobalsOverride] node. @@ -1489,9 +1564,9 @@ Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using [method instance_set_base]. - This is the internal equivalent of the [VisualInstance3D] node. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, reflection probes and decals need to be associated with an instance to be visible in the scenario using [method instance_set_base]. + [b]Note:[/b] The equivalent node is [VisualInstance3D]. @@ -1500,7 +1575,7 @@ Creates a visual instance, adds it to the RenderingServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. This is a shorthand for using [method instance_create] and setting the base and scenario manually. @@ -1508,6 +1583,8 @@ + Returns the value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to [method GeometryInstance3D.get_instance_shader_parameter]. + [b]Note:[/b] Per-instance shader parameter names are case-sensitive. @@ -1515,12 +1592,14 @@ + Returns the default value of the per-instance shader uniform from the specified 3D geometry instance. Equivalent to [method GeometryInstance3D.get_instance_shader_parameter]. + Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified 3D geometry instance. The returned dictionary is in PropertyInfo format, with the keys [code]name[/code], [code]class_name[/code], [code]type[/code], [code]hint[/code], [code]hint_string[/code] and [code]usage[/code]. Equivalent to [method GeometryInstance3D.get_instance_shader_parameter]. @@ -1547,6 +1626,7 @@ + Sets the lightmap GI instance to use for the specified 3D geometry instance. The lightmap UV scale for the specified instance (equivalent to [member GeometryInstance3D.gi_lightmap_scale]) and lightmap atlas slice must also be specified. @@ -1554,6 +1634,7 @@ + Sets the level of detail bias to use when rendering the specified 3D geometry instance. Higher values result in higher detail from further away. Equivalent to [member GeometryInstance3D.lod_bias]. @@ -1578,6 +1659,7 @@ + Sets the per-instance shader uniform on the specified 3D geometry instance. Equivalent to [method GeometryInstance3D.set_instance_shader_parameter]. @@ -1608,7 +1690,7 @@ - Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario. + Sets the base of the instance. A base can be any of the 3D objects that are created in the RenderingServer that can be displayed. For example, any of the light types, mesh, multimesh, particle system, reflection probe, decal, lightmap, voxel GI and visibility notifiers are all types that can be set as the base of an instance in order to be displayed in the scenario. @@ -1641,6 +1723,7 @@ + If [code]true[/code], ignores both frustum and occlusion culling on the specified 3D geometry instance. This is not the same as [member GeometryInstance3D.ignore_occlusion_culling], which only ignores occlusion culling and leaves frustum culling intact. @@ -1706,7 +1789,7 @@ - Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided AABB. Only 3D nodes that inherit from [VisualInstance3D] are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -1715,7 +1798,7 @@ - Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided convex shape. Only 3D nodes that inherit from [VisualInstance3D] are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -1725,7 +1808,7 @@ - Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. + Returns an array of object IDs intersecting with the provided 3D ray. Only 3D nodes that inherit from [VisualInstance3D] are considered, such as [MeshInstance3D] or [DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain the actual nodes. A scenario RID must be provided, which is available in the [World3D] you want to query. This forces an update for all resources queued to update. [b]Warning:[/b] This function is primarily intended for editor usage. For in-game use cases, prefer physics collision. @@ -1765,6 +1848,7 @@ + Sets the texture filter mode to use when rendering light projectors. This parameter is global and cannot be set on a per-light basis. @@ -1772,6 +1856,7 @@ + Sets the bake mode to use for the specified 3D light. Equivalent to [member Light3D.light_bake_mode]. @@ -1787,7 +1872,7 @@ - Sets the cull mask for this Light3D. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask]. + Sets the cull mask for this 3D light. Lights only affect objects in the selected layers. Equivalent to [member Light3D.light_cull_mask]. @@ -1798,7 +1883,7 @@ - Sets the distance fade for this Light3D. This acts as a form of level of detail (LOD) and can be used to improve performance. Equivalent to [member Light3D.distance_fade_enabled], [member Light3D.distance_fade_begin], [member Light3D.distance_fade_shadow], and [member Light3D.distance_fade_length]. + Sets the distance fade for this 3D light. This acts as a form of level of detail (LOD) and can be used to improve performance. Equivalent to [member Light3D.distance_fade_enabled], [member Light3D.distance_fade_begin], [member Light3D.distance_fade_shadow], and [member Light3D.distance_fade_length]. @@ -1806,6 +1891,7 @@ + Sets the maximum SDFGI cascade in which the 3D light's indirect lighting is rendered. Higher values allow the light to be rendered in SDFGI further away from the camera. @@ -1813,7 +1899,7 @@ - If [code]true[/code], light will subtract light instead of adding light. Equivalent to [member Light3D.light_negative]. + If [code]true[/code], the 3D light will subtract light instead of adding light. Equivalent to [member Light3D.light_negative]. @@ -1822,7 +1908,7 @@ - Sets the specified light parameter. See [enum LightParam] for options. Equivalent to [method Light3D.set_param]. + Sets the specified 3D light parameter. See [enum LightParam] for options. Equivalent to [method Light3D.set_param]. @@ -1830,7 +1916,7 @@ - Not implemented in Godot 3.x. + Sets the projector texture to use for the specified 3D light. Equivalent to [member Light3D.light_projector]. @@ -1852,9 +1938,9 @@ - Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]lightmap_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [LightmapGI] node. + Creates a new lightmap global illumination instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]lightmap_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [LightmapGI]. @@ -1925,6 +2011,7 @@ + Set the textures on the given [param lightmap] GI instance to the texture array pointed to by the [param light] RID. If the lightmap texture was baked with [member LightmapGI.directional] set to [code]true[/code], then [param uses_sh] must also be [code]true[/code]. @@ -1933,15 +2020,15 @@ - Returns a mesh of a sphere with the given number of horizontal and vertical subdivisions. + Returns a mesh of a sphere with the given number of horizontal subdivisions, vertical subdivisions and radius. See also [method get_test_cube]. Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. - This is the internal equivalent of the [Material] resource. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [Material]. @@ -2014,9 +2101,9 @@ Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. - This is the internal equivalent of the [Mesh] resource. + [b]Note:[/b] The equivalent resource is [Mesh]. @@ -2187,9 +2274,9 @@ Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID. - This is the internal equivalent of the [MultiMesh] resource. + [b]Note:[/b] The equivalent resource is [MultiMesh]. @@ -2203,6 +2290,8 @@ + Returns the MultiMesh data (such as instance transforms, colors, etc). See [method multimesh_set_buffer] for a description of the returned data. + [b]Note:[/b] If the buffer is in the engine's internal cache, it will have to be fetched from GPU memory and possibly decompressed. This means [method multimesh_get_buffer] is potentially a slow operation and should be avoided whenever possible. @@ -2299,6 +2388,20 @@ + Set the entire data to use for drawing the [param multimesh] at once to [param buffer] (such as instance transforms and colors). [param buffer]'s size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also [method multimesh_get_buffer]. + The per-instance data size and expected data order is: + [codeblock] + 2D: + - Position: 8 floats (8 floats for Transform2D) + - Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color) + - Position + Custom data: 12 floats (8 floats for Transform2D, 4 floats of custom data) + - Position + Vertex color + Custom data: 16 floats (8 floats for Transform2D, 4 floats for Color, 4 floats of custom data) + 3D: + - Position: 12 floats (12 floats for Transform3D) + - Position + Vertex color: 16 floats (12 floats for Transform3D, 4 floats for Color) + - Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data) + - Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data) + [/codeblock] @@ -2320,6 +2423,9 @@ + Creates an occluder instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]occluder_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [Occluder3D] (not to be confused with the [OccluderInstance3D] node). @@ -2328,25 +2434,30 @@ + Sets the mesh data for the given occluder RID, which controls the shape of the occlusion culling that will be performed. Creates a new omni light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this omni light to an instance using [method instance_set_base] using the returned RID. + [b]Note:[/b] The equivalent node is [OmniLight3D]. + Creates a new 3D GPU particle collision or attractor and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]particles_collision_*[/code] RenderingServer functions. + [b]Note:[/b] The equivalent nodes are [GPUParticlesCollision3D] and [GPUParticlesAttractor3D]. + Requests an update for the 3D GPU particle collision heightfield. This may be automatically called by the 3D GPU particle collision heightfield depending on its [member GPUParticlesCollisionHeightField3D.update_mode]. @@ -2354,6 +2465,7 @@ + Sets the attenuation [param curve] for the 3D GPU particles attractor specified by the [param particles_collision] RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.attenuation]. @@ -2361,6 +2473,7 @@ + Sets the directionality [param amount] for the 3D GPU particles attractor specified by the [param particles_collision] RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.directionality]. @@ -2368,6 +2481,8 @@ + Sets the [param setrngth] for the 3D GPU particles attractor specified by the [param particles_collision] RID. Only used for attractors, not colliders. Equivalent to [member GPUParticlesAttractor3D.strength]. + [b]Note:[/b] The [param setrngth] parameter should be named "strength", but this typo was kept in the 4.0.x branch to preserve compatibility for C# and GDExtension. @@ -2375,6 +2490,7 @@ + Sets the [param extents] for the 3D GPU particles collision by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionBox3D.size], [member GPUParticlesCollisionSDF3D.size], [member GPUParticlesCollisionHeightField3D.size], [member GPUParticlesAttractorBox3D.size] or [member GPUParticlesAttractorVectorField3D.size] depending on the [param particles_collision] type. @@ -2382,6 +2498,7 @@ + Sets the collision or attractor shape [param type] for the 3D GPU particles collision or attractor specified by the [param particles_collision] RID. @@ -2389,6 +2506,7 @@ + Sets the cull [param mask] for the 3D GPU particles collision or attractor specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollision3D.cull_mask] or [member GPUParticlesAttractor3D.cull_mask] depending on the [param particles_collision] type. @@ -2396,6 +2514,7 @@ + Sets the signed distance field [param texture] for the 3D GPU particles collision specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionSDF3D.texture] or [member GPUParticlesAttractorVectorField3D.texture] depending on the [param particles_collision] type. @@ -2403,6 +2522,7 @@ + Sets the heightmap [param resolution] for the 3D GPU particles heightfield collision specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionHeightField3D.resolution]. @@ -2410,14 +2530,17 @@ + Sets the [param radius] for the 3D GPU particles sphere collision or attractor specified by the [param particles_collision] RID. Equivalent to [member GPUParticlesCollisionSphere3D.radius] or [member GPUParticlesAttractorSphere3D.radius] depending on the [param particles_collision] type. - Creates a particle system and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]particles_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Creates a GPU-based particle system and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]particles_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach these particles to an instance using [method instance_set_base] using the returned RID. + [b]Note:[/b] The equivalent nodes are [GPUParticles2D] and [GPUParticles3D]. + [b]Note:[/b] All [code]particles_*[/code] methods only apply to GPU-based particles, not CPU-based particles. [CPUParticles2D] and [CPUParticles3D] do not have equivalent RenderingServer functions available, as these use [MultiMeshInstance2D] and [MultiMeshInstance3D] under the hood (see [code]multimesh_*[/code] methods). @@ -2429,6 +2552,7 @@ + Manually emits particles from the [param particles] instance. @@ -2574,6 +2698,7 @@ + Sets whether the GPU particles specified by the [param particles] RID should be rendered in 2D or 3D according to [param mode]. @@ -2637,6 +2762,7 @@ + If [param enable] is [code]true[/code], enables trails for the [param particles] with the specified [param length_sec] in seconds. Equivalent to [member GPUParticles3D.trail_enabled] and [member GPUParticles3D.trail_lifetime]. @@ -2658,14 +2784,16 @@ + Sets the filter quality for omni and spot light shadows in 3D. See also [member ProjectSettings.rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality]. This parameter is global and cannot be set on a per-viewport basis. Creates a reflection probe and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]reflection_probe_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this reflection probe to an instance using [method instance_set_base] using the returned RID. + [b]Note:[/b] The equivalent node is [ReflectionProbe]. @@ -2673,6 +2801,7 @@ + Sets the reflection probe's custom ambient light color. Equivalent to [member ReflectionProbe.ambient_color]. @@ -2680,6 +2809,7 @@ + Sets the reflection probe's custom ambient light energy. Equivalent to [member ReflectionProbe.ambient_color_energy]. @@ -2687,6 +2817,7 @@ + Sets the reflection probe's ambient light mode. Equivalent to [member ReflectionProbe.ambient_mode]. @@ -2742,6 +2873,7 @@ + Sets the mesh level of detail to use in the reflection probe rendering. Higher values will use less detailed versions of meshes that have LOD variations generated, which can improve performance. Equivalent to [member ReflectionProbe.mesh_lod_threshold]. @@ -2757,6 +2889,7 @@ + Sets the resolution to use when rendering the specified reflection probe. The [param resolution] is specified for each cubemap face: for instance, specifying [code]512[/code] will allocate 6 faces of 512×512 each (plus mipmaps for roughness levels). @@ -2786,7 +2919,7 @@ Creates a scenario and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]scenario_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. The scenario is the 3D world that all the visual instances exist in. @@ -2795,6 +2928,7 @@ + Sets the camera attributes ([param effects]) that will be used with this scenario. See also [CameraAttributes]. @@ -2802,7 +2936,7 @@ - Sets the environment that will be used with this scenario. + Sets the environment that will be used with this scenario. See also [Environment]. @@ -2819,6 +2953,7 @@ + Sets the screen-space roughness limiter parameters, such as whether it should be enabled and its thresholds. Equivalent to [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/enabled], [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/amount] and [member ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/limit]. @@ -2835,28 +2970,29 @@ - If [code]true[/code], the engine will generate wireframes for use with the wireframe debug mode. + This method is currently unimplemented and does nothing if called with [param generate] set to [code]true[/code]. - Sets the default clear color which is used when a specific clear color has not been selected. + Sets the default clear color which is used when a specific clear color has not been selected. See also [method get_default_clear_color]. Creates an empty shader and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]shader_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [Shader]. - Returns a shader's code. + Returns a shader's source code as a string. @@ -2874,6 +3010,7 @@ + Returns the default value for the specified shader uniform. This is usually the value written in the shader source code. @@ -2881,6 +3018,7 @@ + Sets the shader's source code (which triggers recompilation after being changed). @@ -2899,6 +3037,7 @@ + Sets the path hint for the specified shader. This should generally match the [Shader] resource's [member Resource.resource_path]. @@ -2947,7 +3086,7 @@ Creates a skeleton and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]skeleton_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. @@ -2971,13 +3110,16 @@ + Generates and returns an [Image] containing the radiance map for the specified [param sky] RID. This supports built-in sky material and custom sky shaders. If [param bake_irradiance] is [code]true[/code], the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also [method environment_bake_panorama]. + [b]Note:[/b] The image is saved in linear color space without any tonemapping performed, which means it will look too dark if viewed directly in an image editor. [param energy] values above [code]1.0[/code] can be used to brighten the resulting image. + [b]Note:[/b] [param size] should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than [member Sky.radiance_size], as it won't increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map. Creates an empty sky and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]sky_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. @@ -2985,7 +3127,7 @@ - Sets the material that the sky uses to render the background and reflection maps. + Sets the material that the sky uses to render the background, ambient and reflection maps. @@ -2993,6 +3135,7 @@ + Sets the process [param mode] of the sky specified by the [param sky] RID. Equivalent to [member Sky.process_mode]. @@ -3000,13 +3143,14 @@ + Sets the [param radiance_size] of the sky specified by the [param sky] RID (in pixels). Equivalent to [member Sky.radiance_size]. Creates a spot light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. To place in a scene, attach this spot light to an instance using [method instance_set_base] using the returned RID. @@ -3014,6 +3158,7 @@ + Sets [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality] to use when rendering materials that have subsurface scattering enabled. @@ -3021,18 +3166,30 @@ + Sets the [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scale] and [member ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale] to use when rendering materials that have subsurface scattering enabled. + Creates a 2-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [Texture2D]. + [b]Note:[/b] Not to be confused with [method RenderingDevice.texture_create], which creates the graphics API's own texture type as opposed to the Godot-specific [Texture2D] resource. + Returns an [Image] instance from the given [param texture] [RID]. + Example of getting the test texture from [method get_test_texture] and applying it to a [Sprite2D] node: + [codeblock] + var texture_rid = RenderingServer.get_test_texture() + var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid)) + $Sprite2D.texture = texture + [/codeblock] @@ -3040,6 +3197,7 @@ + Returns an [Image] instance from the given [param texture] [RID] and [param layer]. @@ -3047,17 +3205,25 @@ + Creates a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_layered_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [TextureLayered]. + Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_layered_*[/code] RenderingServer functions, although it does nothing when used. See also [method texture_2d_placeholder_create]. + [b]Note:[/b] The equivalent resource is [PlaceholderTextureLayered]. + Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_2d_layered_*[/code] RenderingServer functions, although it does nothing when used. See also [method texture_2d_layered_placeholder_create] + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [PlaceholderTexture2D]. @@ -3066,6 +3232,8 @@ + Updates the texture specified by the [param texture] [RID] with the data in [param image]. A [param layer] must also be specified, which should be [code]0[/code] when updating a single-layer texture ([Texture2D]). + [b]Note:[/b] The [param image] must have the same width, height and format as the current [param texture] data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height or format, use [method texture_replace] instead. @@ -3077,17 +3245,22 @@ + [b]Note:[/b] The equivalent resource is [Texture3D]. + Returns 3D texture data as an array of [Image]s for the specified texture [RID]. + Creates a placeholder for a 3-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]texture_3d_*[/code] RenderingServer functions, although it does nothing when used. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent resource is [PlaceholderTexture3D]. @@ -3095,6 +3268,8 @@ + Updates the texture specified by the [param texture] [RID]'s data with the data in [param data]. All the texture's layers must be replaced at once. + [b]Note:[/b] The [param texture] must have the same width, height, depth and format as the current texture data. Otherwise, an error will be printed and the original texture won't be modified. If you need to use different width, height, depth or format, use [method texture_replace] instead. @@ -3115,6 +3290,7 @@ + [i]Deprecated.[/i] As ProxyTexture was removed in Godot 4, this method does nothing when called and always returns a null [RID]. @@ -3122,6 +3298,7 @@ + [i]Deprecated.[/i] ProxyTexture was removed in Godot 4, so this method cannot be used anymore. @@ -3129,6 +3306,7 @@ + Replaces [param texture]'s texture data by the texture specified by the [param by_texture] RID, without changing [param texture]'s RID. @@ -3192,19 +3370,25 @@ Creates an empty viewport and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]viewport_*[/code] RenderingServer functions. - Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [Viewport]. + Returns the CPU time taken to render the last frame in milliseconds. This [i]only[/i] includes time spent in rendering-related operations; scripts' [code]_process[/code] functions and other engine subsystems are not included in this readout. To get a complete readout of CPU time spent to render the scene, sum the render times of all viewports that are drawn every frame plus [method get_frame_setup_time_cpu]. Unlike [method Engine.get_frames_per_second], this method will accurately reflect CPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_gpu]. + [b]Note:[/b] Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns [code]0.0[/code]. + Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike [method Engine.get_frames_per_second], this method accurately reflects GPU utilization even if framerate is capped via V-Sync or [member Engine.max_fps]. See also [method viewport_get_measured_render_time_gpu]. + [b]Note:[/b] Requires measurements to be enabled on the specified [param viewport] using [method viewport_set_measure_render_time]. Otherwise, this method returns [code]0.0[/code]. + [b]Note:[/b] When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU's highest power state). Keep this in mind when benchmarking using [method viewport_get_measured_render_time_gpu]. This behavior can be overridden in the graphics driver settings at the cost of higher power usage. @@ -3213,6 +3397,27 @@ + Returns a statistic about the rendering engine which can be used for performance profiling. This is separated into render pass [param type]s, each of them having the same [param info]s you can query (different passes will return different values). See [enum RenderingServer.ViewportRenderInfoType] for a list of render pass types and [enum RenderingServer.ViewportRenderInfo] for a list of information that can be queried. + See also [method get_rendering_info], which returns global information across all viewports. + [b]Note:[/b] Viewport rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, [method viewport_get_render_info] returns [code]0[/code]. To print rendering information in [code]_ready()[/code] successfully, use the following: + [codeblock] + func _ready(): + for _i in 2: + await get_tree().process_frame + + print( + RenderingServer.viewport_get_render_info(get_viewport().get_viewport_rid(), + RenderingServer.VIEWPORT_RENDER_INFO_TYPE_VISIBLE, + RenderingServer.VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME) + ) + [/codeblock] + + + + + + + Returns the render target for the viewport. @@ -3287,6 +3492,7 @@ + Sets the default texture filtering mode for the specified [param viewport] RID. See [enum CanvasItemTextureFilter] for options. @@ -3294,6 +3500,7 @@ + Sets the default texture repeat mode for the specified [param viewport] RID. See [enum CanvasItemTextureRepeat] for options. @@ -3301,7 +3508,7 @@ - If [code]true[/code], the viewport's canvas is not rendered. + If [code]true[/code], the viewport's canvas (i.e. 2D and GUI elements) is not rendered. @@ -3309,6 +3516,7 @@ + If [code]true[/code], the viewport's 3D elements are not rendered. @@ -3340,6 +3548,7 @@ + Sets the measurement for the given [param viewport] RID (obtained using [method Viewport.get_viewport_rid]). Once enabled, [method viewport_get_measured_render_time_cpu] and [method viewport_get_measured_render_time_gpu] will return values greater than [code]0.0[/code] when queried with the given [param viewport]. @@ -3347,7 +3556,7 @@ - Sets the multisample anti-aliasing mode for 2D/Canvas. See [enum ViewportMSAA] for options. + Sets the multisample anti-aliasing mode for 2D/Canvas on the specified [param viewport] RID. See [enum ViewportMSAA] for options. @@ -3355,19 +3564,21 @@ - Sets the multisample anti-aliasing mode for 3D. See [enum ViewportMSAA] for options. + Sets the multisample anti-aliasing mode for 3D on the specified [param viewport] RID. See [enum ViewportMSAA] for options. + Sets the [member ProjectSettings.rendering/occlusion_culling/bvh_build_quality] to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis. + Sets the [member ProjectSettings.rendering/occlusion_culling/occlusion_rays_per_thread] to use for occlusion culling. This parameter is global and cannot be set on a per-viewport basis. @@ -3375,7 +3586,7 @@ - Sets the viewport's parent to another viewport. + Sets the viewport's parent to the viewport specified by the [param parent_viewport] RID. @@ -3384,7 +3595,7 @@ - Sets the shadow atlas quadrant's subdivision. + Sets the number of subdivisions to use in the specified shadow atlas [param quadrant] for omni and spot shadows. See also [method Viewport.set_positional_shadow_atlas_quadrant_subdiv]. @@ -3393,8 +3604,8 @@ - Sets the size of the shadow atlas's images (used for omni and spot lights). The value will be rounded up to the nearest power of 2. - [b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at all (including directional shadows). + Sets the [param size] of the shadow atlas's images (used for omni and spot lights) on the viewport specified by the [param viewport] RID. The value is rounded up to the nearest power of 2. If [code]use_16_bits[/code] is [code]true[/code], use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. + [b]Note:[/b] If this is set to [code]0[/code], no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows). @@ -3410,7 +3621,7 @@ - Sets scaling 3d mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible. + Sets the 3D resolution scaling mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible. @@ -3427,8 +3638,7 @@ - Sets a viewport's scenario. - The scenario contains information about environment information, reflection atlas etc. + Sets a viewport's scenario. The scenario contains information about environment information, reflection atlas, etc. @@ -3436,6 +3646,7 @@ + Sets the viewport's screen-space antialiasing mode. @@ -3444,6 +3655,7 @@ + Sets the viewport's 2D signed distance field [member ProjectSettings.rendering/2d/sdf/oversize] and [member ProjectSettings.rendering/2d/sdf/scale]. This is used when sampling the signed distance field in [CanvasItem] shaders as well as [GPUParticles2D] collision. This is [i]not[/i] used by SDFGI in 3D rendering. @@ -3452,7 +3664,7 @@ - Sets the viewport's width and height. + Sets the viewport's width and height in pixels. @@ -3460,6 +3672,7 @@ + If [code]true[/code], canvas item transforms (i.e. origin position) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. Equivalent to [member ProjectSettings.rendering/2d/snap/snap_2d_transforms_to_pixel]. @@ -3467,6 +3680,7 @@ + If [code]true[/code], canvas item vertices (i.e. polygon points) are snapped to the nearest pixel when rendering. This can lead to a crisper appearance at the cost of less smooth movement, especially when [Camera2D] smoothing is enabled. Equivalent to [member ProjectSettings.rendering/2d/snap/snap_2d_vertices_to_pixel]. @@ -3499,6 +3713,7 @@ + If [code]true[/code], enables debanding on the specified viewport. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_debanding]. @@ -3506,6 +3721,7 @@ + If [code]true[/code], enables occlusion culling on the specified viewport. Equivalent to [member ProjectSettings.rendering/occlusion_culling/use_occlusion_culling]. @@ -3513,7 +3729,7 @@ - If [code]true[/code], use Temporal Anti-Aliasing. + If [code]true[/code], use Temporal Anti-Aliasing. Equivalent to [member ProjectSettings.rendering/anti_aliasing/quality/use_taa]. @@ -3529,7 +3745,7 @@ - Sets the Variable Rate Shading (VRS) mode for the viewport. Note, if hardware does not support VRS this property is ignored. + Sets the Variable Rate Shading (VRS) mode for the viewport. If the GPU does not support VRS, this property is ignored. Equivalent to [member ProjectSettings.rendering/vrs/mode]. @@ -3537,12 +3753,16 @@ - Texture to use when the VRS mode is set to [constant RenderingServer.VIEWPORT_VRS_TEXTURE]. + The texture to use when the VRS mode is set to [constant RenderingServer.VIEWPORT_VRS_TEXTURE]. Equivalent to [member ProjectSettings.rendering/vrs/texture]. + Creates a new 3D visibility notifier object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]visibility_notifier_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. + [b]Note:[/b] The equivalent node is [VisibleOnScreenNotifier3D]. @@ -3576,6 +3796,9 @@ + Creates a new voxel-based global illumination object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]voxel_gi_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] method. + [b]Note:[/b] The equivalent node is [VoxelGI]. @@ -3627,6 +3850,7 @@ + Sets the [member VoxelGIData.bias] value to use on the specified [param voxel_gi]'s [RID]. @@ -3634,6 +3858,7 @@ + Sets the [member VoxelGIData.dynamic_range] value to use on the specified [param voxel_gi]'s [RID]. @@ -3641,6 +3866,7 @@ + Sets the [member VoxelGIData.energy] value to use on the specified [param voxel_gi]'s [RID]. @@ -3648,6 +3874,7 @@ + Sets the [member VoxelGIData.interior] value to use on the specified [param voxel_gi]'s [RID]. @@ -3655,6 +3882,7 @@ + Sets the [member VoxelGIData.normal_bias] value to use on the specified [param voxel_gi]'s [RID]. @@ -3662,12 +3890,14 @@ + Sets the [member VoxelGIData.propagation] value to use on the specified [param voxel_gi]'s [RID]. + Sets the [member ProjectSettings.rendering/global_illumination/voxel_gi/quality] value to use when rendering. This parameter is global and cannot be set on a per-VoxelGI basis. @@ -3675,6 +3905,7 @@ + Sets the [member VoxelGIData.use_two_bounces] value to use on the specified [param voxel_gi]'s [RID]. @@ -3709,30 +3940,40 @@ The maximum Z-layer for canvas items. - Max number of glow levels that can be used with glow post-process effect. + The maximum number of glow levels that can be used with the glow post-processing effect. - Unused enum in Godot 3.x. + [i]Deprecated.[/i] This constant is unused. + The maximum number of directional lights that can be rendered at a given time in 2D. + Array of 2-dimensional textures (see [Texture2DArray]). + Cubemap texture (see [Cubemap]). + Array of cubemap textures (see [CubemapArray]). + Left face of a [Cubemap]. + Right face of a [Cubemap]. + Bottom face of a [Cubemap]. + Top face of a [Cubemap]. + Front face of a [Cubemap]. + Back face of a [Cubemap]. Shader is a 3D shader. @@ -3741,13 +3982,13 @@ Shader is a 2D shader. - Shader is a particle shader. + Shader is a particle shader (can be used in both 2D and 3D). - Shader is a sky shader. + Shader is a 3D sky shader. - Shader is a fog shader. + Shader is a 3D fog shader. Represents the size of the [enum ShaderMode] enum. @@ -3759,7 +4000,7 @@ The maximum renderpriority of all materials. - Array is a vertex array. + Array is a vertex position array. Array is a normal array. @@ -3768,21 +4009,25 @@ Array is a tangent array. - Array is a color array. + Array is a vertex color array. Array is an UV coordinates array. - Array is an UV coordinates array for the second UV coordinates. + Array is an UV coordinates array for the second set of UV coordinates. + Array is a custom data array for the first set of custom data. + Array is a custom data array for the second set of custom data. + Array is a custom data array for the third set of custom data. + Array is a custom data array for the fourth set of custom data. Array contains bone information. @@ -3791,33 +4036,43 @@ Array is weight information. - Array is index array. + Array is an index array. Represents the size of the [enum ArrayType] enum. + The number of custom data arrays available ([constant ARRAY_CUSTOM0], [constant ARRAY_CUSTOM1], [constant ARRAY_CUSTOM2], [constant ARRAY_CUSTOM3]). + Custom data array contains 8-bit-per-channel red/green/blue/alpha color data. Values are normalized, unsigned floating-point in the [code][0.0, 1.0][/code] range. + Custom data array contains 8-bit-per-channel red/green/blue/alpha color data. Values are normalized, signed floating-point in the [code][-1.0, 1.0][/code] range. + Custom data array contains 16-bit-per-channel red/green color data. Values are floating-point in half precision. + Custom data array contains 16-bit-per-channel red/green/blue/alpha color data. Values are floating-point in half precision. + Custom data array contains 32-bit-per-channel red color data. Values are floating-point in single precision. + Custom data array contains 32-bit-per-channel red/green color data. Values are floating-point in single precision. + Custom data array contains 32-bit-per-channel red/green/blue color data. Values are floating-point in single precision. + Custom data array contains 32-bit-per-channel red/green/blue/alpha color data. Values are floating-point in single precision. + Represents the size of the [enum ArrayCustomFormat] enum. - Flag used to mark a vertex array. + Flag used to mark a vertex position array. Flag used to mark a normal array. @@ -3826,7 +4081,7 @@ Flag used to mark a tangent array. - Flag used to mark a color array. + Flag used to mark a vertex color array. Flag used to mark an UV coordinates array. @@ -3835,12 +4090,16 @@ Flag used to mark an UV coordinates array for the second UV coordinates. + Flag used to mark an array of custom per-vertex data for the first set of custom data. + Flag used to mark an array of custom per-vertex data for the second set of custom data. + Flag used to mark an array of custom per-vertex data for the third set of custom data. + Flag used to mark an array of custom per-vertex data for the fourth set of custom data. Flag used to mark a bone information array. @@ -3875,6 +4134,7 @@ + Flag used to mark that the array uses 8 bone weighs instead of 4. @@ -3927,13 +4187,13 @@ Linear filter for light projectors (use for non-pixel art light projectors). Anisotropic mipmaps are used for rendering, which means light projectors at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. - Is a directional (sun) light. + Directional (sun/moon) light (see [DirectionalLight3D]). - Is an omni light. + Omni light (see [OmniLight3D]). - Is a spot light. + Spot light (see [SpotLight3D]). The light's energy multiplier. @@ -3963,7 +4223,7 @@ The spotlight's attenuation. - Max distance that shadows will be rendered. + The maximum distance for shadow splits. Increasing this value will make directional shadows visible from further away, at the cost of lower overall shadow detail and performance (since more objects need to be included in the directional shadow rendering). Proportion of shadow atlas occupied by the first split. @@ -3998,10 +4258,13 @@ Represents the size of the [enum LightParam] enum. + Light is ignored when baking. This is the fastest mode, but the light will be taken into account when baking global illumination. This mode should generally be used for dynamic lights that change quickly, as the effect of global illumination is less noticeable on those lights. + Light is taken into account in static baking ([VoxelGI], [LightmapGI], SDFGI ([member Environment.sdfgi_enabled])). The light can be moved around or modified, but its global illumination will not update in real-time. This is suitable for subtle changes (such as flickering torches), but generally not large changes such as toggling a light on and off. + Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member Environment.sdfgi_enabled]) only). The light can be moved around or modified with global illumination updating in real-time. The light's global illumination appearance will be slightly different compared to [constant LIGHT_BAKE_STATIC]. This has a greater performance cost compared to [constant LIGHT_BAKE_STATIC]. When using SDFGI, the update speed of dynamic lights is affected by [member ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights]. Use a dual paraboloid shadow map for omni lights. @@ -4047,6 +4310,7 @@ Highest low shadow filtering quality (slowest). When using this quality setting, [member Light3D.shadow_blur] is automatically multiplied by 2× to better make use of the high sample count. This increased blur also improves the stability of dynamic object shadows. This multiplier only applies to lights whose [member Light3D.light_size] or [member Light3D.light_angular_distance] is [code]0.0[/code]). + Represents the size of the [enum ShadowQuality] enum. Reflection probe will update reflections once and then stop. @@ -4055,20 +4319,28 @@ Reflection probe will update each frame. This mode is necessary to capture moving objects. + Do not apply any ambient lighting inside the reflection probe's box defined by its size. + Apply automatically-sourced environment lighting inside the reflection probe's box defined by its size. + Apply custom ambient lighting inside the reflection probe's box defined by its size. See [method reflection_probe_set_ambient_color] and [method reflection_probe_set_ambient_energy]. + Albedo texture slot in a decal ([member Decal.texture_albedo]). + Normal map texture slot in a decal ([member Decal.texture_normal]). + Occlusion/Roughness/Metallic texture slot in a decal ([member Decal.texture_orm]). + Emission texture slot in a decal ([member Decal.texture_emission]). + Represents the size of the [enum DecalTexture] enum. Nearest-neighbor filter for decals (use for pixel art decals). No mipmaps are used for rendering, which means decals at a distance will look sharp but grainy. This has roughly the same performance cost as using mipmaps. @@ -4089,12 +4361,16 @@ Linear filter for decals (use for non-pixel art decals). Anisotropic mipmaps are used for rendering, which means decals at a distance will look smooth and sharp when viewed from oblique angles. This looks better compared to isotropic mipmaps, but is slower. The level of anisotropic filtering is defined by [member ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level]. + Low [VoxelGI] rendering quality using 4 cones. + High [VoxelGI] rendering quality using 6 cones. + 2D particles. + 3D particles. @@ -4152,6 +4428,7 @@ + Represents the size of the [enum ParticlesCollisionHeightfieldResolution] enum. [FogVolume] will be shaped like an ellipsoid (stretched sphere). @@ -4169,6 +4446,7 @@ [FogVolume] will have no shape, will cover the whole world and will not be culled. + Represents the size of the [enum FogVolumeShape] enum. Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will result in undersampling while values greater than [code]1.0[/code] will result in supersampling. A value of [code]1.0[/code] disables scaling. @@ -4177,29 +4455,31 @@ Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using [member Viewport.scaling_3d_scale]. Values less than [code]1.0[/code] will be result in the viewport being upscaled using FSR. Values greater than [code]1.0[/code] are not supported and bilinear downsampling will be used instead. A value of [code]1.0[/code] disables scaling. + Represents the size of the [enum ViewportScaling3DMode] enum. - Do not update the viewport. + Do not update the viewport's render target. - Update the viewport once then set to disabled. + Update the viewport's render target once, then switch to [constant VIEWPORT_UPDATE_DISABLED]. - Update the viewport whenever it is visible. + Update the viewport's render target only when it is visible. This is the default value. + Update the viewport's render target only when its parent is visible. - Always update the viewport. + Always update the viewport's render target. - The viewport is always cleared before drawing. + Always clear the viewport's render target before drawing. - The viewport is never cleared before drawing. + Never clear the viewport's render target. - The viewport is cleared once, then the clear mode is set to [constant VIEWPORT_CLEAR_NEVER]. + Clear the viewport's render target on the next frame, then switch to [constant VIEWPORT_CLEAR_NEVER]. Disable rendering of 3D environment over 2D canvas. @@ -4208,28 +4488,37 @@ Enable rendering of 3D environment over 2D canvas. - Inherit enable/disable value from parent. If topmost parent is also set to inherit, then this has the same behavior as [constant VIEWPORT_ENVIRONMENT_ENABLED]. + Inherit enable/disable value from parent. If the topmost parent is also set to [constant VIEWPORT_ENVIRONMENT_INHERIT], then this has the same behavior as [constant VIEWPORT_ENVIRONMENT_ENABLED]. - Max value of [enum ViewportEnvironmentMode] enum. + Represents the size of the [enum ViewportEnvironmentMode] enum. + Do not oversize the 2D signed distance field. Occluders may disappear when touching the viewport's edges, and [GPUParticles3D] collision may stop working earlier than intended. This has the lowest GPU requirements. + 2D signed distance field covers 20% of the viewport's size outside the viewport on each side (top, right, bottom, left). + 2D signed distance field covers 50% of the viewport's size outside the viewport on each side (top, right, bottom, left). + 2D signed distance field covers 100% of the viewport's size outside the viewport on each side (top, right, bottom, left). This has the highest GPU requirements. + Represents the size of the [enum ViewportSDFOversize] enum. + Full resolution 2D signed distance field scale. This has the highest GPU requirements. + Half resolution 2D signed distance field scale on each axis (25% of the viewport pixel count). + Quarter resolution 2D signed distance field scale on each axis (6.25% of the viewport pixel count). This has the lowest GPU requirements. + Represents the size of the [enum ViewportSDFScale] enum. Multisample antialiasing for 3D is disabled. This is the default value, and also the fastest setting. @@ -4244,18 +4533,25 @@ Multisample antialiasing uses 8 samples per pixel for 3D. This has a very high impact on performance. Likely unsupported on low-end and older hardware. + Represents the size of the [enum ViewportMSAA] enum. + Do not perform any antialiasing in the full screen post-process. + Use fast approximate antialiasing. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. + Represents the size of the [enum ViewportScreenSpaceAA] enum. + Low occlusion culling BVH build quality (as defined by Embree). Results in the lowest CPU usage, but least effective culling. + Medium occlusion culling BVH build quality (as defined by Embree). + High occlusion culling BVH build quality (as defined by Embree). Results in the highest CPU usage, but most effective culling. Number of objects drawn in a single frame. @@ -4270,10 +4566,13 @@ Represents the size of the [enum ViewportRenderInfo] enum. + Visible render pass (excluding shadows). + Shadow render pass. Objects will be rendered several times depending on the number of amounts of lights with shadows and the number of directional shadow splits. + Represents the size of the [enum ViewportRenderInfoType] enum. Debug draw is disabled. Default setting. @@ -4310,6 +4609,7 @@ Draws the shadow atlas that stores shadows from [DirectionalLight3D]s in the upper left quadrant of the [Viewport]. + Draws the estimated scene luminance. This is a 1×1 texture that is generated when autoexposure is enabled to control the scene's exposure. Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have [member Environment.ssao_enabled] set in your [WorldEnvironment]. @@ -4321,49 +4621,62 @@ Colors each PSSM split for the [DirectionalLight3D]s in the scene a different color so you can see where the splits are. In order they will be colored red, green, blue, yellow. + Draws the decal atlas that stores decal textures from [Decal]s. + Draws SDFGI cascade data. This is the data structure that is used to bounce lighting against and create reflections. + Draws SDFGI probe data. This is the data structure that is used to give indirect lighting dynamic objects moving within the scene. + Draws the global illumination buffer ([VoxelGI] or SDFGI). + Disable mesh LOD. All meshes are drawn with full detail, which can be used to compare performance. + Draws the [OmniLight3D] cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting. + Draws the [SpotLight3D] cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting. + Draws the [Decal] cluster. Clustering determines where decals are positioned in screen-space, which allows the engine to only process these portions of the screen for decals. + Draws the [ReflectionProbe] cluster. Clustering determines where reflection probes are positioned in screen-space, which allows the engine to only process these portions of the screen for reflection probes. + Draws the occlusion culling buffer. This low-resolution occlusion culling buffer is rasterized on the CPU and is used to check whether instances are occluded by other objects. + Draws the motion vectors buffer. This is used by temporal antialiasing to correct for motion that occurs during gameplay. - VRS is disabled. + Variable rate shading is disabled. - VRS uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. + Variable rate shading uses a texture. Note, for stereoscopic use a texture atlas with a texture for each view. - VRS texture is supplied by the primary [XRInterface]. + Variable rate shading texture is supplied by the primary [XRInterface]. Represents the size of the [enum ViewportVRSMode] enum. + Automatically selects the appropriate process mode based on your sky shader. If your shader uses [code]TIME[/code] or [code]POSITION[/code], this will use [constant SKY_MODE_REALTIME]. If your shader uses any of the [code]LIGHT_*[/code] variables or any custom uniforms, this uses [constant SKY_MODE_INCREMENTAL]. Otherwise, this defaults to [constant SKY_MODE_QUALITY]. - Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant Sky.PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/reflections/sky_reflections/ggx_samples]. + Uses high quality importance sampling to process the radiance map. In general, this results in much higher quality than [constant SKY_MODE_REALTIME] but takes much longer to generate. This should not be used if you plan on changing the sky at runtime. If you are finding that the reflection is not blurry enough and is showing sparkles or fireflies, try increasing [member ProjectSettings.rendering/reflections/sky_reflections/ggx_samples]. + Uses the same high quality importance sampling to process the radiance map as [constant SKY_MODE_QUALITY], but updates over several frames. The number of frames is determined by [member ProjectSettings.rendering/reflections/sky_reflections/roughness_layers]. Use this when you need highest quality radiance maps, but have a sky that updates slowly. - Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. - [b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member Sky.radiance_size] must be set to [constant Sky.RADIANCE_SIZE_256]. + Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [member ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality]. + [b]Note:[/b] The fast filtering algorithm is limited to 256×256 cubemaps, so [method sky_set_radiance_size] must be set to [code]256[/code]. Otherwise, a warning is printed and the overridden radiance size is ignored. Use the clear color as background. @@ -4478,60 +4791,88 @@ Highest quality screen-space indirect lighting. Uses the adaptive target setting which can be dynamically adjusted to smoothly balance performance and visual quality. + Use 50% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be twice as short as they are wide. This allows providing increased GI detail and reduced light leaking with thin floors and ceilings. This is usually the best choice for scenes that don't feature much verticality. + Use 75% scale for SDFGI on the Y (vertical) axis. This is a balance between the 50% and 100% SDFGI Y scales. + Use 100% scale for SDFGI on the Y (vertical) axis. SDFGI cells will be as tall as they are wide. This is usually the best choice for highly vertical scenes. The downside is that light leaking may become more noticeable with thin floors and ceilings. + Throw 4 rays per frame when converging SDFGI. This has the lowest GPU requirements, but creates the most noisy result. + Throw 8 rays per frame when converging SDFGI. + Throw 16 rays per frame when converging SDFGI. + Throw 32 rays per frame when converging SDFGI. + Throw 64 rays per frame when converging SDFGI. + Throw 96 rays per frame when converging SDFGI. This has high GPU requirements. + Throw 128 rays per frame when converging SDFGI. This has very high GPU requirements, but creates the least noisy result. + Represents the size of the [enum EnvironmentSDFGIRayCount] enum. + Converge SDFGI over 5 frames. This is the most responsive, but creates the most noisy result with a given ray count. + Configure SDFGI to fully converge over 10 frames. + Configure SDFGI to fully converge over 15 frames. + Configure SDFGI to fully converge over 20 frames. + Configure SDFGI to fully converge over 25 frames. + Configure SDFGI to fully converge over 30 frames. This is the least responsive, but creates the least noisy result with a given ray count. + Represents the size of the [enum EnvironmentSDFGIFramesToConverge] enum. + Update indirect light from dynamic lights in SDFGI over 1 frame. This is the most responsive, but has the highest GPU requirements. + Update indirect light from dynamic lights in SDFGI over 2 frames. + Update indirect light from dynamic lights in SDFGI over 4 frames. + Update indirect light from dynamic lights in SDFGI over 8 frames. + Update indirect light from dynamic lights in SDFGI over 16 frames. This is the least responsive, but has the lowest GPU requirements. + Represents the size of the [enum EnvironmentSDFGIFramesToUpdateLight] enum. + Disables subsurface scattering entirely, even on materials that have [member BaseMaterial3D.subsurf_scatter_enabled] set to [code]true[/code]. This has the lowest GPU requirements. + Low subsurface scattering quality. + Medium subsurface scattering quality. + High subsurface scattering quality. This has the highest GPU requirements. Calculate the DOF blur using a box filter. The fastest option, but results in obvious lines in blur pattern. @@ -4567,6 +4908,7 @@ The instance is a particle emitter. + The instance is a GPUParticles collision shape. The instance is a light. @@ -4584,10 +4926,13 @@ The instance is a lightmap. + The instance is an occlusion culling occluder. + The instance is a visible on-screen notifier. + The instance is a fog volume. Represents the size of the [enum InstanceType] enum. @@ -4605,6 +4950,7 @@ When set, manually requests to draw geometry on next frame. + Always draw, even if the instance would be culled by occlusion culling. Does not affect view frustum culling. Represents the size of the [enum InstanceFlags] enum. @@ -4643,10 +4989,13 @@ Index of [Image] in array of [Image]s returned by [method bake_render_uv2]. Image uses [constant Image.FORMAT_RGBAH] and contains emission color in the [code].rgb[/code] channels and nothing in the [code].a[/code] channel. + Diffuse canvas texture ([member CanvasTexture.diffuse_texture]). + Normal map canvas texture ([member CanvasTexture.normal_texture]). + Specular map canvas texture ([member CanvasTexture.specular_texture]). The nine patch gets stretched where needed. @@ -4697,16 +5046,21 @@ Max value for [enum CanvasItemTextureRepeat] enum. + Child draws over parent and is not clipped. + Parent is used for the purposes of clipping only. Child is clipped to the parent's visible area, parent is not drawn. + Parent is used for clipping child, but parent is also drawn underneath child as normal before clipping child to its visible area. + 2D point light (see [PointLight2D]). + 2D directional (sun/moon) light (see [DirectionalLight2D]). Adds light color additive to the canvas. @@ -4739,74 +5093,109 @@ Culling of the canvas occluder is counterclockwise. + Boolean global shader parameter ([code]global uniform bool ...[/code]). + 2-dimensional boolean vector global shader parameter ([code]global uniform bvec2 ...[/code]). + 3-dimensional boolean vector global shader parameter ([code]global uniform bvec3 ...[/code]). + 4-dimensional boolean vector global shader parameter ([code]global uniform bvec4 ...[/code]). + Integer global shader parameter ([code]global uniform int ...[/code]). + 2-dimensional integer vector global shader parameter ([code]global uniform ivec2 ...[/code]). + 3-dimensional integer vector global shader parameter ([code]global uniform ivec3 ...[/code]). + 4-dimensional integer vector global shader parameter ([code]global uniform ivec4 ...[/code]). + 2-dimensional integer rectangle global shader parameter ([code]global uniform ivec4 ...[/code]). Equivalent to [constant GLOBAL_VAR_TYPE_IVEC4] in shader code, but exposed as a [Rect2i] in the editor UI. + Unsigned integer global shader parameter ([code]global uniform uint ...[/code]). + 2-dimensional unsigned integer vector global shader parameter ([code]global uniform uvec2 ...[/code]). + 3-dimensional unsigned integer vector global shader parameter ([code]global uniform uvec3 ...[/code]). + 4-dimensional unsigned integer vector global shader parameter ([code]global uniform uvec4 ...[/code]). + Single-precision floating-point global shader parameter ([code]global uniform float ...[/code]). + 2-dimensional floating-point vector global shader parameter ([code]global uniform vec2 ...[/code]). + 3-dimensional floating-point vector global shader parameter ([code]global uniform vec3 ...[/code]). + 4-dimensional floating-point vector global shader parameter ([code]global uniform vec4 ...[/code]). + Color global shader parameter ([code]global uniform vec4 ...[/code]). Equivalent to [constant GLOBAL_VAR_TYPE_VEC4] in shader code, but exposed as a [Color] in the editor UI. + 2-dimensional floating-point rectangle global shader parameter ([code]global uniform vec4 ...[/code]). Equivalent to [constant GLOBAL_VAR_TYPE_VEC4] in shader code, but exposed as a [Rect2] in the editor UI. + 2×2 matrix global shader parameter ([code]global uniform mat2 ...[/code]). Exposed as a [PackedInt32Array] in the editor UI. + 3×3 matrix global shader parameter ([code]global uniform mat3 ...[/code]). Exposed as a [Basis] in the editor UI. + 4×4 matrix global shader parameter ([code]global uniform mat4 ...[/code]). Exposed as a [Projection] in the editor UI. + 2-dimensional transform global shader parameter ([code]global uniform mat2x3 ...[/code]). Exposed as a [Transform2D] in the editor UI. + 3-dimensional transform global shader parameter ([code]global uniform mat3x4 ...[/code]). Exposed as a [Transform3D] in the editor UI. + 2D sampler global shader parameter ([code]global uniform sampler2D ...[/code]). Exposed as a [Texture2D] in the editor UI. + 2D sampler array global shader parameter ([code]global uniform sampler2DArray ...[/code]). Exposed as a [Texture2DArray] in the editor UI. + 3D sampler global shader parameter ([code]global uniform sampler3D ...[/code]). Exposed as a [Texture3D] in the editor UI. + Cubemap sampler global shader parameter ([code]global uniform samplerCube ...[/code]). Exposed as a [Cubemap] in the editor UI. + Represents the size of the [enum GlobalShaderParameterType] enum. + Number of objects rendered in the current 3D scene. This varies depending on camera position and rotation. + Number of vertices/indices rendered in the current 3D scene. This varies depending on camera position and rotation. + Number of draw calls performed to render in the current 3D scene. This varies depending on camera position and rotation. + Texture memory used (in bytes). + Buffer memory used (in bytes). + Video memory used (in bytes). This is always greater than the sum of [constant RENDERING_INFO_TEXTURE_MEM_USED] and [constant RENDERING_INFO_BUFFER_MEM_USED], since there is miscellaneous data not accounted for by those two metrics. Hardware supports shaders. This enum is currently unused in Godot 3.x. diff --git a/doc/classes/ResourceLoader.xml b/doc/classes/ResourceLoader.xml index d51a5293ec3..67b967d476d 100644 --- a/doc/classes/ResourceLoader.xml +++ b/doc/classes/ResourceLoader.xml @@ -71,6 +71,7 @@ The [param cache_mode] property defines whether and how the cache should be used or updated when loading the resource. See [enum CacheMode] for details. Returns an empty resource if no [ResourceFormatLoader] could handle the file. GDScript has a simplified [method @GDScript.load] built-in method which can be used in most situations, leaving the use of [ResourceLoader] for more advanced scenarios. + [b]Note:[/b] If [member ProjectSettings.editor/export/convert_text_resources_to_binary] is [code]true[/code], [method @GDScript.load] will not be able to read converted files in an exported project. If you rely on run-time loading of files present within the PCK, set [member ProjectSettings.editor/export/convert_text_resources_to_binary] to [code]false[/code]. diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 5985af53fc0..4b15034e24e 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -357,7 +357,7 @@ - Adds a [code][font][/code] tag with a italics font to the tag stack. This is the same as adding a [code][i][/code] tag if not currently in a [code][b][/code] tag. + Adds a [code][font][/code] tag with an italics font to the tag stack. This is the same as adding an [code][i][/code] tag if not currently in a [code][b][/code] tag. diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index af39261e81a..82d5c56d525 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -52,10 +52,20 @@ Deadzone for touch scrolling. Lower deadzone makes the scrolling more sensitive. - The current horizontal scroll value. + The current horizontal scroll value. + [b]Note:[/b] If you are setting this value in the [method Node._ready] function or earlier, it needs to be wrapped with [method Object.set_deferred], since scroll bar's [member Range.max_value] is not initialized yet. + [codeblock] + func _ready(): + set_deferred("scroll_horizontal", 600) + [/codeblock] The current vertical scroll value. + [b]Note:[/b] Setting it early needs to be deferred, just like in [member scroll_horizontal]. + [codeblock] + func _ready(): + set_deferred("scroll_vertical", 600) + [/codeblock] Controls whether vertical scrollbar can be used and when it should be visible. See [enum ScrollMode] for options. diff --git a/doc/classes/ShaderGlobalsOverride.xml b/doc/classes/ShaderGlobalsOverride.xml index 4c49d104bbb..255fc122b99 100644 --- a/doc/classes/ShaderGlobalsOverride.xml +++ b/doc/classes/ShaderGlobalsOverride.xml @@ -1,8 +1,12 @@ + Overrides global shader parameters' values in a specific scene. + Similar to how a [WorldEnvironment] node can be used to override the environment while a specific scene is loaded, [ShaderGlobalsOverride] can be used to override global shader parameters temporarily. Once the node is removed, the project-wide values for the global shader parameters are restored. See the [RenderingServer] [code]global_shader_parameter_*[/code] methods for more information. + [b]Note:[/b] Only one [ShaderGlobalsOverride] can be used per scene. If there is more than one [ShaderGlobalsOverride] node in the scene tree, only the first node (in tree order) will be taken into account. + [b]Note:[/b] All [ShaderGlobalsOverride] nodes are made part of a [code]"shader_overrides_group"[/code] group when they are added to the scene tree. The currently active [ShaderGlobalsOverride] node also has a [code]"shader_overrides_group_active"[/code] group added to it. You can use this to check which [ShaderGlobalsOverride] node is currently active. diff --git a/doc/classes/SkeletonModification2D.xml b/doc/classes/SkeletonModification2D.xml index 3a78f13bff2..fafe1837497 100644 --- a/doc/classes/SkeletonModification2D.xml +++ b/doc/classes/SkeletonModification2D.xml @@ -38,7 +38,7 @@ - Takes a angle and clamps it so it is within the passed-in [param min] and [param max] range. [param invert] will inversely clamp the angle, clamping it to the range outside of the given bounds. + Takes an angle and clamps it so it is within the passed-in [param min] and [param max] range. [param invert] will inversely clamp the angle, clamping it to the range outside of the given bounds. diff --git a/doc/classes/Sky.xml b/doc/classes/Sky.xml index e14e57a1c44..86589e0fb84 100644 --- a/doc/classes/Sky.xml +++ b/doc/classes/Sky.xml @@ -57,7 +57,7 @@ Uses the fast filtering algorithm to process the radiance map. In general this results in lower quality, but substantially faster run times. If you need better quality, but still need to update the sky every frame, consider turning on [member ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality]. - [b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so [member radiance_size] must be set to [constant RADIANCE_SIZE_256]. + [b]Note:[/b] The fast filtering algorithm is limited to 256×256 cubemaps, so [member radiance_size] must be set to [constant RADIANCE_SIZE_256]. Otherwise, a warning is printed and the overridden radiance size is ignored. diff --git a/doc/classes/StreamPeerTLS.xml b/doc/classes/StreamPeerTLS.xml index 9e16dc89147..ed9a68c5670 100644 --- a/doc/classes/StreamPeerTLS.xml +++ b/doc/classes/StreamPeerTLS.xml @@ -4,7 +4,7 @@ TLS stream peer. - TLS stream peer. This object can be used to connect to an TLS server or accept a single TLS client connection. + TLS stream peer. This object can be used to connect to a TLS server or accept a single TLS client connection. [b]Note:[/b] When exporting to Android, make sure to enable the [code]INTERNET[/code] permission in the Android export preset before exporting the project or using one-click deploy. Otherwise, network communication of any kind will be blocked by Android. diff --git a/doc/classes/SyntaxHighlighter.xml b/doc/classes/SyntaxHighlighter.xml index fcac96c04d2..14ac7f47314 100644 --- a/doc/classes/SyntaxHighlighter.xml +++ b/doc/classes/SyntaxHighlighter.xml @@ -5,7 +5,7 @@ Base syntax highlighter resource all syntax highlighters extend from, provides syntax highlighting data to [TextEdit]. - The associated [TextEdit] node will call into the [SyntaxHighlighter] on a as needed basis. + The associated [TextEdit] node will call into the [SyntaxHighlighter] on an as-needed basis. [b]Note:[/b] Each Syntax highlighter instance should not be shared across multiple [TextEdit] nodes. diff --git a/doc/classes/TextServerDummy.xml b/doc/classes/TextServerDummy.xml index b872e93fd61..7bf8738499a 100644 --- a/doc/classes/TextServerDummy.xml +++ b/doc/classes/TextServerDummy.xml @@ -1,8 +1,22 @@ + A dummy text server that can't render text or manage fonts. + A dummy [TextServer] interface that doesn't do anything. Useful for freeing up memory when rendering text is not needed, as text servers are resource-intensive. It can also be used for performance comparisons in complex GUIs to check the impact of text rendering. + A dummy text server is always available at the start of a project. Here's how to access it: + [codeblock] + var dummy_text_server = TextServerManager.find_interface("Dummy") + if dummy_text_server != null: + TextServerManager.set_primary_interface(dummy_text_server) + # If the other text servers are unneeded, they can be removed: + for i in TextServerManager.get_interface_count(): + var text_server = TextServerManager.get_interface(i) + if text_server != dummy_text_server: + TextServerManager.remove_interface(text_server) + [/codeblock] + The command line argument [code]--text-driver Dummy[/code] (case-sensitive) can be used to force the "Dummy" [TextServer] on any project. diff --git a/doc/classes/TileSet.xml b/doc/classes/TileSet.xml index 23f2623cffd..0038233baf9 100644 --- a/doc/classes/TileSet.xml +++ b/doc/classes/TileSet.xml @@ -8,7 +8,7 @@ Tiles can either be from a [TileSetAtlasSource], that render tiles out of a texture with support for physics, navigation, etc... or from a [TileSetScenesCollectionSource] which exposes scene-based tiles. Tiles are referenced by using three IDs: their source ID, their atlas coordinates ID and their alternative tile ID. A TileSet can be configured so that its tiles expose more or less properties. To do so, the TileSet resources uses property layers, that you can add or remove depending on your needs. - For example, adding a physics layer allows giving collision shapes to your tiles. Each layer having dedicated properties (physics layer an mask), you may add several TileSet physics layers for each type of collision you need. + For example, adding a physics layer allows giving collision shapes to your tiles. Each layer having dedicated properties (physics layer and mask), you may add several TileSet physics layers for each type of collision you need. See the functions to add new layers for more information. diff --git a/doc/classes/TileSetScenesCollectionSource.xml b/doc/classes/TileSetScenesCollectionSource.xml index ec8fe2ad540..935f22e05a5 100644 --- a/doc/classes/TileSetScenesCollectionSource.xml +++ b/doc/classes/TileSetScenesCollectionSource.xml @@ -79,7 +79,7 @@ - Changes a scene tile's ID from [param id] to [param new_id]. This will fail if there is already a tile with a ID equal to [param new_id]. + Changes a scene tile's ID from [param id] to [param new_id]. This will fail if there is already a tile with an ID equal to [param new_id]. diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index 35253dc9ef1..25ee5a5226e 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -197,6 +197,7 @@ Stops the input from propagating further down the [SceneTree]. + [b]Note:[/b] This does not affect the methods in [Input], only the way events are propagated. @@ -284,6 +285,7 @@ [b]Note:[/b] This setting is disabled by default because of its potential expensive computational cost. + Use 16 bits for the omni/spot shadow depth map. Enabling this results in shadows having less precision and may result in shadow acne, but can lead to performance improvements on some devices. The subdivision amount of the first quadrant on the shadow atlas. @@ -298,8 +300,8 @@ The subdivision amount of the fourth quadrant on the shadow atlas. - The shadow atlas' resolution (used for omni and spot lights). The value will be rounded up to the nearest power of 2. - [b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at all (including directional shadows). + The shadow atlas' resolution (used for omni and spot lights). The value is rounded up to the nearest power of 2. + [b]Note:[/b] If this is set to [code]0[/code], no positional shadows will be visible at all. This can improve performance significantly on low-end systems by reducing both the CPU and GPU load (as fewer draw calls are needed to draw the scene without shadows). Sets scaling 3d mode. Bilinear scaling renders at different resolution to either undersample or supersample the viewport. FidelityFX Super Resolution 1.0, abbreviated to FSR, is an upscaling technology that produces high quality images at fast framerates by using a spatially aware upscaling algorithm. FSR is slightly more expensive than bilinear, but it produces significantly higher image quality. FSR should be used where possible. diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index 6bd64a50bb4..36390863cf0 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -6,7 +6,7 @@ Displays the content of a [Viewport] node as a dynamic [Texture2D]. This can be used to mix controls, 2D, and 3D elements in the same scene. To create a ViewportTexture in code, use the [method Viewport.get_texture] method on the target viewport. - [b]Note:[/b] When local to scene, this texture uses [method Resource.setup_local_to_scene] to set the proxy texture and flags in the local viewport. + [b]Note:[/b] When local to scene, this texture uses [method Resource.setup_local_to_scene] to set the proxy texture and flags in the local viewport. Local to scene viewport textures will return incorrect data until the scene root is ready (see [signal Node.ready]). https://godotengine.org/asset-library/asset/127 @@ -17,6 +17,7 @@ The path to the [Viewport] node to display. This is relative to the scene root, not to the node which uses the texture. + [b]Note:[/b] In the editor, it is automatically updated when the target viewport's node path changes due to renaming or moving the viewport or its ancestors. At runtime, it may not be able to automatically update due to the inability to determine the scene root. diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index deef703e0de..fd63ec991d1 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -567,6 +567,7 @@ The window's position in pixels. + If [member ProjectSettings.display/window/subwindows/embed_subwindows] is [code]false[/code], the position is in absolute screen coordinates. This typically applies to editor plugins. If the setting is [code]false[/code], the window's position is in the coordinates of its parent [Viewport]. The window's size in pixels. @@ -714,7 +715,7 @@ Regardless of the platform, enabling full screen will change the window size to match the monitor's size. Therefore, make sure your project supports [url=$DOCS_URL/tutorials/rendering/multiple_resolutions.html]multiple resolutions[/url] when enabling full screen mode. - The window can't be resizing by dragging its resize grip. It's still possible to resize the window using [member size]. This flag is ignored for full screen windows. Set with [member unresizable]. + The window can't be resized by dragging its resize grip. It's still possible to resize the window using [member size]. This flag is ignored for full screen windows. Set with [member unresizable]. The window do not have native title bar and other decorations. This flag is ignored for full-screen windows. Set with [member borderless]. diff --git a/doc/classes/X509Certificate.xml b/doc/classes/X509Certificate.xml index 37b202a513e..4301e6cb7fd 100644 --- a/doc/classes/X509Certificate.xml +++ b/doc/classes/X509Certificate.xml @@ -5,7 +5,7 @@ The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource]. - They can be used as the server certificate in [method StreamPeerTLS.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to an TLS server via [method StreamPeerTLS.connect_to_stream]. + They can be used as the server certificate in [method StreamPeerTLS.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to a TLS server via [method StreamPeerTLS.connect_to_stream]. diff --git a/doc/translations/es.po b/doc/translations/es.po index 398698fc4b1..6a4217c98aa 100644 --- a/doc/translations/es.po +++ b/doc/translations/es.po @@ -49,12 +49,13 @@ # Joinner Medina , 2023. # Denis Anfruns , 2023. # Luis Ortiz , 2023. +# Biel Serrano Sanchez , 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-04-12 08:56+0000\n" -"Last-Translator: Luis Ortiz \n" +"PO-Revision-Date: 2023-04-26 21:48+0000\n" +"Last-Translator: Javier Ocampos \n" "Language-Team: Spanish \n" "Language: es\n" @@ -62,7 +63,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8-bit\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17-dev\n" +"X-Generator: Weblate 4.18-dev\n" msgid "Description" msgstr "Descripción" @@ -2447,24 +2448,6 @@ msgstr "" msgid "Returns [code]true[/code] if the array is empty." msgstr "Devuelve [code]true[/code] si el array es vacio." -msgid "" -"Returns the maximum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"Devuelve el maximo valor contenido en el array si todos los elementos son de " -"tipos comparables. Si los elementos no pueden ser comparados, [code]null[/" -"code] es devuelto." - -msgid "" -"Returns the minimum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"Devuelve el minimo valor contenido en el array si todos los elementos son de " -"tipos comparables. Si los elementos no pueden ser comparados, [code]null[/" -"code] es devuelto." - msgid "" "Resizes the array to contain a different number of elements. If the array " "size is smaller, elements are cleared, if bigger, new elements are " @@ -3934,16 +3917,6 @@ msgstr "" "sombreadas son opacas y las áreas no sombreadas son transparentes. Es útil " "para superponer sombras en una cámara de alimentación en AR." -msgid "" -"If [code]true[/code], subsurface scattering is enabled. Emulates light that " -"penetrates an object's surface, is scattered, and then emerges." -msgstr "" -"Si [code]true[/code], se activa la dispersión subterránea. Emula la luz que " -"penetra en la superficie de un objeto, se dispersa y luego emerge." - -msgid "The strength of the subsurface scattering effect." -msgstr "La fuerza del efecto de dispersión del subsuelo." - msgid "" "Texture used to control the subsurface scattering strength. Stored in the " "red texture channel. Multiplied by [member subsurf_scatter_strength]." @@ -4877,21 +4850,6 @@ msgstr "" "Si [code]true[/code], la propiedad del [member material] de [CanvasItem] se " "utiliza como el material para este elemento." -msgid "" -"If [code]true[/code], this [CanvasItem] is drawn. The node is only visible " -"if all of its antecedents are visible as well (in other words, [method " -"is_visible_in_tree] must return [code]true[/code]).\n" -"[b]Note:[/b] For controls that inherit [Popup], the correct way to make them " -"visible is to call one of the multiple [code]popup*()[/code] functions " -"instead." -msgstr "" -"Si [code]true[/code], se dibuja este [CanvasItem]. El nodo sólo es visible " -"si todos sus antecedentes también lo son (en otras palabras, [method " -"is_visible_in_tree] debe devolver [code]true[/code]).\n" -"[b]Nota:[/b] Para los controles que heredan [Popup], la forma correcta de " -"hacerlos visibles es llamar a una de las múltiples funciones [code]popup*()[/" -"code] en su lugar." - msgid "" "If [code]true[/code], the node's Z index is relative to its parent's Z " "index. If this node's Z index is 2 and its parent's effective Z index is 3, " @@ -6073,15 +6031,6 @@ msgstr "" "La notificación, para cuando se ordenan los hijos, debe ser obedecida " "inmediatamente." -msgid "" -"Marks an input event as handled. Once you accept an input event, it stops " -"propagating, even to nodes listening to [method Node._unhandled_input] or " -"[method Node._unhandled_key_input]." -msgstr "" -"Marca un evento de entrada como manejado. Una vez que aceptas un evento de " -"entrada, deja de propagarse, incluso a los nodos que escuchan [method Node." -"_unhandled_input] o [method Node._unhandled_key_input]." - msgid "" "Returns the mouse cursor shape the control displays on mouse hover. See " "[enum CursorShape]." @@ -6890,16 +6839,6 @@ msgstr "" "nodo hijo de CSG ya que la operación es entre este nodo y el hijo previo a " "este nodo padre." -msgid "" -"Snap makes the mesh snap to a given distance so that the faces of two meshes " -"can be perfectly aligned. A lower value results in greater precision but may " -"be harder to adjust." -msgstr "" -"El recorte hace que la malla se ajuste a una distancia determinada para que " -"las caras de dos mallas puedan estar perfectamente alineadas. Un valor más " -"bajo da como resultado una mayor precisión pero puede ser más difícil de " -"ajustar." - msgid "" "Geometry of both primitives is merged, intersecting geometry is removed." msgstr "" @@ -8289,18 +8228,6 @@ msgstr "" "Devuelve [code]true[/code] si el juego está dentro del proceso fijo y la " "fase de física del bucle de juego." -msgid "" -"Controls how fast or slow the in-game clock ticks versus the real life one. " -"It defaults to 1.0. A value of 2.0 means the game moves twice as fast as " -"real life, whilst a value of 0.5 means the game moves at half the regular " -"speed." -msgstr "" -"Controla la velocidad o la lentitud del reloj del juego en comparación con " -"el de la vida real. El valor por defecto es 1.0. Un valor de 2.0 significa " -"que el juego se mueve el doble de rápido que en la vida real, mientras que " -"un valor de 0.5 significa que el juego se mueve a la mitad de la velocidad " -"normal." - msgid "" "Resource for environment nodes (like [WorldEnvironment]) that define " "multiple rendering options." @@ -9369,9 +9296,6 @@ msgstr "" "Un recurso interpolador de color que puede ser usado para generar colores " "entre puntos de color definidos por el usuario." -msgid "Returns the interpolated color specified by [code]offset[/code]." -msgstr "Devuelve el color interpolado especificado por [code]offset[/code]." - msgid "Cubic interpolation." msgstr "Interpolación cúbica." @@ -11291,18 +11215,6 @@ msgstr "" msgid "A singleton that deals with inputs." msgstr "Un singleton que se ocupa de las entradas." -msgid "" -"A singleton that deals with inputs. This includes key presses, mouse buttons " -"and movement, joypads, and input actions. Actions and their events can be " -"set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or " -"with the [InputMap] class." -msgstr "" -"Un singleton que se ocupa de las entradas. Esto incluye pulsaciones de " -"teclas, botones del ratón y movimiento, joypads y acciones de entrada. Las " -"acciones y sus eventos se pueden configurar en la pestaña [b]Mapa de " -"entradas[/b] en el [b]Proyecto > Configuración del proyecto[/b], o con la " -"clase [InputMap]." - msgid "" "This will simulate pressing the specified action.\n" "The strength can be used for non-boolean actions, it's ranged between 0 and " @@ -13994,17 +13906,6 @@ msgstr "" "Devuelve si este nodo utiliza una escala de [code](1, 1, 1)[/code] o su " "escala de transformación local." -msgid "" -"Returns [code]true[/code] if the node is present in the [SceneTree], its " -"[member visible] property is [code]true[/code] and all its antecedents are " -"also visible. If any antecedent is hidden, this node will not be visible in " -"the scene tree." -msgstr "" -"Devuelve [code]true[/code] si el nodo está presente en el [SceneTree], su " -"propiedad [member visible] es [code]true[/code] y todos sus antecedentes " -"también son visibles. Si algún antecedente está oculto, este nodo no será " -"visible en el árbol de la escena." - msgid "" "Rotates the local transformation around axis, a unit [Vector3], by specified " "angle in radians." @@ -14068,15 +13969,6 @@ msgstr "" "Cambia la posición del nodo por el desplazamiento dado [Vector3] en el " "espacio local." -msgid "" -"If [code]true[/code], this node is drawn. The node is only visible if all of " -"its antecedents are visible as well (in other words, [method " -"is_visible_in_tree] must return [code]true[/code])." -msgstr "" -"Si [code]true[/code], este nodo se dibuja. El nodo sólo es visible si todos " -"sus antecedentes también lo son (en otras palabras, [method " -"is_visible_in_tree] debe devolver [code]true[/code])." - msgid "Emitted when node visibility changes." msgstr "Emitido cuando cambia la visibilidad del nodo." @@ -14192,6 +14084,9 @@ msgstr "" msgid "Add an action set." msgstr "Añadir un conjunto de acciones." +msgid "Add an interaction profile." +msgstr "Añadir un perfil de interacción." + msgid "Optimized translation." msgstr "Traducción optimizada." @@ -16823,9 +16718,6 @@ msgstr "" "Si [code]true[/code], utiliza un modelo de iluminación de material Lambert " "más rápido pero de menor calidad en lugar del Burley." -msgid "Quaternion." -msgstr "Cuaternario." - msgid "" "Constructs a quaternion that will rotate around the given axis by the " "specified angle. The axis must be a normalized vector." @@ -17294,9 +17186,6 @@ msgstr "Establece el [CanvasItem] para copiar un rectángulo al backbuffer." msgid "Sets the index for the [CanvasItem]." msgstr "Establece el índice para el [CanvasItem]." -msgid "Sets a new material to the [CanvasItem]." -msgstr "Establece un nuevo material para el [CanvasItem]." - msgid "Sets if the [CanvasItem] uses its parent's material." msgstr "Establece si el [CanvasItem] utiliza el material de su padre." @@ -17409,27 +17298,6 @@ msgstr "" msgid "Modulates all colors in the given canvas." msgstr "Modula todos los colores en el canvas dado." -msgid "" -"Sets the values to be used with the \"Adjustment\" post-process effect. See " -"[Environment] for more details." -msgstr "" -"Establece los valores que se utilizarán con el efecto de post-proceso de " -"\"Ajuste\". Ver [Environment] para más detalles." - -msgid "" -"Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment." -"background_mode]." -msgstr "" -"Establece el [i]BGMode[/i] del medio ambiente. Equivalente a [member " -"Environment.background_mode]." - -msgid "" -"Color displayed for clear areas of the scene (if using Custom color or " -"Color+Sky background modes)." -msgstr "" -"Color mostrado para áreas claras de la escena (si se utilizan los modos de " -"fondo Color personalizado o Color+Sky)." - msgid "Sets the intensity of the background color." msgstr "Establece la intensidad del color de fondo." @@ -17437,13 +17305,6 @@ msgid "Sets the maximum layer to use if using Canvas background mode." msgstr "" "Establece la capa máxima a usar si se utiliza el modo de fondo de canvas." -msgid "" -"Sets the variables to be used with the \"screen space reflections\" post-" -"process effect. See [Environment] for more details." -msgstr "" -"Establece las variables que se utilizarán con el efecto de post-proceso " -"\"reflejos del espacio de la pantalla\". Ver [Environment] para más detalles." - msgid "" "Sets the variables to be used with the \"tonemap\" post-process effect. See " "[Environment] for more details." @@ -17513,9 +17374,6 @@ msgstr "" "Establece el escenario en el que se encuentra la instancia. El escenario es " "el mundo tridimensional en el que se mostrarán los objetos." -msgid "Not implemented in Godot 3.x." -msgstr "No se implementó en Godot 3.x." - msgid "Returns the value of a certain material's parameter." msgstr "Devuelve el valor del parámetro de un determinado material." @@ -17716,9 +17574,6 @@ msgstr "" "una vez o cada fotograma. Ver [enum ReflectionProbeUpdateMode] para las " "opciones." -msgid "Sets the environment that will be used with this scenario." -msgstr "Establece el entorno que se utilizará con este escenario." - msgid "" "Sets the fallback environment to be used by this scenario. The fallback " "environment is used if no environment is set. Internally, this is used by " @@ -17729,23 +17584,6 @@ msgstr "" "Internamente, es usado por el editor para proporcionar un entorno por " "defecto." -msgid "" -"If [code]true[/code], the engine will generate wireframes for use with the " -"wireframe debug mode." -msgstr "" -"Si [code]true[/code], el motor generará mallas de alambre para su uso con el " -"modo de depuración de mallas de alambre." - -msgid "" -"Sets the default clear color which is used when a specific clear color has " -"not been selected." -msgstr "" -"Establece el color claro predeterminado que se utiliza cuando no se ha " -"seleccionado un color claro específico." - -msgid "Returns a shader's code." -msgstr "Devuelve un código de shader." - msgid "Returns the [Transform2D] set for a specific bone of this skeleton." msgstr "" "Devuelve el conjunto [Transform] para un hueso específico de este esqueleto." @@ -17789,21 +17627,9 @@ msgstr "" "Establece el modo de dibujo de depuración de un viewport. Ver [enum " "ViewportDebugDraw] para las opciones." -msgid "If [code]true[/code], the viewport's canvas is not rendered." -msgstr "Si [code]true[/code], el canvas del viewport no se renderiza." - msgid "Sets the viewport's global transformation matrix." msgstr "Establece la matriz de transformación global del Viewport." -msgid "Sets the viewport's parent to another viewport." -msgstr "Establece el padre del viewport a otra viewport." - -msgid "Sets the shadow atlas quadrant's subdivision." -msgstr "Establece la subdivisión del cuadrante del atlas de las sombras." - -msgid "Sets the viewport's width and height." -msgstr "Establece el ancho y la altura del viewport." - msgid "" "If [code]true[/code], the viewport renders its background as transparent." msgstr "Si [code]true[/code], el viewport hace que su fondo sea transparente." @@ -17836,24 +17662,12 @@ msgstr "La capa Z mínima para los objetos del canvas." msgid "The maximum Z-layer for canvas items." msgstr "La máxima capa Z para los objetos del canvas." -msgid "" -"Max number of glow levels that can be used with glow post-process effect." -msgstr "" -"Número máximo de niveles de brillo que se pueden utilizar con el efecto de " -"post-procesado de brillo." - -msgid "Unused enum in Godot 3.x." -msgstr "La lista no utilizada en Godot 3.x." - msgid "Shader is a 3D shader." msgstr "Shader es un shader 3D." msgid "Shader is a 2D shader." msgstr "Shader es un shader 2D." -msgid "Shader is a particle shader." -msgstr "Shader es un shader de partículas." - msgid "Represents the size of the [enum ShaderMode] enum." msgstr "Representa el tamaño del enum [enum ShaderMode]." @@ -17863,46 +17677,27 @@ msgstr "La prioridad mínima de renderizado de todos los materiales." msgid "The maximum renderpriority of all materials." msgstr "La máxima prioridad de renderización de todos los materiales." -msgid "Array is a vertex array." -msgstr "El array es un array de vértices." - msgid "Array is a normal array." msgstr "El array es un array normales." msgid "Array is a tangent array." msgstr "El Array es una array de tangentes." -msgid "Array is a color array." -msgstr "El Array es un array de colores." - msgid "Array is an UV coordinates array." msgstr "El Array es un array de coordenadas UV." -msgid "Array is an UV coordinates array for the second UV coordinates." -msgstr "" -"El Array es un array de coordenadas UV para las segundas coordenadas UV." - msgid "Array contains bone information." msgstr "El Array contiene información sobre los huesos." msgid "Array is weight information." msgstr "El Array contiene la información de pesos." -msgid "Array is index array." -msgstr "El Array es un array de índices." - -msgid "Flag used to mark a vertex array." -msgstr "Bandera usada para marcar un array de vértices." - msgid "Flag used to mark a normal array." msgstr "Bandera usada para marcar una array de normales." msgid "Flag used to mark a tangent array." msgstr "Bandera usada para marcar un array de tangentes." -msgid "Flag used to mark a color array." -msgstr "Bandera usada para marcar un array de colores." - msgid "Flag used to mark an UV coordinates array." msgstr "Bandera usada para marcar un conjunto de coordenadas UV." @@ -17947,15 +17742,6 @@ msgstr "Representa el tamaño del enum [enum PrimitiveType]." msgid "Use [Transform2D] to store MultiMesh transform." msgstr "Use [Transform2D] para almacenar la transformada de MultiMalla." -msgid "Is a directional (sun) light." -msgstr "Es una luz direccional (sol)." - -msgid "Is an omni light." -msgstr "Es una luz omnipresente." - -msgid "Is a spot light." -msgstr "Es un foco de luz." - msgid "The light's influence on specularity." msgstr "La influencia de la luz en la especularidad." @@ -17971,9 +17757,6 @@ msgstr "El ángulo del foco." msgid "The spotlight's attenuation." msgstr "La atenuación del foco." -msgid "Max distance that shadows will be rendered." -msgstr "La distancia máxima a la que las sombras se renderizarán." - msgid "Proportion of shadow atlas occupied by the first split." msgstr "Proporción de atlas de sombras ocupados por la primera división." @@ -18046,31 +17829,6 @@ msgstr "Clasificar las partículas en función de su vida útil." msgid "Sort particles based on their distance to the camera." msgstr "Clasifica las partículas según su distancia a la cámara." -msgid "Do not update the viewport." -msgstr "No actualice el viewport." - -msgid "Update the viewport once then set to disabled." -msgstr "Actualiza el viewport una vez y luego ponlo en desactivado." - -msgid "Update the viewport whenever it is visible." -msgstr "Actualice el viewport siempre que sea visible." - -msgid "Always update the viewport." -msgstr "Siempre actualiza el viewport." - -msgid "The viewport is always cleared before drawing." -msgstr "El viewport siempre se limpia antes de dibujar." - -msgid "The viewport is never cleared before drawing." -msgstr "El viewport nunca se limpia antes de dibujar." - -msgid "" -"The viewport is cleared once, then the clear mode is set to [constant " -"VIEWPORT_CLEAR_NEVER]." -msgstr "" -"El viewport se borra una vez, luego el modo de borrado se establece en " -"[constant VIEWPORT_CLEAR_NEVER]." - msgid "Number of objects drawn in a single frame." msgstr "Número de objetos dibujados en un solo fotograma." @@ -18424,15 +18182,6 @@ msgstr "" "Añade una etiqueta [code]font[/code] a la pila de etiquetas. Anula las " "fuentes predeterminadas para su duración." -msgid "" -"Adds a [code][font][/code] tag with a italics font to the tag stack. This is " -"the same as adding a [code][i][/code] tag if not currently in a [code][b][/" -"code] tag." -msgstr "" -"Añade una etiqueta [code]font[/code] con una fuente en cursiva a la pila de " -"etiquetas. Esto es lo mismo que añadir una etiqueta [code]i[/code] si no " -"está actualmente en una etiqueta [code]b[/code]." - msgid "Adds a [code][font][/code] tag with a monospace font to the tag stack." msgstr "" "Añade una etiqueta [code]font[/code] con una fuente monoespacio a la pila de " @@ -18964,12 +18713,6 @@ msgstr "" "hijos enfocados (incluyendo los niños indirectos) para asegurarse de que son " "completamente visibles." -msgid "The current horizontal scroll value." -msgstr "El valor actual de desplazamiento horizontal." - -msgid "The current vertical scroll value." -msgstr "El valor actual de scroll vertical." - msgid "Emitted when scrolling stops." msgstr "Emitido cuando el scroll se detiene." @@ -19659,13 +19402,6 @@ msgstr "" msgid "Returns the smallest border width out of all four borders." msgstr "Devuelve el menor ancho de borde de los cuatro bordes." -msgid "" -"This changes the size of the faded ring. Higher values can be used to " -"achieve a \"blurry\" effect." -msgstr "" -"Esto cambia el tamaño del anillo descolorido. Se pueden usar valores más " -"altos para lograr un efecto \"borroso\"." - msgid "The background color of the stylebox." msgstr "El color de fondo de la caja de estilo." @@ -22202,9 +21938,6 @@ msgstr "[VideoStream] recurso para los videos de Ogg Theora." msgid "Returns the visible rectangle in global screen coordinates." msgstr "Devuelve el RID del viewport del [VisualServer]." -msgid "Stops the input from propagating further down the [SceneTree]." -msgstr "Evita que la entrada se propague más abajo en el [SceneTree]." - msgid "" "Sets the number of subdivisions to use in the specified quadrant. A higher " "number of subdivisions allows you to have more shadows in the scene at once, " @@ -22328,13 +22061,6 @@ msgstr "Los objetos se muestran en el estilo wireframe." msgid "Texture which displays the content of a [Viewport]." msgstr "Textura que muestra el contenido de un [Viewport]." -msgid "" -"The path to the [Viewport] node to display. This is relative to the scene " -"root, not to the node which uses the texture." -msgstr "" -"La ruta al nodo [Viewport] para visualizar. Es relativa a la raíz de la " -"escena, no al nodo que usa la textura." - msgid "Enables certain nodes only when approximately visible." msgstr "Habilita ciertos nodos sólo cuando son aproximadamente visibles." diff --git a/doc/translations/fr.po b/doc/translations/fr.po index 5c764f41a46..63861059506 100644 --- a/doc/translations/fr.po +++ b/doc/translations/fr.po @@ -68,13 +68,14 @@ # GuruWP , 2023. # Paul Cordellier , 2023. # Alexis Robin , 2023. +# "Dimitri A." , 2023. msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" "POT-Creation-Date: \n" -"PO-Revision-Date: 2023-04-03 15:09+0000\n" -"Last-Translator: Paul Cordellier \n" +"PO-Revision-Date: 2023-04-30 10:49+0000\n" +"Last-Translator: \"Dimitri A.\" \n" "Language-Team: French \n" "Language: fr\n" @@ -82,7 +83,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.17-dev\n" +"X-Generator: Weblate 4.18-dev\n" msgid "Description" msgstr "Description" @@ -389,56 +390,6 @@ msgstr "" "[, res://test.gd, bar]\n" "[/codeblock]" -msgid "" -"Returns [code]true[/code] if [param value] is an instance of [param type]. " -"The [param type] value must be one of the following:\n" -"- A constant from the [enum Variant.Type] enumeration, for example [constant " -"TYPE_INT].\n" -"- An [Object]-derived class which exists in [ClassDB], for example [Node].\n" -"- A [Script] (you can use any class, including inner one).\n" -"Unlike the right operand of the [code]is[/code] operator, [param type] can " -"be a non-constant value. The [code]is[/code] operator supports more features " -"(such as typed arrays) and is more performant. Use the operator instead of " -"this method if you do not need dynamic type checking.\n" -"Examples:\n" -"[codeblock]\n" -"print(is_instance_of(a, TYPE_INT))\n" -"print(is_instance_of(a, Node))\n" -"print(is_instance_of(a, MyClass))\n" -"print(is_instance_of(a, MyClass.InnerClass))\n" -"[/codeblock]\n" -"[b]Note:[/b] If [param value] and/or [param type] are freed objects (see " -"[method @GlobalScope.is_instance_valid]), or [param type] is not one of the " -"above options, this method will raise an runtime error.\n" -"See also [method @GlobalScope.typeof], [method type_exists], [method Array." -"is_same_typed] (and other [Array] methods)." -msgstr "" -"Renvoie [code]true[/code] si [param value] est une instance de [param type]. " -"La valeur de [param type] doit être l'une des suivantes :\n" -"- Une constante de l'énumération [enum Variant.Type], par exemple [constant " -"TYPE_INT].\n" -"- Une classe dérivée de [Object] qui existe dans [ClassDB], par exemple " -"[Node].\n" -"- Un [Script] (vous pouvez utiliser n'importe quelle classe, y compris une " -"classe interne).\n" -"Contrairement à l'opérande droit de l'opérateur [code]is[/code], [param " -"type] peut être une valeur non constante. L'opérateur [code]is[/code] prend " -"en charge davantage de fonctionnalités (telles que les tableaux typés) et " -"est plus performant. Utilisez l'opérateur au lieu de cette méthode si vous " -"n'avez pas besoin d'une vérification dynamique des types.\n" -"Exemples :\n" -"[bloc de code]\n" -"print(is_instance_of(a, TYPE_INT))\n" -"print(is_instance_of(a, Node))\n" -"print(is_instance_of(a, MyClass))\n" -"print(is_instance_of(a, MyClass.InnerClass))\n" -"[/codeblock]\n" -"[b]Note :[/b] Si [param value] et/ou [param type] sont des objets libérés " -"(voir [method @GlobalScope.is_instance_valid]), ou si [param type] n'est pas " -"l'une des options ci-dessus, cette méthode lèvera une erreur d'exécution.\n" -"Voir aussi [method @GlobalScope.typeof], [method type_exists], [method Array." -"is_same_typed] (et autres méthodes [Array])." - msgid "" "Returns the length of the given Variant [param var]. The length can be the " "character count of a [String], the element count of any array type or the " @@ -464,58 +415,6 @@ msgstr "" "len(a) # Renvoie 6\n" "[/codeblock]" -msgid "" -"Returns a [Resource] from the filesystem located at the absolute [param " -"path]. Unless it's already referenced elsewhere (such as in another script " -"or in the scene), the resource is loaded from disk on function call, which " -"might cause a slight delay, especially when loading large scenes. To avoid " -"unnecessary delays when loading something multiple times, either store the " -"resource in a variable or use [method preload].\n" -"[b]Note:[/b] Resource paths can be obtained by right-clicking on a resource " -"in the FileSystem dock and choosing \"Copy Path\", or by dragging the file " -"from the FileSystem dock into the current script.\n" -"[codeblock]\n" -"# Load a scene called \"main\" located in the root of the project directory " -"and cache it in a variable.\n" -"var main = load(\"res://main.tscn\") # main will contain a PackedScene " -"resource.\n" -"[/codeblock]\n" -"[b]Important:[/b] The path must be absolute. A relative path will always " -"return [code]null[/code].\n" -"This function is a simplified version of [method ResourceLoader.load], which " -"can be used for more advanced scenarios.\n" -"[b]Note:[/b] Files have to be imported into the engine first to load them " -"using this function. If you want to load [Image]s at run-time, you may use " -"[method Image.load]. If you want to import audio files, you can use the " -"snippet described in [member AudioStreamMP3.data]." -msgstr "" -"Retourne une [Resource] depuis le système de fichiers localisé au chemin " -"absolu [param path]. Sauf si cela est déjà référencé autre part (comme dans " -"un autre script ou dans une scène), la ressource est chargée depuis le " -"disque sur un appel de fonction, qui peut causé un petit délai, en " -"particulier pendant le chargement de larges scènes. Pour éviter des délais " -"inutiles lorsque vous chargez quelque chose plusieurs fois, vous pouvez " -"stocker la ressource dans une variable ou utiliser [method preload].\n" -"[b]Note :[/b] Les chemins des ressources peuvent être obtenus en faisant un " -"clic droit sur une ressource dans la barre d'outils du système de fichiers " -"et en choisissant \"Copier le chemin\", ou en déplaçant le fichier du " -"système de fichiers vers le script actuel.\n" -"[codeblock]\n" -"# Charge une scène appelée \"main\" située dans la racine du répertoire du " -"projet et la stocke dans une variable.\n" -"var main = load(\"res://main.tscn\") # main contiendra une ressource " -"PackedScene.\n" -"[/codeblock]\n" -"[b]Important :[/b] Le chemin doit être absolu. Un chemin relatif retournera " -"toujours [code]null[/code].\n" -"Cette fonction est une version simplifiée de [method ResourceLoader.load], " -"qui peut être utilisée pour des scénarios plus avancés.\n" -"[b]Note :[/b] Les fichiers doivent être importés dans le moteur de jeu en " -"premier pour qu'ils soient chargés en utilisant cette fonction. Si vous " -"voulez importer des [Image]s au run-time vous pouvez utiliser [method Image." -"load]. Si vous voulez importer des fichiers audio, vous pouvez utiliser " -"l'extrait décrit dans [member AudioStreamMP3.data]." - msgid "" "Returns a [Resource] from the filesystem located at [param path]. During run-" "time, the resource is loaded when the script is being parsed. This function " @@ -929,25 +828,6 @@ msgstr "Constantes et fonction à portée globale." msgid "Random number generation" msgstr "Génération de nombres aléatoires" -msgid "" -"Returns the arc cosine of [param x] in radians. Use to get the angle of " -"cosine [param x]. [param x] must be between [code]-1.0[/code] and [code]1.0[/" -"code] (inclusive), otherwise, [method acos] will return [constant @GDScript." -"NAN].\n" -"[codeblock]\n" -"# c is 0.523599 or 30 degrees if converted with rad_to_deg(c)\n" -"var c = acos(0.866025)\n" -"[/codeblock]" -msgstr "" -"Renvoie le cosinus inverse de [param x] en radians. À utiliser pour obtenir " -"l'angle du cosinus [param x]. [param x] doit être entre [code]-1.0[/code] et " -"[code]1.0[/code] (inclus), dans le cas contraire, [method acos] retournera " -"[constant @GDScript.NAN].\n" -"[codeblock]\n" -"# c vaut 0.523599 ou 30 degrés si converti avec rad2deg(s)\n" -"c = acos(0.866025)\n" -"[/codeblock]" - msgid "Converts from decibels to linear energy (audio)." msgstr "Convertit les décibels en énergie linéaire (audio)." @@ -2008,6 +1888,45 @@ msgstr "" "Retourne [code]true[/code] si cette [AABB] en recouvre complètement une " "autre." +msgid "" +"Returns a copy of this [AABB] expanded to include a given point.\n" +"[b]Example:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"# position (-3, 2, 0), size (1, 1, 1)\n" +"var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1))\n" +"# position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB and " +"Vector3(0, -1, 2)\n" +"var box2 = box.expand(Vector3(0, -1, 2))\n" +"[/gdscript]\n" +"[csharp]\n" +"// position (-3, 2, 0), size (1, 1, 1)\n" +"var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1));\n" +"// position (-3, -1, 0), size (3, 4, 2), so we fit both the original AABB " +"and Vector3(0, -1, 2)\n" +"var box2 = box.Expand(new Vector3(0, -1, 2));\n" +"[/csharp]\n" +"[/codeblocks]" +msgstr "" +"Retourne une copie de ce [AABB] élargi afin d'inclure un point donné.\n" +"[b]Exemple :[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"# Occupe la position (-3, 2, 0) avec une taille de (1, 1, 1).\n" +"var box = AABB(Vector3(-3, 2, 0), Vector3(1, 1, 1))\n" +"# Occupe la position (-3, -1, 0) avec une taille de (3, 4, 2) afin d'inclure " +"le point défini par Vector3(0, -1, 2) en plus du AABB d'origine.\n" +"var box2 = box.expand(Vector3(0, -1, 2))\n" +"[/gdscript]\n" +"[csharp]\n" +"// Occupe la position (-3, 2, 0) avec une taille de (1, 1, 1).\n" +"var box = new Aabb(new Vector3(-3, 2, 0), new Vector3(1, 1, 1));\n" +"// Occupe la position (-3, -1, 0) avec une taille de (3, 4, 2) afin " +"d'inclure le point défini par Vector3(0, -1, 2) en plus du AABB d'origine.\n" +"var box2 = box.Expand(new Vector3(0, -1, 2));\n" +"[/csharp]\n" +"[/codeblocks]" + msgid "" "Returns the center of the [AABB], which is equal to [member position] + " "([member size] / 2)." @@ -2196,7 +2115,7 @@ msgid "Maximum value for the mode enum." msgstr "Valeur maximale pour le mode énumeration." msgid "3D Physics Tests Demo" -msgstr "Démo des tests de physique 3D" +msgstr "Démo de tests physiques en 3D" msgid "Third Person Shooter Demo" msgstr "Démo de tir à la troisième personne" @@ -3121,6 +3040,12 @@ msgstr "" msgid "Using Area2D" msgstr "Utiliser les Area2D" +msgid "2D Pong Demo" +msgstr "Démo 2D « Pong »" + +msgid "2D Platformer Demo" +msgstr "Démo de jeu de plateforme en 2D" + msgid "" "Returns a list of intersecting [Area2D]s. The overlapping area's [member " "CollisionObject2D.collision_layer] must be part of this area's [member " @@ -3184,7 +3109,7 @@ msgid "This area does not affect gravity/damping." msgstr "Cette aire n'influe pas sur la gravité/amortissement." msgid "GUI in 3D Demo" -msgstr "Démo des interfaces en 3D" +msgstr "Démo d'interface graphique en 3D" msgid "" "The rate at which objects stop spinning in this area. Represents the angular " @@ -3317,24 +3242,6 @@ msgstr "" msgid "Returns [code]true[/code] if the array is empty." msgstr "Retourne [code]true[/code] si le tableau est vide." -msgid "" -"Returns the maximum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"Retourne la valeur maximale contenue dans le tableau si tous les éléments " -"peuvent être comparés entre eux. Si les éléments ne peuvent pas être " -"comparés, [code]null[/code] est retourné." - -msgid "" -"Returns the minimum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"Retourne la valeur minimale contenue dans le tableau si tous les éléments " -"peuvent être comparés entre eux. Si les éléments ne peuvent pas être " -"comparés, [code]null[/code] est retourné." - msgid "" "Removes and returns the last element of the array. Returns [code]null[/code] " "if the array is empty, without printing an error message. See also [method " @@ -4207,9 +4114,6 @@ msgstr "Démo du générateur audio" msgid "Returns the length of the audio stream in seconds." msgstr "Retourne la durée en secondes du flux audio." -msgid "Audio stream that generates sounds procedurally." -msgstr "Un flux audio qui génère des sons de manière procédurale." - msgid "" "The length of the buffer to generate (in seconds). Lower values result in " "less latency, but require the script to generate audio data faster, " @@ -4755,9 +4659,6 @@ msgstr "" "La texture utilisée pour contrôler la rugosité par pixel. Multipliée par " "[membre roughness]." -msgid "The strength of the subsurface scattering effect." -msgstr "L'intensité de l'effet de transluminance." - msgid "" "If [code]true[/code], instead of using [code]UV2[/code] textures will use a " "triplanar texture lookup to determine how to apply textures. Triplanar uses " @@ -5011,7 +4912,7 @@ msgid "Matrix Transform Demo" msgstr "Démo de transformation matricielle" msgid "2.5D Demo" -msgstr "Démo 2.5D" +msgstr "Démo 2,5D" msgid "Constructs a pure rotation basis matrix from the given quaternion." msgstr "" @@ -5209,13 +5110,13 @@ msgstr "" "Le nombre de boucles de bord supplémentaires insérées le long de l'axe X." msgid "3D Kinematic Character Demo" -msgstr "Démo de caractère cinématique 3D" +msgstr "Démo de personnage cinématique en 3D" msgid "Standard themed Button." msgstr "Bouton thématique standard." msgid "OS Test Demo" -msgstr "Démo de test de système d'exploitation" +msgstr "Démo de test des fonctions OS (système d'exploitation)" msgid "" "When this property is enabled, text that is too large to fit the button is " @@ -5287,6 +5188,23 @@ msgstr "Émis lorsqu’un des boutons de ce groupe est appuyé." msgid "Calls the specified method after optional delay." msgstr "Appelle la méthode spécifiée après un délai optionnel." +msgid "" +"Makes the callback call delayed by given time in seconds.\n" +"[b]Example:[/b]\n" +"[codeblock]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_callback(queue_free).set_delay(2) #this will call queue_free() " +"after 2 seconds\n" +"[/codeblock]" +msgstr "" +"Retarde l'appel par le temps donné en secondes.\n" +"[b]Exemple :[/b]\n" +"[codeblock]\n" +"var tween = get_tree().create_tween()\n" +"tween.tween_callback(queue_free).set_delay(2) # Ceci va appeler queue_free() " +"après 2 secondes\n" +"[/codeblock]" + msgid "Camera node for 2D scenes." msgstr "Nœud de caméra pour les scènes en 2D." @@ -5294,7 +5212,7 @@ msgid "2D Isometric Demo" msgstr "Démo 2D isométrique" msgid "2D HDR Demo" -msgstr "Démo 2D HDR" +msgstr "Démo de plage dynamique étendue (HDR) en 2D" msgid "Aligns the camera to the tracked node." msgstr "Aligne la caméra sur le nœud suivi." @@ -5353,7 +5271,7 @@ msgid "The camera updates with the [code]_process[/code] callback." msgstr "La caméra se met à jour durant l'appel de [code]_process[/code]." msgid "Camera node, displays from a point of view." -msgstr "Nœud de caméra, affiche d'un point de vue." +msgstr "Un nœud de caméra ; affichage d'un point de vue." msgid "" "Makes this camera the current camera for the [Viewport] (see class " @@ -5387,6 +5305,36 @@ msgstr "" "la caméra. Ceci est utile pour lancer des rayons sous la forme (origine, " "normale) pour l'intersection ou la sélection d'objets." +msgid "" +"Returns the 2D coordinate in the [Viewport] rectangle that maps to the given " +"3D point in world space.\n" +"[b]Note:[/b] When using this to position GUI elements over a 3D viewport, " +"use [method is_position_behind] to prevent them from appearing if the 3D " +"point is behind the camera:\n" +"[codeblock]\n" +"# This code block is part of a script that inherits from Node3D.\n" +"# `control` is a reference to a node inheriting from Control.\n" +"control.visible = not get_viewport().get_camera_3d()." +"is_position_behind(global_transform.origin)\n" +"control.position = get_viewport().get_camera_3d()." +"unproject_position(global_transform.origin)\n" +"[/codeblock]" +msgstr "" +"Retourne les coordonnées 2D dans le rectangle du [Viewport] qui " +"correspondent à un point 3D donné dans l'espace du monde.\n" +"[b]Note :[/b] Lorsque vous utilisez cette méthode pour positionner des " +"éléments graphiques sur un [Viewport] en 3D, pensez à utiliser [method " +"is_position_behind] pour les empêcher d'apparaître tant que le point 3D se " +"trouve derrière la caméra :\n" +"[codeblock]\n" +"# Cet extrait de code fait partie d'un script qui hérite de Node3D.\n" +"# `control` fait référence à un nœud qui hérite de Control.\n" +"control.visible = not get_viewport().get_camera_3d()." +"is_position_behind(global_transform.origin)\n" +"control.position = get_viewport().get_camera_3d()." +"unproject_position(global_transform.origin)\n" +"[/codeblock]" + msgid "The [Environment] to use for this camera." msgstr "L'[Environment] à utiliser pour cette caméra." @@ -5649,13 +5597,6 @@ msgstr "" msgid "Returns the [RID] of the [World2D] canvas where this item is in." msgstr "Retourne le [RID] de la toile [World2D] où cet élément se trouve." -msgid "" -"Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is " -"in using the coordinate system of the [CanvasLayer]." -msgstr "" -"Retourne la position de la souris dans le [CanvasLayer] que ce [CanvasItem] " -"utilise suivant le système de coordonnées du [CanvasLayer]." - msgid "" "Returns the mouse's position in this [CanvasItem] using the local coordinate " "system of this [CanvasItem]." @@ -5719,21 +5660,6 @@ msgstr "" "Si [code]true[/code], la propriété [member material] du [CanvasItem] parent " "est utilisée comme matériau de celui-ci." -msgid "" -"If [code]true[/code], this [CanvasItem] is drawn. The node is only visible " -"if all of its antecedents are visible as well (in other words, [method " -"is_visible_in_tree] must return [code]true[/code]).\n" -"[b]Note:[/b] For controls that inherit [Popup], the correct way to make them " -"visible is to call one of the multiple [code]popup*()[/code] functions " -"instead." -msgstr "" -"Si [code]true[/code], ce [CanvasItem] est affiché. Le nœud n'est visible que " -"si tous ses parents le sont également (en d'autres termes, [méthode " -"is_visible_in_tree] doit retourner [code]true[/code]).\n" -"[b]Note :[/b] Pour les contrôles qui héritent de [Popup], la bonne manière " -"de les rendre visible est plutôt d'appeler l'une des fonctions [code]popup*()" -"[/code]." - msgid "" "If [code]true[/code], the node's Z index is relative to its parent's Z " "index. If this node's Z index is 2 and its parent's effective Z index is 3, " @@ -5931,7 +5857,7 @@ msgid "Kinematic character (2D)" msgstr "Caractère cinématique (2D)" msgid "2D Kinematic Character Demo" -msgstr "Démo de caractère cinétique 2D" +msgstr "Démo de personnage cinématique en 2D" msgid "" "Returns a [KinematicCollision2D], which contains information about the " @@ -6352,11 +6278,14 @@ msgstr "" msgid "A disabled collision shape has no effect in the world." msgstr "Une forme de collision désactivée n’a aucun effet dans le monde." +msgid "2D GD Paint Demo" +msgstr "Démo 2D « GD Paint »" + msgid "Tween Demo" msgstr "Démo des Tween" msgid "GUI Drag And Drop Demo" -msgstr "Démo de l'interface de déposer-glisser" +msgstr "Démo de glisser-déplacer dans une interface graphique" msgid "" "The color's alpha component, typically on the range of 0 to 1. A value of 0 " @@ -7117,16 +7046,7 @@ msgid "Control node gallery" msgstr "Galerie des nœuds de contrôle" msgid "All GUI Demos" -msgstr "Toutes les démos d'interface" - -msgid "" -"Marks an input event as handled. Once you accept an input event, it stops " -"propagating, even to nodes listening to [method Node._unhandled_input] or " -"[method Node._unhandled_key_input]." -msgstr "" -"Marque un événement d'entrée comme traité. Une fois l'événement accepté, il " -"arrête de se propager, même aux nœuds surchargeant les méthodes [method Node." -"_unhandled_input] ou [method Node._unhandled_key_input]." +msgstr "Toutes les démos d'interface graphique" msgid "" "Finds the next (below in the tree) [Control] that can receive the focus." @@ -9825,6 +9745,18 @@ msgstr "" "Définit une liste des dossiers récemment visités dans le dialogue de " "fichiers de ce projet." +msgid "" +"The language to use for the editor interface.\n" +"Translations are provided by the community. If you spot a mistake, " +"[url=$DOCS_URL/contributing/documentation/editor_and_docs_localization." +"html]contribute to editor translations on Weblate![/url]" +msgstr "" +"La langue à utiliser dans l'interface de l'éditeur.\n" +"Les traductions sont fournies par la communauté. Si vous apercevez une " +"erreur, [url=$DOCS_URL/contributing/documentation/" +"editor_and_docs_localization.html]merci de contribuer aux traductions de " +"l'éditeur sur Weblate ![/url]" + msgid "Emitted after any editor setting has changed." msgstr "Émis après qu'une préférence de l'éditeur a changé." @@ -10567,6 +10499,16 @@ msgstr "" "lumières physiques (qui ont une portée infinie). Lors de la création d'une " "lumière Godot, la portée est fixée à 4096 unités." +msgid "2D Particles Demo" +msgstr "Démo des particules en 2D" + +msgid "" +"2D Dodge The Creeps Demo (uses GPUParticles2D for the trail behind the " +"player)" +msgstr "" +"Démo 2D « Dodge The Creeps » (utilise GPUParticles2D pour les traces " +"derrière le joueur)" + msgid "Returns a rectangle containing the positions of all existing particles." msgstr "" "Retourne un rectangle contenant la position de toutes les particules " @@ -10611,9 +10553,6 @@ msgstr "" "Une ressource d'interpolation de couleur qui peut être utilisé pour générer " "des couleurs entre des points de couleur définis par l'utilisateur." -msgid "Returns the interpolated color specified by [code]offset[/code]." -msgstr "Retourne la couleur interpolée spécifiée à [code]offset[/code]." - msgid "" "Defines how the colors between points of the gradient are interpolated. See " "[enum InterpolationMode] for available modes." @@ -12527,6 +12466,9 @@ msgstr "" msgid "Base class for all 3D joints." msgstr "La classe parente de tous les joints 3D." +msgid "3D Truck Town Demo" +msgstr "Démo 3D « Truck Town »" + msgid "The node attached to the first side (A) of the joint." msgstr "Le nœud attaché à la première extrémité (A) du joint." @@ -13098,6 +13040,18 @@ msgstr "Appelé une fois lors de l’initialisation." msgid "Emitted when a user responds to a permission request." msgstr "Émis quand l'utilisateur répond à une demande de permission." +msgid "" +"Notification received when translations may have changed. Can be triggered " +"by the user changing the locale. Can be used to respond to language changes, " +"for example to change the UI strings on the fly. Useful when working with " +"the built-in translation support, like [method Object.tr]." +msgstr "" +"La notification reçue quand les traductions peuvent avoir changé. Peut être " +"déclenchée quand l'utilisateur modifie les paramètres régionaux. Permet de " +"réagir aux changements de langue, par exemple en modifiant le texte des " +"interfaces utilisateur à la volée. Pratique lorsque vous utilisez la prise " +"en charge intégrée des traductions, comme par le biais de [method Object.tr]." + msgid "" "Notification received from Godot's crash handler when the engine is about to " "crash.\n" @@ -13636,9 +13590,6 @@ msgstr "" "d'exécution.\n" "[b]Note :[/b] Si n'est à l'intérieur d'un RPC, cette méthode retournera 0." -msgid "WebRTC Signaling Demo" -msgstr "Démo des signaux WebRTC" - msgid "" "Returns the current state of the connection. See [enum ConnectionStatus]." msgstr "Retourne l'état actuel de la connexion. Voir [enum ConnexionStatus]." @@ -13837,6 +13788,12 @@ msgstr "" "les zones d'un environnement qui peuvent être traversés pour aider les " "agents dans leur cheminement dans les espaces compliqués." +msgid "3D Navmesh Demo" +msgstr "Démo de NavigationMesh (« navmesh ») en 3D" + +msgid "Using NavigationMeshes" +msgstr "Utiliser les NavigationMesh" + msgid "" "Adds a polygon using the indices of the vertices you get when calling " "[method get_vertices]." @@ -14842,17 +14799,6 @@ msgstr "" "Retourne si ce nœud utilise une échelle de [code](1, 1, 1)[/code] ou son " "échelle de transformation locale." -msgid "" -"Returns [code]true[/code] if the node is present in the [SceneTree], its " -"[member visible] property is [code]true[/code] and all its antecedents are " -"also visible. If any antecedent is hidden, this node will not be visible in " -"the scene tree." -msgstr "" -"Retourne [code]true[/code] si le nœud est présent dans le [SceneTree], que " -"sa propriété [member visible] est [code]true[/code] et que tous ses parents " -"sont également visibles. Si un parent est caché, ce nœud ne sera pas visible " -"dans l'arborescence de la scène." - msgid "" "Rotates the local transformation around axis, a unit [Vector3], by specified " "angle in radians." @@ -15492,75 +15438,6 @@ msgstr "" "d'envoyer des paquets à une adresse de diffusion (par exemple " "[code]255.255.255[/code])." -msgid "" -"Waits for a packet to arrive on the bound address. See [method bind].\n" -"[b]Note:[/b] [method wait] can't be interrupted once it has been called. " -"This can be worked around by allowing the other party to send a specific " -"\"death pill\" packet like this:\n" -"[codeblocks]\n" -"[gdscript]\n" -"socket = PacketPeerUDP.new()\n" -"# Server\n" -"socket.set_dest_address(\"127.0.0.1\", 789)\n" -"socket.put_packet(\"Time to stop\".to_ascii())\n" -"\n" -"# Client\n" -"while socket.wait() == OK:\n" -" var data = socket.get_packet().get_string_from_ascii()\n" -" if data == \"Time to stop\":\n" -" return\n" -"[/gdscript]\n" -"[csharp]\n" -"var socket = new PacketPeerUDP();\n" -"// Server\n" -"socket.SetDestAddress(\"127.0.0.1\", 789);\n" -"socket.PutPacket(\"Time to stop\".ToAscii());\n" -"\n" -"// Client\n" -"while (socket.Wait() == OK)\n" -"{\n" -" string data = socket.GetPacket().GetStringFromASCII();\n" -" if (data == \"Time to stop\")\n" -" {\n" -" return;\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"Attend qu'un paquet arrive sur l'adresse attachée. Voir [method bind].\n" -"[b]Note :[/b] [method wait] ne peut pas être interrompu une fois appelé. " -"Nous pouvons contourner cela en autorisant l'autre partie à envoyer un " -"paquet \"death pill\" comme cela :\n" -"[codeblock]\n" -"# Serveur\n" -"socket.set_dest_address(\"127.0.0.1\", 789)\n" -"socket.put_packet(\"Time to stop\".to_ascii())\n" -"\n" -"# Client\n" -"while socket.wait() == OK:\n" -" var data = socket.get_packet().get_string_from_ascii()\n" -" if data == \"Time to stop\":\n" -" return\n" -"[/gdscript]\n" -"[csharp]\n" -"var socket = new PacketPeerUDP();\n" -"// Serveur\n" -"socket.SetDestAddress(\"127.0.0.1\", 789);\n" -"socket.PutPacket(\"Time to stop\".ToAscii());\n" -"\n" -"// Client\n" -"while (socket.Wait() == OK)\n" -"{\n" -" string data = socket.GetPacket().GetStringFromASCII();\n" -" if (data == \"Time to stop\")\n" -" {\n" -" return;\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "Provides an opaque background for [Control] children." msgstr "Fournis un arrière-plan opaque pour le [Control] enfant." @@ -16359,6 +16236,48 @@ msgstr "" "Définit l'ordre d'une valeur de configuration (qui a une influence quand " "sauvegardée dans le fichier de configuration)." +msgid "" +"Sets whether a setting requires restarting the editor to properly take " +"effect.\n" +"[b]Note:[/b] This is just a hint to display to the user that the editor must " +"be restarted for changes to take effect. Enabling [method " +"set_restart_if_changed] does [i]not[/i] delay the setting being set when " +"changed." +msgstr "" +"Définit si un paramètre exige que l'éditeur soit redémarré afin d'être " +"correctement pris en compte.\n" +"[b]Note :[/b] Cela n'aura pour effet que d'indiquer (ou non) à l'utilisateur " +"que l'éditeur doit être redémarré pour que les changements prennent effet. " +"Activer [method set_restart_if_changed] [i]ne retarde pas[/i] l'affectation " +"d'une valeur à un paramètre lorsqu'il est modifié." + +msgid "" +"Sets the value of a setting.\n" +"[b]Example:[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"ProjectSettings.set_setting(\"application/config/name\", \"Example\")\n" +"[/gdscript]\n" +"[csharp]\n" +"ProjectSettings.SetSetting(\"application/config/name\", \"Example\");\n" +"[/csharp]\n" +"[/codeblocks]\n" +"This can also be used to erase custom project settings. To do this change " +"the setting value to [code]null[/code]." +msgstr "" +"Définit la valeur d'un paramètre.\n" +"[b]Exemple :[/b]\n" +"[codeblocks]\n" +"[gdscript]\n" +"ProjectSettings.set_setting(\"application/config/name\", \"Exemple\")\n" +"[/gdscript]\n" +"[csharp]\n" +"ProjectSettings.SetSetting(\"application/config/name\", \"Exemple\");\n" +"[/csharp]\n" +"[/codeblocks]\n" +"Cela permet aussi de supprimer un paramètre personnalisé du projet : pour ce " +"faire, remplacez la valeur de ce dernier par [code]null[/code]." + msgid "Background color for the boot splash." msgstr "La couleur d'arrière plan pour l'écran de lancement." @@ -16417,6 +16336,14 @@ msgstr "" "L'icône utilisée pour le projet, défini au chargement du projet. Les " "exportateurs utiliseront également cette icône si possible." +msgid "" +"Translations of the project's name. This setting is used by OS tools to " +"translate application name on Android, iOS and macOS." +msgstr "" +"Traductions du nom du projet. Ce paramètre est utilisé en interne par le " +"système d'exploitation afin de traduire le nom de l'application sur Android, " +"iOS et macOS." + msgid "" "Enables [url=https://github.com/facebook/zstd/releases/tag/v1.3.2]long-" "distance matching[/url] in Zstandard." @@ -17195,9 +17122,6 @@ msgstr "" msgid "2D in 3D Demo" msgstr "Démo pour la 2D en 3D" -msgid "Quaternion." -msgstr "Quaternion." - msgid "" "Constructs a quaternion that will rotate around the given axis by the " "specified angle. The axis must be a normalized vector." @@ -17626,9 +17550,6 @@ msgstr "Efface le [CanvasItem] et enlève toutes les commandes." msgid "Sets the index for the [CanvasItem]." msgstr "Définit l’index du [CanvasItem]." -msgid "Sets a new material to the [CanvasItem]." -msgstr "Définit un nouveau matériau pour le [CanvasItem]." - msgid "Sets if the [CanvasItem] uses its parent's material." msgstr "Définit si le [CanvasItem] utilise le même matériau que son parent." @@ -17690,13 +17611,6 @@ msgstr "Définit la forme du polygone occulteur." msgid "Modulates all colors in the given canvas." msgstr "Module toutes les couleurs du canevas spécifié." -msgid "" -"Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment." -"background_mode]." -msgstr "" -"Définit le mode d'arrière-plan [i]BGMode[/i] de l'environnement. Équivalent " -"à [member Environment.background_mode]." - msgid "Sets the intensity of the background color." msgstr "Définit l'intensité de la couleur de l'arrière-plan." @@ -17745,9 +17659,6 @@ msgstr "" "Définit le drapeau pour un [enum InstanceFlags] spécifié. Voir [enum " "InstanceFlags] pour plus de détails." -msgid "Not implemented in Godot 3.x." -msgstr "Non mis en œuvre dans Godot 3.x." - msgid "Returns the value of a certain material's parameter." msgstr "Retourne la valeur du paramètre du matériau." @@ -17822,9 +17733,6 @@ msgstr "" "Retourne [code]true[/code] si les particules ne sont pas émises et qu'elles " "sont inactives." -msgid "Returns a shader's code." -msgstr "Retourne le code d'un shader." - msgid "Returns the [Transform2D] set for a specific bone of this skeleton." msgstr "" "Retourne la [Transform2D] définie pour l'os spécifié pour ce squelette." @@ -17865,22 +17773,10 @@ msgstr "" "Définit le mode d'affichage de débogage de la fenêtre d'affichage. Voir " "[enum ViewportDebugDraw] pour les options." -msgid "If [code]true[/code], the viewport's canvas is not rendered." -msgstr "" -"Si [code]true[/code], le canevas de la fenêtre d'affichage n'est pas rendu." - msgid "Sets the viewport's global transformation matrix." msgstr "" "Définit la matrice de transformation globale de la fenêtre d'affichage." -msgid "Sets the viewport's parent to another viewport." -msgstr "" -"Définir le parent de la fenêtre d'affichage par une autre fenêtre " -"d'affichage." - -msgid "Sets the viewport's width and height." -msgstr "Définit la largeur et la hauteur de la fenêtre d'affichage." - msgid "" "If [code]true[/code], the viewport renders its background as transparent." msgstr "" @@ -17898,18 +17794,12 @@ msgid "The maximum Z-layer for canvas items." msgstr "" "Le niveau maximal du calque de profondeur pour les éléments de canevas." -msgid "Unused enum in Godot 3.x." -msgstr "Énumération inutilisée dans Godot 3.x." - msgid "Shader is a 3D shader." msgstr "Ce shader est utilisé en 3D." msgid "Shader is a 2D shader." msgstr "Ce shader est utilisé en 2D." -msgid "Shader is a particle shader." -msgstr "Ce shader est utilisé pour les particules." - msgid "Represents the size of the [enum ShaderMode] enum." msgstr "Représente la taille de l'énumération [enum ShaderMode]." @@ -17919,45 +17809,27 @@ msgstr "La priorité minimale de rendu de tous les matériaux." msgid "The maximum renderpriority of all materials." msgstr "La priorité maximale de rendu de tous les matériaux." -msgid "Array is a vertex array." -msgstr "Le tableau est un tableau de sommets." - msgid "Array is a normal array." msgstr "Le tableau est un tableau normal." msgid "Array is a tangent array." msgstr "Le tableau est un tableau de tangentes." -msgid "Array is a color array." -msgstr "Le tableau est un tableau de couleurs." - msgid "Array is an UV coordinates array." msgstr "Le tableau est un tableau de coordonnées UV." -msgid "Array is an UV coordinates array for the second UV coordinates." -msgstr "Le tableau est un tableau de coordonnées UV secondaires (UV2)." - msgid "Array contains bone information." msgstr "Le tableau contient des informations sur les os." msgid "Array is weight information." msgstr "Le tableau est une information sur le poids." -msgid "Array is index array." -msgstr "Le tableau est un tableau d'index." - -msgid "Flag used to mark a vertex array." -msgstr "Drapeau utilisé pour marquer un tableau de sommets." - msgid "Flag used to mark a normal array." msgstr "Drapeau utilisé pour marquer un tableau de normales." msgid "Flag used to mark a tangent array." msgstr "Drapeau utilisé pour marquer un tableau de tangentes." -msgid "Flag used to mark a color array." -msgstr "Drapeau utilisé pour marquer un tableau de couleurs." - msgid "Flag used to mark an UV coordinates array." msgstr "Drapeau utilisé pour marquer un tableau de coordonnées UV." @@ -17981,15 +17853,6 @@ msgstr "Représente la taille de l'énumération [enum PrimitiveType]." msgid "Use [Transform2D] to store MultiMesh transform." msgstr "Utiliser [Transform2D] pour stocker la transformation des MultiMesh." -msgid "Is a directional (sun) light." -msgstr "Est une lumière (solaire) directionnelle." - -msgid "Is an omni light." -msgstr "Est une lumière omnidirectionnelle." - -msgid "Is a spot light." -msgstr "Est une lumière ponctuelle." - msgid "The light's influence on specularity." msgstr "L’influence de la lumière sur la spécularité." @@ -18005,9 +17868,6 @@ msgstr "L’angle du projecteur." msgid "The spotlight's attenuation." msgstr "L'atténuation du projecteur." -msgid "Max distance that shadows will be rendered." -msgstr "Distance maximale à laquelle les ombres seront rendues." - msgid "Represents the size of the [enum LightParam] enum." msgstr "Représente la taille de l'énumération [enum LightParam]." @@ -18047,31 +17907,6 @@ msgstr "Trier les particules par durée de vie." msgid "Sort particles based on their distance to the camera." msgstr "Trier les particules suivant leur distance à la caméra." -msgid "Do not update the viewport." -msgstr "Ne pas mettre à jour le viewport." - -msgid "Update the viewport once then set to disabled." -msgstr "Met à jour le fenêtre d'affichage une fois puis arrête les mis à jour." - -msgid "Update the viewport whenever it is visible." -msgstr "Met à jour la fenêtre d'affichage quand elle est visible." - -msgid "Always update the viewport." -msgstr "Toujours mettre à jour la fenêtre d'affichage." - -msgid "The viewport is always cleared before drawing." -msgstr "La fenêtre d'affichage est toujours nettoyée avant d'être dessinée." - -msgid "The viewport is never cleared before drawing." -msgstr "La fenêtre d'affichage n'est jamais nettoyée avant d'être dessinée." - -msgid "" -"The viewport is cleared once, then the clear mode is set to [constant " -"VIEWPORT_CLEAR_NEVER]." -msgstr "" -"La fenêtre d'affichage sera effacée une seule fois, puis passera en mode " -"[constant VIEWPORT_CLEAR_NEVER]." - msgid "Number of objects drawn in a single frame." msgstr "Le nombre d'objets affichés en une seule trame." @@ -18550,12 +18385,6 @@ msgstr "Classe de base pour les barres de défilement." msgid "Emitted when the scrollbar is being scrolled." msgstr "Émis quand la barre de défilement est défilée." -msgid "The current horizontal scroll value." -msgstr "La valeur de défilement horizontal actuelle." - -msgid "The current vertical scroll value." -msgstr "La valeur de défilement vertical actuelle." - msgid "Emitted when scrolling stops." msgstr "Émis lorsque le défilement s'arrête." @@ -19206,13 +19035,6 @@ msgstr "" msgid "Returns the smallest border width out of all four borders." msgstr "Retourne la plus fine bordure parmi les quatre bordures." -msgid "" -"This changes the size of the faded ring. Higher values can be used to " -"achieve a \"blurry\" effect." -msgstr "" -"Cela change la taille de l’anneau fané. Des valeurs plus élevées peuvent " -"être utilisées pour obtenir un effet « flou »." - msgid "The background color of the stylebox." msgstr "La couleur d'arrière-plan de la stylebox." @@ -21602,10 +21424,6 @@ msgstr "" "[constant Node. NOTIFICATION_DRAG_END] lorsque vous préférez récupérer " "directement la valeur." -msgid "Stops the input from propagating further down the [SceneTree]." -msgstr "" -"Arrête la propagation de l'entrée plus profondément dans le [SceneTree]." - msgid "If [code]true[/code], the viewport will process 2D audio streams." msgstr "Si [code]true[/code], la fenêtre d'affichage gèrera les flux audio 2D." diff --git a/doc/translations/zh_CN.po b/doc/translations/zh_CN.po index a5957c9be48..c3caf836ad7 100644 --- a/doc/translations/zh_CN.po +++ b/doc/translations/zh_CN.po @@ -79,7 +79,7 @@ msgid "" msgstr "" "Project-Id-Version: Godot Engine class reference\n" "Report-Msgid-Bugs-To: https://github.com/godotengine/godot\n" -"PO-Revision-Date: 2023-04-19 00:40+0000\n" +"PO-Revision-Date: 2023-04-20 17:02+0000\n" "Last-Translator: Haoyu Qiu \n" "Language-Team: Chinese (Simplified) \n" @@ -394,51 +394,6 @@ msgstr "" "[, res://test.gd, bar]\n" "[/codeblock]" -msgid "" -"Returns [code]true[/code] if [param value] is an instance of [param type]. " -"The [param type] value must be one of the following:\n" -"- A constant from the [enum Variant.Type] enumeration, for example [constant " -"TYPE_INT].\n" -"- An [Object]-derived class which exists in [ClassDB], for example [Node].\n" -"- A [Script] (you can use any class, including inner one).\n" -"Unlike the right operand of the [code]is[/code] operator, [param type] can " -"be a non-constant value. The [code]is[/code] operator supports more features " -"(such as typed arrays) and is more performant. Use the operator instead of " -"this method if you do not need dynamic type checking.\n" -"Examples:\n" -"[codeblock]\n" -"print(is_instance_of(a, TYPE_INT))\n" -"print(is_instance_of(a, Node))\n" -"print(is_instance_of(a, MyClass))\n" -"print(is_instance_of(a, MyClass.InnerClass))\n" -"[/codeblock]\n" -"[b]Note:[/b] If [param value] and/or [param type] are freed objects (see " -"[method @GlobalScope.is_instance_valid]), or [param type] is not one of the " -"above options, this method will raise an runtime error.\n" -"See also [method @GlobalScope.typeof], [method type_exists], [method Array." -"is_same_typed] (and other [Array] methods)." -msgstr "" -"如果 [param value] 为 [param type] 类型的实例,则返回 [code]true[/code]。" -"[param type] 的值必须为下列值之一:\n" -"- [enum Variant.Type] 枚举常量,例如 [constant TYPE_INT]。\n" -"- [ClassDB] 中存在的派生自 [Object] 的类,例如 [Node]。\n" -"- [Script](可以用任何类,包括内部类)。\n" -"[param type] 可以不是常量,这一点与 [code]is[/code] 的右操作数不同。" -"[code]is[/code] 运算符支持的功能更多(例如类型化数组),性能也更高。如果你不" -"需要动态类型检查,请使用该运算符,不要使用此方法。\n" -"示例:\n" -"[codeblock]\n" -"print(is_instance_of(a, TYPE_INT))\n" -"print(is_instance_of(a, Node))\n" -"print(is_instance_of(a, MyClass))\n" -"print(is_instance_of(a, MyClass.InnerClass))\n" -"[/codeblock]\n" -"[b]注意:[/b]如果 [param value] 和/或 [param type] 为已释放的对象(见 " -"[method @GlobalScope.is_instance_valid]),或者 [param type] 不是以上选项之" -"一,则此方法会报运行时错误。\n" -"另见 [method @GlobalScope.typeof]、[method type_exists]、[method Array." -"is_same_typed](以及其他 [Array] 方法)。" - msgid "" "Returns the length of the given Variant [param var]. The length can be the " "character count of a [String], the element count of any array type or the " @@ -463,48 +418,6 @@ msgstr "" "len(b) # 返回 6\n" "[/codeblock]" -msgid "" -"Returns a [Resource] from the filesystem located at the absolute [param " -"path]. Unless it's already referenced elsewhere (such as in another script " -"or in the scene), the resource is loaded from disk on function call, which " -"might cause a slight delay, especially when loading large scenes. To avoid " -"unnecessary delays when loading something multiple times, either store the " -"resource in a variable or use [method preload].\n" -"[b]Note:[/b] Resource paths can be obtained by right-clicking on a resource " -"in the FileSystem dock and choosing \"Copy Path\", or by dragging the file " -"from the FileSystem dock into the current script.\n" -"[codeblock]\n" -"# Load a scene called \"main\" located in the root of the project directory " -"and cache it in a variable.\n" -"var main = load(\"res://main.tscn\") # main will contain a PackedScene " -"resource.\n" -"[/codeblock]\n" -"[b]Important:[/b] The path must be absolute. A relative path will always " -"return [code]null[/code].\n" -"This function is a simplified version of [method ResourceLoader.load], which " -"can be used for more advanced scenarios.\n" -"[b]Note:[/b] Files have to be imported into the engine first to load them " -"using this function. If you want to load [Image]s at run-time, you may use " -"[method Image.load]. If you want to import audio files, you can use the " -"snippet described in [member AudioStreamMP3.data]." -msgstr "" -"返回一个位于文件系统绝对路径 [param path] 的 [Resource]。除非该资源已在其他地" -"方引用(例如在另一个脚本或场景中),否则资源是在函数调用时从磁盘加载的——这可" -"能会导致轻微的延迟,尤其是在加载大型场景时。为避免在多次加载某些内容时出现不" -"必要的延迟,可以将资源存储在变量中或使用预加载 [method preload]。\n" -"[b]注意:[/b]资源路径可以通过右键单击文件系统停靠面板中的资源并选择“复制路" -"径”,或将文件从文件系统停靠面板拖到脚本中获得。\n" -"[codeblock]\n" -"# 加载位于项目根目录的一个名为“main”的场景,并将其缓存在一个变量中。\n" -"var main = load(\"res://main.tscn\") # main 将包含一个 PackedScene 资源。\n" -"[/codeblock]\n" -"[b]重要提示:[/b]路径必须是绝对路径。相对路径将始终返回 [code]null[/code]。\n" -"这个方法是 [method ResourceLoader.load] 的简化版,原方法可以用于更高级的场" -"景。\n" -"[b]注意:[/b]必须先将文件导入引擎才能使用此函数加载它们。如果你想在运行时加" -"载 [Image],你可以使用 [method Image.load]。如果要导入音频文件,可以使用 " -"[member AudioStreamMP3.data]中描述的代码片段。" - msgid "" "Returns a [Resource] from the filesystem located at [param path]. During run-" "time, the resource is loaded when the script is being parsed. This function " @@ -1503,41 +1416,6 @@ msgstr "" "var a = absi(-1)\n" "[/codeblock]" -msgid "" -"Returns the arc cosine of [param x] in radians. Use to get the angle of " -"cosine [param x]. [param x] must be between [code]-1.0[/code] and [code]1.0[/" -"code] (inclusive), otherwise, [method acos] will return [constant @GDScript." -"NAN].\n" -"[codeblock]\n" -"# c is 0.523599 or 30 degrees if converted with rad_to_deg(c)\n" -"var c = acos(0.866025)\n" -"[/codeblock]" -msgstr "" -"返回 [param x] 的反余弦,单位为弧度。用来获取余弦 [param x] 的角度。[param " -"x] 必须在 [code]-1.0[/code] 和 [code]1.0[/code](包括)之间,否则 [method " -"acos] 将返回 [constant @GDScript.NAN]。\n" -"[codeblock]\n" -"# 如果用 rad_to_deg(c) 转换,c为0.523599或30度\n" -"var c = acos(0.866025)\n" -"[/codeblock]" - -msgid "" -"Returns the arc sine of [param x] in radians. Use to get the angle of sine " -"[param x]. [param x] must be between [code]-1.0[/code] and [code]1.0[/code] " -"(inclusive), otherwise, [method asin] will return [constant @GDScript.NAN].\n" -"[codeblock]\n" -"# s is 0.523599 or 30 degrees if converted with rad_to_deg(s)\n" -"var s = asin(0.5)\n" -"[/codeblock]" -msgstr "" -"返回 [param x] 的反正弦值,单位为弧度。用来获取正弦 [param x] 的角度。[param " -"x] 必须在 [code]-1.0[/code] 和 [code]1.0[/code](包括)之间,否则 [method " -"asin] 将返回 [constant @GDScript.NAN]。\n" -"[codeblock]\n" -"# 如果用 rad_to_deg(s) 转换,s为0.523599或30度\n" -"var s = asin(0.5)\n" -"[/codeblock]" - msgid "" "Returns the arc tangent of [param x] in radians. Use it to get the angle " "from an angle's tangent in trigonometry.\n" @@ -2620,55 +2498,6 @@ msgstr "" "误和警告消息,而不是 [method print] 或 [method print_rich]。这将它们与用于调" "试目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。" -msgid "" -"Converts one or more arguments of any type to string in the best way " -"possible and prints them to the console. The following BBCode tags are " -"supported: b, i, u, s, indent, code, url, center, right, color, bgcolor, " -"fgcolor. Color tags only support named colors such as [code]red[/code], " -"[i]not[/i] hexadecimal color codes. Unsupported tags will be left as-is in " -"standard output.\n" -"When printing to standard output, the supported subset of BBCode is " -"converted to ANSI escape codes for the terminal emulator to display. " -"Displaying ANSI escape codes is currently only supported on Linux and macOS. " -"Support for ANSI escape codes may vary across terminal emulators, especially " -"for italic and strikethrough.\n" -"[codeblocks]\n" -"[gdscript]\n" -"print_rich(\"[code][b]Hello world![/b][/code]\") # Prints out: [b]Hello " -"world![/b]\n" -"[/gdscript]\n" -"[csharp]\n" -"GD.PrintRich(\"[code][b]Hello world![/b][/code]\"); // Prints out: [b]Hello " -"world![/b]\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[b]Note:[/b] Consider using [method push_error] and [method push_warning] to " -"print error and warning messages instead of [method print] or [method " -"print_rich]. This distinguishes them from print messages used for debugging " -"purposes, while also displaying a stack trace when an error or warning is " -"printed." -msgstr "" -"以尽可能最佳的方式将一个或多个任意类型的参数转换为字符串,并将其打印到控制" -"台。支持以下 BBCode 标签:b、i、u、s、indent、code、url、center、right、" -"color、bgcolor、fgcolor。颜色标签仅支持命名颜色,例如 [code]red[/code]、[i]不" -"支持[/i] 十六进制颜色代码。不支持的标签将在标准输出中保持原样。\n" -"当打印到标准输出时,支持的 BBCode 子集被转换为 ANSI 转义码以供终端仿真器显" -"示。目前仅 Linux 和 macOS 支持显示 ANSI 转义码。对 ANSI 转义码的支持可能因终" -"端仿真器而异,尤其是斜体和删除线。\n" -"[codeblocks]\n" -"[gdscript]\n" -"print_rich(\"[code][b]Hello world![/b][/code]\") # 输出:[b]Hello world![/" -"b]\n" -"[/gdscript]\n" -"[csharp]\n" -"GD.PrintRich(\"[code][b]Hello world![/b][/code]\"); // 输出:[b]Hello world!" -"[/b]\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[b]注意:[/b]请考虑使用 [method push_error] 和 [method push_warning] 来打印错" -"误和警告消息,而不是 [method print] 或 [method print_rich]。这将它们与用于调" -"试目的的打印消息区分开来,同时还会在打印错误或警告时显示堆栈跟踪。" - msgid "" "If verbose mode is enabled ([method OS.is_stdout_verbose] returning " "[code]true[/code]), converts one or more arguments of any type to string in " @@ -5957,159 +5786,6 @@ msgstr "填充窗口背景的面板。" msgid "Interface to low level AES encryption features." msgstr "底层 AES 加密功能接口。" -msgid "" -"This class provides access to AES encryption/decryption of raw data. Both " -"AES-ECB and AES-CBC mode are supported.\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"\n" -"var aes = AESContext.new()\n" -"\n" -"func _ready():\n" -" var key = \"My secret key!!!\" # Key must be either 16 or 32 bytes.\n" -" var data = \"My secret text!!\" # Data size must be multiple of 16 " -"bytes, apply padding if needed.\n" -" # Encrypt ECB\n" -" aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8())\n" -" var encrypted = aes.update(data.to_utf8())\n" -" aes.finish()\n" -" # Decrypt ECB\n" -" aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8())\n" -" var decrypted = aes.update(encrypted)\n" -" aes.finish()\n" -" # Check ECB\n" -" assert(decrypted == data.to_utf8())\n" -"\n" -" var iv = \"My secret iv!!!!\" # IV must be of exactly 16 bytes.\n" -" # Encrypt CBC\n" -" aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8())\n" -" encrypted = aes.update(data.to_utf8())\n" -" aes.finish()\n" -" # Decrypt CBC\n" -" aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8())\n" -" decrypted = aes.update(encrypted)\n" -" aes.finish()\n" -" # Check CBC\n" -" assert(decrypted == data.to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private AesContext _aes = new AesContext();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" string key = \"My secret key!!!\"; // Key must be either 16 or 32 " -"bytes.\n" -" string data = \"My secret text!!\"; // Data size must be multiple of " -"16 bytes, apply padding if needed.\n" -" // Encrypt ECB\n" -" _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8());\n" -" byte[] encrypted = _aes.Update(data.ToUtf8());\n" -" _aes.Finish();\n" -" // Decrypt ECB\n" -" _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8());\n" -" byte[] decrypted = _aes.Update(encrypted);\n" -" _aes.Finish();\n" -" // Check ECB\n" -" Debug.Assert(decrypted == data.ToUtf8());\n" -"\n" -" string iv = \"My secret iv!!!!\"; // IV must be of exactly 16 " -"bytes.\n" -" // Encrypt CBC\n" -" _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8(), iv.ToUtf8());\n" -" encrypted = _aes.Update(data.ToUtf8());\n" -" _aes.Finish();\n" -" // Decrypt CBC\n" -" _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8(), iv.ToUtf8());\n" -" decrypted = _aes.Update(encrypted);\n" -" _aes.Finish();\n" -" // Check CBC\n" -" Debug.Assert(decrypted == data.ToUtf8());\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"此类提供了对原始数据的 AES 加密/解密的访问。同时支持 AES-ECB 和 AES-CBC 模" -"式。\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"\n" -"var aes = AESContext.new()\n" -"\n" -"func _ready():\n" -" var key = \"My secret key!!!\" # 密钥必须是 16 或 32 字节。\n" -" var data = \"My secret text!!\" # 数据大小必须是 16 字节的倍数,需要时添" -"加补白。\n" -" # ECB 加密\n" -" aes.start(AESContext.MODE_ECB_ENCRYPT, key.to_utf8())\n" -" var encrypted = aes.update(data.to_utf8())\n" -" aes.finish()\n" -" # ECB 解密\n" -" aes.start(AESContext.MODE_ECB_DECRYPT, key.to_utf8())\n" -" var decrypted = aes.update(encrypted)\n" -" aes.finish()\n" -" # ECB 校验\n" -" assert(decrypted == data.to_utf8())\n" -"\n" -" var iv = \"My secret iv!!!!\" # IV 必须是 16 字节。\n" -" # CBC 加密\n" -" aes.start(AESContext.MODE_CBC_ENCRYPT, key.to_utf8(), iv.to_utf8())\n" -" encrypted = aes.update(data.to_utf8())\n" -" aes.finish()\n" -" # CBC 解密\n" -" aes.start(AESContext.MODE_CBC_DECRYPT, key.to_utf8(), iv.to_utf8())\n" -" decrypted = aes.update(encrypted)\n" -" aes.finish()\n" -" # CBC 校验\n" -" assert(decrypted == data.to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private AesContext _aes = new AesContext();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" string key = \"My secret key!!!\"; // 密钥必须是 16 或 32 字节。\n" -" string data = \"My secret text!!\"; // 数据大小必须是 16 字节的倍数," -"需要时添加补白。\n" -" // ECB 加密\n" -" _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8());\n" -" byte[] encrypted = _aes.Update(data.ToUtf8());\n" -" _aes.Finish();\n" -" // ECB 解密\n" -" _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8());\n" -" byte[] decrypted = _aes.Update(encrypted);\n" -" _aes.Finish();\n" -" // ECB 校验\n" -" Debug.Assert(decrypted == data.ToUtf8());\n" -"\n" -" string iv = \"My secret iv!!!!\"; // IV 必须是 16 字节。\n" -" // CBC 加密\n" -" _aes.Start(AesContext.Mode.EcbEncrypt, key.ToUtf8(), iv.ToUtf8());\n" -" encrypted = _aes.Update(data.ToUtf8());\n" -" _aes.Finish();\n" -" // CBC 解密\n" -" _aes.Start(AesContext.Mode.EcbDecrypt, key.ToUtf8(), iv.ToUtf8());\n" -" decrypted = _aes.Update(encrypted);\n" -" _aes.Finish();\n" -" // CBC 校验\n" -" Debug.Assert(decrypted == data.ToUtf8());\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "Close this AES context so it can be started again. See [method start]." msgstr "关闭此 AES 上下文,以便可以再次启动它。见 [method start]。" @@ -6160,11 +5836,6 @@ msgstr "AES 密码封锁器链式解密模式。" msgid "Maximum value for the mode enum." msgstr "模式列举的最大值。" -msgid "" -"Physics body for 2D physics which moves only by script or animation. Useful " -"for moving platforms and doors." -msgstr "用于 2D 物理中仅通过脚本或动画移动的物理实体。适用于移动的平台和门。" - msgid "" "Animatable body for 2D physics.\n" "An animatable body can't be moved by external forces or contacts, but can be " @@ -6196,11 +5867,6 @@ msgstr "" "[AnimationPlayer] 为运动设置动画时,例如在移动的平台上,这个功能很有用。[b]不" "要[/b]与[method PhysicsBody2D.move_and_collide]一起使用。" -msgid "" -"Physics body for 3D physics which moves only by script or animation. Useful " -"for moving platforms and doors." -msgstr "仅通过脚本或动画移动、用于3D 物理的物理体。适用于移动的平台和门。" - msgid "" "Animatable body for 3D physics.\n" "An animatable body can't be moved by external forces or contacts, but can be " @@ -8663,14 +8329,6 @@ msgstr "" "如果 [param keep_state] 为 [code]true[/code],则动画状态不会在视觉上更新。\n" "[b]注意:[/b]方法/音频/动画播放轨道不会被该方法处理。" -msgid "" -"If playing, the the current animation's key, otherwise, the animation last " -"played. When set, this changes the animation, but will not play it unless " -"already playing. See also [member current_animation]." -msgstr "" -"如果正在播放,则为当前动画的键,否则为上次播放的动画。设置后会改变动画,但除" -"非已经播放,否则不会播放。另见 [member current_animation]。" - msgid "" "The number of possible simultaneous sounds for each of the assigned " "AudioStreamPlayers.\n" @@ -9800,15 +9458,6 @@ msgstr "风力随着距其原点的距离而衰减的指数速率。" msgid "The magnitude of area-specific wind force." msgstr "特定区域风力的大小。" -msgid "" -"The [Node3D] which is used to specify the the direction and origin of an " -"area-specific wind force. The direction is opposite to the z-axis of the " -"[Node3D]'s local transform, and its origin is the origin of the [Node3D]'s " -"local transform." -msgstr "" -"[Node3D] 用于指定特定区域风力的方向和原点。方向与 [Node3D] 局部变换的 z 轴相" -"反,其原点为 [Node3D] 局部变换的原点。" - msgid "" "Emitted when a [Shape3D] of the received [param area] enters a shape of this " "area. Requires [member monitoring] to be set to [code]true[/code].\n" @@ -10545,22 +10194,6 @@ msgstr "" "[/codeblock]\n" "另请参见 [method filter]、[method reduce]、[method any] 和 [method all]。" -msgid "" -"Returns the maximum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"如果数组中的所有元素都是可比较的类型,返回其中的最大值。如果无法比较,返回 " -"[code]null[/code]。" - -msgid "" -"Returns the minimum value contained in the array if all elements are of " -"comparable types. If the elements can't be compared, [code]null[/code] is " -"returned." -msgstr "" -"如果数组中的所有元素都是可比较的类型,返回其中的最小值。如果无法比较,返回 " -"[code]null[/code]。" - msgid "" "Returns a random value from the target array.\n" "[codeblocks]\n" @@ -13657,27 +13290,6 @@ msgid "" msgstr "" "如果该音频流仅支持单声道播放,则返回 true;如果音频流支持复调,则返回 false。" -msgid "Audio stream that generates sounds procedurally." -msgstr "使用程序生成声音的音频流。" - -msgid "" -"This audio stream does not play back sounds, but expects a script to " -"generate audio data for it instead. See also " -"[AudioStreamGeneratorPlayback].\n" -"See also [AudioEffectSpectrumAnalyzer] for performing real-time audio " -"spectrum analysis.\n" -"[b]Note:[/b] Due to performance constraints, this class is best used from C# " -"or from a compiled language via GDExtension. If you still want to use this " -"class from GDScript, consider using a lower [member mix_rate] such as 11,025 " -"Hz or 22,050 Hz." -msgstr "" -"该音频流不播放声音,但需要脚本为其生成音频数据。另见 " -"[AudioStreamGeneratorPlayback]。\n" -"另请参阅 [AudioEffectSpectrumAnalyzer] 以执行实时音频频谱分析。\n" -"[b]注意:[/b]由于性能限制,最好从 C# 或通过 GDExtension 编译的语言中使用此" -"类。如果仍想使从 GDScript 中使用此类,请考虑使用较低的 [member mix_rate],例" -"如 11,025 Hz 或 22,050 Hz。" - msgid "" "The length of the buffer to generate (in seconds). Lower values result in " "less latency, but require the script to generate audio data faster, " @@ -15620,13 +15232,6 @@ msgstr "" "镜面反射、屏幕空间反射、[VoxelGI]、SDFGI 或 [ReflectionProbe]。要同时禁用来自" "这些源的反射,请将 [member metallic_specular] 设置为 [code]0.0[/code]。" -msgid "" -"If [code]true[/code], subsurface scattering is enabled. Emulates light that " -"penetrates an object's surface, is scattered, and then emerges." -msgstr "" -"如果为 [code]true[/code],则启用次表面散射。模拟光线穿透物体表面,被散射,然" -"后出现。" - msgid "" "If [code]true[/code], subsurface scattering will use a special mode " "optimized for the color and density of human skin, such as boosting the " @@ -15635,9 +15240,6 @@ msgstr "" "如果为 [code]true[/code],则次表面散射将使用针对人类皮肤的颜色和密度进行优化" "的特殊模式,例如提升次表面散射中红色通道的强度。" -msgid "The strength of the subsurface scattering effect." -msgstr "次表面散射效果的强度。" - msgid "" "Texture used to control the subsurface scattering strength. Stored in the " "red texture channel. Multiplied by [member subsurf_scatter_strength]." @@ -17702,22 +17304,6 @@ msgstr "" "创建新的 [Callable],使用指定对象 [param object] 中名为 [param method] 的方" "法。" -msgid "" -"Returns a copy of this [Callable] with one or more arguments bound. When " -"called, the bound arguments are passed [i]after[/i] the arguments supplied " -"by [method call]." -msgstr "" -"返回该 [Callable] 的副本,绑定其中的一个或多个参数。调用时,被绑定的参数在提" -"供给 [method call] 的参数[i]之后[/i]传递。" - -msgid "" -"Returns a copy of this [Callable] with one or more arguments bound, reading " -"them from an array. When called, the bound arguments are passed [i]after[/i] " -"the arguments supplied by [method call]." -msgstr "" -"返回该 [Callable] 的副本,绑定其中的一个或多个参数,参数从数组中读取。调用" -"时,被绑定的参数在提供给 [method call] 的参数[i]之后[/i]传递。" - msgid "" "Calls the method represented by this [Callable]. Arguments can be passed and " "should match the method's signature." @@ -17843,16 +17429,6 @@ msgstr "" "程过程调用)。用于多人游戏,一般不可用,除非所调用的函数有 [i]RPC[/i] 标记。" "在不支持的方法上调用该方法会导致出错。见 [method Node.rpc_id]。" -msgid "" -"Returns a copy of this [Callable] with the arguments unbound, as defined by " -"[param argcount]. Calling the returned [Callable] will call the method " -"without the extra arguments that are supplied in the [Callable] on which you " -"are calling this method." -msgstr "" -"返回该 [Callable] 的副本,解绑若干个参数,个数由 [param argcount] 定义。调用" -"返回的 [Callable] 时,会去除所提供参数中的额外参数,再对原 [Callable] 的方法" -"进行调用。" - msgid "Returns [code]true[/code] if both [Callable]s invoke different targets." msgstr "如果两个 [Callable] 调用的目标不同,则返回 [code]true[/code]。" @@ -19444,16 +19020,6 @@ msgstr "" "用所提供的纹理以 2D 方式绘制一个 [MultiMesh]。相关文档请参考 " "[MultiMeshInstance2D]。" -msgid "" -"Draws a solid polygon of any number of points, convex or concave. Unlike " -"[method draw_colored_polygon], each point's color can be changed " -"individually. See also [method draw_polyline] and [method " -"draw_polyline_colors]." -msgstr "" -"绘制一个由任意数量的点构成的实心多边形,凸形或凹形。与 [method " -"draw_colored_polygon] 不同,每个点的颜色都可以单独改变。另见 [method " -"draw_polyline] 和 [method draw_polyline_colors]。" - msgid "" "Draws interconnected line segments with a uniform [param color] and [param " "width] and optional antialiasing (supported only for positive [param " @@ -19507,32 +19073,6 @@ msgstr "" "消息。另请参阅 [method draw_line]、[method draw_polyline]、[method " "draw_polygon]、[method draw_rect]。" -msgid "" -"Draws a rectangle. If [param filled] is [code]true[/code], the rectangle " -"will be filled with the [param color] specified. If [param filled] is " -"[code]false[/code], the rectangle will be drawn as a stroke with the [param " -"color] and [param width] specified.\n" -"If [param width] is negative, then two-point primitives will be drawn " -"instead of a four-point ones. This means that when the CanvasItem is scaled, " -"the lines will remain thin. If this behavior is not desired, then pass a " -"positive [param width] like [code]1.0[/code].\n" -"[b]Note:[/b] [param width] is only effective if [param filled] is " -"[code]false[/code].\n" -"[b]Note:[/b] Unfilled rectangles drawn with a negative [param width] may not " -"display perfectly. For example, corners may be missing or brighter due to " -"overlapping lines (for a translucent [param color])." -msgstr "" -"绘制一个矩形。如果 [param filled] 为 [code]true[/code],则矩形将使用指定的 " -"[param color] 填充。如果 [param filled] 为 [code]false[/code],则矩形将被绘制" -"为具有指定的 [param color] 和 [param width] 的笔划。\n" -"如果 [param width] 为负,则将绘制一个两点图元而不是一个四点图元。这意味着当缩" -"放 CanvasItem 时,线条将保持细长。如果不需要此行为,请传递一个正的 [param " -"width],如 [code]1.0[/code]。\n" -"[b]注意:[/b][param width] 只有在 [param filled] 为 [code]false[/code] 时才有" -"效。\n" -"[b]注意:[/b]使用负 [param width] 绘制的未填充矩形可能不会完美显示。例如,由" -"于线条的重叠,角可能会缺失或变亮(对于半透明的 [param color])。" - msgid "" "Sets a custom transform for drawing via components. Anything drawn " "afterwards will be transformed by this.\n" @@ -19631,22 +19171,6 @@ msgstr "绘制一个样式矩形。" msgid "Draws a texture at a given position." msgstr "在给定的位置绘制纹理。" -msgid "" -"Draws a textured rectangle at a given position, optionally modulated by a " -"color. If [param transpose] is [code]true[/code], the texture will have its " -"X and Y coordinates swapped." -msgstr "" -"在给定位置绘制一个带纹理的矩形,可以选择用颜色调制。如果 [param transpose] " -"为 [code]true[/code],则纹理将交换其 X 和 Y 坐标。" - -msgid "" -"Draws a textured rectangle region at a given position, optionally modulated " -"by a color. If [param transpose] is [code]true[/code], the texture will have " -"its X and Y coordinates swapped." -msgstr "" -"在给定位置绘制带纹理的矩形区域,可选择用颜色调制。如果 [param transpose] 为 " -"[code]true[/code],则纹理将交换其 X 和 Y 坐标。" - msgid "" "Forces the transform to update. Transform changes in physics are not instant " "for performance reasons. Transforms are accumulated and then set. Use this " @@ -19666,13 +19190,6 @@ msgid "" "in, to the [Viewport]s coordinate system." msgstr "返回从该项目所在的画布坐标系到 [Viewport] 坐标系的变换。" -msgid "" -"Returns the mouse's position in the [CanvasLayer] that this [CanvasItem] is " -"in using the coordinate system of the [CanvasLayer]." -msgstr "" -"返回该 [CanvasItem] 所在的 [CanvasLayer] 中鼠标的位置,使用该 [CanvasLayer] " -"的坐标系。" - msgid "" "Returns the global transform matrix of this item, i.e. the combined " "transform up to the topmost [CanvasItem] node. The topmost item is a " @@ -19738,16 +19255,6 @@ msgid "" "to children." msgstr "如果将全局变换通知传达给子级,则返回 [code]true[/code]。" -msgid "" -"Returns [code]true[/code] if the node is present in the [SceneTree], its " -"[member visible] property is [code]true[/code] and all its antecedents are " -"also visible. If any antecedent is hidden, this node will not be visible in " -"the scene tree, and is consequently not drawn (see [method _draw])." -msgstr "" -"如果该节点位于 [SceneTree] 中,并且其 [member visible] 属性为 [code]true[/" -"code],并且其所有上层节点也均可见,则返回 [code]true[/code]。如果任何上层节点" -"被隐藏,则该节点在场景树中将不可见,因此也不会进行绘制(见 [method _draw])。" - msgid "Assigns [param screen_point] as this node's new local transform." msgstr "将 [param screen_point] 指定为该节点的新局部变换。" @@ -19876,20 +19383,6 @@ msgstr "" "有父级均与 [Viewport] 的画布剔除遮罩有交集,该 [Viewport] 才会渲染此 " "[CanvasItem]。" -msgid "" -"If [code]true[/code], this [CanvasItem] is drawn. The node is only visible " -"if all of its antecedents are visible as well (in other words, [method " -"is_visible_in_tree] must return [code]true[/code]).\n" -"[b]Note:[/b] For controls that inherit [Popup], the correct way to make them " -"visible is to call one of the multiple [code]popup*()[/code] functions " -"instead." -msgstr "" -"如果为 [code]true[/code],这个 [CanvasItem] 被绘制。只有当它的所有父节点也可" -"见时,该节点才是可见的(换句话说,[method is_visible_in_tree] 必须返回 " -"[code]true[/code])。\n" -"[b]注意:[/b]对于继承了 [Popup] 的控件,使其可见的正确方法是调用多个 " -"[code]popup*()[/code] 函数之一。" - msgid "" "If [code]true[/code], child nodes with the lowest Y position are drawn " "before those with a higher Y position. If [code]false[/code], Y-sorting is " @@ -21985,9 +21478,6 @@ msgstr "将该选项标记为变量。" msgid "Marks the option as a member." msgstr "将该选项标记为成员。" -msgid "Marks the option as a enum entry." -msgstr "将该选项标记为枚举条目。" - msgid "Marks the option as a constant." msgstr "将该选项标记为常量。" @@ -24695,14 +24185,125 @@ msgstr "" msgid "6-sided texture typically used in 3D rendering, optionally compressed." msgstr "6 面纹理,通常用于 3D 渲染,可选择压缩。" +msgid "" +"A cubemap that is loaded from a [code].ccube[/code] file. This file format " +"is internal to Godot; it is created by importing other image formats with " +"the import system. [CompressedCubemap] can use one of 4 compresson methods:\n" +"- Lossless (WebP or PNG, uncompressed on the GPU)\n" +"- Lossy (WebP, uncompressed on the GPU)\n" +"- VRAM Compressed (compressed on the GPU)\n" +"- VRAM Uncompressed (uncompressed on the GPU)\n" +"- Basis Universal (compressed on the GPU. Lower file sizes than VRAM " +"Compressed, but slower to compress and lower quality than VRAM Compressed)\n" +"Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. " +"The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the " +"required storage on disk, but they will not reduce memory usage on the GPU " +"as the texture is sent to the GPU uncompressed.\n" +"Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed " +"textures are faster to load compared to textures using lossless or lossy " +"compression. VRAM compression can exhibit noticeable artifacts and is " +"intended to be used for 3D rendering, not 2D.\n" +"See [Cubemap] for a general description of cubemaps." +msgstr "" +"一种从 [code].ccube[/code] 文件加载的立方体贴图。这种文件格式是 Godot 内部使" +"用的;它是通过导入系统导入其他图像格式创建的。[CompressedCubemap] 可以使用 4 " +"种压缩方法中的一种:\n" +"- 无损(WebP 或 PNG,在 GPU 上不压缩)\n" +"- 有损(WebP,在 GPU 上不压缩)\n" +"- VRAM 压缩(在 GPU 上压缩)\n" +"- VRAM 未压缩(在 GPU 上不压缩)\n" +"- Basis Universal(在 GPU 上压缩。与 VRAM 压缩相比,文件更小,但压缩速度更" +"慢、质量更低)\n" +"只有 [b]VRAM 压缩[/b]实际上减少了 GPU 上的内存使用。[b]无损[/b]和[b]有损[/b]" +"压缩方法将减少磁盘上所需的存储空间,但它们不会减少 GPU 上的内存使用,因为纹理" +"未经压缩地被发送到 GPU。\n" +"使用 [b]VRAM 压缩[/b]还可以缩短加载时间,因为与使用无损或有损压缩的纹理相比," +"VRAM 压缩的纹理加载速度更快。VRAM 压缩会表现出明显的伪影,并且它旨在用于 3D " +"渲染,而不是 2D。\n" +"有关立方体贴图的一般描述,请参阅 [Cubemap]。" + msgid "" "Array of 6-sided textures typically used in 3D rendering, optionally " "compressed." msgstr "6 面纹理的数组,通常用于 3D 渲染,可选择压缩。" +msgid "" +"A cubemap array that is loaded from a [code].ccubearray[/code] file. This " +"file format is internal to Godot; it is created by importing other image " +"formats with the import system. [CompressedCubemapArray] can use one of 4 " +"compresson methods:\n" +"- Lossless (WebP or PNG, uncompressed on the GPU)\n" +"- Lossy (WebP, uncompressed on the GPU)\n" +"- VRAM Compressed (compressed on the GPU)\n" +"- VRAM Uncompressed (uncompressed on the GPU)\n" +"- Basis Universal (compressed on the GPU. Lower file sizes than VRAM " +"Compressed, but slower to compress and lower quality than VRAM Compressed)\n" +"Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. " +"The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the " +"required storage on disk, but they will not reduce memory usage on the GPU " +"as the texture is sent to the GPU uncompressed.\n" +"Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed " +"textures are faster to load compared to textures using lossless or lossy " +"compression. VRAM compression can exhibit noticeable artifacts and is " +"intended to be used for 3D rendering, not 2D.\n" +"See [CubemapArray] for a general description of cubemap arrays." +msgstr "" +"一种从 [code].ccubearray[/code] 文件加载的立方体贴图数组。这种文件格式是 " +"Godot 内部使用的;它是通过导入系统导入其他图像格式创建的。" +"[CompressedCubemapArray] 可以使用 4 种压缩方法中的一种:\n" +"- 无损(WebP 或 PNG,在 GPU 上不压缩)\n" +"- 有损(WebP,在 GPU 上不压缩)\n" +"- VRAM 压缩(在 GPU 上压缩)\n" +"- VRAM 未压缩(在 GPU 上不压缩)\n" +"- Basis Universal(在 GPU 上压缩。与 VRAM 压缩相比,文件更小,但压缩速度更" +"慢、质量更低)\n" +"只有 [b]VRAM 压缩[/b]实际上减少了 GPU 上的内存使用。[b]无损[/b]和[b]有损[/b]" +"压缩方法将减少磁盘上所需的存储空间,但它们不会减少 GPU 上的内存使用,因为纹理" +"未经压缩地被发送到 GPU。\n" +"使用 [b]VRAM 压缩[/b]还可以缩短加载时间,因为与使用无损或有损压缩的纹理相比," +"VRAM 压缩的纹理加载速度更快。VRAM 压缩会表现出明显的伪影,并且它旨在用于 3D " +"渲染,而不是 2D。\n" +"有关立方体贴图数组的一般说明,请参阅 [CubemapArray]。" + msgid "Texture with 2 dimensions, optionally compressed." msgstr "二维纹理,可选择压缩。" +msgid "" +"A texture that is loaded from a [code].ctex[/code] file. This file format is " +"internal to Godot; it is created by importing other image formats with the " +"import system. [CompressedTexture2D] can use one of 4 compression methods " +"(including a lack of any compression):\n" +"- Lossless (WebP or PNG, uncompressed on the GPU)\n" +"- Lossy (WebP, uncompressed on the GPU)\n" +"- VRAM Compressed (compressed on the GPU)\n" +"- VRAM Uncompressed (uncompressed on the GPU)\n" +"- Basis Universal (compressed on the GPU. Lower file sizes than VRAM " +"Compressed, but slower to compress and lower quality than VRAM Compressed)\n" +"Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. " +"The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the " +"required storage on disk, but they will not reduce memory usage on the GPU " +"as the texture is sent to the GPU uncompressed.\n" +"Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed " +"textures are faster to load compared to textures using lossless or lossy " +"compression. VRAM compression can exhibit noticeable artifacts and is " +"intended to be used for 3D rendering, not 2D." +msgstr "" +"一种从 [code].ctex[/code] 文件加载的纹理。这种文件格式是 Godot 内部使用的;它" +"是通过导入系统导入其他图像格式创建的。[CompressedTexture2D] 可以使用 4 种压缩" +"方法中的一种(包括没有任何压缩):\n" +"- 无损(WebP 或 PNG,在 GPU 上不压缩)\n" +"- 有损(WebP,在 GPU 上不压缩)\n" +"- VRAM 压缩(在 GPU 上压缩)\n" +"- VRAM 未压缩(在 GPU 上不压缩)\n" +"- Basis Universal(在 GPU 上压缩。与 VRAM 压缩相比,文件更小,但压缩速度更" +"慢、质量更低)\n" +"只有 [b]VRAM 压缩[/b]实际上减少了 GPU 上的内存使用。[b]无损[/b]和[b]有损[/b]" +"压缩方法将减少磁盘上所需的存储空间,但它们不会减少 GPU 上的内存使用,因为纹理" +"未经压缩地被发送到 GPU。\n" +"使用 [b]VRAM 压缩[/b]还可以缩短加载时间,因为与使用无损或有损压缩的纹理相比," +"VRAM 压缩的纹理加载速度更快。VRAM 压缩会表现出明显的伪影,并且它旨在用于 3D " +"渲染,而不是 2D。" + msgid "Loads the texture from the specified [param path]." msgstr "从指定的路径 [param path] 加载纹理。" @@ -24712,6 +24313,44 @@ msgstr "该 [CompressedTexture2D] 的文件路径,指向 [code].ctex[/code] msgid "Array of 2-dimensional textures, optionally compressed." msgstr "二维纹理的数组,可选择压缩。" +msgid "" +"A texture array that is loaded from a [code].ctexarray[/code] file. This " +"file format is internal to Godot; it is created by importing other image " +"formats with the import system. [CompressedTexture2DArray] can use one of 4 " +"compresson methods:\n" +"- Lossless (WebP or PNG, uncompressed on the GPU)\n" +"- Lossy (WebP, uncompressed on the GPU)\n" +"- VRAM Compressed (compressed on the GPU)\n" +"- VRAM Uncompressed (uncompressed on the GPU)\n" +"- Basis Universal (compressed on the GPU. Lower file sizes than VRAM " +"Compressed, but slower to compress and lower quality than VRAM Compressed)\n" +"Only [b]VRAM Compressed[/b] actually reduces the memory usage on the GPU. " +"The [b]Lossless[/b] and [b]Lossy[/b] compression methods will reduce the " +"required storage on disk, but they will not reduce memory usage on the GPU " +"as the texture is sent to the GPU uncompressed.\n" +"Using [b]VRAM Compressed[/b] also improves loading times, as VRAM-compressed " +"textures are faster to load compared to textures using lossless or lossy " +"compression. VRAM compression can exhibit noticeable artifacts and is " +"intended to be used for 3D rendering, not 2D.\n" +"See [Texture2DArray] for a general description of texture arrays." +msgstr "" +"一种从 [code].ctexarray[/code] 文件加载的纹理数组。这种文件格式是 Godot 内部" +"使用的;它是通过导入系统导入其他图像格式创建的。[CompressedTexture2DArray] 可" +"以使用 4 种压缩方法中的一种:\n" +"- 无损(WebP 或 PNG,在 GPU 上不压缩)\n" +"- 有损(WebP,在 GPU 上不压缩)\n" +"- VRAM 压缩(在 GPU 上压缩)\n" +"- VRAM 未压缩(在 GPU 上不压缩)\n" +"- Basis Universal(在 GPU 上压缩。与 VRAM 压缩相比,文件更小,但压缩速度更" +"慢、质量更低)\n" +"只有 [b]VRAM 压缩[/b]实际上减少了 GPU 上的内存使用。[b]无损[/b]和[b]有损[/b]" +"压缩方法将减少磁盘上所需的存储空间,但它们不会减少 GPU 上的内存使用,因为纹理" +"未经压缩地被发送到 GPU。\n" +"使用 [b]VRAM 压缩[/b]还可以缩短加载时间,因为与使用无损或有损压缩的纹理相比," +"VRAM 压缩的纹理加载速度更快。VRAM 压缩会表现出明显的伪影,并且它旨在用于 3D " +"渲染,而不是 2D。\n" +"有关纹理数组的一般描述,请参阅 [Texture2DArray]。" + msgid "Texture with 3 dimensions, optionally compressed." msgstr "三维纹理,可选择压缩。" @@ -24741,8 +24380,16 @@ msgstr "该 [CompressedTexture3D] 的文件路径,指向 [code].ctex3d[/code] msgid "Base class for texture arrays that can optionally be compressed." msgstr "可压缩纹理数组的基类。" +msgid "" +"Base class for [CompressedTexture2DArray] and [CompressedTexture3D]. Cannot " +"be used directly, but contains all the functions necessary for accessing the " +"derived resource types. See also [TextureLayered]." +msgstr "" +"[CompressedTexture2DArray] 和 [CompressedTexture3D] 的基类。不能直接使用,但" +"包含了访问派生资源类型所需的所有函数。另见 [TextureLayered]。" + msgid "Loads the texture at [param path]." -msgstr "从路径 [param path] 加载纹理。" +msgstr "加载位于 [param path] 的纹理。" msgid "The path the texture should be loaded from." msgstr "加载纹理所使用的路径。" @@ -25869,14 +25516,6 @@ msgstr "" "该覆盖完整的来源文本 [param text],不应该存在重叠。BiDi 算法会对每个范围单独" "应用。" -msgid "" -"Marks an input event as handled. Once you accept an input event, it stops " -"propagating, even to nodes listening to [method Node._unhandled_input] or " -"[method Node._unhandled_key_input]." -msgstr "" -"将输入事件标记为已处理。一旦接受输入事件,传播就会停止,不会再传播到正在侦听 " -"[method Node._unhandled_input] 和 [method Node._unhandled_key_input] 的节点。" - msgid "" "Creates a local override for a theme [Color] with the specified [param " "name]. Local overrides always take precedence when fetching theme items for " @@ -26895,30 +26534,6 @@ msgstr "" "输入动作来更改按键。该节点必须为 [Control]。如果未设置此属性,则 Godot 会将焦" "点交给与该控件左侧最接近的 [Control]。" -msgid "" -"Tells Godot which node it should give focus to if the user presses the right " -"arrow on the keyboard or right on a gamepad by default. You can change the " -"key by editing the [member ProjectSettings.input/ui_right] input action. The " -"node must be a [Control]. If this property is not set, Godot will give focus " -"to the closest [Control] to the bottom of this one." -msgstr "" -"告诉 Godot 在默认情况下,当用户按下键盘上的向右箭头或游戏手柄上的向右键时,应" -"将焦点交给哪个节点。你可以通过编辑 [member ProjectSettings.input/ui_right] 的" -"输入动作来更改按键。该节点必须为 [Control]。如果未设置此属性,则 Godot 会将焦" -"点交给与该控件右侧最接近的 [Control]。" - -msgid "" -"Tells Godot which node it should give focus to if the user presses the top " -"arrow on the keyboard or top on a gamepad by default. You can change the key " -"by editing the [member ProjectSettings.input/ui_up] input action. The node " -"must be a [Control]. If this property is not set, Godot will give focus to " -"the closest [Control] to the bottom of this one." -msgstr "" -"告诉 Godot 在默认情况下,当用户按下键盘上的向上箭头或游戏手柄上的向上键时,应" -"将焦点交给哪个节点。你可以通过编辑 [member ProjectSettings.input/ui_up] 的输" -"入动作来更改按键。该节点必须为 [Control]。如果未设置此属性,则 Godot 会将焦点" -"交给与该控件顶部最接近的 [Control]。" - msgid "" "Tells Godot which node it should give focus to if the user presses [kbd]Tab[/" "kbd] on a keyboard by default. You can change the key by editing the [member " @@ -28759,157 +28374,6 @@ msgstr "粒子将以环形或圆柱的形式发射出来。" msgid "Access to advanced cryptographic functionalities." msgstr "访问高级加密功能。" -msgid "" -"The Crypto class allows you to access some more advanced cryptographic " -"functionalities in Godot.\n" -"For now, this includes generating cryptographically secure random bytes, RSA " -"keys and self-signed X509 certificates generation, asymmetric key encryption/" -"decryption, and signing/verification.\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"\n" -"var crypto = Crypto.new()\n" -"var key = CryptoKey.new()\n" -"var cert = X509Certificate.new()\n" -"\n" -"func _ready():\n" -" # Generate new RSA key.\n" -" key = crypto.generate_rsa(4096)\n" -" # Generate new self-signed certificate with the given key.\n" -" cert = crypto.generate_self_signed_certificate(key, \"CN=mydomain.com," -"O=My Game Company,C=IT\")\n" -" # Save key and certificate in the user folder.\n" -" key.save(\"user://generated.key\")\n" -" cert.save(\"user://generated.crt\")\n" -" # Encryption\n" -" var data = \"Some data\"\n" -" var encrypted = crypto.encrypt(key, data.to_utf8())\n" -" # Decryption\n" -" var decrypted = crypto.decrypt(key, encrypted)\n" -" # Signing\n" -" var signature = crypto.sign(HashingContext.HASH_SHA256, data." -"sha256_buffer(), key)\n" -" # Verifying\n" -" var verified = crypto.verify(HashingContext.HASH_SHA256, data." -"sha256_buffer(), signature, key)\n" -" # Checks\n" -" assert(verified)\n" -" assert(data.to_utf8() == decrypted)\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private Crypto _crypto = new Crypto();\n" -" private CryptoKey _key = new CryptoKey();\n" -" private X509Certificate _cert = new X509Certificate();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" // Generate new RSA key.\n" -" _key = _crypto.GenerateRsa(4096);\n" -" // Generate new self-signed certificate with the given key.\n" -" _cert = _crypto.GenerateSelfSignedCertificate(_key, \"CN=mydomain." -"com,O=My Game Company,C=IT\");\n" -" // Save key and certificate in the user folder.\n" -" _key.Save(\"user://generated.key\");\n" -" _cert.Save(\"user://generated.crt\");\n" -" // Encryption\n" -" string data = \"Some data\";\n" -" byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8());\n" -" // Decryption\n" -" byte[] decrypted = _crypto.Decrypt(_key, encrypted);\n" -" // Signing\n" -" byte[] signature = _crypto.Sign(HashingContext.HashType.Sha256, Data." -"Sha256Buffer(), _key);\n" -" // Verifying\n" -" bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data." -"Sha256Buffer(), signature, _key);\n" -" // Checks\n" -" Debug.Assert(verified);\n" -" Debug.Assert(data.ToUtf8() == decrypted);\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"Crypto 类允许您访问 Godot 中一些更高级的加密功能。\n" -"目前,这包括生成加密安全随机字节、RSA 密钥和自签名 X509 证书生成、非对称密钥" -"加密/解密、以及签名/验证。\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"\n" -"var crypto = Crypto.new()\n" -"var key = CryptoKey.new()\n" -"var cert = X509Certificate.new()\n" -"\n" -"func _ready():\n" -" # 生成新的 RSA 密钥。\n" -" key = crypto.generate_rsa(4096)\n" -" # 使用给定的密钥生成新的自签名证书。\n" -" cert = crypto.generate_self_signed_certificate(key, \"CN=mydomain.com," -"O=My Game Company,C=IT\")\n" -" # 将密钥和证书保存在用户文件夹中。\n" -" key.save(\"user://generated.key\")\n" -" cert.save(\"user://generated.crt\")\n" -" # 加密\n" -" var data = \"Some data\"\n" -" var encrypted = crypto.encrypt(key, data.to_utf8())\n" -" # 解密\n" -" var decrypted = crypto.decrypt(key, encrypted)\n" -" # 签名\n" -" var signature = crypto.sign(HashingContext.HASH_SHA256, data." -"sha256_buffer(), key)\n" -" # 验证\n" -" var verified = crypto.verify(HashingContext.HASH_SHA256, data." -"sha256_buffer(), signature, key)\n" -" # 校验\n" -" assert(verified)\n" -" assert(data.to_utf8() == decrypted)\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private Crypto _crypto = new Crypto();\n" -" private CryptoKey _key = new CryptoKey();\n" -" private X509Certificate _cert = new X509Certificate();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" // 生成新的 RSA 密钥。\n" -" _key = _crypto.GenerateRsa(4096);\n" -" // 使用给定的密钥生成新的自签名证书。\n" -" _cert = _crypto.GenerateSelfSignedCertificate(_key, \"CN=mydomain." -"com,O=My Game Company,C=IT\");\n" -" // 将密钥和证书保存在用户文件夹中。\n" -" _key.Save(\"user://generated.key\");\n" -" _cert.Save(\"user://generated.crt\");\n" -" // 加密\n" -" string data = \"Some data\";\n" -" byte[] encrypted = _crypto.Encrypt(_key, data.ToUtf8());\n" -" // 解密\n" -" byte[] decrypted = _crypto.Decrypt(_key, encrypted);\n" -" // 签名\n" -" byte[] signature = _crypto.Sign(HashingContext.HashType.Sha256, Data." -"Sha256Buffer(), _key);\n" -" // 验证\n" -" bool verified = _crypto.Verify(HashingContext.HashType.Sha256, Data." -"Sha256Buffer(), signature, _key);\n" -" // 校验\n" -" Debug.Assert(verified);\n" -" Debug.Assert(data.ToUtf8() == decrypted);\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "" "Compares two [PackedByteArray]s for equality without leaking timing " "information in order to prevent timing attacks.\n" @@ -29539,14 +29003,6 @@ msgstr "" "在此形状上执行的操作。对于第一个 CSG 子节点,将忽略此操作,因为操作是在此节点" "与该节点父级的上一个子级之间进行的。" -msgid "" -"Snap makes the mesh snap to a given distance so that the faces of two meshes " -"can be perfectly aligned. A lower value results in greater precision but may " -"be harder to adjust." -msgstr "" -"捕捉使网格捕捉到给定的距离,以便两个网格的面可以完美对齐。较低的值会导致较高" -"的精度,但可能难以调整。" - msgid "" "Adds a collision shape to the physics engine for our CSG shape. This will " "always act like a static body. Note that the collision shape is still active " @@ -30202,19 +29658,6 @@ msgstr "" "如果曲线没有向上向量,则该函数将向控制台发送一个错误,并返回 [code](0, 1, 0)" "[/code]。" -msgid "" -"Similar with [code]interpolate_baked()[/code]. The the return value is " -"[code]Transform3D[/code], with [code]origin[/code] as point position, " -"[code]basis.x[/code] as sideway vector, [code]basis.y[/code] as up vector, " -"[code]basis.z[/code] as forward vector. When the curve length is 0, there is " -"no reasonable way to calculate the rotation, all vectors aligned with global " -"space axes." -msgstr "" -"与 [code]interpolate_baked()[/code] 类似。返回值为 [code]Transform3D[/code]," -"其中 [code]origin[/code] 作为点位置,[code]basis.x[/code] 作为横向向量," -"[code]basis.y[/code] 作为向上向量,[code]basis.z[/code] 作为前向向量。当曲线" -"长度为 0 时,将没有合理的方法来计算旋转,所有向量都会与全局空间轴对齐。" - msgid "" "Sets the tilt angle in radians for the point [param idx]. If the index is " "out of bounds, the function sends an error to the console.\n" @@ -30265,13 +29708,6 @@ msgstr "" msgid "The [Curve] that is rendered onto the texture." msgstr "渲染到纹理上的 [Curve]。" -msgid "" -"The format the texture should be generated with. When passing a CurveTexture " -"as a input to a [Shader], this may need to be adjusted." -msgstr "" -"生成纹理时应使用的格式。当将 CurveTexture 作为输入传递给 [Shader] 时,可能需" -"要调整。" - msgid "" "The width of the texture (in pixels). Higher values make it possible to " "represent high-frequency data better (such as sudden direction changes), at " @@ -30763,29 +30199,6 @@ msgstr "" "texture_albedo],并将 [member albedo_mix] 设置为 [code]0.0[/code]。反照率纹理" "的 Alpha 通道将用于确定应在何处覆盖底层表面的法线贴图(及其强度)。" -msgid "" -"[Texture2D] storing ambient occlusion, roughness, and metallic for the " -"decal. Use this to add extra detail to decals.\n" -"[b]Note:[/b] Unlike [BaseMaterial3D] whose filter mode can be adjusted on a " -"per-material basis, the filter mode for [Decal] textures is set globally " -"with [member ProjectSettings.rendering/textures/decals/filter].\n" -"[b]Note:[/b] Setting this texture alone will not result in a visible decal, " -"as [member texture_albedo] must also be set. To create a ORM-only decal, " -"load an albedo texture into [member texture_albedo] and set [member " -"albedo_mix] to [code]0.0[/code]. The albedo texture's alpha channel will be " -"used to determine where the underlying surface's ORM map should be " -"overridden (and its intensity)." -msgstr "" -"存有贴花的环境光遮蔽、粗糙度、金属性的 [Texture2D]。可用于为贴花添加额外的细" -"节。\n" -"[b]注意:[/b][BaseMaterial3D] 的过滤模式可以对每个材质进行调整,而 [Decal] 纹" -"理的过滤模式是通过 [member ProjectSettings.rendering/textures/decals/filter] " -"全局设置的。\n" -"[b]注意:[/b]单独设置此纹理时贴花不可见,因为还必须设置 [member " -"texture_albedo]。要创建仅包含 ORM 的贴花,请将反照率纹理加载到 [member " -"texture_albedo],并将 [member albedo_mix] 设置为 [code]0.0[/code]。反照率纹理" -"的 Alpha 通道将用于确定应在何处覆盖底层表面的 ORM 贴图(及其强度)。" - msgid "" "Sets the curve over which the decal will fade as the surface gets further " "from the center of the [AABB]. Only positive values are valid (negative " @@ -31606,14 +31019,6 @@ msgstr "" "在 Linux 上,返回作为参数传递的挂载卷或 GTK 3 书签的路径。\n" "在其他平台上,或者当请求的驱动器不存在时,该方法会返回空的 String。" -msgid "" -"Returns a [PackedStringArray] containing filenames of the directory " -"contents, excluding directories. The array is sorted alphabetically.\n" -"Affected by [member include_hidden]." -msgstr "" -"返回该目录内容的文件名 [PackedStringArray],不含目录。该数组按字母排序。\n" -"受 [member include_hidden] 的影响。" - msgid "" "Returns a [PackedStringArray] containing filenames of the directory " "contents, excluding directories, at the given [param path]. The array is " @@ -32590,22 +31995,6 @@ msgstr "" "返回索引为 [param idx] 的菜单项的快捷键回调。\n" "[b]注意:[/b]该方法在 macOS 上实现。" -msgid "" -"Returns number of states of an multistate item. See [method " -"global_menu_add_multistate_item] for details.\n" -"[b]Note:[/b] This method is implemented on macOS." -msgstr "" -"返回多状态项的状态数。详情见 [method global_menu_add_multistate_item]。\n" -"[b]注意:[/b]该方法在 macOS 上实现。" - -msgid "" -"Returns the state of an multistate item. See [method " -"global_menu_add_multistate_item] for details.\n" -"[b]Note:[/b] This method is implemented on macOS." -msgstr "" -"返回多状态项的状态。详情见 [method global_menu_add_multistate_item]。\n" -"[b]注意:[/b]该方法在 macOS 上实现。" - msgid "" "Returns the submenu ID of the item at index [param idx]. See [method " "global_menu_add_submenu_item] for more info on how to add a submenu.\n" @@ -32768,14 +32157,6 @@ msgstr "" "Callable 的参数是创建菜单项时传给 [code]tag[/code] 参数的值。\n" "[b]注意:[/b]该方法在 macOS 上实现。" -msgid "" -"Sets number of state of an multistate item. See [method " -"global_menu_add_multistate_item] for details.\n" -"[b]Note:[/b] This method is implemented on macOS." -msgstr "" -"设置多状态项的状态数。详情见 [method global_menu_add_multistate_item]。\n" -"[b]注意:[/b]该方法在 macOS 上实现。" - msgid "" "Sets the type of the item at the specified index [param idx] to radio " "button. If [code]false[/code], sets the type of the item to plain text.\n" @@ -32788,14 +32169,6 @@ msgstr "" "[b]注意:[/b]仅为装饰作用;必须自行为单选组添加选中、取消选中的逻辑。\n" "[b]注意:[/b]该方法在 macOS 上实现。" -msgid "" -"Sets the state of an multistate item. See [method " -"global_menu_add_multistate_item] for details.\n" -"[b]Note:[/b] This method is implemented on macOS." -msgstr "" -"设置多状态项的状态。详情见 [method global_menu_add_multistate_item]。\n" -"[b]注意:[/b]该方法在 macOS 上实现。" - msgid "" "Sets the submenu of the item at index [param idx]. The submenu is the ID of " "a global menu root that would be shown when the item is clicked.\n" @@ -32937,9 +32310,6 @@ msgstr "" msgid "Returns the current mouse mode. See also [method mouse_set_mode]." msgstr "返回当前的鼠标模式。另见 [method mouse_set_mode]。" -msgid "Returns the mouse cursor's current position." -msgstr "返回鼠标光标当前位置。" - msgid "Sets the current mouse mode. See also [method mouse_get_mode]." msgstr "设置当前的鼠标模式。另见 [method mouse_get_mode]。" @@ -33990,9 +33360,6 @@ msgstr "" msgid "Default landscape orientation." msgstr "默认横屏朝向。" -msgid "Default portrait orienstation." -msgstr "默认竖屏朝向。" - msgid "Reverse landscape orientation (upside down)." msgstr "倒横屏朝向(上下颠倒)。" @@ -34242,14 +33609,6 @@ msgstr "" "确保您的项目在启用全屏模式时支持[url=$DOCS_URL/tutorials/rendering/" "multiple_resolutions.html]多个分辨率[/url]。" -msgid "" -"The window can't be resizing by dragging its resize grip. It's still " -"possible to resize the window using [method window_set_size]. This flag is " -"ignored for full screen windows." -msgstr "" -"该窗口不能通过拖动其调整大小的手柄来调整大小。但仍然可以使用 [method " -"window_set_size] 调整窗口大小。全屏窗口会忽略该标志。" - msgid "" "The window do not have native title bar and other decorations. This flag is " "ignored for full-screen windows." @@ -34279,19 +33638,6 @@ msgid "" "mouse clicks." msgstr "该窗口无法获得焦点。无聚焦窗口会忽略除鼠标点击外的所有输入。" -msgid "" -"Window is part of menu or [OptionButton] dropdown. This flag can't be " -"changed when the window is visible. An active popup window will exclusively " -"receive all input, without stealing focus from its parent. Popup windows are " -"automatically closed when uses click outside it, or when an application is " -"switched. Popup window must have [code]transient parent[/code] set (see " -"[method window_set_transient])." -msgstr "" -"窗口是菜单或 [OptionButton] 下拉菜单的一部分。当窗口可见时,不能更改该标志。" -"一个活动的弹出窗口将仅仅接收所有输入,而不会从其父窗口窃取焦点。当在其外部点" -"击或切换应用程序时,弹出窗口将会自动关闭。 弹出窗口必须已经设置了 " -"[code]transient parent[/code](参见 [method window_set_transient])。" - msgid "" "Window content is expanded to the full size of the window. Unlike borderless " "window, the frame is left intact and can be used to resize the window, title " @@ -34484,316 +33830,6 @@ msgstr "发言到达单词或句子的边界。" msgid "Helper class to implement a DTLS server." msgstr "实现 DTLS 服务器的辅助类。" -msgid "" -"This class is used to store the state of a DTLS server. Upon [method setup] " -"it converts connected [PacketPeerUDP] to [PacketPeerDTLS] accepting them via " -"[method take_connection] as DTLS clients. Under the hood, this class is used " -"to store the DTLS state and cookies of the server. The reason of why the " -"state and cookies are needed is outside of the scope of this documentation.\n" -"Below a small example of how to use it:\n" -"[codeblocks]\n" -"[gdscript]\n" -"# server_node.gd\n" -"extends Node\n" -"\n" -"var dtls := DTLSServer.new()\n" -"var server := UDPServer.new()\n" -"var peers = []\n" -"\n" -"func _ready():\n" -" server.listen(4242)\n" -" var key = load(\"key.key\") # Your private key.\n" -" var cert = load(\"cert.crt\") # Your X509 certificate.\n" -" dtls.setup(key, cert)\n" -"\n" -"func _process(delta):\n" -" while server.is_connection_available():\n" -" var peer: PacketPeerUDP = server.take_connection()\n" -" var dtls_peer: PacketPeerDTLS = dtls.take_connection(peer)\n" -" if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING:\n" -" continue # It is normal that 50% of the connections fails due to " -"cookie exchange.\n" -" print(\"Peer connected!\")\n" -" peers.append(dtls_peer)\n" -"\n" -" for p in peers:\n" -" p.poll() # Must poll to update the state.\n" -" if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED:\n" -" while p.get_available_packet_count() > 0:\n" -" print(\"Received message from client: %s\" % p.get_packet()." -"get_string_from_utf8())\n" -" p.put_packet(\"Hello DTLS client\".to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"// ServerNode.cs\n" -"using Godot;\n" -"\n" -"public partial class ServerNode : Node\n" -"{\n" -" private DtlsServer _dtls = new DtlsServer();\n" -" private UdpServer _server = new UdpServer();\n" -" private Godot.Collections.Array _peers = new Godot." -"Collections.Array();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _server.Listen(4242);\n" -" var key = GD.Load(\"key.key\"); // Your private key.\n" -" var cert = GD.Load(\"cert.crt\"); // Your X509 " -"certificate.\n" -" _dtls.Setup(key, cert);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" while (Server.IsConnectionAvailable())\n" -" {\n" -" PacketPeerUDP peer = _server.TakeConnection();\n" -" PacketPeerDTLS dtlsPeer = _dtls.TakeConnection(peer);\n" -" if (dtlsPeer.GetStatus() != PacketPeerDtls.Status.Handshaking)\n" -" {\n" -" continue; // It is normal that 50% of the connections fails " -"due to cookie exchange.\n" -" }\n" -" GD.Print(\"Peer connected!\");\n" -" _peers.Add(dtlsPeer);\n" -" }\n" -"\n" -" foreach (var p in _peers)\n" -" {\n" -" p.Poll(); // Must poll to update the state.\n" -" if (p.GetStatus() == PacketPeerDtls.Status.Connected)\n" -" {\n" -" while (p.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"Received Message From Client: {p.GetPacket()." -"GetStringFromUtf8()}\");\n" -" p.PutPacket(\"Hello DTLS Client\".ToUtf8());\n" -" }\n" -" }\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[codeblocks]\n" -"[gdscript]\n" -"# client_node.gd\n" -"extends Node\n" -"\n" -"var dtls := PacketPeerDTLS.new()\n" -"var udp := PacketPeerUDP.new()\n" -"var connected = false\n" -"\n" -"func _ready():\n" -" udp.connect_to_host(\"127.0.0.1\", 4242)\n" -" dtls.connect_to_peer(udp, false) # Use true in production for " -"certificate validation!\n" -"\n" -"func _process(delta):\n" -" dtls.poll()\n" -" if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED:\n" -" if !connected:\n" -" # Try to contact server\n" -" dtls.put_packet(\"The answer is... 42!\".to_utf8())\n" -" while dtls.get_available_packet_count() > 0:\n" -" print(\"Connected: %s\" % dtls.get_packet()." -"get_string_from_utf8())\n" -" connected = true\n" -"[/gdscript]\n" -"[csharp]\n" -"// ClientNode.cs\n" -"using Godot;\n" -"using System.Text;\n" -"\n" -"public partial class ClientNode : Node\n" -"{\n" -" private PacketPeerDtls _dtls = new PacketPeerDtls();\n" -" private PacketPeerUdp _udp = new PacketPeerUdp();\n" -" private bool _connected = false;\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _udp.ConnectToHost(\"127.0.0.1\", 4242);\n" -" _dtls.ConnectToPeer(_udp, validateCerts: false); // Use true in " -"production for certificate validation!\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" _dtls.Poll();\n" -" if (_dtls.GetStatus() == PacketPeerDtls.Status.Connected)\n" -" {\n" -" if (!_connected)\n" -" {\n" -" // Try to contact server\n" -" _dtls.PutPacket(\"The Answer Is..42!\".ToUtf8());\n" -" }\n" -" while (_dtls.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"Connected: {_dtls.GetPacket()." -"GetStringFromUtf8()}\");\n" -" _connected = true;\n" -" }\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"该类用于存储 DTLS 服务器的状态。在 [method setup] 之后,它将连接的 " -"[PacketPeerUDP] 转换为 [PacketPeerDTLS],通过 [method take_connection] 接受它" -"们作为 DTLS 客户端。在底层,这个类用于存储服务器的 DTLS 状态和 cookie。为什么" -"需要状态和 cookie 的原因不在本文档的范围内。\n" -"下面是一个如何使用它的小例子:\n" -"[codeblocks]\n" -"[gdscript]\n" -"# server_node.gd\n" -"extends Node\n" -"\n" -"var dtls := DTLSServer.new()\n" -"var server := UDPServer.new()\n" -"var peers = []\n" -"\n" -"func _ready():\n" -" server.listen(4242)\n" -" var key = load(\"key.key\") # 你的私钥。\n" -" var cert = load(\"cert.crt\") # 你的 X509 证书。\n" -" dtls.setup(key, cert)\n" -"\n" -"func _process(delta):\n" -" while server.is_connection_available():\n" -" var peer: PacketPeerUDP = server.take_connection()\n" -" var dtls_peer: PacketPeerDTLS = dtls.take_connection(peer)\n" -" if dtls_peer.get_status() != PacketPeerDTLS.STATUS_HANDSHAKING:\n" -" continue # 由于 cookie 交换,50% 的连接会失败,这是正常现象。\n" -" print(\"对等体已连接!\")\n" -" peers.append(dtls_peer)\n" -"\n" -" for p in peers:\n" -" p.poll() # 必须轮询以更新状态。\n" -" if p.get_status() == PacketPeerDTLS.STATUS_CONNECTED:\n" -" while p.get_available_packet_count() > 0:\n" -" print(\"从客户端收到消息:%s\" % p.get_packet()." -"get_string_from_utf8())\n" -" p.put_packet(\"你好 DTLS 客户端\".to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"// ServerNode.cs\n" -"using Godot;\n" -"\n" -"public partial class ServerNode : Node\n" -"{\n" -" private DtlsServer _dtls = new DtlsServer();\n" -" private UdpServer _server = new UdpServer();\n" -" private Godot.Collections.Array _peers = new Godot." -"Collections.Array();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _server.Listen(4242);\n" -" var key = GD.Load(\"key.key\"); // 你的私钥。\n" -" var cert = GD.Load(\"cert.crt\"); // 你的 X509 证" -"书。\n" -" _dtls.Setup(key, cert);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" while (Server.IsConnectionAvailable())\n" -" {\n" -" PacketPeerUDP peer = _server.TakeConnection();\n" -" PacketPeerDTLS dtlsPeer = _dtls.TakeConnection(peer);\n" -" if (dtlsPeer.GetStatus() != PacketPeerDtls.Status.Handshaking)\n" -" {\n" -" continue; // 由于 cookie 交换,50% 的连接会失败,这是正常现" -"象。\n" -" }\n" -" GD.Print(\"对等体已连接!\");\n" -" _peers.Add(dtlsPeer);\n" -" }\n" -"\n" -" foreach (var p in _peers)\n" -" {\n" -" p.Poll(); // 必须轮询以更新状态。\n" -" if (p.GetStatus() == PacketPeerDtls.Status.Connected)\n" -" {\n" -" while (p.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"从客户端收到消息:{p.GetPacket()." -"GetStringFromUtf8()}\");\n" -" p.PutPacket(\"你好 DTLS 客户端\".ToUtf8());\n" -" }\n" -" }\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[codeblocks]\n" -"[gdscript]\n" -"# client_node.gd\n" -"extends Node\n" -"\n" -"var dtls := PacketPeerDTLS.new()\n" -"var udp := PacketPeerUDP.new()\n" -"var connected = false\n" -"\n" -"func _ready():\n" -" udp.connect_to_host(\"127.0.0.1\", 4242)\n" -" dtls.connect_to_peer(udp, false) # 生产环境中请使用 true 进行证书校验!\n" -"\n" -"func _process(delta):\n" -" dtls.poll()\n" -" if dtls.get_status() == PacketPeerDTLS.STATUS_CONNECTED:\n" -" if !connected:\n" -" # 尝试联系服务器\n" -" dtls.put_packet(\"回应是… 42!\".to_utf8())\n" -" while dtls.get_available_packet_count() > 0:\n" -" print(\"已连接:%s\" % dtls.get_packet()." -"get_string_from_utf8())\n" -" connected = true\n" -"[/gdscript]\n" -"[csharp]\n" -"// ClientNode.cs\n" -"using Godot;\n" -"using System.Text;\n" -"\n" -"public partial class ClientNode : Node\n" -"{\n" -" private PacketPeerDtls _dtls = new PacketPeerDtls();\n" -" private PacketPeerUdp _udp = new PacketPeerUdp();\n" -" private bool _connected = false;\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _udp.ConnectToHost(\"127.0.0.1\", 4242);\n" -" _dtls.ConnectToPeer(_udp, validateCerts: false); // 生产环境中请使用 " -"true 进行证书校验!\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" _dtls.Poll();\n" -" if (_dtls.GetStatus() == PacketPeerDtls.Status.Connected)\n" -" {\n" -" if (!_connected)\n" -" {\n" -" // 尝试联系服务器\n" -" _dtls.PutPacket(\"回应是… 42!\".ToUtf8());\n" -" }\n" -" while (_dtls.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"已连接:{_dtls.GetPacket()." -"GetStringFromUtf8()}\");\n" -" _connected = true;\n" -" }\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "" "Setup the DTLS server to use the given [param server_options]. See [method " "TLSOptions.server]." @@ -39929,12 +38965,6 @@ msgstr "" msgid "If [code]true[/code], render the grid on an XZ plane." msgstr "如果为 [code]true[/code],则在 XZ 平面上渲染栅格。" -msgid "" -"If [code]true[/code], render the grid on an YZ plane. This can be useful for " -"3D side-scrolling games." -msgstr "" -"如果为 [code]true[/code],则在 YZ 平面上渲染栅格。可用于 3D 横向卷轴游戏。" - msgid "" "If [code]true[/code], enables 3-button mouse emulation mode. This is useful " "on laptops when using a trackpad.\n" @@ -41012,14 +40042,6 @@ msgstr "" "如果为 [code]true[/code],则使用 [member text_editor/theme/highlighting/" "current_line_color] 为文本光标当前所在行的背景着色。" -msgid "" -"The shape of the caret to use in the script editor. [b]Line[/b] displays a " -"vertical line to the left of the current character, whereas [b]Block[/b] " -"displays a outline over the current character." -msgstr "" -"在脚本编辑器中使用的文本光标的形状。[b]Line[/b] 会在当前字符的左侧显示一条垂" -"直线,而 [b]Block[/b] 会在当前字符上方显示一个轮廓。" - msgid "" "The column at which to display a subtle line as a line length guideline for " "scripts. This should generally be greater than [member text_editor/" @@ -43646,15 +42668,6 @@ msgstr "" "(默认情况下)之前,[i]不[/i]报告错误。\n" "[b]注意:[/b]从编辑器运行项目时,该属性不会影响编辑器的“错误”选项卡。" -msgid "" -"Controls how fast or slow the in-game clock ticks versus the real life one. " -"It defaults to 1.0. A value of 2.0 means the game moves twice as fast as " -"real life, whilst a value of 0.5 means the game moves at half the regular " -"speed." -msgstr "" -"控制游戏中的时钟与现实生活中的时钟的快慢。默认值为 1.0。值为 2.0 意味着游戏的" -"移动速度是现实生活的两倍,而值为 0.5 意味着游戏的移动速度是常规速度的一半。" - msgid "Exposes the internal debugger." msgstr "暴露内部调试器。" @@ -45955,18 +44968,6 @@ msgstr "" msgid "Invalidate and update the current dialog content list." msgstr "使当前对话框内容列表无效并更新。" -msgid "" -"The file system access scope. See enum [code]Access[/code] constants.\n" -"[b]Warning:[/b] Currently, in sandboxed environments such as Web builds or " -"sandboxed macOS apps, FileDialog cannot access the host file system. See " -"[url=https://github.com/godotengine/godot-proposals/issues/1123]godot-" -"proposals#1123[/url]." -msgstr "" -"文件系统的访问范围。见枚举 [code]Access[/code] 常量。\n" -"[b]警告:[/b]目前,在 Web 构建或沙盒 macOS 应用程序等沙盒环境中,FileDialog " -"无法访问主机文件系统。参见 [url=https://github.com/godotengine/godot-" -"proposals/issues/1123]godot-proposals#1123[/url]。" - msgid "The current working directory of the file dialog." msgstr "文件对话框的当前工作目录。" @@ -45976,15 +44977,6 @@ msgstr "文件对话框的当前选定的文件。" msgid "The currently selected file path of the file dialog." msgstr "当前选择的文件对话框的文件路径。" -msgid "" -"If [code]true[/code], changing the [code]Mode[/code] property will set the " -"window title accordingly (e.g. setting mode to [constant " -"FILE_MODE_OPEN_FILE] will change the window title to \"Open a File\")." -msgstr "" -"如果为 [code]true[/code],更改 [code]Mode[/code] 属性,将相应地设置窗口标题" -"(例如,将模式设置为 [constant FILE_MODE_OPEN_FILE],会将窗口标题更改为“打开" -"文件”)。" - msgid "" "If non-empty, the given sub-folder will be \"root\" of this [FileDialog], i." "e. user won't be able to go to its parent directory." @@ -46889,73 +45881,6 @@ msgid "" "bitmap font." msgstr "字体源数据和预渲染字形的缓存,从动态字体或位图字体导入。" -msgid "" -"[FontFile] contains a set of glyphs to represent Unicode characters imported " -"from a font file, as well as a cache of rasterized glyphs, and a set of " -"fallback [Font]s to use.\n" -"Use [FontVariation] to access specific OpenType variation of the font, " -"create simulated bold / slanted version, and draw lines of text.\n" -"For more complex text processing, use [FontVariation] in conjunction with " -"[TextLine] or [TextParagraph].\n" -"Supported font formats:\n" -"- Dynamic font importer: TrueType (.ttf), TrueType collection (.ttc), " -"OpenType (.otf), OpenType collection (.otc), WOFF (.woff), WOFF2 (.woff2), " -"Type 1 (.pfb, .pfm).\n" -"- Bitmap font importer: AngelCode BMFont (.fnt, .font), text and binary " -"(version 3) format variants.\n" -"- Monospace image font importer: All supported image formats.\n" -"[b]Note:[/b] A character is a symbol that represents an item (letter, digit " -"etc.) in an abstract way.\n" -"[b]Note:[/b] A glyph is a bitmap or shape used to draw a one or more " -"characters in a context-dependent manner. Glyph indices are bound to the " -"specific font data source.\n" -"[b]Note:[/b] If a none of the font data sources contain glyphs for a " -"character used in a string, the character in question will be replaced with " -"a box displaying its hexadecimal code.\n" -"[codeblocks]\n" -"[gdscript]\n" -"var f = load(\"res://BarlowCondensed-Bold.ttf\")\n" -"$Label.add_theme_font_override(\"font\", f)\n" -"$Label.add_theme_font_size_override(\"font_size\", 64)\n" -"[/gdscript]\n" -"[csharp]\n" -"var f = ResourceLoader.Load(\"res://BarlowCondensed-Bold.ttf\");\n" -"GetNode(\"Label\").AddThemeFontOverride(\"font\", f);\n" -"GetNode(\"Label\").AddThemeFontSizeOverride(\"font_size\", 64);\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"[FontFile] 包含一组代表从字体文件导入的 Unicode 字符的字形,以及一个光栅化字" -"形的缓存,还有一组要使用的后备 [Font]。\n" -"使用 [FontVariation] 访问字体的特定 OpenType 变体,创建模拟的粗体/斜体版本," -"并绘制文本行。\n" -"对于更复杂的文本处理,请将 [FontVariation] 与 [TextLine] 或 [TextParagraph] " -"结合使用。\n" -"支持的字体格式:\n" -"- 动态字体导入器:TrueType(.ttf)、TrueType 集合(.ttc)、OpenType(.otf)、" -"OpenType 集合(.otc)、WOFF(.woff)、WOFF2(.woff2)、Type 1(.pfb,." -"pfm)。\n" -"- 位图字体导入器:AngelCode BMFont(.fnt,.font)、文本和二进制(版本 3)格式" -"变体。\n" -"- 等宽图像字体导入器:所有支持的图像格式。\n" -"[b]注意:[/b]字符是以抽象方式表示一个项目(字母、数字等)的符号。\n" -"[b]注意:[/b]字形是一种位图或形状,用于以上下文相关的方式绘制一个或多个字符。" -"字形索引被绑定到特定的字体数据源。\n" -"[b]注意:[/b]如果没有字体数据源包含字符串中使用的字符的字形,则该字符将被替换" -"为显示其十六进制代码的方框。\n" -"[codeblocks]\n" -"[gdscript]\n" -"var f = load(\"res://BarlowCondensed-Bold.ttf\")\n" -"$Label.add_theme_font_override(\"font\", f)\n" -"$Label.add_theme_font_size_override(\"font_size\", 64)\n" -"[/gdscript]\n" -"[csharp]\n" -"var f = ResourceLoader.Load(\"res://BarlowCondensed-Bold.ttf\");\n" -"GetNode(\"Label\").AddThemeFontOverride(\"font\", f);\n" -"GetNode(\"Label\").AddThemeFontSizeOverride(\"font_size\", 64);\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "Removes all font cache entries." msgstr "移除所有字体缓存条目。" @@ -48426,18 +47351,6 @@ msgid "" "possible values." msgstr "选择的阴影投射标志。可能的取值见 [enum ShadowCastingSetting]。" -msgid "" -"Overrides the bounding box of this node with a custom one. This can be used " -"to avoid the expensive [AABB] recalculation that happens when a skeleton is " -"used with a [MeshInstance3D] or to have fine control over the " -"[MeshInstance3D]'s bounding box. To remove this, set value to an [AABB] with " -"all fields set to zero." -msgstr "" -"用一个自定义的边框来覆盖这个节点的边框。这可以用来避免当骨架与 " -"[MeshInstance3D] 一起使用时,昂贵的 [AABB] 重新计算;或者可对 " -"[MeshInstance3D] 的边框进行精细控制。要移除它,请将值设置为一个所有字段被设置" -"为零的 [AABB]。" - msgid "" "The extra distance added to the GeometryInstance3D's bounding box ([AABB]) " "to increase its cull box." @@ -48472,13 +47385,6 @@ msgstr "" "[b]注意:[/b]灯光的烘焙模式,也会影响全局照明渲染。请参阅 [member Light3D." "light_bake_mode]。" -msgid "" -"If [code]true[/code], disables occlusion culling for this instance. Useful " -"for gizmos that must be rendered even when occlusion culling is in use." -msgstr "" -"如果为 [code]true[/code],则禁用该实例的遮挡剔除。对于即使在使用遮挡剔除时也" -"必须渲染的小工具很有用。" - msgid "" "Changes how quickly the mesh transitions to a lower level of detail. A value " "of 0 will force the mesh to its lowest level of detail, a value of 1 will " @@ -48541,25 +47447,6 @@ msgstr "" "GeometryInstance3D 可见的起始距离,同时考虑 [member " "visibility_range_begin_margin]。默认值 0 用于禁用范围检查。" -msgid "" -"Margin for the [member visibility_range_begin] threshold. The " -"GeometryInstance3D will only change its visibility state when it goes over " -"or under the [member visibility_range_begin] threshold by this amount.\n" -"If [member visibility_range_fade_mode] is [constant " -"VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If " -"[member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] " -"or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade " -"transition distance and must be set to a value greater than [code]0.0[/code] " -"for the effect to be noticeable." -msgstr "" -"[member visibility_range_begin] 阈值的边距。GeometryInstance3D 只有在超出或低" -"于 [member visibility_range_begin] 阈值达到这个量时,才会更改其可见性状态。\n" -"如果 [member visibility_range_fade_mode] 为 [constant " -"VISIBILITY_RANGE_FADE_DISABLED],这将作为滞后距离。如果 [member " -"visibility_range_fade_mode] 为 [constant VISIBILITY_RANGE_FADE_SELF] 或 " -"[constant VISIBILITY_RANGE_FADE_DEPENDENCIES],这将作为淡入淡出过渡距离,并且" -"必须被设置为大于 [code]0.0[/code] 的值,才能使效果显眼。" - msgid "" "Distance from which the GeometryInstance3D will be hidden, taking [member " "visibility_range_end_margin] into account as well. The default value of 0 is " @@ -48568,25 +47455,6 @@ msgstr "" "GeometryInstance3D 将被隐藏的距离,同时考虑 [member " "visibility_range_end_margin]。默认值 0 用于禁用范围检查。" -msgid "" -"Margin for the [member visibility_range_end] threshold. The " -"GeometryInstance3D will only change its visibility state when it goes over " -"or under the [member visibility_range_end] threshold by this amount.\n" -"If [member visibility_range_fade_mode] is [constant " -"VISIBILITY_RANGE_FADE_DISABLED], this acts as an hysteresis distance. If " -"[member visibility_range_fade_mode] is [constant VISIBILITY_RANGE_FADE_SELF] " -"or [constant VISIBILITY_RANGE_FADE_DEPENDENCIES], this acts as a fade " -"transition distance and must be set to a value greater than [code]0.0[/code] " -"for the effect to be noticeable." -msgstr "" -"[member visibility_range_end] 阈值的边距。GeometryInstance3D 只有在超出或低" -"于 [member visibility_range_end] 阈值达到这个量时,才会更改其可见性状态。\n" -"如果 [member visibility_range_fade_mode] 为 [constant " -"VISIBILITY_RANGE_FADE_DISABLED],这将作为滞后距离。如果 [member " -"visibility_range_fade_mode] 为 [constant VISIBILITY_RANGE_FADE_SELF] 或 " -"[constant VISIBILITY_RANGE_FADE_DEPENDENCIES],这将作为淡入淡出过渡距离,并且" -"必须被设置为大于 [code]0.0[/code] 的值,才能使效果显眼。" - msgid "" "Controls which instances will be faded when approaching the limits of the " "visibility range. See [enum VisibilityRangeFadeMode] for possible values." @@ -50168,16 +49036,6 @@ msgstr "生成 8192×8192 的高度图。适用于具有远景粒子的巨大场 msgid "Represents the size of the [enum Resolution] enum." msgstr "代表 [enum Resolution] 枚举的大小。" -msgid "" -"Only update the heightmap when the [GPUParticlesCollisionHeightField3D] node " -"is moved, or when the camera moves if [member follow_camera_enabled] is " -"[code]true[/code]. An update can be forced by slightly moving the " -"[GPUParticlesCollisionHeightField3D] in any direction." -msgstr "" -"仅在 [GPUParticlesCollisionHeightField3D] 节点移动时,或者当 [member " -"follow_camera_enabled] 为 [code]true[/code] 且相机移动时,更新高度图。可以通" -"过向任意方向稍微移动 [GPUParticlesCollisionHeightField3D] 来强制更新。" - msgid "" "Update the heightmap every frame. This has a significant performance cost. " "This update should only be used when geometry that particles can collide " @@ -50374,12 +49232,6 @@ msgstr "返回渐变中的颜色数。" msgid "Removes the color at the index [param point]." msgstr "移除索引 [param point] 处的颜色。" -msgid "Reverses/mirrors the gradient." -msgstr "将渐变进行反转/镜像。" - -msgid "Returns the interpolated color specified by [code]offset[/code]." -msgstr "返回由偏移 [code]offset[/code] 指定的插值颜色。" - msgid "Sets the color of the gradient color at index [param point]." msgstr "设置渐变色在索引 [param point] 处的颜色。" @@ -51924,102 +50776,6 @@ msgstr "两个物体向不同方向移动时被拉回到一起的速度。" msgid "Used to create an HMAC for a message using a key." msgstr "用来为一个使用密钥的信息创建 HMAC。" -msgid "" -"The HMACContext class is useful for advanced HMAC use cases, such as " -"streaming the message as it supports creating the message over time rather " -"than providing it all at once.\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"var ctx = HMACContext.new()\n" -"\n" -"func _ready():\n" -" var key = \"supersecret\".to_utf8()\n" -" var err = ctx.start(HashingContext.HASH_SHA256, key)\n" -" assert(err == OK)\n" -" var msg1 = \"this is \".to_utf8()\n" -" var msg2 = \"super duper secret\".to_utf8()\n" -" err = ctx.update(msg1)\n" -" assert(err == OK)\n" -" err = ctx.update(msg2)\n" -" assert(err == OK)\n" -" var hmac = ctx.finish()\n" -" print(hmac.hex_encode())\n" -"\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private HmacContext _ctx = new HmacContext();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" byte[] key = \"supersecret\".ToUtf8();\n" -" Error err = _ctx.Start(HashingContext.HashType.Sha256, key);\n" -" Debug.Assert(err == Error.Ok);\n" -" byte[] msg1 = \"this is \".ToUtf8();\n" -" byte[] msg2 = \"super duper secret\".ToUtf8();\n" -" err = _ctx.Update(msg1);\n" -" Debug.Assert(err == Error.Ok);\n" -" err = _ctx.Update(msg2);\n" -" Debug.Assert(err == Error.Ok);\n" -" byte[] hmac = _ctx.Finish();\n" -" GD.Print(hmac.HexEncode());\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"HMACContext 类对于高级的 HMAC 用例非常有用,例如流式消息,因为它支持在一段时" -"间内创建消息,而非一次性提供。\n" -"[codeblocks]\n" -"[gdscript]\n" -"extends Node\n" -"var ctx = HMACContext.new()\n" -"\n" -"func _ready():\n" -" var key = \"supersecret\".to_utf8()\n" -" var err = ctx.start(HashingContext.HASH_SHA256, key)\n" -" assert(err == OK)\n" -" var msg1 = \"this is \".to_utf8()\n" -" var msg2 = \"super duper secret\".to_utf8()\n" -" err = ctx.update(msg1)\n" -" assert(err == OK)\n" -" err = ctx.update(msg2)\n" -" assert(err == OK)\n" -" var hmac = ctx.finish()\n" -" print(hmac.hex_encode())\n" -"\n" -"[/gdscript]\n" -"[csharp]\n" -"using Godot;\n" -"using System.Diagnostics;\n" -"\n" -"public partial class MyNode : Node\n" -"{\n" -" private HmacContext _ctx = new HmacContext();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" byte[] key = \"supersecret\".ToUtf8();\n" -" Error err = _ctx.Start(HashingContext.HashType.Sha256, key);\n" -" Debug.Assert(err == Error.Ok);\n" -" byte[] msg1 = \"this is \".ToUtf8();\n" -" byte[] msg2 = \"super duper secret\".ToUtf8();\n" -" err = _ctx.Update(msg1);\n" -" Debug.Assert(err == Error.Ok);\n" -" err = _ctx.Update(msg2);\n" -" Debug.Assert(err == Error.Ok);\n" -" byte[] hmac = _ctx.Finish();\n" -" GD.Print(hmac.HexEncode());\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "" "Returns the resulting HMAC. If the HMAC failed, an empty [PackedByteArray] " "is returned." @@ -53758,20 +52514,6 @@ msgstr "" msgid "Removes the image's mipmaps." msgstr "删除图像的多级渐远纹理。" -msgid "" -"Compresses the image to use less memory. Can not directly access pixel data " -"while the image is compressed. Returns error if the chosen compression mode " -"is not available.\n" -"The [param mode] parameter helps to pick the best compression method for DXT " -"and ETC2 formats. It is ignored for ASTC compression.\n" -"For ASTC compression, the [param astc_format] parameter must be supplied." -msgstr "" -"压缩图像以减少内存的使用。当图像被压缩时,不能直接访问像素数据。如果选择的压" -"缩模式不可用,则返回错误。\n" -"[param mode] 参数有助于为 DXT 和 ETC2 格式选择最佳压缩方法。对于 ASTC 压缩," -"它会被忽略。\n" -"对于 ASTC 压缩,必须提供 [param astc_format] 参数。" - msgid "" "Compresses the image to use less memory. Can not directly access pixel data " "while the image is compressed. Returns error if the chosen compression mode " @@ -54905,11 +53647,6 @@ msgstr "" msgid "Mesh optimized for creating geometry manually." msgstr "为手动创建几何体,而优化的网格。" -msgid "" -"Mesh optimized for creating geometry manually, similar to OpenGL1.x " -"immediate mode." -msgstr "为手动创建几何体,而优化的网格,类似于 OpenGL1.x 即时模式。" - msgid "Clear all surfaces." msgstr "清除所有表面。" @@ -55071,16 +53808,6 @@ msgstr "设置给定面的 [Material] 材质。该面将会使用此材质渲染 msgid "A singleton that deals with inputs." msgstr "处理输入的单例。" -msgid "" -"A singleton that deals with inputs. This includes key presses, mouse buttons " -"and movement, joypads, and input actions. Actions and their events can be " -"set in the [b]Input Map[/b] tab in the [b]Project > Project Settings[/b], or " -"with the [InputMap] class." -msgstr "" -"处理输入的单例。这包括按键、鼠标点击和移动、游戏手柄和输入动作。可以在[b]项" -"目 > 项目设置[/b]的[b]输入映射[/b]选项卡中或使用 [InputMap] 类设置操作及其事" -"件。" - msgid "Inputs documentation index" msgstr "输入文档索引" @@ -55481,36 +54208,6 @@ msgstr "" "PC 上的编辑器中。\n" "[b]注意:[/b]这个值在 Android 和 iOS 上可立即被硬件传感器的值所覆盖。" -msgid "" -"Sets a custom mouse cursor image, which is only visible inside the game " -"window. The hotspot can also be specified. Passing [code]null[/code] to the " -"image parameter resets to the system cursor. See [enum CursorShape] for the " -"list of shapes.\n" -"[param image]'s size must be lower than 256×256.\n" -"[param hotspot] must be within [param image]'s size.\n" -"[b]Note:[/b] [AnimatedTexture]s aren't supported as custom mouse cursors. If " -"using an [AnimatedTexture], only the first frame will be displayed.\n" -"[b]Note:[/b] Only images imported with the [b]Lossless[/b], [b]Lossy[/b] or " -"[b]Uncompressed[/b] compression modes are supported. The [b]Video RAM[/b] " -"compression mode can't be used for custom cursors.\n" -"[b]Note:[/b] On the web platform, the maximum allowed cursor image size is " -"128×128. Cursor images larger than 32×32 will also only be displayed if the " -"mouse cursor image is entirely located within the page for [url=https://" -"chromestatus.com/feature/5825971391299584]security reasons[/url]." -msgstr "" -"设置一个自定义鼠标光标图像,该图像仅当游戏窗口内可见。还可以指定热点。将 " -"[code]null[/code] 传递给 image 参数将重置为系统光标。有关详细信息,请参阅 " -"[enum CursorShape] 形状列表。\n" -"[param image] 的大小必须小于 256×256。\n" -"[param hotspot] 必须在 [param image] 的大小范围内。\n" -"[b]注意:[/b]不支持 [AnimatedTexture] 作为自定义鼠标光标。如果使用 " -"[AnimatedTexture],则只会显示第一帧。\n" -"[b]注意:[/b]仅支持以[b]无损[/b]、[b]有损[/b]、或[b]未压缩[/b]压缩模式导入的" -"图像。[b]Video RAM[/b] 压缩模式不能用于自定义光标。\n" -"[b]注意:[/b]在网络平台上,最大允许的光标图像大小为 128×128。 出于" -"[url=https://chromestatus.com/feature/5825971391299584]安全原因[/url],只有当" -"鼠标光标图像完全位于页面内时,大于 32×32 的光标图像才会显示。" - msgid "" "Sets the default cursor shape to be used in the viewport instead of " "[constant CURSOR_ARROW].\n" @@ -59608,19 +58305,6 @@ msgstr "" "时更新。这适用于细微的变化(例如闪烁的手电筒),但通常不适用于大的变化,例如" "打开和关闭灯光。" -msgid "" -"Light is taken into account in dynamic baking ([VoxelGI] and SDFGI ([member " -"Environment.sdfgi_enabled]) only). The light can be moved around or modified " -"with global illumination updating in real-time. The light's global " -"illumination appearance will be slightly different compared to [constant " -"BAKE_STATIC]. This has a greater performance cost compared to [constant " -"BAKE_STATIC]." -msgstr "" -"在动态烘焙(仅 [VoxelGI] 和 SDFGI([member Environment.sdfgi_enabled]))时," -"考虑了灯光。灯光可以四处移动或修改,而且全局照明会实时更新。与 [constant " -"BAKE_STATIC] 相比,灯光的全局照明外观会略有不同。与 [constant BAKE_STATIC] 相" -"比,这具有更大的性能成本。" - msgid "Computes and stores baked lightmaps for fast global illumination." msgstr "计算并存储烘焙光照贴图,以实现快速全局照明。" @@ -62116,114 +60800,6 @@ msgstr "混合形状是相对于基础的权重。" msgid "Helper tool to access and edit [Mesh] data." msgstr "用于访问和编辑 [Mesh] 数据的辅助工具。" -msgid "" -"MeshDataTool provides access to individual vertices in a [Mesh]. It allows " -"users to read and edit vertex data of meshes. It also creates an array of " -"faces and edges.\n" -"To use MeshDataTool, load a mesh with [method create_from_surface]. When you " -"are finished editing the data commit the data to a mesh with [method " -"commit_to_surface].\n" -"Below is an example of how MeshDataTool may be used.\n" -"[codeblocks]\n" -"[gdscript]\n" -"var mesh = ArrayMesh.new()\n" -"mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new()." -"get_mesh_arrays())\n" -"var mdt = MeshDataTool.new()\n" -"mdt.create_from_surface(mesh, 0)\n" -"for i in range(mdt.get_vertex_count()):\n" -" var vertex = mdt.get_vertex(i)\n" -" # In this example we extend the mesh by one unit, which results in " -"separated faces as it is flat shaded.\n" -" vertex += mdt.get_vertex_normal(i)\n" -" # Save your change.\n" -" mdt.set_vertex(i, vertex)\n" -"mesh.surface_remove(0)\n" -"mdt.commit_to_surface(mesh)\n" -"var mi = MeshInstance.new()\n" -"mi.mesh = mesh\n" -"add_child(mi)\n" -"[/gdscript]\n" -"[csharp]\n" -"var mesh = new ArrayMesh();\n" -"mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh()." -"GetMeshArrays());\n" -"var mdt = new MeshDataTool();\n" -"mdt.CreateFromSurface(mesh, 0);\n" -"for (var i = 0; i < mdt.GetVertexCount(); i++)\n" -"{\n" -" Vector3 vertex = mdt.GetVertex(i);\n" -" // In this example we extend the mesh by one unit, which results in " -"separated faces as it is flat shaded.\n" -" vertex += mdt.GetVertexNormal(i);\n" -" // Save your change.\n" -" mdt.SetVertex(i, vertex);\n" -"}\n" -"mesh.SurfaceRemove(0);\n" -"mdt.CommitToSurface(mesh);\n" -"var mi = new MeshInstance();\n" -"mi.Mesh = mesh;\n" -"AddChild(mi);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"See also [ArrayMesh], [ImmediateMesh] and [SurfaceTool] for procedural " -"geometry generation.\n" -"[b]Note:[/b] Godot uses clockwise [url=https://learnopengl.com/Advanced-" -"OpenGL/Face-culling]winding order[/url] for front faces of triangle " -"primitive modes." -msgstr "" -"MeshDataTool 提供对 [Mesh] 中各个顶点的访问。它允许用户读取和编辑网格的顶点数" -"据。它还创建了一系列面和边。\n" -"要使用 MeshDataTool,请使用 [method create_from_surface] 加载一个网格。完成数" -"据编辑后,使用 [method commit_to_surface] 将数据提交到一个网格。\n" -"下面是如何使用 MeshDataTool 的示例。\n" -"[codeblocks]\n" -"[gdscript]\n" -"var mesh = ArrayMesh.new()\n" -"mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, BoxMesh.new()." -"get_mesh_arrays())\n" -"var mdt = MeshDataTool.new()\n" -"mdt.create_from_surface(mesh, 0)\n" -"for i in range(mdt.get_vertex_count()):\n" -" var vertex = mdt.get_vertex(i)\n" -" # 在这个例子中,我们将网格挤出一个单位,这会导致分离的面,因为它是平直着" -"色的。\n" -" vertex += mdt.get_vertex_normal(i)\n" -" # 保存你的更改。\n" -" mdt.set_vertex(i, vertex)\n" -"mesh.surface_remove(0)\n" -"mdt.commit_to_surface(mesh)\n" -"var mi = MeshInstance.new()\n" -"mi.mesh = mesh\n" -"add_child(mi)\n" -"[/gdscript]\n" -"[csharp]\n" -"var mesh = new ArrayMesh();\n" -"mesh.AddSurfaceFromArrays(Mesh.PrimitiveType.Triangles, new BoxMesh()." -"GetMeshArrays());\n" -"var mdt = new MeshDataTool();\n" -"mdt.CreateFromSurface(mesh, 0);\n" -"for (var i = 0; i < mdt.GetVertexCount(); i++)\n" -"{\n" -" Vector3 vertex = mdt.GetVertex(i);\n" -" // 在这个例子中,我们将网格挤出一个单位,这会导致分离的面,因为它是平直着" -"色的。\n" -" vertex += mdt.GetVertexNormal(i);\n" -" // 保存你的更改。\n" -" mdt.SetVertex(i, vertex);\n" -"}\n" -"mesh.SurfaceRemove(0);\n" -"mdt.CommitToSurface(mesh);\n" -"var mi = new MeshInstance();\n" -"mi.Mesh = mesh;\n" -"AddChild(mi);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"另请参阅 [ArrayMesh]、[ImmediateMesh]、和 [SurfaceTool],以了解程序化几何生" -"成。\n" -"[b]注意:[/b]对于三角形基元模式的前面,Godot 使用顺时针[url=https://" -"learnopengl.com/Advanced-OpenGL/Face-culling]缠绕顺序[/url]。" - msgid "Clears all data currently in MeshDataTool." msgstr "将当前 MeshDataTool 中所有的数据全部清除。" @@ -63843,13 +62419,6 @@ msgstr "" "读取 [MultiplayerPeer] 所使用的传输模式时调用(见 [member MultiplayerPeer." "transfer_mode])。" -msgid "" -"Called when the unique ID of this [MultiplayerPeer] is requested (see " -"[method MultiplayerPeer.get_unique_id])." -msgstr "" -"请求 [MultiplayerPeer] 的唯一 ID 时调用(见 [method MultiplayerPeer." -"get_unique_id])。" - msgid "" "Called when the \"refuse new connections\" status is requested on this " "[MultiplayerPeer] (see [member MultiplayerPeer.refuse_new_connections])." @@ -65691,55 +64260,6 @@ msgstr "[NavigationMesh] 发生变化时发出通知。" msgid "Server interface for low-level 2D navigation access." msgstr "用于低级 2D 导航访问的服务器接口。" -msgid "" -"NavigationServer2D is the server responsible for all 2D navigation. It " -"handles several objects, namely maps, regions and agents.\n" -"Maps are made up of regions, which are made of navigation polygons. " -"Together, they define the navigable areas in the 2D world.\n" -"[b]Note:[/b] Most NavigationServer changes take effect after the next " -"physics frame and not immediately. This includes all changes made to maps, " -"regions or agents by navigation related Nodes in the SceneTree or made " -"through scripts.\n" -"For two regions to be connected to each other, they must share a similar " -"edge. An edge is considered connected to another if both of its two vertices " -"are at a distance less than [code]edge_connection_margin[/code] to the " -"respective other edge's vertex.\n" -"You may assign navigation layers to regions with [method NavigationServer2D." -"region_set_navigation_layers], which then can be checked upon when " -"requesting a path with [method NavigationServer2D.map_get_path]. This allows " -"allowing or forbidding some areas to 2D objects.\n" -"To use the collision avoidance system, you may use agents. You can set an " -"agent's target velocity, then the servers will emit a callback with a " -"modified velocity.\n" -"[b]Note:[/b] The collision avoidance system ignores regions. Using the " -"modified velocity as-is might lead to pushing and agent outside of a " -"navigable area. This is a limitation of the collision avoidance system, any " -"more complex situation may require the use of the physics engine.\n" -"This server keeps tracks of any call and executes them during the sync " -"phase. This means that you can request any change to the map, using any " -"thread, without worrying." -msgstr "" -"NavigationServer2D 是负责所有 2D 导航的服务器。它处理多种对象,即地图、区块和" -"代理。\n" -"地图由区块组成,区块由导航多边形组成。它们共同定义了 2D 世界中的可导航区" -"域。\n" -"[b]注意:[/b]大多数 NavigationServer 更改,在下一个物理帧之后生效,而不是立即" -"生效。这些更改包括通过 SceneTree 中的导航相关节点或通过脚本对地图、区块或代理" -"所做的所有更改。\n" -"对于要相互连接的两个区块,它们必须共享一条相似的边。如果一条边的两个顶点到另" -"一条边的顶点的距离,都小于 [code]edge_connection_margin[/code],则认为这条边" -"与另一条边相连。\n" -"可以使用 [method NavigationServer2D.region_set_navigation_layers] 将导航层分" -"配给区块,然后可以在使用 [method NavigationServer2D.map_get_path] 请求路径时" -"对其进行检查。这允许允许或禁止某些区域到 2D 对象。\n" -"要使用碰撞回避系统,可以使用代理。可以设置代理的目标速度,然后服务器将以修改" -"后的速度发出回调。\n" -"[b]注意:[/b]碰撞回避系统忽略区块。按原样使用修改后的速度,可能会导致推挤,甚" -"至代理超出可导航区域。这是碰撞回避系统的一个限制,任何更复杂的情况,可能都需" -"要使用物理引擎。\n" -"该服务器会跟踪任何调用并在同步阶段执行它们。这意味着对地图进行任何更改的任何" -"请求,都可以使用线程,而无需担心出现问题。" - msgid "Using NavigationServer" msgstr "使用 NavigationServer" @@ -68486,16 +67006,6 @@ msgid "" msgstr "" "返回该节点是否通知其全局和局部变换的更改。[Node3D] 默认不会传播此属性。" -msgid "" -"Returns [code]true[/code] if the node is present in the [SceneTree], its " -"[member visible] property is [code]true[/code] and all its antecedents are " -"also visible. If any antecedent is hidden, this node will not be visible in " -"the scene tree." -msgstr "" -"如果该节点位于 [SceneTree] 中,并且其 [member visible] 属性为 [code]true[/" -"code],并且其所有上层节点也均可见,则返回 [code]true[/code]。如果任何上层节点" -"被隐藏,则该节点在场景树中将不可见。" - msgid "" "Rotates the node so that the local forward axis (-Z) points toward the " "[param target] position.\n" @@ -68742,15 +67252,6 @@ msgstr "" "[member Node3D.visible] 属性隐藏的节点,基本上可以从可见性依赖树中移除,因此" "依赖实例不会考虑隐藏节点或其祖先。" -msgid "" -"If [code]true[/code], this node is drawn. The node is only visible if all of " -"its antecedents are visible as well (in other words, [method " -"is_visible_in_tree] must return [code]true[/code])." -msgstr "" -"如果为 [code]true[/code],这个节点就会被画出来。只有当它的所有前项也是可见的" -"时候,这个节点才是可见的(换句话说,[method is_visible_in_tree] 必须返回 " -"[code]true[/code])。" - msgid "Emitted when node visibility changes." msgstr "当节点可见性更改时触发。" @@ -70667,19 +69168,6 @@ msgstr "" "为是仅供编辑器使用的。仅限编辑器的元数据不会显示在检查器停靠面板中,也不应该" "被编辑,但它仍可以被该方法找到。" -msgid "" -"Returns [code]true[/code] if the the given [param method] name exists in the " -"object.\n" -"[b]Note:[/b] In C#, [param method] must be in snake_case when referring to " -"built-in Godot methods. Prefer using the names exposed in the " -"[code]MethodName[/code] class to avoid allocating a new [StringName] on each " -"call." -msgstr "" -"如果该对象中存在给定的方法名 [param method],则返回 [code]true[/code]。\n" -"[b]注意:[/b]在 C# 中引用内置 Godot 方法时 [param method] 必须为 snake_case " -"蛇形大小写。请优先使用 [code]MethodName[/code] 类中暴露的名称,避免每次调用都" -"重新分配一个 [StringName]。" - msgid "" "Returns [code]true[/code] if the given [param signal] name exists in the " "object.\n" @@ -72283,110 +70771,6 @@ msgstr "" "[EditorPlugin] 或 [EditorScript] 的一部分时,它会冻结编辑器但不会冻结当前正在" "运行的项目(因为项目是一个独立的子进程)。" -msgid "" -"Executes a command. The file specified in [param path] must exist and be " -"executable. Platform path resolution will be used. The [param arguments] are " -"used in the given order and separated by a space. If an [param output] " -"[Array] is provided, the complete shell output of the process will be " -"appended as a single [String] element in [param output]. If [param " -"read_stderr] is [code]true[/code], the output to the standard error stream " -"will be included too.\n" -"On Windows, if [param open_console] is [code]true[/code] and the process is " -"a console app, a new terminal window will be opened. This is ignored on " -"other platforms.\n" -"If the command is successfully executed, the method will return the exit " -"code of the command, or [code]-1[/code] if it fails.\n" -"[b]Note:[/b] The Godot thread will pause its execution until the executed " -"command terminates. Use [Thread] to create a separate thread that will not " -"pause the Godot thread, or use [method create_process] to create a " -"completely independent process.\n" -"For example, to retrieve a list of the working directory's contents:\n" -"[codeblocks]\n" -"[gdscript]\n" -"var output = []\n" -"var exit_code = OS.execute(\"ls\", [\"-l\", \"/tmp\"], output)\n" -"[/gdscript]\n" -"[csharp]\n" -"var output = new Godot.Collections.Array();\n" -"int exitCode = OS.Execute(\"ls\", new string[] {\"-l\", \"/tmp\"}, output);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"If you wish to access a shell built-in or execute a composite command, a " -"platform-specific shell can be invoked. For example:\n" -"[codeblocks]\n" -"[gdscript]\n" -"var output = []\n" -"OS.execute(\"CMD.exe\", [\"/C\", \"cd %TEMP% && dir\"], output)\n" -"[/gdscript]\n" -"[csharp]\n" -"var output = new Godot.Collections.Array();\n" -"OS.Execute(\"CMD.exe\", new string[] {\"/C\", \"cd %TEMP% && dir\"}, " -"output);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and " -"Windows.\n" -"[b]Note:[/b] To execute a Windows command interpreter built-in command, " -"specify [code]cmd.exe[/code] in [param path], [code]/c[/code] as the first " -"argument, and the desired command as the second argument.\n" -"[b]Note:[/b] To execute a PowerShell built-in command, specify " -"[code]powershell.exe[/code] in [param path], [code]-Command[/code] as the " -"first argument, and the desired command as the second argument.\n" -"[b]Note:[/b] To execute a Unix shell built-in command, specify shell " -"executable name in [param path], [code]-c[/code] as the first argument, and " -"the desired command as the second argument.\n" -"[b]Note:[/b] On macOS, sandboxed applications are limited to run only " -"embedded helper executables, specified during export." -msgstr "" -"执行一条命令。[param path] 中指定的文件必须存在且可执行。将使用平台路径解析。" -"[param arguments] 按给定顺序使用,并以空格分隔。如果提供了 [param output] " -"[Array],则进程的完整 shell 输出,将作为单个 [String] 元素追加到 [param " -"output] 中。如果 [param read_stderr] 为 [code]true[/code],则标准错误流的输出" -"也将被包含在内。\n" -"在 Windows 上,如果 [param open_console] 为 [code]true[/code] 并且进程是控制" -"台应用程序,则将打开一个新的终端窗口。该参数在其他平台上被忽略。\n" -"如果命令执行成功,该方法将返回命令的退出代码,如果失败则返回 [code]-1[/" -"code]。\n" -"[b]注意:[/b]Godot 线程将暂停执行,直到执行的命令终止。使用 [Thread] 创建一个" -"不会暂停 Godot 线程的独立线程,或者使用 [method create_process] 创建一个完全" -"独立的进程。\n" -"例如,要检索工作目录内容的列表:\n" -"[codeblocks]\n" -"[gdscript]\n" -"var output = []\n" -"var exit_code = OS.execute(\"ls\", [\"-l\", \"/tmp\"], output)\n" -"[/gdscript]\n" -"[csharp]\n" -"var output = new Godot.Collections.Array();\n" -"int exitCode = OS.Execute(\"ls\", new string[] {\"-l\", \"/tmp\"}, output);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"如果希望访问内置的 shell 或执行复合命令,则可以调用特定于平台的 shell。例" -"如:\n" -"[codeblocks]\n" -"[gdscript]\n" -"var output = []\n" -"OS.execute(\"CMD.exe\", [\"/C\", \"cd %TEMP% && dir\"], output)\n" -"[/gdscript]\n" -"[csharp]\n" -"var output = new Godot.Collections.Array();\n" -"OS.Execute(\"CMD.exe\", new string[] {\"/C\", \"cd %TEMP% && dir\"}, " -"output);\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[b]注意:[/b]该方法在 Android、iOS、Linux、macOS 和 Windows 上实现。\n" -"[b]注意:[/b]要执行 Windows 命令解释器的内置命令,在 [param path] 中指定 " -"[code]cmd.exe[/code],将 [code]/c[/code] 作为第一个参数,并将所需的命令作为第" -"二个参数。\n" -"[b]注意:[/b]要执行 PowerShell 的内置命令,在 [param path] 中指定 " -"[code]powershell.exe[/code],将 [code]-Command[/code] 作为第一个参数,然后将" -"所需的命令作为第二个参数。\n" -"[b]注意:[/b]要执行 Unix shell 内置命令,请在 [param path] 中指定 shell 可执" -"行文件名称,将 [code]-c[/code] 作为第一个参数,并将所需的命令作为第二个参" -"数。\n" -"[b]注意:[/b]在 macOS 上,沙盒应用程序仅限于运行在导出期间指定的嵌入的辅助可" -"执行文件。" - msgid "Returns the keycode of the given string (e.g. \"Escape\")." msgstr "返回给定字符串(例如“Escape”)的键码。" @@ -72887,31 +71271,6 @@ msgstr "" "[b]注意:[/b]如果没有请求的风格,则可能返回不同风格的字体。\n" "[b]注意:[/b]该方法在 Android、iOS、Linux、macOS、Windows 上实现。" -msgid "" -"Returns an array of the system substitute font file paths, which are similar " -"to the font with [param font_name] and style for the specified text, locale " -"and script. Returns empty array if no matching fonts found.\n" -"The following aliases can be used to request default fonts: \"sans-serif\", " -"\"serif\", \"monospace\", \"cursive\", and \"fantasy\".\n" -"[b]Note:[/b] Depending on OS, it's not guaranteed that any of the returned " -"fonts is suitable for rendering specified text. Fonts should be loaded and " -"checked in the order they are returned, and the first suitable one used.\n" -"[b]Note:[/b] Returned fonts might have different style if the requested " -"style is not available or belong to a different font family.\n" -"[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and " -"Windows." -msgstr "" -"返回系统替换字体文件路径的数组,这些字体与名称为 [param font_name] 并且其他风" -"格也相符的字体相近,可用于指定的文本、区域设置以及文字。如果没有相匹配的字" -"体,则返回空数组。\n" -"下列别名可用于请求默认字体:无衬线“sans-serif”、有衬线“serif”、等" -"宽“monospace”、手写体“cursive”、花体“fantasy”。\n" -"[b]注意:[/b]根据操作系统的不同,无法保证任何返回的字体都适合渲染指定的文本。" -"应该按照返回的顺序加载并检查字体,选用第一个合适的字体。\n" -"[b]注意:[/b]如果没有请求的风格,或者属于不同的字体家族,则可能返回不同风格的" -"字体。\n" -"[b]注意:[/b]该方法在 Android、iOS、Linux、macOS、Windows 上实现。" - msgid "" "Returns list of font family names available.\n" "[b]Note:[/b] This method is implemented on Android, iOS, Linux, macOS and " @@ -73018,28 +71377,6 @@ msgstr "" "版本。\n" "[b]注意:[/b]该方法在 web 平台上不被支持。它将返回一个空字符串。" -msgid "" -"Returns the video adapter driver name and version for the user's currently " -"active graphics card.\n" -"The first element holds the driver name, such as [code]nvidia[/code], " -"[code]amdgpu[/code], etc.\n" -"The second element holds the driver version. For e.g. the [code]nvidia[/" -"code] driver on a Linux/BSD platform, the version is in the format " -"[code]510.85.02[/code]. For Windows, the driver's format is " -"[code]31.0.15.1659[/code].\n" -"[b]Note:[/b] This method is only supported on the platforms Linux/BSD and " -"Windows when not running in headless mode. It returns an empty array on " -"other platforms." -msgstr "" -"返回用户当前激活的显卡的视频适配器驱动程序名称和版本。\n" -"第一个元素保存驱动程序的名称,如 [code]nvidia[/code]、[code]amdgpu[/code] " -"等。\n" -"第二个元素保存驱动程序的版本。例如 Linux/BSD 平台上的 [code]nvidia[/code] 驱" -"动程序,其版本格式为 [code]510.85.02[/code]。对于 Windows,其驱动程序的格式" -"是 [code]31.0.15.1659[/code]。\n" -"[b]注意:[/b]该方法仅在 Linux/BSD 和 Windows 平台上不以无头模式运行时才受支" -"持。在其他平台上返回一个空数组。" - msgid "" "Returns [code]true[/code] if the environment variable with the name [param " "variable] exists.\n" @@ -75065,76 +73402,6 @@ msgstr "" "[b]注意:[/b]在向广播地址(例如:[code]255.255.255.255[/code])发送数据包之" "前,必须启用 [method set_broadcast_enabled]。" -msgid "" -"Waits for a packet to arrive on the bound address. See [method bind].\n" -"[b]Note:[/b] [method wait] can't be interrupted once it has been called. " -"This can be worked around by allowing the other party to send a specific " -"\"death pill\" packet like this:\n" -"[codeblocks]\n" -"[gdscript]\n" -"socket = PacketPeerUDP.new()\n" -"# Server\n" -"socket.set_dest_address(\"127.0.0.1\", 789)\n" -"socket.put_packet(\"Time to stop\".to_ascii())\n" -"\n" -"# Client\n" -"while socket.wait() == OK:\n" -" var data = socket.get_packet().get_string_from_ascii()\n" -" if data == \"Time to stop\":\n" -" return\n" -"[/gdscript]\n" -"[csharp]\n" -"var socket = new PacketPeerUDP();\n" -"// Server\n" -"socket.SetDestAddress(\"127.0.0.1\", 789);\n" -"socket.PutPacket(\"Time to stop\".ToAscii());\n" -"\n" -"// Client\n" -"while (socket.Wait() == OK)\n" -"{\n" -" string data = socket.GetPacket().GetStringFromASCII();\n" -" if (data == \"Time to stop\")\n" -" {\n" -" return;\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"等待数据包到达绑定的地址。见 [method bind]。\n" -"[b]注意:[/b][method wait] 一旦被调用就无法中断。解决方法是让对方发送一个特定" -"的“毒药”数据包,如下所示:\n" -"[codeblocks]\n" -"[gdscript]\n" -"socket = PacketPeerUDP.new()\n" -"# 服务端\n" -"socket.set_dest_address(\"127.0.0.1\", 789)\n" -"socket.put_packet(\"Time to stop\".to_ascii())\n" -"\n" -"# 客户端\n" -"while socket.wait() == OK:\n" -" var data = socket.get_packet().get_string_from_ascii()\n" -" if data == \"Time to stop\":\n" -" return\n" -"[/gdscript]\n" -"[csharp]\n" -"var socket = new PacketPeerUDP();\n" -"// 服务端\n" -"socket.SetDestAddress(\"127.0.0.1\", 789);\n" -"socket.PutPacket(\"Time to stop\".ToAscii());\n" -"\n" -"// 客户端\n" -"while (socket.Wait() == OK)\n" -"{\n" -" string data = socket.GetPacket().GetStringFromASCII();\n" -" if (data == \"Time to stop\")\n" -" {\n" -" return;\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "Provides an opaque background for [Control] children." msgstr "为 [Control] 子控件提供不透明的背景。" @@ -75564,9 +73831,6 @@ msgid "" "Each particle's tangential acceleration will vary along this [CurveTexture]." msgstr "每个粒子的切向加速度将沿着这个 [CurveTexture] 变化。" -msgid "Enables and disables Turbulence for the particle system." -msgstr "启用和禁用粒子系统的湍流。" - msgid "" "Maximum turbulence influence on each particle.\n" "The actual amount of turbulence influence on each particle is calculated as " @@ -75596,30 +73860,6 @@ msgid "" "[CurveTexture] over its life time." msgstr "每个粒子的湍流量,将在其生命周期内沿这条 [CurveTexture] 受到影响。" -msgid "" -"Maximum displacement of each particles spawn position by the turbulence.\n" -"The actual amount of displacement will be a factor of the underlying " -"turbulence multiplied by a random value between [member " -"turbulence_initial_displacement_min] and [member " -"turbulence_initial_displacement_max]." -msgstr "" -"湍流对每个粒子出生位置的最大位移。\n" -"实际位移量将是基础湍流乘以一个介于 [member " -"turbulence_initial_displacement_min] 和 [member " -"turbulence_initial_displacement_max] 之间的随机值的系数。" - -msgid "" -"Minimum displacement of each particles spawn position by the turbulence.\n" -"The actual amount of displacement will be a factor of the underlying " -"turbulence multiplied by a random value between [member " -"turbulence_initial_displacement_min] and [member " -"turbulence_initial_displacement_max]." -msgstr "" -"湍流对每个粒子出生位置的最小位移。\n" -"实际位移量将是基础湍流乘以一个介于 [member " -"turbulence_initial_displacement_min] 和 [member " -"turbulence_initial_displacement_max] 之间的随机值的系数。" - msgid "" "This value controls the overall scale/frequency of the turbulence noise " "pattern.\n" @@ -75639,16 +73879,6 @@ msgstr "" "湍流图案的移动速度。这会改变噪声随时间变化的速度。\n" "[code]Vector3(0.0, 0.0, 0.0)[/code] 的值,会将湍流图案冻结在适当的位置。" -msgid "" -"Use to influence the noise speed in a random pattern. This helps to break up " -"visible movement patterns." -msgstr "用于以随机图案影响噪声速度。这有助于打破可见的移动图案。" - -msgid "" -"The turbulence noise strength. Increasing this will result in a stronger, " -"more contrasting, noise pattern." -msgstr "湍流噪声强度。增加此值将导致更强、更具对比的噪声图案。" - msgid "" "Use with [method set_param_min], [method set_param_max], and [method " "set_param_texture] to set initial velocity properties." @@ -84412,10 +82642,6 @@ msgstr "" "项目被认为是工作空间中的 C# 项目之一,根目录应该包含 [code]project.godot[/" "code] 和[code].csproj[/code]。" -msgid "" -"If [code]true[/code] text resources are converted to binary format on export." -msgstr "如果为 [code]true[/code],则导出时会将文本资源转换为二进制格式。" - msgid "If [code]true[/code] importing of resources is run on multiple threads." msgstr "如果为 [code]true[/code],则会多线程执行资源的导入。" @@ -85116,16 +83342,6 @@ msgid "" "macOS specific override for the shortcut to add a caret below every caret." msgstr "针对 macOS 的快捷键覆盖项,对应在各个光标下方再添加一个光标的快捷键。" -msgid "" -"Default [InputEventAction] to move the text cursor the the end of the text.\n" -"[b]Note:[/b] Default [code]ui_*[/code] actions cannot be removed as they are " -"necessary for the internal logic of several [Control]s. The events assigned " -"to the action can however be modified." -msgstr "" -"默认 [InputEventAction],用于将文本光标移动到文本的末尾。\n" -"[b]注意:[/b]默认的 [code]ui_*[/code] 动作是部分 [Control] 的内部逻辑所必需" -"的,无法删除。但是可以修改分配给该动作的事件。" - msgid "" "macOS specific override for the shortcut to move the text cursor to the end " "of the text." @@ -87112,51 +85328,6 @@ msgstr "" "physics_ticks_per_second],而且远大于默认值,那么建议将 [member physics/" "common/max_physics_steps_per_frame] 也调大。" -msgid "" -"If [code]true[/code], [CanvasItem] nodes will internally snap to full " -"pixels. Their position can still be sub-pixel, but the decimals will not " -"have effect." -msgstr "" -"如果为 [code]true[/code],则 [CanvasItem] 节点在内部会吸附到整像素位置。位置" -"仍然可以是次像素的,但小数点后的值不会产生效果。" - -msgid "" -"If [code]true[/code], vertices of [CanvasItem] nodes will snap to full " -"pixels. Only affects the final vertex positions, not the transforms." -msgstr "" -"如果为 [code]true[/code],则 [CanvasItem] 节点的顶点会吸附到整像素位置。仅影" -"响最终的顶点位置,不影响变换。" - -msgid "" -"Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power " -"of two). MSAA is used to reduce aliasing around the edges of polygons. A " -"higher MSAA value results in smoother edges but can be significantly slower " -"on some hardware. This has no effect on shader-induced aliasing or texture " -"aliasing.\n" -"[b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering " -"methods, not Compatibility." -msgstr "" -"设置用于 2D/Canvas 渲染的 MSAA 采样数(为 2 的幂)。MSAA 可用于减少多边形边缘" -"周围的锯齿。较高的 MSAA 值会产生更平滑的边缘,但在某些硬件上可能会明显变慢。" -"这对着色器引起的锯齿或纹理锯齿无效。\n" -"[b]注意:[/b]MSAA 仅支持 Forward+ 和 Mobile 渲染方式,不支持 Compatibility。" - -msgid "" -"Sets the number of MSAA samples to use for 3D rendering (as a power of two). " -"MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA " -"value results in smoother edges but can be significantly slower on some " -"hardware. See also bilinear scaling 3d [member rendering/scaling_3d/mode] " -"for supersampling, which provides higher quality but is much more expensive. " -"This has no effect on shader-induced aliasing or texture aliasing.\n" -"[b]Note:[/b] MSAA is only supported in the Forward+ and Mobile rendering " -"methods, not Compatibility." -msgstr "" -"设置用于 3D 渲染的 MSAA 采样数(为 2 的幂)。MSAA 用于减少多边形边缘周围的锯" -"齿。较高的 MSAA 值会产生更平滑的边缘,但在某些硬件上可能会明显变慢。另请参见" -"用于超级采样的双线性缩放 3d [member rendering/scaling_3d/mode],它提供更高的" -"质量但更昂贵。这对着色器引起的锯齿或纹理锯齿无效。\n" -"[b]注意:[/b]MSAA 仅支持 Forward+ 和 Mobile 渲染方式,不支持 Compatibility。" - msgid "" "Sets the screen-space antialiasing mode for the default screen [Viewport]. " "Screen-space antialiasing works by selectively blurring edges in a post-" @@ -87223,21 +85394,6 @@ msgstr "" "伪像。\n" "[b]注意:[/b]TAA 只支持 Forward+ 渲染方式,不支持 Mobile 或 Compatibility。" -msgid "" -"If [code]true[/code], enables a spatial filter to limit roughness in areas " -"with high-frequency detail. This can help reduce specular aliasing to an " -"extent, though not as much as enabling [member rendering/anti_aliasing/" -"quality/use_taa]. This filter has a small performance cost, so consider " -"disabling it if it doesn't benefit your scene noticeably.\n" -"[b]Note:[/b] TAA is only supported in the Forward+ and Mobile rendering " -"methods, not Compatibility." -msgstr "" -"如果为 [code]true[/code],则启用空间过滤器以限制具有高频细节的区域的粗糙度。" -"这可以在一定程度上帮助减少镜面反射锯齿,尽管不如启用 [member rendering/" -"anti_aliasing/quality/use_taa]。 该过滤器的性能成本很小,因此如果它对您的场景" -"没有明显好处,请考虑禁用它。\n" -"[b]注意:[/b]TAA 只支持 Forward+ 和 Mobile 渲染方式,不支持 Compatibility。" - msgid "" "Sets the quality of the depth of field effect. Higher quality takes more " "samples, which is slower but looks smoother." @@ -87450,28 +85606,6 @@ msgstr "" "但代价是消耗性能。设为 [code]Ultra[/code] 会使用 [member rendering/" "environment/ssil/adaptive_target] 设置。" -msgid "" -"Scales the depth over which the subsurface scattering effect is applied. A " -"high value may allow light to scatter into a part of the mesh or another " -"mesh that is close in screen space but far in depth." -msgstr "" -"缩放应用次表面散射效果的深度。较高的值可能允许光散射到该网格的一部分,或是散" -"射到屏幕空间中较近但深度较远的另一个网格中。" - -msgid "" -"Sets the quality of the subsurface scattering effect. Higher values are " -"slower but look nicer." -msgstr "设置次表面散射效果的质量。值越高,速度越慢,但看起来也越好。" - -msgid "" -"Scales the distance over which samples are taken for subsurface scattering " -"effect. Changing this does not impact performance, but higher values will " -"result in significant artifacts as the samples will become obviously spread " -"out. A lower value results in a smaller spread of scattered light." -msgstr "" -"缩放对次表面散射效果进行采样的距离。更改该值不会影响性能;但较高的值将导致明" -"显的伪影,因为样本将变得明显分散。较低的值会导致散射光的散布更小。" - msgid "" "Enables filtering of the volumetric fog effect prior to integration. This " "substantially blurs the fog which reduces fine details but also smooths out " @@ -87658,22 +85792,6 @@ msgstr "" "使动态对象光照更新更快。较高的值可以防止快速移动的对象在其上显示“过时的”间接" "光照,但代价是当对象从明亮区域移动到阴影区域时可能会出现闪烁。" -msgid "" -"Use 16 bits for shadow depth map. Enabling this results in shadows having " -"less precision and may result in shadow acne, but can lead to performance " -"improvements on some devices." -msgstr "" -"对阴影深度贴图使用 16 比特。启用此功能会导致阴影精度较低,并可能导致阴影粉" -"刺,但在某些设备上可以带来性能的改善。" - -msgid "" -"The directional shadow's size in pixels. Higher values will result in " -"sharper shadows, at the cost of performance. The value will be rounded up to " -"the nearest power of 2." -msgstr "" -"定向阴影的大小(以像素为单位)。较高的值,将导致更清晰的阴影,但会以性能为代" -"价。该值将四舍五入到最接近的 2 次幂。" - msgid "" "Lower-end override for [member rendering/lights_and_shadows/" "directional_shadow/size] on mobile devices, due to performance concerns or " @@ -87878,29 +85996,6 @@ msgstr "" "[b]注意:[/b]只有在项目启动时该属性才会被读取。要在运行时调整自动 LOD 阈值," "请在根 [Viewport] 上设置 [member Viewport.mesh_lod_threshold]。" -msgid "" -"The [url=https://en.wikipedia.org/wiki/Bounding_volume_hierarchy]BVH[/url] " -"quality to use when rendering the occlusion culling buffer. Higher values " -"will result in more accurate occlusion culling, at the cost of higher CPU " -"usage." -msgstr "" -"渲染遮挡剔除缓冲区时使用的 [url=https://en.wikipedia.org/wiki/" -"Bounding_volume_hierarchy]BVH[/url] 质量。值越高,得到的遮挡剔除越精确,但代" -"价是 CPU 使用率也越高。" - -msgid "" -"Higher values will result in more accurate occlusion culling, at the cost of " -"higher CPU usage. The occlusion culling buffer's pixel count is roughly " -"equal to [code]occlusion_rays_per_thread * number_of_logical_cpu_cores[/" -"code], so it will depend on the system's CPU. Therefore, CPUs with fewer " -"cores will use a lower resolution to attempt keeping performance costs even " -"across devices." -msgstr "" -"更高的值将导致更准确的遮挡剔除,但代价是更高的 CPU 使用率。遮挡剔除缓冲区的像" -"素数大致等于 [code]occlusion_rays_per_thread * number_of_logical_cpu_cores[/" -"code],因此它取决于系统的 CPU。因此,内核较少的 CPU 将使用较低的分辨率,来尝" -"试保持跨设备的性能成本。" - msgid "" "If [code]true[/code], [OccluderInstance3D] nodes will be usable for " "occlusion culling in 3D in the root viewport. In custom viewports, [member " @@ -88285,26 +86380,6 @@ msgstr "" "code] 文件夹,然后重新启动编辑器(请参阅 [member application/config/" "use_hidden_project_data_directory])。" -msgid "" -"If [code]true[/code], the texture importer will import VRAM-compressed " -"textures using the S3 Texture Compression algorithm (DXT1-5) for lower " -"quality textures and the the BPTC algorithm (BC6H and BC7) for high quality " -"textures. This algorithm is only supported on PC desktop platforms and " -"consoles.\n" -"[b]Note:[/b] Changing this setting does [i]not[/i] impact textures that were " -"already imported before. To make this setting apply to textures that were " -"already imported, exit the editor, remove the [code].godot/imported/[/code] " -"folder located inside the project folder then restart the editor (see " -"[member application/config/use_hidden_project_data_directory])." -msgstr "" -"如果为 [code]true[/code],纹理导入器将使用 S3 纹理压缩算法(DXT1-5)导入 " -"VRAM 压缩纹理以获得较低质量的纹理;并使用 BPTC 算法(BC6H 和 BC7)导入高质量" -"纹理。该算法仅在 PC 桌面平台和主机平台上受支持。\n" -"[b]注意:[/b]更改该设置[i]不会[/i]影响之前已经导入的纹理。要使该设置应用于已" -"导入的纹理,请退出编辑器,移除位于项目文件夹内的 [code].godot/imported/[/" -"code] 文件夹,然后重新启动编辑器(请参阅 [member application/config/" -"use_hidden_project_data_directory])。" - msgid "" "The default compression method for WebP. Affects both lossy and lossless " "WebP. A higher value results in smaller files at the cost of compression " @@ -88534,26 +86609,6 @@ msgstr "" msgid "The quad's size in 3D units." msgstr "该四边形的大小,使用 3D 单位。" -msgid "Quaternion." -msgstr "四元数." - -msgid "" -"A unit quaternion used for representing 3D rotations. Quaternions need to be " -"normalized to be used for rotation.\n" -"It is similar to Basis, which implements matrix representation of rotations, " -"and can be parametrized using both an axis-angle pair or Euler angles. Basis " -"stores rotation, scale, and shearing, while Quaternion only stores " -"rotation.\n" -"Due to its compactness and the way it is stored in memory, certain " -"operations (obtaining axis-angle and performing SLERP, in particular) are " -"more efficient and robust against floating-point errors." -msgstr "" -"代表 3D 旋转的单位四元数。四元数归一化后才能用于旋转。\n" -"四元数与 Basis 类似,实现的是旋转的矩阵表示,可以使用轴角对或欧拉角作为参数。" -"Basis 存储的是旋转、缩放以及切变,而 Quaternion 只存储旋转。\n" -"由于四元数的紧凑性以及在内存中的存储方式,部分运算(尤其是获取轴角和执行 " -"SLERP)在防止浮点数误差方面更加有效和稳健。" - msgid "" "Constructs a default-initialized quaternion with all components set to " "[code]0[/code]." @@ -89288,21 +87343,6 @@ msgstr "" "撞法线将为 [code]Vector3(0, 0, 0)[/code]。不会影响无体积的形状,如凹多边形和" "高度图。" -msgid "Framebuffer pass attachment description." -msgstr "帧缓冲区阶段附件描述。" - -msgid "" -"This class contains the list of attachment descriptions for a framebuffer " -"pass. Each points with an index to a previously supplied list of texture " -"attachments.\n" -"Multipass framebuffers can optimize some configurations in mobile, on " -"desktop they provide little to no advantage." -msgstr "" -"该类包含帧缓冲区通道的附件描述列表。每个点都有一个指向先前提供的纹理附件列表" -"的索引。\n" -"多通道帧缓冲区,可以优化移动设备中的某些配置;在桌面设备上,它们几乎没有优" -"势。" - msgid "" "Color attachments in order starting from 0. If this attachment is not used " "by the shader, pass ATTACHMENT_UNUSED to skip." @@ -89838,30 +87878,6 @@ msgstr "" msgid "Reflection probes" msgstr "反射探针" -msgid "" -"The custom ambient color to use within the [ReflectionProbe]'s [member " -"size]. Only effective if [member ambient_mode] is [constant AMBIENT_COLOR]." -msgstr "" -"在 [ReflectionProbe] 的 [member size] 中使用的自定义环境颜色。仅当 [member " -"ambient_mode] 为 [constant AMBIENT_COLOR] 时有效。" - -msgid "" -"The custom ambient color energy to use within the [ReflectionProbe]'s " -"[member size]. Only effective if [member ambient_mode] is [constant " -"AMBIENT_COLOR]." -msgstr "" -"在 [ReflectionProbe] 的 [member size] 中使用的自定义环境颜色能量。仅当 " -"[member ambient_mode] 为 [constant AMBIENT_COLOR] 时有效。" - -msgid "" -"The ambient color to use within the [ReflectionProbe]'s [member size]. The " -"ambient color will smoothly blend with other [ReflectionProbe]s and the rest " -"of the scene (outside the [ReflectionProbe]'s [member size])." -msgstr "" -"在 [ReflectionProbe] 的 [member size] 中使用的环境颜色。环境颜色将平滑地与其" -"他 [ReflectionProbe] 和场景的其余部分(在 [ReflectionProbe] 的 [member size] " -"之外)混合。" - msgid "" "If [code]true[/code], enables box projection. This makes reflections look " "more correct in rectangle-shaped rooms by offsetting the reflection center " @@ -89900,21 +87916,6 @@ msgstr "定义反射强度。" msgid "If [code]true[/code], reflections will ignore sky contribution." msgstr "如果为 [code]true[/code],则反射将忽略天空的贡献。" -msgid "" -"The maximum distance away from the [ReflectionProbe] an object can be before " -"it is culled. Decrease this to improve performance, especially when using " -"the [constant UPDATE_ALWAYS] [member update_mode].\n" -"[b]Note:[/b] The maximum reflection distance is always at least equal to the " -"probe's extents. This means that decreasing [member max_distance] will not " -"always cull objects from reflections, especially if the reflection probe's " -"[member size] is already large." -msgstr "" -"对象在被剔除之前可以距该 [ReflectionProbe] 的最大距离。减少它可以提高性能,尤" -"其是在使用 [constant UPDATE_ALWAYS] 作为 [member update_mode] 时。\n" -"[b]注意:[/b]最大反射距离始终至少等于探针的范围。这意味着减少 [member " -"max_distance] 并不总是会从反射中剔除对象,尤其是在反射探针的 [member size] 已" -"经很大的情况下。" - msgid "" "The automatic LOD bias to use for meshes rendered within the " "[ReflectionProbe] (this is analog to [member Viewport.mesh_lod_threshold]). " @@ -89990,23 +87991,6 @@ msgstr "" "的性能消耗也是显著的。因此,建议同一个场景中最多只使用一个 [constant " "UPDATE_ALWAYS] 的 ReflectionProbe。其他用途请使用 [constant UPDATE_ONCE]。" -msgid "" -"Do not apply any ambient lighting inside the [ReflectionProbe]'s [member " -"size]." -msgstr "不在 [ReflectionProbe] 的 [member size] 内应用任何环境光照。" - -msgid "" -"Apply automatically-sourced environment lighting inside the " -"[ReflectionProbe]'s [member size]." -msgstr "在 [ReflectionProbe] 的 [member size] 内应用自动获取的环境光照。" - -msgid "" -"Apply custom ambient lighting inside the [ReflectionProbe]'s [member size]. " -"See [member ambient_color] and [member ambient_color_energy]." -msgstr "" -"在 [ReflectionProbe] 的 [member size] 内应用自定义的环境光照。见 [member " -"ambient_color] 和 [member ambient_color_energy]。" - msgid "Class for searching text for patterns using regular expressions." msgstr "使用正则表达式搜索文本的类。" @@ -90375,33 +88359,6 @@ msgstr "到远程节点的 [NodePath],相对于 RemoteTransform3D 在场景中 msgid "Abstraction for working with modern low-level graphics APIs." msgstr "用于处理现代低阶图形 API 的抽象。" -msgid "" -"[RenderingDevice] is an abstraction for working with modern low-level " -"graphics APIs such as Vulkan.\n" -"On startup, Godot creates a global [RenderingDevice] which can be retrieved " -"using [method RenderingServer.get_rendering_device]. This global " -"RenderingDevice performs drawing to the screen.\n" -"Internally, [RenderingDevice] is used in Godot to provide support for " -"several modern low-level graphics APIs while reducing the amount of code " -"duplication required.\n" -"[b]Local RenderingDevices:[/b] Using [method RenderingServer." -"create_local_rendering_device], you can create \"secondary\" rendering " -"devices to perform drawing and GPU compute operations on separate threads.\n" -"[b]Note:[/b] [RenderingDevice] is not available when running in headless " -"mode or when using the Compatibility rendering method." -msgstr "" -"[RenderingDevice](渲染设备)是用于处理 Vulkan 等现代低阶图形 API 的抽象。\n" -"启动时,Godot 会创建全局的 [RenderingDevice],可以使用 [method " -"RenderingServer.get_rendering_device] 获取。这个全局的 RenderingDevice 会进行" -"屏幕绘图。\n" -"Godot 在内部使用 [RenderingDevice] 来提供对各种现代低阶图形 API 的支持,从而" -"降低所需的代码重复。\n" -"[b]局部 RenderingDevice:[/b]你可以通过 [method RenderingServer." -"create_local_rendering_device] 来创建“次级”渲染设备,在单独的线程中进行绘图" -"和 GPU 计算操作。\n" -"[b]注意:[/b]使用无头模式运行或使用 OpenGL 渲染器时,[RenderingDevice] 不可" -"用。" - msgid "" "Returns a copy of the data of the specified [param buffer], optionally " "[param offset_bytes] and [param size_bytes] can be set to copy only a " @@ -90410,14 +88367,6 @@ msgstr "" "返回指定 [param buffer] 中数据的副本,还可以设置 [param offset_bytes] 和 " "[param size_bytes],仅复制缓冲区的某一部分。" -msgid "" -"Sets blend constants for draw list, blend constants are used only if the " -"graphics pipeline is created with [constant DYNAMIC_STATE_BLEND_CONSTANTS] " -"flag set." -msgstr "" -"设置绘图列表的混合常量,使用 [constant DYNAMIC_STATE_BLEND_CONSTANTS] 标志创" -"建的图形管线才会使用混合常量。" - msgid "" "Creates a vertex array based on the specified buffers. Optionally, [param " "offsets] (in bytes) may be defined for each buffer." @@ -90517,9 +88466,6 @@ msgid "" "camera)." msgstr "渲染点的图元(大小为常量,和与相机之间的距离无关)。" -msgid "Line rendering primitive." -msgstr "绘制直线的图元。" - msgid "Exclusive or (XOR) logic operation." msgstr "逻辑异或(XOR)运算。" @@ -90582,65 +88528,6 @@ msgstr "返回格式 ID 的函数会在值无效时返回此值。" msgid "Server for anything visible." msgstr "任何可见的东西的服务器。" -msgid "" -"The rendering server is the API backend for everything visible. The whole " -"scene system mounts on it to display.\n" -"The rendering server is completely opaque, the internals are entirely " -"implementation specific and cannot be accessed.\n" -"The rendering server can be used to bypass the scene/[Node] system " -"entirely.\n" -"Resources are created using the [code]*_create[/code] functions. These " -"functions return [RID]s which are not references to the objects themselves, " -"but opaque [i]pointers[/i] towards these objects.\n" -"All objects are drawn to a viewport. You can use the [Viewport] attached to " -"the [SceneTree] or you can create one yourself with [method " -"viewport_create]. When using a custom scenario or canvas, the scenario or " -"canvas needs to be attached to the viewport using [method " -"viewport_set_scenario] or [method viewport_attach_canvas].\n" -"In 3D, all visual objects must be associated with a scenario. The scenario " -"is a visual representation of the world. If accessing the rendering server " -"from a running game, the scenario can be accessed from the scene tree from " -"any [Node3D] node with [method Node3D.get_world_3d]. Otherwise, a scenario " -"can be created with [method scenario_create].\n" -"Similarly, in 2D, a canvas is needed to draw all canvas items.\n" -"In 3D, all visible objects are comprised of a resource and an instance. A " -"resource can be a mesh, a particle system, a light, or any other 3D object. " -"In order to be visible resources must be attached to an instance using " -"[method instance_set_base]. The instance must also be attached to the " -"scenario using [method instance_set_scenario] in order to be visible.\n" -"In 2D, all visible objects are some form of canvas item. In order to be " -"visible, a canvas item needs to be the child of a canvas attached to a " -"viewport, or it needs to be the child of another canvas item that is " -"eventually attached to the canvas.\n" -"[b]Headless mode:[/b] Starting the engine with the [code]--headless[/code] " -"[url=$DOCS_URL/tutorials/editor/command_line_tutorial.html]command line " -"argument[/url] disables all rendering and window management functions. Most " -"functions from [RenderingServer] will return dummy values in this case." -msgstr "" -"渲染服务是所有可见内容的 API 后端。整个场景系统挂载在它上面来显示。\n" -"渲染服务是完全不透明的,其内部完全是特定于实现的,无法访问。\n" -"渲染服务可用于完全绕过场景/[Node] 系统。\n" -"资源是使用 [code]*_create[/code] 函数创建的。这些函数返回的 [RID] 不是对对象" -"本身的引用,而是指向这些对象的不透明[i]指针[/i]。\n" -"所有对象都被绘制到视口。可以使用附加到 [SceneTree] 的 [Viewport],或者可以使" -"用 [method viewport_create] 自己创建一个。使用自定义场景或画布时,需要使用 " -"[method viewport_set_scenario] 或 [method viewport_attach_canvas] 将场景或画" -"布附加到视口。\n" -"在 3D 中,所有视觉对象都必须与一个场景相关联。场景是世界的一个视觉表示。如果" -"从一个正在运行的游戏访问渲染服务,则可以使用 [method Node3D.get_world_3d] 从" -"任何 [Node3D] 节点的场景树访问场景。此外,可以使用 [method scenario_create] " -"创建一个场景。\n" -"相类似地,在2D中,需要一个画布来绘制所有的画布项。\n" -"在 3D 中,所有可见对象都由资源和实例组成。资源可以是网格、粒子系统、灯光或任" -"何其他 3D 对象。为了使资源可见,必须使用 [method instance_set_base] 将其附加" -"到一个实例。该实例还必须使用 [method instance_set_scenario] 附加到场景中才能" -"可见。\n" -"在 2D 中,所有可见对象都是某种形式的画布项。为了使一个画布项可见,它需要是附" -"加到视口的画布的子项,或者它需要是最终附加到画布的另一个画布项的子项。\n" -"[b]无头模式:[/b]使用 [code]--headless[/code] [url=$DOCS_URL/tutorials/" -"editor/command_line_tutorial.html]命令行参数[/url]启动引擎,将禁用所有渲染和" -"窗口管理功能。在这种情况下,来自 [RenderingServer] 的大多数函数将返回虚拟值。" - msgid "Optimization using Servers" msgstr "使用服务器进行优化" @@ -90654,21 +88541,6 @@ msgstr "" "质数据,烘焙为一组大小为 [param image_size] 的 [Image]。返回包含 [enum " "BakeChannels] 中指定的材质属性的 [Image] 数组。" -msgid "" -"Creates a camera attributes object and adds it to the RenderingServer. It " -"can be accessed with the RID that is returned. This RID will be used in all " -"[code]camera_attributes_[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [CameraAttributes] resource." -msgstr "" -"创建空的相机属性并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这" -"个 RID 会在所有 [code]camera_attributes_*[/code] RenderingServer 函数中使" -"用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [CameraAttributes] 资源的内部等价物。" - msgid "" "Sets the parameters to use with the auto-exposure effect. These parameters " "take on the same meaning as their counterparts in [CameraAttributes] and " @@ -90733,20 +88605,6 @@ msgstr "" "sensitivity))\n" "[/codeblock]" -msgid "" -"Creates a camera and adds it to the RenderingServer. It can be accessed with " -"the RID that is returned. This RID will be used in all [code]camera_*[/code] " -"RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [Camera3D] node." -msgstr "" -"创建相机并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在所有 [code]camera_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [Camera3D] 节点的内部等价物。" - msgid "" "Sets the camera_attributes created with [method camera_attributes_create] to " "the given camera." @@ -90800,20 +88658,6 @@ msgstr "" "KEEP_WIDTH]。如果为 [code]false[/code],则保留垂直长宽比,相当于 [constant " "Camera3D.KEEP_HEIGHT]。" -msgid "" -"Creates a canvas and returns the assigned [RID]. It can be accessed with the " -"RID that is returned. This RID will be used in all [code]canvas_*[/code] " -"RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"Canvas has no [Resource] or [Node] equivalent." -msgstr "" -"创建画布并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在所有 [code]canvas_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"没有与画布等价的 [Resource] 或 [Node]。" - msgid "" "Draws a circle on the [CanvasItem] pointed to by the [param item] [RID]. See " "also [method CanvasItem.draw_circle]." @@ -90865,13 +88709,6 @@ msgid "" "Draws particles on the [CanvasItem] pointed to by the [param item] [RID]." msgstr "在 [param item] [RID] 指向的 [CanvasItem] 上绘制粒子。" -msgid "" -"Draws a 2D polygon on the [CanvasItem] pointed to by the [param item] [RID]. " -"See also [method CanvasItem.draw_polygon]." -msgstr "" -"在 [param item] [RID] 指向的 [CanvasItem] 上绘制一个二维多边形。另见 [method " -"CanvasItem.draw_polygon]。" - msgid "" "Draws a 2D polyline on the [CanvasItem] pointed to by the [param item] " "[RID]. See also [method CanvasItem.draw_polyline]." @@ -90918,34 +88755,12 @@ msgstr "" msgid "Clears the [CanvasItem] and removes all commands in it." msgstr "清除[CanvasItem]并删除其中的所有命令。" -msgid "" -"Creates a canvas item and returns the assigned [RID]. It can be accessed " -"with the RID that is returned. This RID will be used in all " -"[code]canvas_item_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [CanvasItem] node." -msgstr "" -"创建画布项目并返回分配的 [RID]。可以通过返回的 RID 进行访问。这个 RID 会在所" -"有 [code]canvas_item_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [CanvasItem] 节点的内部等价物。" - msgid "Sets the [CanvasItem] to copy a rect to the backbuffer." msgstr "设置 [CanvasItem] 以将矩形复制到后台缓冲区。" msgid "Sets the index for the [CanvasItem]." msgstr "设置 [CanvasItem] 的索引。" -msgid "Sets a new material to the [CanvasItem]." -msgstr "为 [CanvasItem] 设置新材质。" - -msgid "" -"Sets a color modulation to the [CanvasItem]. This also affects child canvas " -"items." -msgstr "为 [CanvasItem] 设置调制颜色。也会影响子级画布项目。" - msgid "" "Sets a parent [CanvasItem] to the [CanvasItem]. The item will inherit " "transform, modulation and visibility from its parent, like [CanvasItem] " @@ -90954,22 +88769,6 @@ msgstr "" "为 [CanvasItem] 设置父级 [CanvasItem]。该项目会从父级继承变换、调制、可见性," "和场景树中的 [CanvasItem] 节点一样。" -msgid "" -"Sets a color self-modulation to the [CanvasItem]. It does not affect the " -"child canvas items." -msgstr "为 [CanvasItem] 设置自调制颜色。不会影响子级画布项目。" - -msgid "Enables or disables Y-sorting of a [CanvasItem]." -msgstr "启用或禁用 [CanvasItem] 的 Y 排序。" - -msgid "" -"Sets the transform of the [CanvasItem]. It affects where and how the item " -"will be drawn. Child canvas items' transforms are multiplied by their " -"parent's transform." -msgstr "" -"设置 [CanvasItem] 的变换。会影响该项目在哪里绘制以及如何绘制。子级画布项目的" -"变换会与其父级变换相乘。" - msgid "Sets if the [CanvasItem] uses its parent's material." msgstr "设置 [CanvasItem] 是否使用其父级的材质。" @@ -91013,35 +88812,10 @@ msgid "" "Attaches the canvas light to the canvas. Removes it from its previous canvas." msgstr "将画布灯连接到画布上,并将其从以前的画布中取出。" -msgid "" -"Creates a canvas light and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]canvas_light_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建画布灯光并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]canvas_light_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "" "Attaches a light occluder to the canvas. Removes it from its previous canvas." msgstr "将光遮挡物添加到画布上,并将其从之前的画布中移除。" -msgid "" -"Creates a light occluder and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]canvas_light_occluder_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建光线遮挡器并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这" -"个 RID 会在所有 [code]canvas_light_occluder_*[/code] RenderingServer 函数中使" -"用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "Enables or disables light occluder." msgstr "启用或禁用遮光器。" @@ -91130,19 +88904,6 @@ msgstr "" "设置将受此光影响的对象的 Z 范围。相当于 [member Light2D.range_z_min] 和 " "[member Light2D.range_z_max]。" -msgid "" -"Creates a new light occluder polygon and adds it to the RenderingServer. It " -"can be accessed with the RID that is returned. This RID will be used in all " -"[code]canvas_occluder_polygon_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"新建一个光线遮挡多边形并将其添加到 RenderingServer。可以通过返回的 RID 进行访" -"问。这个 RID 会在所有 [code]canvas_occluder_polygon_*[/code] RenderingServer " -"函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "" "Sets an occluder polygons cull mode. See [enum " "CanvasOccluderPolygonCullMode] constants." @@ -91159,26 +88920,6 @@ msgstr "画布项目的副本将以镜像的局部偏移量[Vector2]被绘制。 msgid "Modulates all colors in the given canvas." msgstr "调制给定画布中的所有颜色。" -msgid "" -"Creates a canvas texture and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]canvas_texture_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [CanvasTexture] resource." -msgstr "" -"创建画布纹理并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]canvas_texture_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [CanvasTexture] 资源的内部等价物。" - -msgid "Sets the texture filter used by the [CanvasTexture]." -msgstr "设置该 [CanvasTexture] 所使用的纹理过滤模式。" - -msgid "Sets the texture repeat used by the [CanvasTexture]." -msgstr "设置该 [CanvasTexture] 所使用的纹理重复模式。" - msgid "" "Creates a RenderingDevice that can be used to do draw and compute operations " "on a separate thread. Cannot draw to the screen nor share data with the " @@ -91191,77 +88932,6 @@ msgstr "" "[b]注意:[/b]使用 OpenGL 后端或在无头模式下运行时,这个函数始终返回 " "[code]null[/code] 。" -msgid "" -"Creates a decal and adds it to the RenderingServer. It can be accessed with " -"the RID that is returned. This RID will be used in all [code]decal_*[/code] " -"RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [Decal] node." -msgstr "" -"创建贴花并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在所有 [code]decal_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [Decal] 节点的内部等价物。" - -msgid "Sets the color modulation of the [Decal]." -msgstr "设置该 [Decal] 的调制颜色。" - -msgid "Sets the size of the [Decal]." -msgstr "设置该 [Decal] 的大小。" - -msgid "Sets the texture of the [Decal]." -msgstr "设置该 [Decal] 的纹理。" - -msgid "" -"Creates a directional light and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID can be used in most " -"[code]light_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this directional light to an instance using " -"[method instance_set_base] using the returned RID.\n" -"This is the internal equivalent of the [DirectionalLight3D] node." -msgstr "" -"新建平行光并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在大多数 [code]light_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这个平行光放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。\n" -"这是 [DirectionalLight3D] 节点的内部等价物。" - -msgid "" -"Creates an environment and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]environment_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [Environment] resource." -msgstr "" -"新建一个环境并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]environment_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [Environment] 资源的内部等价物。" - -msgid "" -"Sets the values to be used with the \"Adjustment\" post-process effect. See " -"[Environment] for more details." -msgstr "设置用于 \"调整 \"后处理效果的数值。参阅[Environment]以了解更多细节。" - -msgid "" -"Sets the [i]BGMode[/i] of the environment. Equivalent to [member Environment." -"background_mode]." -msgstr "" -"设置环境的 [i]BGMode[/i]。相当于 [member Environment.background_mode]。" - -msgid "" -"Color displayed for clear areas of the scene (if using Custom color or " -"Color+Sky background modes)." -msgstr "场景中空白区域的颜色显示(如果使用自定义颜色或颜色+天空背景模式)。" - msgid "Sets the intensity of the background color." msgstr "设置背景颜色的强度。" @@ -91308,11 +88978,6 @@ msgid "" msgstr "" "设置屏幕空间间接照明(SSIL)后期处理效果的质量级别。详情见 [Environment]。" -msgid "" -"Sets the variables to be used with the \"screen space reflections\" post-" -"process effect. See [Environment] for more details." -msgstr "设置用于“屏幕空间反射”后处理效果的变量。详情请参阅 [Environment]。" - msgid "" "Sets the variables to be used with the \"tonemap\" post-process effect. See " "[Environment] for more details." @@ -91333,20 +88998,6 @@ msgstr "" "设置体积雾的片段体素缓冲区分辨率。[param size] 会被屏幕的纵横比修改,用于设置" "缓冲区的宽度和高度。[param depth] 则用于设置缓冲区的深度。" -msgid "" -"Creates a fog volume and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all " -"[code]fog_volume_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [FogVolume] node." -msgstr "" -"创建雾体积并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]fog_volume_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [FogVolume] 节点的内部等价物。" - msgid "" "Sets the [Material] of the fog volume. Can be either a [FogMaterial] or a " "custom [ShaderMaterial]." @@ -91377,14 +89028,6 @@ msgstr "" "FOG_VOLUME_SHAPE_CYLINDER] 或 [constant RenderingServer." "FOG_VOLUME_SHAPE_BOX] 时,雾体积的大小。" -msgid "Tries to free an object in the RenderingServer." -msgstr "尝试释放 RenderingServer 中的某个对象。" - -msgid "" -"Returns the default clear color which is used when a specific clear color " -"has not been selected." -msgstr "返回未选择特定清除颜色时所使用的默认清除颜色。" - msgid "" "Returns the global RenderingDevice.\n" "[b]Note:[/b] When using the OpenGL backend or when running in headless mode, " @@ -91397,25 +89040,6 @@ msgstr "" msgid "Returns the parameters of a shader." msgstr "返回着色器的参数。" -msgid "Returns the ID of the test cube. Creates one if none exists." -msgstr "返回测试立方体的 ID。如果不存在,则会创建一个。" - -msgid "Returns the ID of the test texture. Creates one if none exists." -msgstr "返回测试纹理的 ID。如果不存在,则会创建一个。" - -msgid "" -"Returns the version of the graphics video adapter [i]currently in use[/i] (e." -"g. \"1.2.189\" for Vulkan, \"3.3.0 NVIDIA 510.60.02\" for OpenGL). This " -"version may be different from the actual latest version supported by the " -"hardware, as Godot may not always request the latest version.\n" -"[b]Note:[/b] When running a headless or server binary, this function returns " -"an empty string." -msgstr "" -"返回[i]当前使用的[/i]图形视频适配器的版本(例如,Vulkan 为“1.2.189”,OpenGL " -"为“3.3.0 NVIDIA 510.60.02”)。该版本可能与硬件支持的实际最新版本不同,因为 " -"Godot 可能并不总是要求最新版本。\n" -"[b]注意:[/b]当运行无头或服务器可执行文件时,该函数返回一个空字符串。" - msgid "" "Returns the name of the video adapter (e.g. \"GeForce GTX 1080/PCIe/" "SSE2\").\n" @@ -91449,26 +89073,6 @@ msgstr "" "返回视频适配器的供应商(例如 \"NVIDIA Corporation\")。\n" "[b]注意:[/b]当运行精简或服务器可执行文件时,该函数返回一个空字符串。" -msgid "Returns the ID of a white texture. Creates one if none exists." -msgstr "返回白色纹理的 ID。如果不存在,则创建一个。" - -msgid "" -"If [param half_resolution] is [code]true[/code], renders [VoxelGI] and SDFGI " -"([member Environment.sdfgi_enabled]) buffers at halved resolution (e.g. " -"960×540 when the viewport size is 1920×1080). This improves performance " -"significantly when VoxelGI or SDFGI is enabled, at the cost of artifacts " -"that may be visible on polygon edges. The loss in quality becomes less " -"noticeable as the viewport resolution increases. [LightmapGI] rendering is " -"not affected by this setting. See also [member ProjectSettings.rendering/" -"global_illumination/gi/use_half_resolution]." -msgstr "" -"如果 [param half_resolution] 为 [code]true[/code],则会使用一半的分辨率渲染 " -"[VoxelGI] 和 SDFGI([member Environment.sdfgi_enabled])缓冲区(例如视口大小" -"为 1920×1080 时使用 960×540)。启用 VoxelGI 或 SDFGI 时,这样做能够显著提升性" -"能,但代价是多边形边缘可能产生显示问题。视口分辨率越高,越不容易注意到质量的" -"损失。[LightmapGI] 的渲染不受这个设置的影响。另见 [member ProjectSettings." -"rendering/global_illumination/gi/use_half_resolution]。" - msgid "" "Returns [code]true[/code] if changes have been made to the RenderingServer's " "data. [method force_draw] is usually called if this happens." @@ -91500,37 +89104,6 @@ msgid "" "instance." msgstr "将骨架附加到实例。并从实例中移除之前骨架。" -msgid "" -"Creates a visual instance and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]instance_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"An instance is a way of placing a 3D object in the scenario. Objects like " -"particles, meshes, and reflection probes need to be associated with an " -"instance to be visible in the scenario using [method instance_set_base].\n" -"This is the internal equivalent of the [VisualInstance3D] node." -msgstr "" -"创建可视实例并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]instance_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"实例可以将 3D 对象放置到场景中。粒子、网格、反射探针等对象都需要使用 [method " -"instance_set_base] 与实例关联,才能显示在场景中。\n" -"这是 [VisualInstance3D] 节点的内部等价物。" - -msgid "" -"Creates a visual instance, adds it to the RenderingServer, and sets both " -"base and scenario. It can be accessed with the RID that is returned. This " -"RID will be used in all [code]instance_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建可视实例并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在大多数 [code]instance_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "" "Sets the shadow casting setting to one of [enum ShadowCastingSetting]. " "Equivalent to [member GeometryInstance3D.cast_shadow]." @@ -91595,17 +89168,6 @@ msgstr "" "设置给定几何实例的可见性范围值。相当于 [member GeometryInstance3D." "visibility_range_begin] 和相关属性。" -msgid "" -"Sets the base of the instance. A base can be any of the 3D objects that are " -"created in the RenderingServer that can be displayed. For example, any of " -"the light types, mesh, multimesh, immediate geometry, particle system, " -"reflection probe, lightmap, and the GI probe are all types that can be set " -"as the base of an instance in order to be displayed in the scenario." -msgstr "" -"设置该实例的基础。基础可以是在 RenderingServer 中创建的任何可以显示的 3D 对" -"象。例如,任何光源类型、网格、多重网格、直接几何体、粒子系统、反射探针、光照" -"贴图、和 GI 探针都可以被设置为实例的基础,以便在场景中显示。" - msgid "Sets the weight for a given blend shape associated with this instance." msgstr "设置与该实例相关的特定混合形状的权重。" @@ -91662,54 +89224,6 @@ msgid "" "visible]." msgstr "设置是否绘制实例。相当于 [member Node3D.visible]。" -msgid "" -"Returns an array of object IDs intersecting with the provided AABB. Only " -"visual 3D nodes are considered, such as [MeshInstance3D] or " -"[DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain " -"the actual nodes. A scenario RID must be provided, which is available in the " -"[World3D] you want to query. This forces an update for all resources queued " -"to update.\n" -"[b]Warning:[/b] This function is primarily intended for editor usage. For in-" -"game use cases, prefer physics collision." -msgstr "" -"返回与提供的 AABB 相交的对象 ID 的数组。仅考虑可视的 3D 节点,例如 " -"[MeshInstance3D] 或 [DirectionalLight3D]。可使用 [method @GlobalScope." -"instance_from_id] 来获取实际节点。必须提供一个场景 RID,且它在要查询的 " -"[World3D] 中可用。这会强制更新所有已被队列以等待更新的资源。\n" -"[b]警告:[/b]该函数主要供编辑器使用。对于游戏中的用例,最好是物理碰撞。" - -msgid "" -"Returns an array of object IDs intersecting with the provided convex shape. " -"Only visual 3D nodes are considered, such as [MeshInstance3D] or " -"[DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain " -"the actual nodes. A scenario RID must be provided, which is available in the " -"[World3D] you want to query. This forces an update for all resources queued " -"to update.\n" -"[b]Warning:[/b] This function is primarily intended for editor usage. For in-" -"game use cases, prefer physics collision." -msgstr "" -"返回与提供的凸形相交的对象 ID 的数组。仅考虑可视的 3D 节点,例如 " -"[MeshInstance3D] 或 [DirectionalLight3D]。可使用 [method @GlobalScope." -"instance_from_id] 以获取实际节点。必须提供场景 RID,且它在要查询的 [World3D] " -"中可用。这会强制更新所有已被队列以等待更新的资源。\n" -"[b]警告:[/b]该函数主要供编辑器使用。对于游戏中的用例,最好是物理碰撞。" - -msgid "" -"Returns an array of object IDs intersecting with the provided 3D ray. Only " -"visual 3D nodes are considered, such as [MeshInstance3D] or " -"[DirectionalLight3D]. Use [method @GlobalScope.instance_from_id] to obtain " -"the actual nodes. A scenario RID must be provided, which is available in the " -"[World3D] you want to query. This forces an update for all resources queued " -"to update.\n" -"[b]Warning:[/b] This function is primarily intended for editor usage. For in-" -"game use cases, prefer physics collision." -msgstr "" -"返回与提供的 3D 射线相交的对象 ID 的数组。仅考虑可视的 3D 节点,例如 " -"[MeshInstance3D] 或 [DirectionalLight3D]。可使用 [method @GlobalScope." -"instance_from_id] 以获取实际节点。必须提供场景 RID,且它在你要查询的 " -"[World3D] 中可用。这会强制更新所有已被队列以等待更新的资源。\n" -"[b]警告:[/b]该函数主要供编辑器使用。对于游戏中的用例,最好是物理碰撞。" - msgid "" "If [code]true[/code], this directional light will blend between shadow map " "splits resulting in a smoother transition between them. Equivalent to " @@ -91750,42 +89264,6 @@ msgid "" "Sets the color of the light. Equivalent to [member Light3D.light_color]." msgstr "设置灯光的颜色。相当于 [member Light3D.light_color]。" -msgid "" -"Sets the cull mask for this Light3D. Lights only affect objects in the " -"selected layers. Equivalent to [member Light3D.light_cull_mask]." -msgstr "" -"设置此 Light3D 的剔除掩码。灯光仅影响选定层中的对象。相当于 [member Light3D." -"light_cull_mask]。" - -msgid "" -"Sets the distance fade for this Light3D. This acts as a form of level of " -"detail (LOD) and can be used to improve performance. Equivalent to [member " -"Light3D.distance_fade_enabled], [member Light3D.distance_fade_begin], " -"[member Light3D.distance_fade_shadow], and [member Light3D." -"distance_fade_length]." -msgstr "" -"设置该 Light3D 的淡入淡出距离。这充当了一种多细节层次(LOD)的形式,可用于提" -"高性能。相当于 [member Light3D.distance_fade_enabled]、[member Light3D." -"distance_fade_begin]、[member Light3D.distance_fade_shadow]、和 [member " -"Light3D.distance_fade_length]。" - -msgid "" -"If [code]true[/code], light will subtract light instead of adding light. " -"Equivalent to [member Light3D.light_negative]." -msgstr "" -"如果为 [code]true[/code],则灯光会对光进行扣除而不是增加。相当于 [member " -"Light3D.light_negative]。" - -msgid "" -"Sets the specified light parameter. See [enum LightParam] for options. " -"Equivalent to [method Light3D.set_param]." -msgstr "" -"设置指定的灯光参数。选项见 [enum LightParam]。相当于 [method Light3D." -"set_param]。" - -msgid "Not implemented in Godot 3.x." -msgstr "在 Godot 3.x 中没有实现。" - msgid "" "If [code]true[/code], reverses the backface culling of the mesh. This can be " "useful when you have a flat mesh that has a light behind it. If you need to " @@ -91805,20 +89283,6 @@ msgstr "" "如果为 [code]true[/code],则灯光会投射阴影。相当于 [member Light3D." "shadow_enabled]。" -msgid "" -"Creates a lightmap GI and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all " -"[code]instance_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [LightmapGI] node." -msgstr "" -"创建光照贴图 GI 并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这" -"个 RID 会在所有 [code]instance_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [LightmapGI] 节点的内部等价物。" - msgid "" "Used to inform the renderer what exposure normalization value was used while " "baking the lightmap. This value will be used and modulated at run time to " @@ -91830,25 +89294,6 @@ msgstr "" "制,以确保即使场景范围的曝光归一化值在运行时发生变化,光照贴图也能保持一致的" "曝光水平。有关详细信息,请参阅 [method camera_attributes_set_exposure]。" -msgid "" -"Returns a mesh of a sphere with the given number of horizontal and vertical " -"subdivisions." -msgstr "返回球体网格,具有给定数量的水平和垂直细分。" - -msgid "" -"Creates an empty material and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]material_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"This is the internal equivalent of the [Material] resource." -msgstr "" -"创建空材质并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]material_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"这是 [Material] 资源的内部等价物。" - msgid "Returns the value of a certain material's parameter." msgstr "返回特定材质的参数值。" @@ -91867,24 +89312,6 @@ msgstr "设置着色器材质的着色器。" msgid "Removes all surfaces from a mesh." msgstr "移除网格中的所有表面。" -msgid "" -"Creates a new mesh and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all [code]mesh_*[/" -"code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this mesh to an instance using [method " -"instance_set_base] using the returned RID.\n" -"This is the internal equivalent of the [Mesh] resource." -msgstr "" -"新建网格并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在所有 [code]mesh_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这个网格放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。\n" -"这是 [Mesh] 资源的内部等价物。" - msgid "Returns a mesh's blend shape count." msgstr "返回一个网格的混合形状数量。" @@ -91915,24 +89342,6 @@ msgstr "返回网格表面的材质。" msgid "Sets a mesh's surface's material." msgstr "设置网格表面的材质。" -msgid "" -"Creates a new multimesh on the RenderingServer and returns an [RID] handle. " -"This RID will be used in all [code]multimesh_*[/code] RenderingServer " -"functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this multimesh to an instance using [method " -"instance_set_base] using the returned RID.\n" -"This is the internal equivalent of the [MultiMesh] resource." -msgstr "" -"新建多网格并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]multimesh_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这个多网格放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。\n" -"这是 [MultiMesh] 资源的内部等价物。" - msgid "" "Calculates and returns the axis-aligned bounding box that encloses all " "instances within the multimesh." @@ -92003,38 +89412,6 @@ msgstr "" "设置在给定时间内可见的实例的数量。如果是 -1,所有被分配的实例都会被画出来。相" "当于 [member MultiMesh.visible_instance_count]。" -msgid "" -"Creates a new omni light and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID can be used in most " -"[code]light_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this omni light to an instance using [method " -"instance_set_base] using the returned RID." -msgstr "" -"创建一个新的全向灯并将其添加到 RenderingServer。可以使用返回的 RID 访问它。" -"该 RID 可用于大多数 [code]light_*[/code] RenderingServer 函数。\n" -"一旦使用 RID 完成操作后,需要使用 RenderingServer 的静态方法 [method " -"free_rid] 来释放该 RID。\n" -"要放置在场景中,请使用 [method instance_set_base] 使用该返回的 RID 将该全向灯" -"附加到一个实例。" - -msgid "" -"Creates a particle system and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]particles_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach these particles to an instance using [method " -"instance_set_base] using the returned RID." -msgstr "" -"创建粒子系统并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]particles_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这些粒子放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。" - msgid "" "Calculates and returns the axis-aligned bounding box that contains all the " "particles. Equivalent to [method GPUParticles3D.capture_aabb]." @@ -92183,22 +89560,6 @@ msgstr "" "如果为 [code]true[/code],则粒子使用局部坐标。如果为 [code]false[/code] 则使" "用全局坐标。相当于 [member GPUParticles3D.local_coords]。" -msgid "" -"Creates a reflection probe and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]reflection_probe_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this reflection probe to an instance using " -"[method instance_set_base] using the returned RID." -msgstr "" -"创建反射探针并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]reflection_probe_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这个反射探针放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。" - msgid "" "If [code]true[/code], reflections will ignore sky contribution. Equivalent " "to [member ReflectionProbe.interior]." @@ -92267,23 +89628,6 @@ msgid "" "Schedules a callback to the given callable after a frame has been drawn." msgstr "安排对给定可调用体的回调,会在一帧绘制完成后回调。" -msgid "" -"Creates a scenario and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all " -"[code]scenario_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"The scenario is the 3D world that all the visual instances exist in." -msgstr "" -"创建场景并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在大多数 [code]scenario_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"场景是所有可视实例存在的 3D 世界。" - -msgid "Sets the environment that will be used with this scenario." -msgstr "设置将用于此场景的环境。" - msgid "" "Sets the fallback environment to be used by this scenario. The fallback " "environment is used if no environment is set. Internally, this is used by " @@ -92304,31 +89648,6 @@ msgstr "" "code],则该图像将使用线性插值的方式进行缩放。如果 [param use_filter] 为 " "[code]false[/code],则该图像将使用最近邻插值的方式进行缩放。" -msgid "" -"If [code]true[/code], the engine will generate wireframes for use with the " -"wireframe debug mode." -msgstr "如果为 [code]true[/code],引擎将生成用于线框调试模式的线框。" - -msgid "" -"Sets the default clear color which is used when a specific clear color has " -"not been selected." -msgstr "设置未选择特定透明色时使用的默认透明色。" - -msgid "" -"Creates an empty shader and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]shader_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建空的着色器并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这" -"个 RID 会在所有 [code]shader_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - -msgid "Returns a shader's code." -msgstr "返回着色器的代码。" - msgid "" "Returns a default texture from a shader searched by name.\n" "[b]Note:[/b] If the sampler array is used use [param index] to access the " @@ -92357,54 +89676,9 @@ msgstr "设置该骨架中指定骨骼的 [Transform3D]。" msgid "Sets the [Transform2D] for a specific bone of this skeleton." msgstr "设置该骨架中指定骨骼的 [Transform2D]。" -msgid "" -"Creates a skeleton and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all " -"[code]skeleton_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建骨架并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 RID " -"会在所有 [code]skeleton_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "Returns the number of bones allocated for this skeleton." msgstr "返回分配给这个骨架的骨骼数量。" -msgid "" -"Creates an empty sky and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID will be used in all [code]sky_*[/" -"code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建空的天空并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]sky_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - -msgid "" -"Sets the material that the sky uses to render the background and reflection " -"maps." -msgstr "设置天空用于渲染背景和反射贴图的材质。" - -msgid "" -"Creates a spot light and adds it to the RenderingServer. It can be accessed " -"with the RID that is returned. This RID can be used in most [code]light_*[/" -"code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method.\n" -"To place in a scene, attach this spot light to an instance using [method " -"instance_set_base] using the returned RID." -msgstr "" -"创建聚光灯并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在大多数 [code]light_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。\n" -"如果要将这个聚光灯放置到场景中,请使用返回的 RID 调用 [method " -"instance_set_base],将其附加至某个实例上。" - msgid "Returns a texture [RID] that can be used with [RenderingDevice]." msgstr "返回可用于 [RenderingDevice] 的纹理 [RID]。" @@ -92453,18 +89727,6 @@ msgstr "" "使用它可以带来显著的优化,尤其是在低端设备上。但是,这是以必须手动管理视口为" "代价的。进一步优化请参见 [method viewport_set_render_direct_to_screen]。" -msgid "" -"Creates an empty viewport and adds it to the RenderingServer. It can be " -"accessed with the RID that is returned. This RID will be used in all " -"[code]viewport_*[/code] RenderingServer functions.\n" -"Once finished with your RID, you will want to free the RID using the " -"RenderingServer's [method free_rid] static method." -msgstr "" -"创建空的视口并将其添加到 RenderingServer。可以通过返回的 RID 进行访问。这个 " -"RID 会在所有 [code]viewport_*[/code] RenderingServer 函数中使用。\n" -"RID 使用结束后,应该使用 RenderingServer 的 [method free_rid] 静态方法进行释" -"放。" - msgid "Returns the viewport's last rendered frame." msgstr "返回视口的最后渲染帧。" @@ -92504,9 +89766,6 @@ msgid "" "options." msgstr "设置视口的调试绘图模式。可选项见 [enum ViewportDebugDraw]。" -msgid "If [code]true[/code], the viewport's canvas is not rendered." -msgstr "如果为 [code]true[/code],则不渲染视口的画布。" - msgid "" "Sets the viewport's environment mode which allows enabling or disabling " "rendering of 3D environment over 2D canvas. When disabled, 2D will not be " @@ -92526,33 +89785,6 @@ msgstr "" msgid "Sets the viewport's global transformation matrix." msgstr "设置视口的全局变换矩阵。" -msgid "" -"Sets the multisample anti-aliasing mode for 2D/Canvas. See [enum " -"ViewportMSAA] for options." -msgstr "设置 2D/画布的多重采样抗锯齿模式。选项见 [enum ViewportMSAA]。" - -msgid "" -"Sets the multisample anti-aliasing mode for 3D. See [enum ViewportMSAA] for " -"options." -msgstr "设置 3D 的多重采样抗锯齿模式。选项见 [enum ViewportMSAA]。" - -msgid "Sets the viewport's parent to another viewport." -msgstr "设置视口的父视口到另一个视口。" - -msgid "Sets the shadow atlas quadrant's subdivision." -msgstr "设置阴影图集象限的细分。" - -msgid "" -"Sets the size of the shadow atlas's images (used for omni and spot lights). " -"The value will be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at " -"all (including directional shadows)." -msgstr "" -"设置阴影图集图像的大小(用于全向灯和聚光灯)。该值将向上舍入到最接近的 2 次" -"幂。\n" -"[b]注意:[/b]如果被设置为 [code]0[/code],将根本看不到任何阴影(包括定向阴" -"影)。" - msgid "" "If [code]true[/code], render the contents of the viewport directly to " "screen. This allows a low-level optimization where you can skip drawing a " @@ -92575,19 +89807,6 @@ msgstr "" "个属性,那么只会绘制适合窗口的部分, 无法自动缩放,即使游戏场景明显大于窗口大" "小。" -msgid "" -"Sets scaling 3d mode. Bilinear scaling renders at different resolution to " -"either undersample or supersample the viewport. FidelityFX Super Resolution " -"1.0, abbreviated to FSR, is an upscaling technology that produces high " -"quality images at fast framerates by using a spatially aware upscaling " -"algorithm. FSR is slightly more expensive than bilinear, but it produces " -"significantly higher image quality. FSR should be used where possible." -msgstr "" -"设置缩放 3d 模式。双线性缩放以不同的分辨率渲染,以对视口进行欠采样或超采样。" -"FidelityFX 超分辨率 1.0,缩写为 FSR,是一种放大技术,通过使用空间感知放大算法" -"以快速帧速率生成高质量图像。FSR 比双线性稍微贵一点,但它产生的图像质量明显更" -"高。应尽可能使用 FSR。" - msgid "" "Scales the 3D render buffer based on the viewport size uses an image filter " "specified in [enum ViewportScaling3DMode] to scale the output image to the " @@ -92611,17 +89830,6 @@ msgstr "" "在使用 FSR 放大时,AMD 建议将以下值,作为预设选项公开给用户:“超质量:" "0.77”、“质量:0.67”、“平衡:0.59”、“性能:0.5”,而不是公开整个比例。" -msgid "" -"Sets a viewport's scenario.\n" -"The scenario contains information about environment information, reflection " -"atlas etc." -msgstr "" -"设置视口的场景。\n" -"该场景包含环境、反射图集等信息。" - -msgid "Sets the viewport's width and height." -msgstr "设置视口的宽度和高度。" - msgid "" "Affects the final texture sharpness by reading from a lower or higher mipmap " "(also called \"texture LOD bias\"). Negative values make mipmapped textures " @@ -92655,28 +89863,12 @@ msgid "" "constants for options." msgstr "设置应更新视口的时间。可选项请参阅 [enum ViewportUpdateMode] 。" -msgid "If [code]true[/code], use Temporal Anti-Aliasing." -msgstr "如果为 [code]true[/code],则使用时间抗锯齿。" - msgid "" "If [code]true[/code], the viewport uses augmented or virtual reality " "technologies. See [XRInterface]." msgstr "" "如果为 [code]true[/code],则视口使用增强或虚拟现实技术。参阅 [XRInterface]。" -msgid "" -"Sets the Variable Rate Shading (VRS) mode for the viewport. Note, if " -"hardware does not support VRS this property is ignored." -msgstr "" -"设置视口的可变速率着色(VRS)模式。请注意,如果硬件不支持 VRS,则忽略该属性。" - -msgid "" -"Texture to use when the VRS mode is set to [constant RenderingServer." -"VIEWPORT_VRS_TEXTURE]." -msgstr "" -"当 VRS 模式设置为 [constant RenderingServer.VIEWPORT_VRS_TEXTURE] 时,要使用" -"的纹理。" - msgid "" "Used to inform the renderer what exposure normalization value was used while " "baking the voxel gi. This value will be used and modulated at run time to " @@ -92719,28 +89911,12 @@ msgstr "画布项目的最小 Z 层。" msgid "The maximum Z-layer for canvas items." msgstr "帆布项目的最大 Z 层。" -msgid "" -"Max number of glow levels that can be used with glow post-process effect." -msgstr "可用于辉光后处理效果的最大辉光级别数。" - -msgid "Unused enum in Godot 3.x." -msgstr "在 Godot 3.x 中未使用的枚举。" - msgid "Shader is a 3D shader." msgstr "着色器是 3D 着色器。" msgid "Shader is a 2D shader." msgstr "着色器是 2D 着色器。" -msgid "Shader is a particle shader." -msgstr "着色器是粒子着色器。" - -msgid "Shader is a sky shader." -msgstr "着色器是天空着色器。" - -msgid "Shader is a fog shader." -msgstr "着色器是雾着色器。" - msgid "Represents the size of the [enum ShaderMode] enum." msgstr "代表 [enum ShaderMode] 枚举的大小。" @@ -92750,45 +89926,27 @@ msgstr "所有材质的最小渲染优先级。" msgid "The maximum renderpriority of all materials." msgstr "所有材质的最大渲染优先级。" -msgid "Array is a vertex array." -msgstr "数组是顶点数组。" - msgid "Array is a normal array." msgstr "数组是法线数组。" msgid "Array is a tangent array." msgstr "数组是切线数组。" -msgid "Array is a color array." -msgstr "数组是颜色数组。" - msgid "Array is an UV coordinates array." msgstr "数组是 UV 坐标数组。" -msgid "Array is an UV coordinates array for the second UV coordinates." -msgstr "数组是第二个 UV 坐标的 UV 坐标数组。" - msgid "Array contains bone information." msgstr "数组包含骨骼信息。" msgid "Array is weight information." msgstr "数组是重量信息。" -msgid "Array is index array." -msgstr "数组是索引数组。" - -msgid "Flag used to mark a vertex array." -msgstr "用于标记顶点数组的标志。" - msgid "Flag used to mark a normal array." msgstr "用于标记法线数组的标志。" msgid "Flag used to mark a tangent array." msgstr "用于标记切线数组的标志。" -msgid "Flag used to mark a color array." -msgstr "用于标记颜色数组的标记。" - msgid "Flag used to mark an UV coordinates array." msgstr "用于标记 UV 坐标数组的标志。" @@ -92897,15 +90055,6 @@ msgstr "" "也更慢。各向异性的级别由 [member ProjectSettings.rendering/textures/" "default_filters/anisotropic_filtering_level] 定义。" -msgid "Is a directional (sun) light." -msgstr "是平行光(日光)。" - -msgid "Is an omni light." -msgstr "是全向光。" - -msgid "Is a spot light." -msgstr "是聚光。" - msgid "The light's energy multiplier." msgstr "该灯光的能量倍数。" @@ -92944,9 +90093,6 @@ msgstr "聚光灯的角度。" msgid "The spotlight's attenuation." msgstr "聚光灯的衰减。" -msgid "Max distance that shadows will be rendered." -msgstr "阴影被渲染的最大距离。" - msgid "Proportion of shadow atlas occupied by the first split." msgstr "第一次拆分所占据的阴影图集的比例。" @@ -93188,70 +90334,12 @@ msgid "" "culled." msgstr "[FogVolume] 将没有形状,将覆盖整个世界并且不会被剔除。" -msgid "" -"Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can " -"be set using [member Viewport.scaling_3d_scale]. Values less then [code]1.0[/" -"code] will result in undersampling while values greater than [code]1.0[/" -"code] will result in supersampling. A value of [code]1.0[/code] disables " -"scaling." -msgstr "" -"对视口的 3D 缓冲区使用双线性缩放。可以使用 [member Viewport." -"scaling_3d_scale] 设置缩放量。小于 [code]1.0[/code] 的值将导致欠采样,而大于 " -"[code]1.0[/code] 的值将导致超采样。[code]1.0[/code] 的值将禁用缩放。" - -msgid "" -"Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D " -"buffer. The amount of scaling can be set using [member Viewport." -"scaling_3d_scale]. Values less then [code]1.0[/code] will be result in the " -"viewport being upscaled using FSR. Values greater than [code]1.0[/code] are " -"not supported and bilinear downsampling will be used instead. A value of " -"[code]1.0[/code] disables scaling." -msgstr "" -"对视口的 3D 缓冲区使用 AMD FidelityFX 超分辨率 1.0 放大。可以使用 [member " -"Viewport.scaling_3d_scale] 设置缩放量。小于 [code]1.0[/code] 的值将导致使用 " -"FSR 放大视口。不支持大于 [code]1.0[/code] 的值,将改用双线性降采样。" -"[code]1.0[/code] 的值将禁用缩放。" - -msgid "Do not update the viewport." -msgstr "不要更新视口。" - -msgid "Update the viewport once then set to disabled." -msgstr "更新一次视口,然后设置为禁用。" - -msgid "Update the viewport whenever it is visible." -msgstr "只要视口是可见的,就更新视口。" - -msgid "Always update the viewport." -msgstr "始终更新视口。" - -msgid "The viewport is always cleared before drawing." -msgstr "在绘图之前,视口总是被清空。" - -msgid "The viewport is never cleared before drawing." -msgstr "在绘图之前,视口永远不会被清空。" - -msgid "" -"The viewport is cleared once, then the clear mode is set to [constant " -"VIEWPORT_CLEAR_NEVER]." -msgstr "视口被清除一次,然后清除模式设置为 [constant VIEWPORT_CLEAR_NEVER]。" - msgid "Disable rendering of 3D environment over 2D canvas." msgstr "禁用在 2D 画布上渲染 3D 环境。" msgid "Enable rendering of 3D environment over 2D canvas." msgstr "启用在 2D 画布上渲染 3D 环境。" -msgid "" -"Inherit enable/disable value from parent. If topmost parent is also set to " -"inherit, then this has the same behavior as [constant " -"VIEWPORT_ENVIRONMENT_ENABLED]." -msgstr "" -"从父级继承启用/禁用值。如果最顶层的父级也被设置为继承,那么这与 [constant " -"VIEWPORT_ENVIRONMENT_ENABLED] 具有相同的行为。" - -msgid "Max value of [enum ViewportEnvironmentMode] enum." -msgstr "[enum ViewportEnvironmentMode] 枚举的最大值。" - msgid "" "Multisample antialiasing for 3D is disabled. This is the default value, and " "also the fastest setting." @@ -93274,6 +90362,19 @@ msgstr "" "用于 3D 的多重采样抗锯齿,使用每个像素 8 个样本。这对性能有非常大的影响。可能" "在低端和较旧的硬件上不受支持。" +msgid "Do not perform any antialiasing in the full screen post-process." +msgstr "不要在全屏后处理中执行抗锯齿。" + +msgid "" +"Use fast approximate antialiasing. FXAA is a popular screen-space " +"antialiasing method, which is fast but will make the image look blurry, " +"especially at lower resolutions. It can still work relatively well at large " +"resolutions such as 1440p and 4K." +msgstr "" +"使用快速近似抗锯齿(Fast Approximate Anti-Aliasing)。FXAA 是一种流行的屏幕空" +"间抗锯齿方法,速度很快,但会让图像变模糊,使用较低分辨率时尤为显著。1440p 和 " +"4K 等较高分辨率下效果仍然不错。" + msgid "Number of objects drawn in a single frame." msgstr "在单帧中绘制的对象的数量。" @@ -93369,47 +90470,9 @@ msgstr "" "为场景中的 [DirectionalLight3D] 的每个 PSSM 分割着色不同的颜色,以便可以看到" "分割的位置。它们将按顺序被着色为红色、绿色、蓝色、黄色。" -msgid "VRS is disabled." -msgstr "VRS 已禁用。" - -msgid "" -"VRS uses a texture. Note, for stereoscopic use a texture atlas with a " -"texture for each view." -msgstr "" -"VRS 使用一个纹理。请注意,对于立体视觉,请为每个视图使用带有纹理的纹理图集。" - -msgid "VRS texture is supplied by the primary [XRInterface]." -msgstr "VRS 纹理由主 [XRInterface] 提供。" - msgid "Represents the size of the [enum ViewportVRSMode] enum." msgstr "代表 [enum ViewportVRSMode] 枚举的大小。" -msgid "" -"Uses high quality importance sampling to process the radiance map. In " -"general, this results in much higher quality than [constant Sky." -"PROCESS_MODE_REALTIME] but takes much longer to generate. This should not be " -"used if you plan on changing the sky at runtime. If you are finding that the " -"reflection is not blurry enough and is showing sparkles or fireflies, try " -"increasing [member ProjectSettings.rendering/reflections/sky_reflections/" -"ggx_samples]." -msgstr "" -"使用高质量重要性采样处理辐照度贴图。得到的结果通常比 [constant Sky." -"PROCESS_MODE_REALTIME] 的质量更高,但需要花费更多的时间来生成。如果你计划在运" -"行时修改天空,则不应使用。如果你发现反射不够模糊,出现了火花或者萤火虫,请尝" -"试增大 [member ProjectSettings.rendering/reflections/sky_reflections/" -"ggx_samples]。" - -msgid "" -"Uses the fast filtering algorithm to process the radiance map. In general " -"this results in lower quality, but substantially faster run times.\n" -"[b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so " -"[member Sky.radiance_size] must be set to [constant Sky.RADIANCE_SIZE_256]." -msgstr "" -"使用快速过滤算法处理辐照度贴图。一般来说,这会导致质量降低,但运行时间会大大" -"加快。\n" -"[b]注意:[/b]快速过滤算法仅限于 256x256 的立方体贴图,因此 [member Sky." -"radiance_size] 必须被设置为 [constant Sky.RADIANCE_SIZE_256]。" - msgid "Use the clear color as background." msgstr "用透明的颜色作为背景。" @@ -94274,37 +91337,6 @@ msgstr "" "方法将使用缓存版本。可以通过在具有相同路径的新资源上使用 [method Resource." "take_over_path] 来覆盖缓存资源。" -msgid "" -"Loads a resource at the given [param path], caching the result for further " -"access.\n" -"The registered [ResourceFormatLoader]s are queried sequentially to find the " -"first one which can handle the file's extension, and then attempt loading. " -"If loading fails, the remaining ResourceFormatLoaders are also attempted.\n" -"An optional [param type_hint] can be used to further specify the [Resource] " -"type that should be handled by the [ResourceFormatLoader]. Anything that " -"inherits from [Resource] can be used as a type hint, for example [Image].\n" -"The [param cache_mode] property defines whether and how the cache should be " -"used or updated when loading the resource. See [enum CacheMode] for " -"details.\n" -"Returns an empty resource if no [ResourceFormatLoader] could handle the " -"file.\n" -"GDScript has a simplified [method @GDScript.load] built-in method which can " -"be used in most situations, leaving the use of [ResourceLoader] for more " -"advanced scenarios." -msgstr "" -"在给定的 [param path] 中加载资源,并将结果缓存以供进一步访问。\n" -"按顺序查询注册的 [ResourceFormatLoader],以找到可以处理文件扩展名的第一个 " -"[ResourceFormatLoader],然后尝试加载。如果加载失败,则还会尝试其余的 " -"[ResourceFormatLoader]。\n" -"可选的 [param type_hint] 可用于进一步指定 [ResourceFormatLoader] 应处理的 " -"[Resource] 类型。任何继承自 [Resource] 的东西都可以用作类型提示,例如 " -"[Image]。\n" -"[param cache_mode] 属性定义在加载资源时是否以及如何使用或更新缓存。有关详细信" -"息,请参见 [enum CacheMode]。\n" -"如果没有 [ResourceFormatLoader] 可以处理该文件,则返回空资源。\n" -"GDScript 具有一个简化的 [method @GDScript.load] 内置方法,可在大多数情况下使" -"用,而 [ResourceLoader] 供更高级的情况使用。" - msgid "" "Returns the resource loaded by [method load_threaded_request].\n" "If this is called before the loading thread is done (i.e. [method " @@ -95012,14 +92044,6 @@ msgstr "" "添加一个 [code][indent][/code] 标签到标签栈。将 [param level] 乘以当前 " "[member tab_size] 以确定新的边距长度。" -msgid "" -"Adds a [code][font][/code] tag with a italics font to the tag stack. This is " -"the same as adding a [code][i][/code] tag if not currently in a [code][b][/" -"code] tag." -msgstr "" -"在标签栈中添加 [code][font][/code] 标签,字体为斜体。如果当前没有 [code][b][/" -"code] 标签,这与添加 [code][i][/code] 标签相同。" - msgid "" "Adds [code][ol][/code] or [code][ul][/code] tag to the tag stack. Multiplies " "[param level] by current [member tab_size] to determine new margin length." @@ -95918,11 +92942,6 @@ msgstr "" "运动物体的冻结模式。类似于 [constant FREEZE_MODE_STATIC] ,但是在移动时会与其" "路径上的其他物体发生碰撞。适用于需要动画的冻结物体。" -msgid "" -"In this mode, the body's center of mass is calculated automatically based on " -"its shapes." -msgstr "在此模式下,该物体的质心将基于其形状自动计算。" - msgid "" "In this mode, the body's center of mass is set through [member " "center_of_mass]. Defaults to the body's origin position." @@ -97483,16 +94502,6 @@ msgid "" "local variable." msgstr "该选项局限于代码补全查询的位置 - 例如局部变量。" -msgid "" -"The option is from the containing class or a parent class, relative to the " -"location of the code completion query. Perform a bitwise OR with the class " -"depth (e.g. 0 for the local class, 1 for the parent, 2 for the grandparent, " -"etc) to store the depth of an option in a the class or a parent class." -msgstr "" -"该选项来自于所在的类或父类,相对于代码补全查询的位置。请使用类的深度进行按位 " -"OR(或)运算(例如 0 表示当前类,1 表示父类,2 表示父类的父类等),从而在当前" -"类或父类中存储选项的深度。" - msgid "" "The option is from user code which is not local and not in a derived class " "(e.g. Autoload Singletons)." @@ -97611,12 +94620,6 @@ msgid "" "sensitive." msgstr "触摸滚动的死区。较低的死区使滚动更加敏感。" -msgid "The current horizontal scroll value." -msgstr "当前水平滚动值。" - -msgid "The current vertical scroll value." -msgstr "当前垂直滚动值。" - msgid "" "Controls whether vertical scrollbar can be used and when it should be " "visible. See [enum ScrollMode] for options." @@ -98025,31 +95028,6 @@ msgid "" "the [RayCast2D] node." msgstr "用于物理碰撞扫描和即时重叠查询的节点。类似于 [RayCast2D] 节点。" -msgid "" -"Shape casting allows to detect collision objects by sweeping the [member " -"shape] along the cast direction determined by [member target_position] " -"(useful for things like beam weapons).\n" -"Immediate collision overlaps can be done with the [member target_position] " -"set to [code]Vector2(0, 0)[/code] and by calling [method " -"force_shapecast_update] within the same [b]physics_frame[/b]. This also " -"helps to overcome some limitations of [Area2D] when used as a continuous " -"detection area, often requiring waiting a couple of frames before collision " -"information is available to [Area2D] nodes, and when using the signals " -"creates unnecessary complexity.\n" -"The node can detect multiple collision objects, but it's usually used to " -"detect the first collision.\n" -"[b]Note:[/b] shape casting is more computationally expensive compared to ray " -"casting." -msgstr "" -"形状投射能够让 [member shape] 沿着投射方向扫过,检测途中碰撞到的对象,投射方" -"向由 [member target_position] 决定(可用于类似激光武器的东西)。\n" -"要原地检测碰撞重叠,可以将 [member target_position] 设置为 [code]Vector2(0, " -"0)[/code] 并在同一[b]物理帧[/b]中调用 [method force_shapecast_update]。这样也" -"能克服将 [Area2D] 用于连续碰撞检测的一些限制,[Area2D] 节点通常需要等待几帧才" -"能获取碰撞信息,而使用信号则会产生不必要的复杂度。\n" -"这个节点可以检测到多个碰撞对象,但通常只用于检测第一次碰撞。\n" -"[b]注意:[/b]形状投射所需的计算量比光线投射更大。" - msgid "" "Adds a collision exception so the shape does not report collisions with the " "specified [CollisionObject2D] node." @@ -98185,31 +95163,6 @@ msgid "" "the [RayCast3D] node." msgstr "用于物理碰撞扫描和即时重叠查询的节点。类似于 [RayCast3D] 节点。" -msgid "" -"Shape casting allows to detect collision objects by sweeping the [member " -"shape] along the cast direction determined by [member target_position] " -"(useful for things like beam weapons).\n" -"Immediate collision overlaps can be done with the [member target_position] " -"set to [code]Vector3(0, 0, 0)[/code] and by calling [method " -"force_shapecast_update] within the same [b]physics_frame[/b]. This also " -"helps to overcome some limitations of [Area3D] when used as a continuous " -"detection area, often requiring waiting a couple of frames before collision " -"information is available to [Area3D] nodes, and when using the signals " -"creates unnecessary complexity.\n" -"The node can detect multiple collision objects, but it's usually used to " -"detect the first collision.\n" -"[b]Note:[/b] Shape casting is more computationally expensive compared to ray " -"casting." -msgstr "" -"形状投射能够让 [member shape] 沿着投射方向扫过,检测途中碰撞到的对象,投射方" -"向由 [member target_position] 决定(可用于类似激光武器的东西)。\n" -"要原地检测碰撞重叠,可以将 [member target_position] 设置为 [code]Vector3(0, " -"0, 0)[/code] 并在同一[b]物理帧[/b]中调用 [method force_shapecast_update]。这" -"样也能克服将 [Area2D] 用于连续碰撞检测的一些限制,[Area3D] 节点通常需要等待几" -"帧才能获取碰撞信息,而使用信号则会产生不必要的复杂度。\n" -"这个节点可以检测到多个碰撞对象,但通常只用于检测第一次碰撞。\n" -"[b]注意:[/b]形状投射所需的计算量比光线投射更大。" - msgid "" "Adds a collision exception so the shape does not report collisions with the " "specified [CollisionObject3D] node." @@ -98997,14 +95950,6 @@ msgid "" "performs initialization." msgstr "安装修改器时调用。修改器在此时执行初始化。" -msgid "" -"Takes a angle and clamps it so it is within the passed-in [param min] and " -"[param max] range. [param invert] will inversely clamp the angle, clamping " -"it to the range outside of the given bounds." -msgstr "" -"接受角度并将其钳制在传入的 [param min] 和 [param max] 范围内。[param invert] " -"会逆向钳制该角度,将其钳制在给定范围之外。" - msgid "" "Returns whether this modification will call [method _draw_editor_gizmo] in " "the Godot editor to draw modification-specific gizmos." @@ -99191,46 +96136,6 @@ msgid "" "reach a target." msgstr "使用 FABRIK 操纵一系列 [Bone2D] 到达某个目标的修改器。" -msgid "" -"This [SkeletonModification2D] uses an algorithm called Forward And Backward " -"Reaching Inverse Kinematics, or FABRIK, to rotate a bone chain so that it " -"reaches a target.\n" -"FABRIK works by knowing the positions and lengths of a series of bones, " -"typically called a \"bone chain\". It first starts by running a forward " -"pass, which places the final bone at the target's position. Then all other " -"bones are moved towards the tip bone, so they stay at the defined bone " -"length away. Then a backwards pass is performed, where the root/first bone " -"in the FABRIK chain is placed back at the origin. then all other bones are " -"moved so they stay at the defined bone length away. This positions the bone " -"chain so that it reaches the target when possible, but all of the bones stay " -"the correct length away from each other.\n" -"Because of how FABRIK works, it often gives more natural results than those " -"seen in [SkeletonModification2DCCDIK]. FABRIK also supports angle " -"constraints, which are fully taken into account when solving.\n" -"[b]Note:[/b] The FABRIK modifier has [code]fabrik_joints[/code], which are " -"the data objects that hold the data for each joint in the FABRIK chain. This " -"is different from [Bone2D] nodes! FABRIK joints hold the data needed for " -"each [Bone2D] in the bone chain used by FABRIK.\n" -"To help control how the FABRIK joints move, a magnet vector can be passed, " -"which can nudge the bones in a certain direction prior to solving, giving a " -"level of control over the final result." -msgstr "" -"这种 [SkeletonModification2D] 使用的是名为前后延伸反向运动学(Forward And " -"Backward Reaching Inverse Kinematics)的算法,即 FABRIK,能够对一条骨骼链进行" -"旋转,从而抵达目标。\n" -"FABRIK 需要先拿到一系列骨骼的位置和长度,这组骨骼通常称作“骨骼链”。它首先会做" -"一次向前处理,将最终的骨骼放置在目标的位置。然后让所有其他骨骼朝尖端骨骼移" -"动,恢复原有的骨骼长度。然后再做一次向后处理,将 FABRIK 链中的根/第一根骨骼放" -"回原点。然后移动所有其他骨骼,恢复原有的骨骼长度。这样就尽可能地让骨骼链抵达" -"了目标,并且所有骨骼之间的长度仍然为正确的长度。\n" -"由于 FABRIK 的工作原理,它通常比 [SkeletonModification2DCCDIK] 得到的结果更加" -"自然。FABRIK 还支持角度约束,在求解过程中会完全遵守这些约束。\n" -"[b]注意:[/b]FABRIK 修改器具有关节属性 [code]fabrik_joints[/code],里面是存" -"放 FABRIK 链中各个关节数据的数据对象。关节和 [Bone2D] 是两码事!FABRIK 关节存" -"放的是 FABRIK 所使用的骨骼链中每根 [Bone2D] 所需的数据。\n" -"可以传入磁铁向量来帮助控制 FABRIK 关节的移动,会在求解前让骨骼朝某个方向做略" -"微的移动,对最终结果进行微调。" - msgid "" "Returns the [Bone2D] node assigned to the FABRIK joint at [param joint_idx]." msgstr "返回分配给位于 [param joint_idx] 的 FABRIK 关节的 [Bone2D] 节点。" @@ -99548,13 +96453,6 @@ msgstr "" "的 [PhysicalBone2D] 节点,这允许 [Bone2D] 节点对物理做出反应。\n" "实验性的。物理骨骼在未来可能会被改变,以便自行执行 [Bone2D] 的位置更新。" -msgid "" -"Empties the list of [PhysicalBone2D] nodes and populates it will all " -"[PhysicalBone2D] nodes that are children of the [Skeleton2D]." -msgstr "" -"清空 [PhysicalBone2D] 节点列表,并使用该 [Skeleton2D] 节点的所有 " -"[PhysicalBone2D] 子节点填充该列表。" - msgid "Returns the [PhysicalBone2D] node at [param joint_idx]." msgstr "返回位于 [param joint_idx] 的 [PhysicalBone2D] 节点。" @@ -100110,22 +97008,6 @@ msgstr "" "sky_reflections/roughness_layers] 决定。当需要最高质量的辐照度贴图,但天空更" "新缓慢时,请使用该选项。" -msgid "" -"Uses the fast filtering algorithm to process the radiance map. In general " -"this results in lower quality, but substantially faster run times. If you " -"need better quality, but still need to update the sky every frame, consider " -"turning on [member ProjectSettings.rendering/reflections/sky_reflections/" -"fast_filter_high_quality].\n" -"[b]Note:[/b] The fast filtering algorithm is limited to 256x256 cubemaps, so " -"[member radiance_size] must be set to [constant RADIANCE_SIZE_256]." -msgstr "" -"使用快速过滤算法处理辐照度贴图。一般来说,这会导致质量较低,但运行时间会大大" -"加快。如果需要更好的质量,但仍需要每帧更新天空,请考虑开启 [member " -"ProjectSettings.rendering/reflections/sky_reflections/" -"fast_filter_high_quality]。\n" -"[b]注意:[/b]快速过滤算法被限制为 256x256 立方体贴图,因此 [member " -"radiance_size] 必须被设置为 [constant RADIANCE_SIZE_256]。" - msgid "Base class for GUI sliders." msgstr "GUI 滑动条的基类。" @@ -101154,40 +98036,6 @@ msgstr "" "境光遮蔽、粗糙度和金属性贴图使用单独的纹理。要为所有 3 个纹理使用一个 ORM 贴" "图,请使用 [ORMMaterial3D] 代替。" -msgid "" -"Physics body for 2D physics which is static or moves only by script. Useful " -"for floor and walls." -msgstr "静态或者只能被脚本移动的 2D 物理物体。可用于地面和墙体。" - -msgid "" -"Static body for 2D physics.\n" -"A static body is a simple body that doesn't move under physics simulation, i." -"e. it can't be moved by external forces or contacts but its transformation " -"can still be updated manually by the user. It is ideal for implementing " -"objects in the environment, such as walls or platforms. In contrast to " -"[RigidBody2D], it doesn't consume any CPU resources as long as they don't " -"move.\n" -"They have extra functionalities to move and affect other bodies:\n" -"[b]Static transform change:[/b] Static bodies can be moved by animation or " -"script. In this case, they are just teleported and don't affect other bodies " -"on their path.\n" -"[b]Constant velocity:[/b] When [member constant_linear_velocity] or [member " -"constant_angular_velocity] is set, static bodies don't move themselves but " -"affect touching bodies as if they were moving. This is useful for simulating " -"conveyor belts or conveyor wheels." -msgstr "" -"静态物体,用于 2D 物理。\n" -"静态物体是一种不会在物理仿真中移动的简单物体,也就是说,它无法被外力移动,也" -"无法因为碰触而移动,但用户仍然可以对它的变换进行手动更新。用来实现墙壁、平台" -"等环境中的对象非常理想。与 [RigidBody2D] 不同,静态物体只要不移动,就不会消耗" -"任何 CPU 资源。\n" -"静态物体还能移动和影响其他物体。\n" -"[b]改变静态变换:[/b]静态物体可以通过动画或脚本来移动。在这种情况下它们是被传" -"送的,不会影响移动路径上的其他物体。\n" -"[b]恒定速度:[/b]当 [member constant_linear_velocity] 或 [member " -"constant_angular_velocity] 被设置时,静态物体虽然自己不会移动,但会影响与之接" -"触的物体,就好像这些静态物体是在移动一样。可用于模拟传送带或传送轮。" - msgid "" "The body's constant angular velocity. This does not rotate the body, but " "affects touching bodies, as if it were rotating." @@ -101202,45 +98050,6 @@ msgstr "" "该物体的恒定线速度。不会移动该物体,但会影响接触的物体,就好像这个静态物体正" "在移动一样。" -msgid "" -"Physics body for 3D physics which is static or moves only by script. Useful " -"for floor and walls." -msgstr "静态或者只能被脚本移动的 3D 物理物体。可用于地面和墙体。" - -msgid "" -"Static body for 3D physics.\n" -"A static body is a simple body that doesn't move under physics simulation, i." -"e. it can't be moved by external forces or contacts but its transformation " -"can still be updated manually by the user. It is ideal for implementing " -"objects in the environment, such as walls or platforms. In contrast to " -"[RigidBody3D], it doesn't consume any CPU resources as long as they don't " -"move.\n" -"They have extra functionalities to move and affect other bodies:\n" -"[i]Static transform change:[/i] Static bodies can be moved by animation or " -"script. In this case, they are just teleported and don't affect other bodies " -"on their path.\n" -"[i]Constant velocity:[/i] When [member constant_linear_velocity] or [member " -"constant_angular_velocity] is set, static bodies don't move themselves but " -"affect touching bodies as if they were moving. This is useful for simulating " -"conveyor belts or conveyor wheels.\n" -"[b]Warning:[/b] With a non-uniform scale this node will probably not " -"function as expected. Please make sure to keep its scale uniform (i.e. the " -"same on all axes), and change the size(s) of its collision shape(s) instead." -msgstr "" -"静态物体,用于 2D 物理。\n" -"静态物体是一种不会在物理仿真中移动的简单物体,也就是说,它无法被外力移动,也" -"无法因为碰触而移动,但用户仍然可以对它的变换进行手动更新。用来实现墙壁、平台" -"等环境中的对象非常理想。与 [RigidBody3D] 不同,静态物体只要不移动,就不会消耗" -"任何 CPU 资源。\n" -"静态物体还能移动和影响其他物体。\n" -"[i]改变静态变换:[/i]静态物体可以通过动画或脚本来移动。在这种情况下它们是被传" -"送的,不会影响移动路径上的其他物体。\n" -"[i]恒定速度:[/i]当 [member constant_linear_velocity] 或 [member " -"constant_angular_velocity] 被设置时,静态物体虽然自己不会移动,但会影响与之接" -"触的物体,就好像这些静态物体是在移动一样。可用于模拟传送带或传送轮。\n" -"[b]警告:[/b]如果缩放不统一,该节点可能无法正常工作。请确保缩放的统一(即各轴" -"都相同),可以改为修改碰撞形状的大小。" - msgid "Abstraction and base class for stream-based protocols." msgstr "基于流的协议的抽象和基类。" @@ -101377,33 +98186,6 @@ msgstr "" "通过连接发送数据。如果数据无法一次性发完,则仅会发送部分数据。该函数返回两个" "值,一个 [enum Error] 错误码以及一个整数,表示实际发送的数据量。" -msgid "" -"Puts a zero-terminated ASCII string into the stream prepended by a 32-bit " -"unsigned integer representing its size.\n" -"[b]Note:[/b] To put an ASCII string without prepending its size, you can use " -"[method put_data]:\n" -"[codeblocks]\n" -"[gdscript]\n" -"put_data(\"Hello world\".to_ascii())\n" -"[/gdscript]\n" -"[csharp]\n" -"PutData(\"Hello World\".ToAscii());\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"向流中放入一个以零结尾的 ASCII 字符串,会前置一个表示其大小的 32 位无符号整" -"数。\n" -"[b]注意:[/b]如果要放置 ASCII 字符串,而不前置大小,可以使用 [method " -"put_data]:\n" -"[codeblocks]\n" -"[gdscript]\n" -"put_data(\"Hello world\".to_ascii())\n" -"[/gdscript]\n" -"[csharp]\n" -"PutData(\"Hello World\".ToAscii());\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "Puts an unsigned 16-bit value into the stream." msgstr "向流中放入一个无符号 16 位值。" @@ -101416,33 +98198,6 @@ msgstr "向流中放入一个无符号 64 位值。" msgid "Puts an unsigned byte into the stream." msgstr "向流中放入一个无符号字节。" -msgid "" -"Puts a zero-terminated UTF-8 string into the stream prepended by a 32 bits " -"unsigned integer representing its size.\n" -"[b]Note:[/b] To put an UTF-8 string without prepending its size, you can use " -"[method put_data]:\n" -"[codeblocks]\n" -"[gdscript]\n" -"put_data(\"Hello world\".to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"PutData(\"Hello World\".ToUtf8());\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"向流中放入一个以零结尾的 UTF-8 字符串,前置一个表示其大小的 32 位无符号整" -"数。\n" -"[b]注意:[/b]如果要放置 UTF-8 字符串,而不前置其大小,可以使用 [method " -"put_data]:\n" -"[codeblocks]\n" -"[gdscript]\n" -"put_data(\"Hello world\".to_utf8())\n" -"[/gdscript]\n" -"[csharp]\n" -"PutData(\"Hello World\".ToUTF8());\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "" "Puts a Variant into the stream. If [param full_objects] is [code]true[/code] " "encoding objects is allowed (and can potentially include code).\n" @@ -101633,19 +98388,6 @@ msgstr "表示处于错误状态的 [StreamPeerTCP] 的状态。" msgid "TLS stream peer." msgstr "TLS 流对等体。" -msgid "" -"TLS stream peer. This object can be used to connect to an TLS server or " -"accept a single TLS client connection.\n" -"[b]Note:[/b] When exporting to Android, make sure to enable the " -"[code]INTERNET[/code] permission in the Android export preset before " -"exporting the project or using one-click deploy. Otherwise, network " -"communication of any kind will be blocked by Android." -msgstr "" -"TLS 流对等体。此对象可用于连接到 TLS 服务器或接受单个 TLS 客户端连接。\n" -"[b]注意:[/b] 当导出到 Android 时,确保在导出项目或使用一键部署之前,在 " -"Android 导出预设中启用 [code]INTERNET[/code] 权限。否则,任何形式的网络通信都" -"会被 Android 阻止。" - msgid "" "Accepts a peer connection as a server using the given [param " "server_options]. See [method TLSOptions.server]." @@ -103804,11 +100546,6 @@ msgstr "" "anti_aliasing] 设为 [code]false[/code],这样可以保证画面锐利、避免一些显示问" "题。" -msgid "" -"This changes the size of the faded ring. Higher values can be used to " -"achieve a \"blurry\" effect." -msgstr "这将改变褪色环的大小。更高的数值可以用来实现 \"模糊 \"的效果。" - msgid "The background color of the stylebox." msgstr "StyleBox的背景颜色。" @@ -104557,16 +101294,6 @@ msgstr "" "默认情况下,仅使用 4 个骨骼影响([constant SKIN_4_WEIGHTS])\n" "[b]注意:[/b]该函数接受一个枚举,而不是权重的确切数量。" -msgid "" -"Specifies the smooth group to use for the [i]next[/i] vertex. If this is " -"never called, all vertices will have the default smooth group of [code]0[/" -"code] and will be smoothed with adjacent vertices of the same group. To " -"produce a mesh with flat normals, set the smooth group to [code]-1[/code]." -msgstr "" -"指定用于[i]下一个[/i]顶点的平滑组。如果从未调用过,则所有顶点都将具有默认的 " -"[code]0[/code] 平滑组,并将与同一组的相邻顶点一起平滑。要生成具有平坦法线的网" -"格,请将平滑组设置为 [code]-1[/code]。" - msgid "" "Specifies a tangent to use for the [i]next[/i] vertex. If every vertex needs " "to have this information set and you fail to submit it for the first vertex, " @@ -104671,19 +101398,6 @@ msgstr "每个单独的顶点最多能够受到 8 个骨骼权重的影响。" msgid "Base Syntax highlighter resource for [TextEdit]." msgstr "用于 [TextEdit] 的基础语法高亮器资源。" -msgid "" -"Base syntax highlighter resource all syntax highlighters extend from, " -"provides syntax highlighting data to [TextEdit].\n" -"The associated [TextEdit] node will call into the [SyntaxHighlighter] on a " -"as needed basis.\n" -"[b]Note:[/b] Each Syntax highlighter instance should not be shared across " -"multiple [TextEdit] nodes." -msgstr "" -"基础语法高亮器资源,所有语法高亮器都从这个类继承,向 [TextEdit] 提供语法高亮" -"数据。\n" -"关联的 [TextEdit] 节点会根据需要调用 [SyntaxHighlighter]。\n" -"[b]注意:[/b]不应在多个 [TextEdit] 节点间共享语法高亮器实例。" - msgid "Virtual method which can be overridden to clear any local caches." msgstr "虚方法,覆盖后可以清空本地缓存。" @@ -104973,13 +101687,6 @@ msgid "" msgstr "" "设置所有选项卡应被限制的最大宽度。如果设置为 [code]0[/code],则无限制。" -msgid "" -"If [code]true[/code], the tab offset will be changed to keep the the " -"currently selected tab visible." -msgstr "" -"如果为 [code]true[/code],则会更改选项卡偏移量,从而保持当前选中的选项卡可" -"见。" - msgid "" "if [code]true[/code], the mouse's scroll wheel can be used to navigate the " "scroll view." @@ -107181,33 +103888,6 @@ msgstr "" msgid "Returns [code]true[/code] if locale is right-to-left." msgstr "如果区域设置为从右至左,则返回 [code]true[/code]。" -msgid "" -"Returns [code]true[/code] is [param string] is a valid identifier.\n" -"If the text server supports the [constant FEATURE_UNICODE_IDENTIFIERS] " -"feature, a valid identifier must:\n" -"- Conform to normalization form C.\n" -"- Begin with a Unicode character of class XID_Start or [code]\"_\"[/code].\n" -"- May contain Unicode characters of class XID_Continue in the other " -"positions.\n" -"- Use UAX #31 recommended scripts only (mixed scripts are allowed).\n" -"If the [constant FEATURE_UNICODE_IDENTIFIERS] feature is not supported, a " -"valid identifier must:\n" -"- Begin with a Unicode character of class XID_Start or [code]\"_\"[/code].\n" -"- May contain Unicode characters of class XID_Continue in the other " -"positions." -msgstr "" -"如果 [param string] 为有效的标识符,则返回 [code]true[/code]。\n" -"如果文字服务器支持 [constant FEATURE_UNICODE_IDENTIFIERS] 特性,则有效的标识" -"符必须:\n" -"- 遵循 C 范式。\n" -"- 开头是 XID_Start 类的 Unicode 字符或 [code]\"_\"[/code]。\n" -"- 其他位置可以包含 XID_Continue 类的 Unicode 字符。\n" -"- 仅使用 UAX #31 推荐的文字(允许混合文字)。\n" -"如果不支持 [constant FEATURE_UNICODE_IDENTIFIERS] 特性,则有效的标识符必" -"须:\n" -"- 开头是 XID_Start 类的 Unicode 字符或 [code]\"_\"[/code]。\n" -"- 其他位置可以包含 XID_Continue 类的 Unicode 字符。" - msgid "" "Loads optional TextServer database (e.g. ICU break iterators and " "dictionaries).\n" @@ -108386,12 +105066,28 @@ msgid "" "Each image is of the same size and format." msgstr "包含多个 [Image] 的纹理类型的基类。每个图像的大小和格式都是一样的。" +msgid "" +"Base class for [ImageTextureLayered] and [CompressedTextureLayered]. Cannot " +"be used directly, but contains all the functions necessary for accessing the " +"derived resource types. See also [Texture3D].\n" +"Data is set on a per-layer basis. For [Texture2DArray]s, the layer specifies " +"the array layer.\n" +"All images need to have the same width, height and number of mipmap levels.\n" +"A [TextureLayered] can be loaded with [method ResourceLoader.load].\n" +"Internally, Godot maps these files to their respective counterparts in the " +"target rendering driver (Vulkan, OpenGL3)." +msgstr "" +"[ImageTextureLayered] 和 [CompressedTextureLayered] 的基类。不能直接使用,但" +"包含了访问派生资源类型所需的所有函数。另见 [Texture3D]。\n" +"数据是按层设置的。对于 [Texture2DArray],层指定的是数组层。\n" +"所有图像都需要具有相同的宽度、高度和 mipmap 级别数。\n" +"[TextureLayered] 可以用 [method ResourceLoader.load] 加载。\n" +"在内部,Godot 将这些文件映射到目标渲染驱动程序(Vulkan、OpenGL3)中的对应文" +"件。" + msgid "Called when the [TextureLayered]'s format is queried." msgstr "查询该 [TextureLayered] 的格式时被调用。" -msgid "Called when the the [TextureLayered]'s height is queried." -msgstr "查询该 [TextureLayered] 的高度时被调用。" - msgid "Called when the data for a layer in the [TextureLayered] is queried." msgstr "查询该 [TextureLayered] 中某一层的数据时被调用。" @@ -110290,33 +106986,6 @@ msgstr "设置图案的大小。" msgid "Tile library for tilemaps." msgstr "Tilemap 的图块库。" -msgid "" -"A TileSet is a library of tiles for a [TileMap]. A TileSet handles a list of " -"[TileSetSource], each of them storing a set of tiles.\n" -"Tiles can either be from a [TileSetAtlasSource], that render tiles out of a " -"texture with support for physics, navigation, etc... or from a " -"[TileSetScenesCollectionSource] which exposes scene-based tiles.\n" -"Tiles are referenced by using three IDs: their source ID, their atlas " -"coordinates ID and their alternative tile ID.\n" -"A TileSet can be configured so that its tiles expose more or less " -"properties. To do so, the TileSet resources uses property layers, that you " -"can add or remove depending on your needs.\n" -"For example, adding a physics layer allows giving collision shapes to your " -"tiles. Each layer having dedicated properties (physics layer an mask), you " -"may add several TileSet physics layers for each type of collision you need.\n" -"See the functions to add new layers for more information." -msgstr "" -"TileSet 是 [TileMap] 的图块库。TileSet 处理 [TileSetSource] 列表,每个表中存" -"储一组图块。\n" -"图块既可以来自 [TileSetAtlasSource],可以渲染纹理中的图块,支持物理、导航等功" -"能,也可以来自 [TileSetScenesCollectionSource],提供基于场景的图块。\n" -"图块通过使用三个 ID 来引用:源 ID、图集坐标 ID、备选图块 ID。\n" -"TileSet 可以配置图块暴露哪些属性。为了做到这一点,TileSet 资源使用了属性层," -"你可以根据需要进行添加和删除。\n" -"例如,添加物理层可以为瓷砖提供碰撞形状。不同的层都有不同的属性(物理层和遮" -"罩),要实现不同类型的碰撞,你也可以添加多个 TileSet 物理层。\n" -"更多信息请参阅添加新层的函数。" - msgid "" "Adds a custom data layer to the TileSet at the given position [param " "to_position] in the array. If [param to_position] is -1, adds it at the end " @@ -110364,17 +107033,6 @@ msgstr "" "[param to_position] 为 -1,则会将其添加到数组的末尾。\n" "物理层能够为图集图块分配碰撞多边形。" -msgid "" -"Adds a [TileSetSource] to the TileSet. If [param atlas_source_id_override] " -"is not -1, also set its source ID. Otherwise, a unique identifier is " -"automatically generated.\n" -"The function returns the added source source ID or -1 if the source could " -"not be added." -msgstr "" -"在 TileSet 中添加 [TileSetSource]。如果 [param atlas_source_id_override] 不" -"为 -1,则还会设置其源 ID。否则会自动生成唯一标识符。\n" -"函数返回添加的源 ID,如果无法添加源则返回 -1。" - msgid "" "Adds a new terrain to the given terrain set [param terrain_set] at the given " "position [param to_position] in the array. If [param to_position] is -1, " @@ -110718,23 +107376,6 @@ msgstr "设置给定 TileSet 物理层中物体的物理材质。" msgid "Changes a source's ID." msgstr "更改源的 ID。" -msgid "" -"Creates a source-level proxy for the given source ID. A proxy will map set " -"of tile identifiers to another set of identifiers. Both the atlac " -"coordinates ID and the alternative tile ID are kept the same when using " -"source-level proxies.\n" -"This can be used to replace a source in all TileMaps using this TileSet, as " -"TileMap nodes will find and use the proxy's target source when one is " -"available.\n" -"Proxied tiles can be automatically replaced in TileMap nodes using the " -"editor." -msgstr "" -"为给定的源 ID 创建源级代理。代理会将一组图块标识符映射到另一组标识符。使用源" -"级代理时,图集坐标 ID 和备选图块 ID 均保持不变。\n" -"可以用来替换使用此 TileSet 的所有 TileMap 中的某个源,因为 TileMap 节点将在目" -"标源可用时找到并使用代理的目标源。\n" -"可以使用编辑器自动替换 TileMap 节点中的代理图块。" - msgid "" "Sets a terrain's color. This color is used for identifying the different " "terrains in the TileSet editor." @@ -111212,13 +107853,6 @@ msgstr "" "设置 ID 为 [param id] 的场景图块是否应该在编辑器中显示为占位符。对不可见的场" "景可能有用。" -msgid "" -"Changes a scene tile's ID from [param id] to [param new_id]. This will fail " -"if there is already a tile with a ID equal to [param new_id]." -msgstr "" -"将场景图块的 ID 从 [param id] 改为 [param new_id]。如果已经存在 ID 为 [param " -"new_id] 的图块则会失败。" - msgid "" "Assigns a [PackedScene] resource to the scene tile with [param id]. This " "will fail if the scene does not extend CanvasItem, as positioning properties " @@ -111629,16 +108263,6 @@ msgstr "星期六,使用数字 [code]6[/code] 表示。" msgid "A countdown timer." msgstr "倒数计时器。" -msgid "" -"Counts down a specified interval and emits a signal on reaching 0. Can be " -"set to repeat or \"one-shot\" mode.\n" -"[b]Note:[/b] To create a one-shot timer without instantiating a node, use " -"[method SceneTree.create_timer]." -msgstr "" -"可以设置为重复或“一次性”模式。\n" -"[b]注意:[/b]要创建一次性定时器而不需要实例化一个节点,请使用 [method " -"SceneTree.create_timer]。" - msgid "Returns [code]true[/code] if the timer is stopped." msgstr "如果定时器被停止,返回 [code]true[/code]。" @@ -111691,22 +108315,6 @@ msgstr "" "[b]注意:[/b]该值是只读的,无法设置。基于的是 [member wait_time],请使用 " "[method start] 设置。" -msgid "" -"The wait time in seconds.\n" -"[b]Note:[/b] Timers can only emit once per rendered frame at most (or once " -"per physics frame if [member process_callback] is [constant " -"TIMER_PROCESS_PHYSICS]). This means very low wait times (lower than 0.05 " -"seconds) will behave in significantly different ways depending on the " -"rendered framerate. For very low wait times, it is recommended to use a " -"process loop in a script instead of using a Timer node." -msgstr "" -"等待时间,单位为秒。\n" -"[b]注意:[/b]计时器在每个渲染帧最多只能发射一次(或者如果 [member " -"process_callback] 为 [constant TIMER_PROCESS_PHYSICS],则是每个物理帧)。这意" -"味着非常短的等待时间(低于 0.05 秒),将根据渲染的帧速率,会有明显不同的表" -"现。对于非常短的等待时间,建议在脚本中使用一个 process 循环,而不是使用 " -"Timer 节点。" - msgid "" "Update the timer during the physics step at each frame (fixed framerate " "processing)." @@ -114637,256 +111245,6 @@ msgstr "当该 [Tweener] 刚刚完成其任务时触发。" msgid "Helper class to implement a UDP server." msgstr "用于实现 UDP 服务器的辅助类。" -msgid "" -"A simple server that opens a UDP socket and returns connected " -"[PacketPeerUDP] upon receiving new packets. See also [method PacketPeerUDP." -"connect_to_host].\n" -"After starting the server ([method listen]), you will need to [method poll] " -"it at regular intervals (e.g. inside [method Node._process]) for it to " -"process new packets, delivering them to the appropriate [PacketPeerUDP], and " -"taking new connections.\n" -"Below a small example of how it can be used:\n" -"[codeblocks]\n" -"[gdscript]\n" -"# server_node.gd\n" -"class_name ServerNode\n" -"extends Node\n" -"\n" -"var server := UDPServer.new()\n" -"var peers = []\n" -"\n" -"func _ready():\n" -" server.listen(4242)\n" -"\n" -"func _process(delta):\n" -" server.poll() # Important!\n" -" if server.is_connection_available():\n" -" var peer: PacketPeerUDP = server.take_connection()\n" -" var packet = peer.get_packet()\n" -" print(\"Accepted peer: %s:%s\" % [peer.get_packet_ip(), peer." -"get_packet_port()])\n" -" print(\"Received data: %s\" % [packet.get_string_from_utf8()])\n" -" # Reply so it knows we received the message.\n" -" peer.put_packet(packet)\n" -" # Keep a reference so we can keep contacting the remote peer.\n" -" peers.append(peer)\n" -"\n" -" for i in range(0, peers.size()):\n" -" pass # Do something with the connected peers.\n" -"[/gdscript]\n" -"[csharp]\n" -"// ServerNode.cs\n" -"using Godot;\n" -"using System.Collections.Generic;\n" -"\n" -"public partial class ServerNode : Node\n" -"{\n" -" private UdpServer _server = new UdpServer();\n" -" private List _peers = new List();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _server.Listen(4242);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" _server.Poll(); // Important!\n" -" if (_server.IsConnectionAvailable())\n" -" {\n" -" PacketPeerUdp peer = _server.TakeConnection();\n" -" byte[] packet = peer.GetPacket();\n" -" GD.Print($\"Accepted Peer: {peer.GetPacketIP()}:{peer." -"GetPacketPort()}\");\n" -" GD.Print($\"Received Data: {packet.GetStringFromUtf8()}\");\n" -" // Reply so it knows we received the message.\n" -" peer.PutPacket(packet);\n" -" // Keep a reference so we can keep contacting the remote peer.\n" -" _peers.Add(peer);\n" -" }\n" -" foreach (var peer in _peers)\n" -" {\n" -" // Do something with the peers.\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[codeblocks]\n" -"[gdscript]\n" -"# client_node.gd\n" -"class_name ClientNode\n" -"extends Node\n" -"\n" -"var udp := PacketPeerUDP.new()\n" -"var connected = false\n" -"\n" -"func _ready():\n" -" udp.connect_to_host(\"127.0.0.1\", 4242)\n" -"\n" -"func _process(delta):\n" -" if !connected:\n" -" # Try to contact server\n" -" udp.put_packet(\"The answer is... 42!\".to_utf8())\n" -" if udp.get_available_packet_count() > 0:\n" -" print(\"Connected: %s\" % udp.get_packet().get_string_from_utf8())\n" -" connected = true\n" -"[/gdscript]\n" -"[csharp]\n" -"// ClientNode.cs\n" -"using Godot;\n" -"\n" -"public partial class ClientNode : Node\n" -"{\n" -" private PacketPeerUdp _udp = new PacketPeerUdp();\n" -" private bool _connected = false;\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _udp.ConnectToHost(\"127.0.0.1\", 4242);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" if (!_connected)\n" -" {\n" -" // Try to contact server\n" -" _udp.PutPacket(\"The Answer Is..42!\".ToUtf8());\n" -" }\n" -" if (_udp.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"Connected: {_udp.GetPacket()." -"GetStringFromUtf8()}\");\n" -" _connected = true;\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" -msgstr "" -"简易服务器,会打开 UDP 套接字,并在收到新数据包时返回已连接的 " -"[PacketPeerUDP]。另见 [method PacketPeerUDP.connect_to_host]。\n" -"服务器启动后([method listen]),你需要调用 [method poll] 按照一定的间隔轮询" -"(例如在 [method Node._process] 中)才能处理新数据包、将它们传递给合适的 " -"[PacketPeerUDP]、获取新连接。\n" -"下面是简单的用法示例:\n" -"[codeblocks]\n" -"[gdscript]\n" -"# server_node.gd\n" -"class_name ServerNode\n" -"extends Node\n" -"\n" -"var server := UDPServer.new()\n" -"var peers = []\n" -"\n" -"func _ready():\n" -" server.listen(4242)\n" -"\n" -"func _process(delta):\n" -" server.poll() # 重要!\n" -" if server.is_connection_available():\n" -" var peer: PacketPeerUDP = server.take_connection()\n" -" var packet = peer.get_packet()\n" -" print(\"接受对等体:%s:%s\" % [peer.get_packet_ip(), peer." -"get_packet_port()])\n" -" print(\"接收到数据:%s\" % [packet.get_string_from_utf8()])\n" -" # 进行回复,这样对方就知道我们收到了消息。\n" -" peer.put_packet(packet)\n" -" # 保持引用,这样我们就能继续与远程对等体联系。\n" -" peers.append(peer)\n" -"\n" -" for i in range(0, peers.size()):\n" -" pass # 针对已连接的对等体进行操作。\n" -"[/gdscript]\n" -"[csharp]\n" -"// ServerNode.cs\n" -"using Godot;\n" -"using System.Collections.Generic;\n" -"\n" -"public partial class ServerNode : Node\n" -"{\n" -" private UdpServer _server = new UdpServer();\n" -" private List _peers = new List();\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _server.Listen(4242);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" _server.Poll(); // 重要!\n" -" if (_server.IsConnectionAvailable())\n" -" {\n" -" PacketPeerUdp peer = _server.TakeConnection();\n" -" byte[] packet = peer.GetPacket();\n" -" GD.Print($\"接受对等体:{peer.GetPacketIP()}:{peer." -"GetPacketPort()}\");\n" -" GD.Print($\"接收到数据:{packet.GetStringFromUtf8()}\");\n" -" // 进行回复,这样对方就知道我们收到了消息。\n" -" peer.PutPacket(packet);\n" -" // 保持引用,这样我们就能继续与远程对等体联系。\n" -" _peers.Add(peer);\n" -" }\n" -" foreach (var peer in _peers)\n" -" {\n" -" // 针对已连接的对等体进行操作。\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]\n" -"[codeblocks]\n" -"[gdscript]\n" -"# client_node.gd\n" -"class_name ClientNode\n" -"extends Node\n" -"\n" -"var udp := PacketPeerUDP.new()\n" -"var connected = false\n" -"\n" -"func _ready():\n" -" udp.connect_to_host(\"127.0.0.1\", 4242)\n" -"\n" -"func _process(delta):\n" -" if !connected:\n" -" # 尝试连接服务器\n" -" udp.put_packet(\"答案是……42!\".to_utf8())\n" -" if udp.get_available_packet_count() > 0:\n" -" print(\"已连接:%s\" % udp.get_packet().get_string_from_utf8())\n" -" connected = true\n" -"[/gdscript]\n" -"[csharp]\n" -"// ClientNode.cs\n" -"using Godot;\n" -"\n" -"public partial class ClientNode : Node\n" -"{\n" -" private PacketPeerUdp _udp = new PacketPeerUdp();\n" -" private bool _connected = false;\n" -"\n" -" public override void _Ready()\n" -" {\n" -" _udp.ConnectToHost(\"127.0.0.1\", 4242);\n" -" }\n" -"\n" -" public override void _Process(double delta)\n" -" {\n" -" if (!_connected)\n" -" {\n" -" // 尝试联系服务器\n" -" _udp.PutPacket(\"答案是……42!\".ToUtf8());\n" -" }\n" -" if (_udp.GetAvailablePacketCount() > 0)\n" -" {\n" -" GD.Print($\"已连接:{_udp.GetPacket().GetStringFromUtf8()}\");\n" -" _connected = true;\n" -" }\n" -" }\n" -"}\n" -"[/csharp]\n" -"[/codeblocks]" - msgid "" "Returns [code]true[/code] if a packet with a new address/port combination " "was received on the socket." @@ -116215,12 +112573,11 @@ msgstr "" "[/codeblock]" msgid "" -"Returns [code]true[/code] if this vector and [code]v[/code] are " -"approximately equal, by running [method @GlobalScope.is_equal_approx] on " -"each component." +"Returns [code]true[/code] if this vector and [param to] are approximately " +"equal, by running [method @GlobalScope.is_equal_approx] on each component." msgstr "" -"如果这个向量和 [code]v[/code] 大约相等,则返回 [code]true[/code],比较的方法" -"是对每个分量执行 [method @GlobalScope.is_equal_approx]。" +"如果这个向量与 [param to] 大致相等,则返回 [code]true[/code],判断方法是对每" +"个分量执行 [method @GlobalScope.is_equal_approx]。" msgid "" "Returns [code]true[/code] if this vector is finite, by calling [method " @@ -116296,12 +112653,12 @@ msgstr "" msgid "" "Returns the result of scaling the vector to unit length. Equivalent to " "[code]v / v.length()[/code]. See also [method is_normalized].\n" -"[b]Note:[/b] This function may return incorrect values if the initial vector " +"[b]Note:[/b] This function may return incorrect values if the input vector " "length is near zero." msgstr "" "返回该向量缩放至单位长度的结果。等价于 [code]v / v.length()[/code]。另见 " "[method is_normalized]。\n" -"[b]注意:[/b]如果初始向量的长度接近零,则这个函数可能返回不正确的值。" +"[b]注意:[/b]如果输入向量的长度接近零,则这个函数可能返回不正确的值。" msgid "" "Returns a perpendicular vector rotated 90 degrees counter-clockwise compared " @@ -116595,6 +112952,16 @@ msgstr "构造默认初始化的 [Vector2i],所有分量都为 [code]0[/code] msgid "Constructs a [Vector2i] as a copy of the given [Vector2i]." msgstr "构造给定 [Vector2i] 的副本。" +msgid "" +"Constructs a new [Vector2i] from the given [Vector2] by truncating " +"components' fractional parts (rounding towards zero). For a different " +"behavior consider passing the result of [method Vector2.ceil], [method " +"Vector2.floor] or [method Vector2.round] to this constructor instead." +msgstr "" +"根据给定的 [Vector2] 构造 [Vector2i],会将各个分量的小数部分截断(向 0 取" +"整)。要使用不同的行为,请考虑改为传入 [method Vector2.ceil]、[method " +"Vector2.floor] 或 [method Vector2.round] 的结果。" + msgid "Constructs a new [Vector2i] from the given [param x] and [param y]." msgstr "从给定的 [param x] 和 [param y] 构造新的 [Vector2i]。" @@ -116634,22 +113001,6 @@ msgstr "" "print(Vector2i(10, -20) % Vector2i(7, 8)) # 输出 \"(3, -4)\"\n" "[/codeblock]" -msgid "" -"Gets the remainder of each component of the [Vector2i] with the the given " -"[int]. This operation uses truncated division, which is often not desired as " -"it does not work well with negative numbers. Consider using [method " -"@GlobalScope.posmod] instead if you want to handle negative numbers.\n" -"[codeblock]\n" -"print(Vector2i(10, -20) % 7) # Prints \"(3, -6)\"\n" -"[/codeblock]" -msgstr "" -"获取该 [Vector2i] 的每个分量与给定的 [int] 的余数。这个运算使用的是截断式除" -"法,因为对负数不友好,所以通常不会想要使用。如果你想要处理负数,请考虑改用 " -"[method @GlobalScope.posmod]。\n" -"[codeblock]\n" -"print(Vector2i(10, -20) % 7) # 输出 \"(3, -6)\"\n" -"[/codeblock]" - msgid "" "Multiplies each component of the [Vector2i] by the components of the given " "[Vector2i].\n" @@ -116834,13 +113185,6 @@ msgstr "" "返回该向量的逆向量。与 [code]Vector3(1.0 / v.x, 1.0 / v.y, 1.0 / v.z)[/code] " "相同。" -msgid "" -"Returns [code]true[/code] if this vector and [param to] are approximately " -"equal, by running [method @GlobalScope.is_equal_approx] on each component." -msgstr "" -"如果这个向量与 [param to] 大致相等,则返回 [code]true[/code],判断方法是对每" -"个分量执行 [method @GlobalScope.is_equal_approx]。" - msgid "" "Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] " "constants. If all components are equal, this method returns [constant " @@ -116849,16 +113193,6 @@ msgstr "" "返回该向量中最小值的轴。见 [code]AXIS_*[/code] 常量。如果所有分量相等,则该方" "法返回 [constant AXIS_Z]。" -msgid "" -"Returns the result of scaling the vector to unit length. Equivalent to " -"[code]v / v.length()[/code]. See also [method is_normalized].\n" -"[b]Note:[/b] This function may return incorrect values if the input vector " -"length is near zero." -msgstr "" -"返回该向量缩放至单位长度的结果。等价于 [code]v / v.length()[/code]。另见 " -"[method is_normalized]。\n" -"[b]注意:[/b]如果输入向量的长度接近零,则这个函数可能返回不正确的值。" - msgid "" "Returns the [Vector3] from an octahedral-compressed form created using " "[method octahedron_encode] (stored as a [Vector2])." @@ -117115,6 +113449,16 @@ msgstr "构造默认初始化的 [Vector3i],所有分量都为 [code]0[/code] msgid "Constructs a [Vector3i] as a copy of the given [Vector3i]." msgstr "构造给定 [Vector3i] 的副本。" +msgid "" +"Constructs a new [Vector3i] from the given [Vector3] by truncating " +"components' fractional parts (rounding towards zero). For a different " +"behavior consider passing the result of [method Vector3.ceil], [method " +"Vector3.floor] or [method Vector3.round] to this constructor instead." +msgstr "" +"根据给定的 [Vector3] 构造 [Vector3i],会将各个分量的小数部分截断(向 0 取" +"整)。要使用不同的行为,请考虑改为传入 [method Vector3.ceil]、[method " +"Vector3.floor] 或 [method Vector3.round] 的结果。" + msgid "Returns a [Vector3i] with the given components." msgstr "返回具有给定分量的 [Vector3i]。" @@ -117135,22 +113479,6 @@ msgstr "" "print(Vector3i(10, -20, 30) % Vector3i(7, 8, 9)) # 输出 \"(3, -4, 3)\"\n" "[/codeblock]" -msgid "" -"Gets the remainder of each component of the [Vector3i] with the the given " -"[int]. This operation uses truncated division, which is often not desired as " -"it does not work well with negative numbers. Consider using [method " -"@GlobalScope.posmod] instead if you want to handle negative numbers.\n" -"[codeblock]\n" -"print(Vector3i(10, -20, 30) % 7) # Prints \"(3, -6, 2)\"\n" -"[/codeblock]" -msgstr "" -"获取该 [Vector3i] 的每个分量与给定的 [int] 的余数。这个运算使用的是截断式除" -"法,因为对负数不友好,所以通常不会想要使用。如果你想要处理负数,请考虑改用 " -"[method @GlobalScope.posmod]。\n" -"[codeblock]\n" -"print(Vector3i(10, -20, 30) % 7) # 输出 \"(3, -6, 2)\"\n" -"[/codeblock]" - msgid "" "Multiplies each component of the [Vector3i] by the components of the given " "[Vector3i].\n" @@ -117329,19 +113657,6 @@ msgstr "" "返回该向量的逆向量。与 [code]Vector4(1.0 / v.x, 1.0 / v.y, 1.0 / v.z, 1.0 / " "v.w)[/code] 相同。" -msgid "" -"Returns [code]true[/code] if this vector and [param with] are approximately " -"equal, by running [method @GlobalScope.is_equal_approx] on each component." -msgstr "" -"如果这个向量与 [param with] 大致相等,则返回 [code]true[/code],判断方法是对" -"每个分量执行 [method @GlobalScope.is_equal_approx]。" - -msgid "" -"Returns the squared length (squared magnitude) of this vector. This method " -"runs faster than [method length]." -msgstr "" -"返回该向量的平方长度(平方大小)。此方法比 [method length] 运行得更快。" - msgid "" "Returns the axis of the vector's lowest value. See [code]AXIS_*[/code] " "constants. If all components are equal, this method returns [constant " @@ -117350,20 +113665,6 @@ msgstr "" "返回该向量中最小值的轴。见 [code]AXIS_*[/code] 常量。如果所有分量相等,则该方" "法返回 [constant AXIS_W]。" -msgid "" -"Returns a new vector composed of the [method @GlobalScope.fposmod] of this " -"vector's components and [param mod]." -msgstr "" -"返回新的向量,由这个向量的分量和 [param mod] 进行 [method @GlobalScope." -"fposmod] 构成。" - -msgid "" -"Returns a new vector composed of the [method @GlobalScope.fposmod] of this " -"vector's components and [param modv]'s components." -msgstr "" -"返回新的向量,由这个向量的分量和 [param modv] 的分量进行 [method " -"@GlobalScope.fposmod] 构成。" - msgid "" "The vector's W component. Also accessible by using the index position [code]" "[3][/code]." @@ -117552,6 +113853,16 @@ msgstr "构造默认初始化的 [Vector4i],所有分量都为 [code]0[/code] msgid "Constructs a [Vector4i] as a copy of the given [Vector4i]." msgstr "构造给定 [Vector4i] 的副本。" +msgid "" +"Constructs a new [Vector4i] from the given [Vector4] by truncating " +"components' fractional parts (rounding towards zero). For a different " +"behavior consider passing the result of [method Vector4.ceil], [method " +"Vector4.floor] or [method Vector4.round] to this constructor instead." +msgstr "" +"根据给定的 [Vector4] 构造 [Vector4i],会将各个分量的小数部分截断(向 0 取" +"整)。要使用不同的行为,请考虑改为传入 [method Vector4.ceil]、[method " +"Vector4.floor] 或 [method Vector4.round] 的结果。" + msgid "Returns a [Vector4i] with the given components." msgstr "返回具有给定分量的 [Vector4i]。" @@ -118462,9 +114773,6 @@ msgid "" "editing this [Viewport]'s layers." msgstr "设置或清除碰撞掩码上的比特位。可以简化 [Viewport] 层的编辑。" -msgid "Stops the input from propagating further down the [SceneTree]." -msgstr "阻止输入沿着 [SceneTree] 继续向下传播。" - msgid "" "Sets the number of subdivisions to use in the specified quadrant. A higher " "number of subdivisions allows you to have more shadows in the scene at once, " @@ -118558,21 +114866,6 @@ msgid "" "perfectly." msgstr "如果为 [code]true[/code],该视口上的 GUI 控件将完美地放置像素。" -msgid "" -"If [code]true[/code], this viewport will mark incoming input events as " -"handled by itself. If [code]false[/code], this is instead done by the the " -"first parent viewport that is set to handle input locally.\n" -"A [SubViewportContainer] will automatically set this property to " -"[code]false[/code] for the [Viewport] contained inside of it.\n" -"See also [method set_input_as_handled] and [method is_input_handled]." -msgstr "" -"如果为 [code]true[/code],则这个视口会把收到的输入事件标记为已被自身处理。如" -"果为 [code]false[/code],则由第一个设置本地处理输入的父级视口进行这样的操" -"作。\n" -"[SubViewportContainer] 会自动将其包含的 [Viewport] 的这个属性设置为 " -"[code]false[/code]。\n" -"另见 [method set_input_as_handled] 和 [method is_input_handled]。" - msgid "" "The automatic LOD bias to use for meshes rendered within the [Viewport] " "(this is analogous to [member ReflectionProbe.mesh_lod_threshold]). Higher " @@ -118655,16 +114948,6 @@ msgstr "阴影图集上第三象限的细分量。" msgid "The subdivision amount of the fourth quadrant on the shadow atlas." msgstr "阴影图集上第四象限的细分量。" -msgid "" -"The shadow atlas' resolution (used for omni and spot lights). The value will " -"be rounded up to the nearest power of 2.\n" -"[b]Note:[/b] If this is set to [code]0[/code], no shadows will be visible at " -"all (including directional shadows)." -msgstr "" -"阴影图集的分辨率(用于全向灯和聚光灯)。该值将向上舍入到最接近的 2 次幂。\n" -"[b]注意:[/b]如果被设置为 [code]0[/code],将根本看不到任何阴影(包括定向阴" -"影)。" - msgid "" "Sets scaling 3d mode. Bilinear scaling renders at different resolution to " "either undersample or supersample the viewport. FidelityFX Super Resolution " @@ -118910,29 +115193,6 @@ msgid "" "Represents the size of the [enum PositionalShadowAtlasQuadrantSubdiv] enum." msgstr "代表 [enum PositionalShadowAtlasQuadrantSubdiv] 枚举的大小。" -msgid "" -"Use bilinear scaling for the viewport's 3D buffer. The amount of scaling can " -"be set using [member scaling_3d_scale]. Values less then [code]1.0[/code] " -"will result in undersampling while values greater than [code]1.0[/code] will " -"result in supersampling. A value of [code]1.0[/code] disables scaling." -msgstr "" -"对该视口的 3D 缓冲区使用双线性缩放。缩放的程度可以使用 [member " -"scaling_3d_scale] 设置。小于 [code]1.0[/code] 的值会产生欠采样的效果,大于 " -"[code]1.0[/code] 会产生超采样的效果。值为 [code]1.0[/code] 时禁用缩放。" - -msgid "" -"Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D " -"buffer. The amount of scaling can be set using [member scaling_3d_scale]. " -"Values less then [code]1.0[/code] will be result in the viewport being " -"upscaled using FSR. Values greater than [code]1.0[/code] are not supported " -"and bilinear downsampling will be used instead. A value of [code]1.0[/code] " -"disables scaling." -msgstr "" -"对该视口的 3D 缓冲区使用 AMD FidelityFX 超分辨率 1.0 升采样技术。缩放的程度可" -"以使用 [member scaling_3d_scale] 设置。小于 [code]1.0[/code] 的值会使用 FSR " -"进行放大。不支持大于 [code]1.0[/code] 的值,会改用双线性降采样。值为 " -"[code]1.0[/code] 时禁用缩放。" - msgid "Represents the size of the [enum Scaling3DMode] enum." msgstr "代表 [enum Scaling3DMode] 枚举的大小。" @@ -118966,19 +115226,6 @@ msgstr "" msgid "Represents the size of the [enum MSAA] enum." msgstr "代表 [enum MSAA] 枚举的大小。" -msgid "Do not perform any antialiasing in the full screen post-process." -msgstr "不要在全屏后处理中执行抗锯齿。" - -msgid "" -"Use fast approximate antialiasing. FXAA is a popular screen-space " -"antialiasing method, which is fast but will make the image look blurry, " -"especially at lower resolutions. It can still work relatively well at large " -"resolutions such as 1440p and 4K." -msgstr "" -"使用快速近似抗锯齿(Fast Approximate Anti-Aliasing)。FXAA 是一种流行的屏幕空" -"间抗锯齿方法,速度很快,但会让图像变模糊,使用较低分辨率时尤为显著。1440p 和 " -"4K 等较高分辨率下效果仍然不错。" - msgid "Represents the size of the [enum ScreenSpaceAA] enum." msgstr "代表 [enum ScreenSpaceAA] 枚举的大小。" @@ -119048,35 +115295,24 @@ msgstr "[enum DefaultCanvasItemTextureFilter] 枚举的最大值。" msgid "Max value for [enum DefaultCanvasItemTextureRepeat] enum." msgstr "[enum DefaultCanvasItemTextureRepeat] 枚举的最大值。" +msgid "VRS is disabled." +msgstr "VRS 已禁用。" + +msgid "" +"VRS uses a texture. Note, for stereoscopic use a texture atlas with a " +"texture for each view." +msgstr "" +"VRS 使用一个纹理。请注意,对于立体视觉,请为每个视图使用带有纹理的纹理图集。" + +msgid "VRS texture is supplied by the primary [XRInterface]." +msgstr "VRS 纹理由主 [XRInterface] 提供。" + msgid "Represents the size of the [enum VRSMode] enum." msgstr "代表 [enum VRSMode] 枚举的大小。" msgid "Texture which displays the content of a [Viewport]." msgstr "显示 [Viewport] 内容的纹理。" -msgid "" -"Displays the content of a [Viewport] node as a dynamic [Texture2D]. This can " -"be used to mix controls, 2D, and 3D elements in the same scene.\n" -"To create a ViewportTexture in code, use the [method Viewport.get_texture] " -"method on the target viewport.\n" -"[b]Note:[/b] When local to scene, this texture uses [method Resource." -"setup_local_to_scene] to set the proxy texture and flags in the local " -"viewport." -msgstr "" -"将 [Viewport] 节点的内容显示为一个动态 [Texture2D]。这可用于在同一场景中混合" -"控件、2D 和 3D 元素。\n" -"要在代码中创建 ViewportTexture,请在目标视口上使用 [method Viewport." -"get_texture] 方法。\n" -"[b]注意:[/b]当局部于场景时,该纹理使用 [method Resource." -"setup_local_to_scene] 在局部视口中设置代理纹理和标志。" - -msgid "" -"The path to the [Viewport] node to display. This is relative to the scene " -"root, not to the node which uses the texture." -msgstr "" -"显示 [Viewport] 节点的路径。该路径是相对于场景根的,而不是相对于使用该纹理的" -"节点。" - msgid "Automatically disables another node if not visible on screen." msgstr "某个节点在屏幕上不可见时自动禁用该节点。" @@ -119290,23 +115526,6 @@ msgstr "" "基于 [param value],启用或禁用 [member layers] 中的指定层,该层由一个介于 1 " "和 20 之间的给定 [param layer_number] 指定。" -msgid "" -"The render layer(s) this [VisualInstance3D] is drawn on.\n" -"This object will only be visible for [Camera3D]s whose cull mask includes " -"the render object this [VisualInstance3D] is set to.\n" -"For [Light3D]s, this can be used to control which [VisualInstance3D]s are " -"affected by a specific light. For [GPUParticles3D], this can be used to " -"control which particles are effected by a specific attractor. For [Decal]s, " -"this can be used to control which [VisualInstance3D]s are affected by a " -"specific decal." -msgstr "" -"这个 [VisualInstance3D] 要绘制到的渲染层。\n" -"[Camera3D] 的剔除掩码包含这个 [VisualInstance3D] 所设置的渲染对象时,这个对象" -"才在该相机中可见。\n" -"对于 [Light3D],可以用于控制指定的灯光能够影响哪些 [VisualInstance3D]。对于 " -"[GPUParticles3D],可以用于控制哪些粒子受到吸引器的影响。对于 [Decal],可以用" -"于控制哪些 [VisualInstance3D] 受到指定贴花的影响。" - msgid "" "The amount by which the depth of this [VisualInstance3D] will be adjusted " "when sorting by depth. Uses the same units as the engine (which are " @@ -121743,13 +117962,6 @@ msgstr "设置纹理过滤模式。选项见 [enum TextureFilter]。" msgid "Sets the texture repeating mode. See [enum TextureRepeat] for options." msgstr "设置纹理重复模式。选项见 [enum TextureRepeat]。" -msgid "" -"Sets the texture source mode. Used for reading from the screen, depth, or " -"normal_roughness texture. see [enum TextureSource] for options." -msgstr "" -"设置纹理源的模式。用于读取 screen(屏幕)、depth(深度)或 normal_roughness" -"(法线粗糙度)纹理。选项见 [enum TextureSource]。" - msgid "" "Adds [code]source_color[/code] as hint to the uniform declaration for proper " "sRGB to linear conversion." @@ -124776,9 +120988,6 @@ msgstr "" "不会在系统窗口管理器的窗口列表中显示为单独的窗口,并且会在单击它们之外的任何" "位置时发送关闭请求(除非启用了 [member exclusive])。" -msgid "The window's position in pixels." -msgstr "该窗口的位置,单位为像素。" - msgid "The window's size in pixels." msgstr "该窗口的大小,单位为像素。" @@ -125005,15 +121214,6 @@ msgstr "" "此,在启用全屏模式之前,请确保你的项目支持[url=$DOCS_URL/tutorials/rendering/" "multiple_resolutions.html]多分辨率[/url]。" -msgid "" -"The window can't be resizing by dragging its resize grip. It's still " -"possible to resize the window using [member size]. This flag is ignored for " -"full screen windows. Set with [member unresizable]." -msgstr "" -"该窗口不能通过拖动其调整大小的手柄来调整大小。仍然可以使用 [member size] 来调" -"整窗口的大小。这个标志对于全屏窗口来说是被忽略的。用 [member unresizable] 设" -"置。" - msgid "" "The window do not have native title bar and other decorations. This flag is " "ignored for full-screen windows. Set with [member borderless]." @@ -125046,19 +121246,6 @@ msgstr "" "该窗口无法被聚焦。无焦点窗口会忽略除鼠标点击之外的所有输入。由 [member " "unfocusable] 设置。" -msgid "" -"Window is part of menu or [OptionButton] dropdown. This flag can't be " -"changed when the window is visible. An active popup window will exclusively " -"receive all input, without stealing focus from its parent. Popup windows are " -"automatically closed when uses click outside it, or when an application is " -"switched. Popup window must have [code]transient parent[/code] set (see " -"[member transient])." -msgstr "" -"窗口为菜单或 [OptionButton] 下来菜单的一部分。窗口可见时无法更改这个标志。活" -"动弹出窗口独占接收所有输入,无需从父级窃取焦点。用户在区域外点击或切换应用程" -"序时,弹出窗口会自动关闭。弹出窗口必须设置 [code]transient parent[/code](见 " -"[member transient])。" - msgid "" "Window content is expanded to the full size of the window. Unlike borderless " "window, the frame is left intact and can be used to resize the window, title " @@ -125354,20 +121541,6 @@ msgstr "" msgid "An X509 certificate (e.g. for TLS)." msgstr "X509 证书(例如用于 TLS)。" -msgid "" -"The X509Certificate class represents an X509 certificate. Certificates can " -"be loaded and saved like any other [Resource].\n" -"They can be used as the server certificate in [method StreamPeerTLS." -"accept_stream] (along with the proper [CryptoKey]), and to specify the only " -"certificate that should be accepted when connecting to an TLS server via " -"[method StreamPeerTLS.connect_to_stream]." -msgstr "" -"X509Certificate 类代表 X509 证书。证书可以像其他的 [Resource] 资源一样加载和" -"保存。\n" -"可以用作 [method StreamPeerTLS.accept_stream] 中的服务器证书(搭配正确的 " -"[CryptoKey]),也可以用于指定通过 [method StreamPeerTLS.connect_to_stream] 连" -"接到 TLS 服务器时应该接受的唯一证书。" - msgid "Loads a certificate from [param path] (\"*.crt\" file)." msgstr "从路径 [param path] 加载证书(“*.crt”文件)。" @@ -125697,17 +121870,6 @@ msgstr "" "如果支持,返回我们的跟踪状态。这将使你能够向用户反馈,是否存在位置跟踪的问" "题。" -msgid "" -"Returns the transform for a view/eye.\n" -"[param view] is the view/eye index.\n" -"[param cam_transform] is the transform that maps device coordinates to scene " -"coordinates, typically the global_transform of the current XROrigin3D." -msgstr "" -"返回视图/眼睛的变换。\n" -"[param view] 是视图/眼睛的索引。\n" -"[param cam_transform] 是将设备坐标映射至场景坐标的变换,通常是当前 " -"XROrigin3D 的 global_transform。" - msgid "" "Returns the number of views that need to be rendered for this device. 1 for " "Monoscopic, 2 for Stereoscopic." @@ -125923,13 +122085,6 @@ msgstr "玩家处于坐姿,提供有限的位置跟踪,玩家周围有固定 msgid "Player is free to move around, full positional tracking." msgstr "玩家可以自由移动,提供完整的位置跟踪。" -msgid "" -"Same as roomscale but origin point is fixed to the center of the physical " -"space, XRServer.center_on_hmd disabled." -msgstr "" -"与 roomscale 相同,但是原点固定在物理空间的中心,禁用 XRServer." -"center_on_hmd。" - msgid "Opaque blend mode. This is typically used for VR devices." msgstr "不透明混合模式。通常用于 VR 设备。" @@ -126054,21 +122209,6 @@ msgstr "" "[code]true[/code]。如果用户摘下头戴式设备,XR 接口可能会返回 [code]false[/" "code],我们可以暂停渲染。" -msgid "" -"Called if this [XRInterfaceExtension] is active before rendering starts, " -"most XR interfaces will sync tracking at this point in time." -msgstr "" -"如果这个 [XRInterfaceExtension] 在渲染开始前处于激活状态,则会调用这个函数," -"大多数 XR 接口都会在此时进行追踪同步。" - -msgid "" -"Called if this [XRInterfaceExtension] is active before our physics and game " -"process is called. most XR interfaces will update its [XRPositionalTracker]s " -"at this point in time." -msgstr "" -"如果这个 [XRInterfaceExtension] 在调用我们的物理和游戏处理前处于激活状态,则" -"会调用这个函数。大多数 XR 接口都会在此时更新其 [XRPositionalTracker]。" - msgid "Enables anchor detection on this interface if supported." msgstr "如果支持,则在此接口上启用锚点检测。" diff --git a/drivers/gl_context/SCsub b/drivers/gl_context/SCsub index 2204c486c65..91240ce3e31 100644 --- a/drivers/gl_context/SCsub +++ b/drivers/gl_context/SCsub @@ -10,7 +10,11 @@ if env["platform"] in ["haiku", "macos", "windows", "linuxbsd"]: ] thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources] - env.Prepend(CPPPATH=[thirdparty_dir]) + # Treat glad headers as system headers to avoid raising warnings. Not supported on MSVC. + if not env.msvc: + env.Append(CPPFLAGS=["-isystem", Dir(thirdparty_dir).path]) + else: + env.Prepend(CPPPATH=[thirdparty_dir]) env.Append(CPPDEFINES=["GLAD_ENABLED"]) env.Append(CPPDEFINES=["GLES_OVER_GL"]) diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp index 7cbce428cbc..4e5e103884b 100644 --- a/drivers/gles3/rasterizer_gles3.cpp +++ b/drivers/gles3/rasterizer_gles3.cpp @@ -300,12 +300,13 @@ void RasterizerGLES3::_blit_render_target_to_screen(RID p_render_target, Display } GLuint read_fbo = 0; + glGenFramebuffers(1, &read_fbo); + glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo); + if (rt->view_count > 1) { - glGenFramebuffers(1, &read_fbo); - glBindFramebuffer(GL_READ_FRAMEBUFFER, read_fbo); glFramebufferTextureLayer(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, rt->color, 0, p_layer); } else { - glBindFramebuffer(GL_READ_FRAMEBUFFER, rt->fbo); + glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, rt->color, 0); } glReadBuffer(GL_COLOR_ATTACHMENT0); diff --git a/drivers/gles3/storage/material_storage.cpp b/drivers/gles3/storage/material_storage.cpp index 1736ad1d424..6ab29b86cf8 100644 --- a/drivers/gles3/storage/material_storage.cpp +++ b/drivers/gles3/storage/material_storage.cpp @@ -1651,7 +1651,7 @@ MaterialStorage::MaterialStorage() { actions.renames["CAMERA_POSITION_WORLD"] = "scene_data.inv_view_matrix[3].xyz"; actions.renames["CAMERA_DIRECTION_WORLD"] = "scene_data.view_matrix[3].xyz"; actions.renames["CAMERA_VISIBLE_LAYERS"] = "scene_data.camera_visible_layers"; - actions.renames["NODE_POSITION_VIEW"] = "(model_matrix * scene_data.view_matrix)[3].xyz"; + actions.renames["NODE_POSITION_VIEW"] = "(scene_data.view_matrix * model_matrix)[3].xyz"; actions.renames["VIEW_INDEX"] = "ViewIndex"; actions.renames["VIEW_MONO_LEFT"] = "uint(0)"; diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp index 744d0319b5b..2bafc559bd4 100644 --- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp +++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp @@ -222,8 +222,8 @@ Error AudioDriverPulseAudio::init_output_device() { break; } - int latency = GLOBAL_GET("audio/driver/output_latency"); - buffer_frames = closest_power_of_2(latency * mix_rate / 1000); + int tmp_latency = GLOBAL_GET("audio/driver/output_latency"); + buffer_frames = closest_power_of_2(tmp_latency * mix_rate / 1000); pa_buffer_size = buffer_frames * pa_map.channels; print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " output channels"); diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp index ee3cb876cf2..172f2a044c3 100644 --- a/drivers/unix/file_access_unix.cpp +++ b/drivers/unix/file_access_unix.cpp @@ -284,11 +284,11 @@ bool FileAccessUnix::file_exists(const String &p_path) { uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { String file = fix_path(p_file); - struct stat flags = {}; - int err = stat(file.utf8().get_data(), &flags); + struct stat status = {}; + int err = stat(file.utf8().get_data(), &status); if (!err) { - return flags.st_mtime; + return status.st_mtime; } else { print_verbose("Failed to get modified time for: " + p_file + ""); return 0; @@ -297,11 +297,11 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) { uint32_t FileAccessUnix::_get_unix_permissions(const String &p_file) { String file = fix_path(p_file); - struct stat flags = {}; - int err = stat(file.utf8().get_data(), &flags); + struct stat status = {}; + int err = stat(file.utf8().get_data(), &status); if (!err) { - return flags.st_mode & 0x7FF; //only permissions + return status.st_mode & 0x7FF; //only permissions } else { ERR_FAIL_V_MSG(0, "Failed to get unix permissions for: " + p_file + "."); } diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index f6cc2ae4f11..1baa9eb27fb 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -2463,10 +2463,10 @@ Error RenderingDeviceVulkan::_texture_update(RID p_texture, uint32_t p_layer, co } ERR_FAIL_COND_V_MSG(texture->bound, ERR_CANT_ACQUIRE_RESOURCE, - "Texture can't be updated while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Texture can't be updated while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to update this texture."); ERR_FAIL_COND_V_MSG(!(texture->usage_flags & TEXTURE_USAGE_CAN_UPDATE_BIT), ERR_INVALID_PARAMETER, - "Texture requires the TEXTURE_USAGE_CAN_UPDATE_BIT in order to be updatable."); + "Texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_UPDATE_BIT` to be set to be updatable."); uint32_t layer_count = texture->layers; if (texture->type == TEXTURE_TYPE_CUBE || texture->type == TEXTURE_TYPE_CUBE_ARRAY) { @@ -2739,9 +2739,9 @@ Vector RenderingDeviceVulkan::texture_get_data(RID p_texture, uint32_t ERR_FAIL_COND_V(!tex, Vector()); ERR_FAIL_COND_V_MSG(tex->bound, Vector(), - "Texture can't be retrieved while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Texture can't be retrieved while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to retrieve this texture."); ERR_FAIL_COND_V_MSG(!(tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), Vector(), - "Texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + "Texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT` to be set to be retrieved."); uint32_t layer_count = tex->layers; if (tex->type == TEXTURE_TYPE_CUBE || tex->type == TEXTURE_TYPE_CUBE_ARRAY) { @@ -2889,9 +2889,9 @@ Error RenderingDeviceVulkan::texture_copy(RID p_from_texture, RID p_to_texture, ERR_FAIL_COND_V(!src_tex, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, - "Source texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Source texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to copy this texture."); ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), ERR_INVALID_PARAMETER, - "Source texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + "Source texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT` to be set to be retrieved."); uint32_t src_layer_count = src_tex->layers; uint32_t src_width, src_height, src_depth; @@ -2910,9 +2910,9 @@ Error RenderingDeviceVulkan::texture_copy(RID p_from_texture, RID p_to_texture, ERR_FAIL_COND_V(!dst_tex, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(dst_tex->bound, ERR_INVALID_PARAMETER, - "Destination texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Destination texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to copy this texture."); ERR_FAIL_COND_V_MSG(!(dst_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, - "Destination texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be retrieved."); + "Destination texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_TO_BIT` to be set to be retrieved."); uint32_t dst_layer_count = dst_tex->layers; uint32_t dst_width, dst_height, dst_depth; @@ -3084,9 +3084,9 @@ Error RenderingDeviceVulkan::texture_resolve_multisample(RID p_from_texture, RID ERR_FAIL_COND_V(!src_tex, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, - "Source texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Source texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to copy this texture."); ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_FROM_BIT), ERR_INVALID_PARAMETER, - "Source texture requires the TEXTURE_USAGE_CAN_COPY_FROM_BIT in order to be retrieved."); + "Source texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_FROM_BIT` to be set to be retrieved."); ERR_FAIL_COND_V_MSG(src_tex->type != TEXTURE_TYPE_2D, ERR_INVALID_PARAMETER, "Source texture must be 2D (or a slice of a 3D/Cube texture)"); ERR_FAIL_COND_V_MSG(src_tex->samples == TEXTURE_SAMPLES_1, ERR_INVALID_PARAMETER, "Source texture must be multisampled."); @@ -3095,9 +3095,9 @@ Error RenderingDeviceVulkan::texture_resolve_multisample(RID p_from_texture, RID ERR_FAIL_COND_V(!dst_tex, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(dst_tex->bound, ERR_INVALID_PARAMETER, - "Destination texture can't be copied while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Destination texture can't be copied while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to copy this texture."); ERR_FAIL_COND_V_MSG(!(dst_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, - "Destination texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be retrieved."); + "Destination texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_TO_BIT` to be set to be retrieved."); ERR_FAIL_COND_V_MSG(dst_tex->type != TEXTURE_TYPE_2D, ERR_INVALID_PARAMETER, "Destination texture must be 2D (or a slice of a 3D/Cube texture)."); ERR_FAIL_COND_V_MSG(dst_tex->samples != TEXTURE_SAMPLES_1, ERR_INVALID_PARAMETER, "Destination texture must not be multisampled."); @@ -3255,13 +3255,13 @@ Error RenderingDeviceVulkan::texture_clear(RID p_texture, const Color &p_color, ERR_FAIL_COND_V(!src_tex, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(src_tex->bound, ERR_INVALID_PARAMETER, - "Source texture can't be cleared while a render pass that uses it is being created. Ensure render pass is finalized (and that it was created with RENDER_PASS_CONTENTS_FINISH) to unbind this texture."); + "Source texture can't be cleared while a draw list that uses it as part of a framebuffer is being created. Ensure the draw list is finalized (and that the color/depth texture using it is not set to `RenderingDevice.FINAL_ACTION_CONTINUE`) to clear this texture."); ERR_FAIL_COND_V(p_layers == 0, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(p_mipmaps == 0, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V_MSG(!(src_tex->usage_flags & TEXTURE_USAGE_CAN_COPY_TO_BIT), ERR_INVALID_PARAMETER, - "Source texture requires the TEXTURE_USAGE_CAN_COPY_TO_BIT in order to be cleared."); + "Source texture requires the `RenderingDevice.TEXTURE_USAGE_CAN_COPY_TO_BIT` to be set to be cleared."); uint32_t src_layer_count = src_tex->layers; if (src_tex->type == TEXTURE_TYPE_CUBE || src_tex->type == TEXTURE_TYPE_CUBE_ARRAY) { @@ -4326,10 +4326,6 @@ RID RenderingDeviceVulkan::vertex_buffer_create(uint32_t p_size_bytes, const Vec _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); uint32_t usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; if (p_use_as_storage) { @@ -4467,10 +4463,6 @@ RID RenderingDeviceVulkan::vertex_array_create(uint32_t p_vertex_count, VertexFo RID RenderingDeviceVulkan::index_buffer_create(uint32_t p_index_count, IndexBufferFormat p_format, const Vector &p_data, bool p_use_restart_indices) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); ERR_FAIL_COND_V(p_index_count == 0, RID()); @@ -5153,10 +5145,6 @@ RID RenderingDeviceVulkan::uniform_buffer_create(uint32_t p_size_bytes, const Ve _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); Buffer buffer; Error err = _buffer_allocate(&buffer, p_size_bytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, 0); @@ -5176,10 +5164,6 @@ RID RenderingDeviceVulkan::uniform_buffer_create(uint32_t p_size_bytes, const Ve RID RenderingDeviceVulkan::storage_buffer_create(uint32_t p_size_bytes, const Vector &p_data, BitField p_usage) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); @@ -5202,10 +5186,6 @@ RID RenderingDeviceVulkan::storage_buffer_create(uint32_t p_size_bytes, const Ve RID RenderingDeviceVulkan::texture_buffer_create(uint32_t p_size_elements, DataFormat p_format, const Vector &p_data) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); uint32_t element_size = get_format_vertex_size(p_format); ERR_FAIL_COND_V_MSG(element_size == 0, RID(), "Format requested is not supported for texture buffers"); diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 7d11293f9b3..59b7c896ca1 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -480,6 +480,14 @@ Error AudioDriverWASAPI::init_output_device(bool p_reinit) { } switch (audio_output.channels) { + case 1: // Mono + case 3: // Surround 2.1 + case 5: // Surround 5.0 + case 7: // Surround 7.0 + // We will downmix as required. + channels = audio_output.channels + 1; + break; + case 2: // Stereo case 4: // Surround 3.1 case 6: // Surround 5.1 @@ -499,7 +507,7 @@ Error AudioDriverWASAPI::init_output_device(bool p_reinit) { input_position = 0; input_size = 0; - print_verbose("WASAPI: detected " + itos(channels) + " channels"); + print_verbose("WASAPI: detected " + itos(audio_output.channels) + " channels"); print_verbose("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms"); return OK; @@ -746,6 +754,19 @@ void AudioDriverWASAPI::thread_func(void *p_udata) { for (unsigned int i = 0; i < write_frames * ad->channels; i++) { ad->write_sample(ad->audio_output.format_tag, ad->audio_output.bits_per_sample, buffer, i, ad->samples_in.write[write_ofs++]); } + } else if (ad->channels == ad->audio_output.channels + 1) { + // Pass all channels except the last two as-is, and then mix the last two + // together as one channel. E.g. stereo -> mono, or 3.1 -> 2.1. + unsigned int last_chan = ad->audio_output.channels - 1; + for (unsigned int i = 0; i < write_frames; i++) { + for (unsigned int j = 0; j < last_chan; j++) { + ad->write_sample(ad->audio_output.format_tag, ad->audio_output.bits_per_sample, buffer, i * ad->audio_output.channels + j, ad->samples_in.write[write_ofs++]); + } + int32_t l = ad->samples_in.write[write_ofs++]; + int32_t r = ad->samples_in.write[write_ofs++]; + int32_t c = (int32_t)(((int64_t)l + (int64_t)r) / 2); + ad->write_sample(ad->audio_output.format_tag, ad->audio_output.bits_per_sample, buffer, i * ad->audio_output.channels + last_chan, c); + } } else { for (unsigned int i = 0; i < write_frames; i++) { for (unsigned int j = 0; j < MIN(ad->channels, ad->audio_output.channels); j++) { diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index 7b88bd8a957..88eb89656ab 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -59,6 +59,14 @@ struct DirAccessWindowsPrivate { WIN32_FIND_DATAW fu; //unicode version }; +String DirAccessWindows::fix_path(String p_path) const { + String r_path = DirAccess::fix_path(p_path); + if (r_path.is_absolute_path() && !r_path.is_network_share_path() && r_path.length() > MAX_PATH) { + r_path = "\\\\?\\" + r_path.replace("/", "\\"); + } + return r_path; +} + // CreateFolderAsync Error DirAccessWindows::list_dir_begin() { @@ -158,6 +166,7 @@ Error DirAccessWindows::make_dir(String p_dir) { p_dir = fix_path(p_dir); if (p_dir.is_relative_path()) { p_dir = current_dir.path_join(p_dir); + p_dir = fix_path(p_dir); } p_dir = p_dir.simplify_path().replace("/", "\\"); @@ -165,12 +174,6 @@ Error DirAccessWindows::make_dir(String p_dir) { bool success; int err; - if (!p_dir.is_network_share_path()) { - p_dir = "\\\\?\\" + p_dir; - // Add "\\?\" to the path to extend max. path length past 248, if it's not a network share UNC path. - // See https://msdn.microsoft.com/en-us/library/windows/desktop/aa363855(v=vs.85).aspx - } - success = CreateDirectoryW((LPCWSTR)(p_dir.utf16().get_data()), nullptr); err = GetLastError(); diff --git a/drivers/windows/dir_access_windows.h b/drivers/windows/dir_access_windows.h index 9d91c22f7ec..1e55917756a 100644 --- a/drivers/windows/dir_access_windows.h +++ b/drivers/windows/dir_access_windows.h @@ -53,6 +53,9 @@ class DirAccessWindows : public DirAccess { bool _cisdir = false; bool _cishidden = false; +protected: + virtual String fix_path(String p_path) const override; + public: virtual Error list_dir_begin() override; ///< This starts dir listing virtual String get_next() override; diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 0e51586b5a4..03930626a52 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -68,6 +68,14 @@ bool FileAccessWindows::is_path_invalid(const String &p_path) { return invalid_files.has(fname); } +String FileAccessWindows::fix_path(const String &p_path) const { + String r_path = FileAccess::fix_path(p_path); + if (r_path.is_absolute_path() && !r_path.is_network_share_path() && r_path.length() > MAX_PATH) { + r_path = "\\\\?\\" + r_path.replace("/", "\\"); + } + return r_path; +} + Error FileAccessWindows::open_internal(const String &p_path, int p_mode_flags) { if (is_path_invalid(p_path)) { #ifdef DEBUG_ENABLED diff --git a/drivers/windows/file_access_windows.h b/drivers/windows/file_access_windows.h index 453f8d3b5f8..13c881e562a 100644 --- a/drivers/windows/file_access_windows.h +++ b/drivers/windows/file_access_windows.h @@ -54,6 +54,7 @@ class FileAccessWindows : public FileAccess { static HashSet invalid_files; public: + virtual String fix_path(const String &p_path) const override; virtual Error open_internal(const String &p_path, int p_mode_flags) override; ///< open a file virtual bool is_open() const override; ///< true when file is open diff --git a/editor/debugger/script_editor_debugger.cpp b/editor/debugger/script_editor_debugger.cpp index 9f69b5dc2ae..bb8eafb7a25 100644 --- a/editor/debugger/script_editor_debugger.cpp +++ b/editor/debugger/script_editor_debugger.cpp @@ -1717,7 +1717,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { { //debugger VBoxContainer *vbc = memnew(VBoxContainer); - vbc->set_name(TTR("Debugger")); + vbc->set_name(TTR("Stack Trace")); Control *dbg = vbc; HBoxContainer *hbc = memnew(HBoxContainer); diff --git a/editor/editor_command_palette.cpp b/editor/editor_command_palette.cpp index 1c598277dda..eb35eddeb15 100644 --- a/editor/editor_command_palette.cpp +++ b/editor/editor_command_palette.cpp @@ -75,9 +75,15 @@ void EditorCommandPalette::_update_command_search(const String &search_text) { r.shortcut_text = E.value.shortcut; r.last_used = E.value.last_used; - if (search_text.is_subsequence_ofn(r.display_name)) { + bool is_subsequence_of_key_name = search_text.is_subsequence_ofn(r.key_name); + bool is_subsequence_of_display_name = search_text.is_subsequence_ofn(r.display_name); + + if (is_subsequence_of_key_name || is_subsequence_of_display_name) { if (!search_text.is_empty()) { - r.score = _score_path(search_text, r.display_name.to_lower()); + float key_name_score = is_subsequence_of_key_name ? _score_path(search_text, r.key_name.to_lower()) : .0f; + float display_name_score = is_subsequence_of_display_name ? _score_path(search_text, r.display_name.to_lower()) : .0f; + + r.score = MAX(key_name_score, display_name_score); } entries.push_back(r); diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 9bdd39f6849..7eb539333be 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -595,7 +595,7 @@ void EditorData::remove_scene(int p_idx) { } if (!edited_scene[p_idx].path.is_empty()) { - ScriptEditor::get_singleton()->close_builtin_scripts_from_scene(edited_scene[p_idx].path); + EditorNode::get_singleton()->emit_signal("scene_closed", edited_scene[p_idx].path); } undo_redo_manager->discard_history(edited_scene[p_idx].history_id); diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 87ca642be51..54494b63df8 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -6617,6 +6617,7 @@ void EditorNode::_bind_methods() { ADD_SIGNAL(MethodInfo("scene_saved", PropertyInfo(Variant::STRING, "path"))); ADD_SIGNAL(MethodInfo("project_settings_changed")); ADD_SIGNAL(MethodInfo("scene_changed")); + ADD_SIGNAL(MethodInfo("scene_closed", PropertyInfo(Variant::STRING, "path"))); } static Node *_resource_get_edited_scene() { diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index 01a574def66..348e1ead4a4 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -3998,7 +3998,6 @@ void EditorPropertyResource::_viewport_selected(const NodePath &p_path) { Ref vt; vt.instantiate(); vt->set_viewport_path_in_scene(get_tree()->get_edited_scene_root()->get_path_to(to_node)); - vt->setup_local_to_scene(); emit_changed(get_edited_property(), vt); update_property(); diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index 80ebd32295c..e684698e017 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -222,7 +222,7 @@ void EditorPropertyArray::update_property() { String array_type_name = Variant::get_type_name(array_type); if (array_type == Variant::ARRAY && subtype != Variant::NIL) { String type_name; - if (subtype == Variant::OBJECT && subtype_hint == PROPERTY_HINT_RESOURCE_TYPE) { + if (subtype == Variant::OBJECT && (subtype_hint == PROPERTY_HINT_RESOURCE_TYPE || subtype_hint == PROPERTY_HINT_NODE_TYPE)) { type_name = subtype_hint_string; } else { type_name = Variant::get_type_name(subtype); diff --git a/editor/export/project_export.cpp b/editor/export/project_export.cpp index a7ac95bd5b1..0407f77e9b0 100644 --- a/editor/export/project_export.cpp +++ b/editor/export/project_export.cpp @@ -244,6 +244,7 @@ void ProjectExportDialog::_edit_preset(int p_index) { export_filter->select(current->get_export_filter()); include_filters->set_text(current->get_include_filter()); + include_label->set_text(current->get_export_filter() == EditorExportPreset::EXCLUDE_SELECTED_RESOURCES ? TTR("Resources to exclude:") : TTR("Resources to export:")); exclude_filters->set_text(current->get_exclude_filter()); server_strip_message->set_visible(current->get_export_filter() == EditorExportPreset::EXPORT_CUSTOMIZED); @@ -704,6 +705,7 @@ void ProjectExportDialog::_export_type_changed(int p_which) { if (filter_type == EditorExportPreset::EXPORT_CUSTOMIZED && current->get_customized_files_count() == 0) { current->set_file_export_mode("res://", EditorExportPreset::MODE_FILE_STRIP); } + include_label->set_text(current->get_export_filter() == EditorExportPreset::EXCLUDE_SELECTED_RESOURCES ? TTR("Resources to exclude:") : TTR("Resources to export:")); updating = true; _fill_resource_tree(); diff --git a/editor/import/collada.cpp b/editor/import/collada.cpp index a8d746fde66..a499fc4feb0 100644 --- a/editor/import/collada.cpp +++ b/editor/import/collada.cpp @@ -44,10 +44,10 @@ /* HELPERS */ -String Collada::Effect::get_texture_path(const String &p_source, Collada &state) const { +String Collada::Effect::get_texture_path(const String &p_source, Collada &p_state) const { const String &image = p_source; - ERR_FAIL_COND_V(!state.state.image_map.has(image), ""); - return state.state.image_map[image].path; + ERR_FAIL_COND_V(!p_state.state.image_map.has(image), ""); + return p_state.state.image_map[image].path; } Transform3D Collada::get_root_transform() const { @@ -58,9 +58,9 @@ Transform3D Collada::get_root_transform() const { return unit_scale_transform; } -void Collada::Vertex::fix_unit_scale(const Collada &state) { +void Collada::Vertex::fix_unit_scale(const Collada &p_state) { #ifdef COLLADA_IMPORT_SCALE_SCENE - vertex *= state.state.unit_scale; + vertex *= p_state.state.unit_scale; #endif } @@ -102,27 +102,27 @@ Transform3D Collada::fix_transform(const Transform3D &p_transform) { //return state.matrix_fix * p_transform; } -static Transform3D _read_transform_from_array(const Vector &array, int ofs = 0) { +static Transform3D _read_transform_from_array(const Vector &p_array, int p_ofs = 0) { Transform3D tr; // i wonder why collada matrices are transposed, given that's opposed to opengl.. - tr.basis.rows[0][0] = array[0 + ofs]; - tr.basis.rows[0][1] = array[1 + ofs]; - tr.basis.rows[0][2] = array[2 + ofs]; - tr.basis.rows[1][0] = array[4 + ofs]; - tr.basis.rows[1][1] = array[5 + ofs]; - tr.basis.rows[1][2] = array[6 + ofs]; - tr.basis.rows[2][0] = array[8 + ofs]; - tr.basis.rows[2][1] = array[9 + ofs]; - tr.basis.rows[2][2] = array[10 + ofs]; - tr.origin.x = array[3 + ofs]; - tr.origin.y = array[7 + ofs]; - tr.origin.z = array[11 + ofs]; + tr.basis.rows[0][0] = p_array[0 + p_ofs]; + tr.basis.rows[0][1] = p_array[1 + p_ofs]; + tr.basis.rows[0][2] = p_array[2 + p_ofs]; + tr.basis.rows[1][0] = p_array[4 + p_ofs]; + tr.basis.rows[1][1] = p_array[5 + p_ofs]; + tr.basis.rows[1][2] = p_array[6 + p_ofs]; + tr.basis.rows[2][0] = p_array[8 + p_ofs]; + tr.basis.rows[2][1] = p_array[9 + p_ofs]; + tr.basis.rows[2][2] = p_array[10 + p_ofs]; + tr.origin.x = p_array[3 + p_ofs]; + tr.origin.y = p_array[7 + p_ofs]; + tr.origin.z = p_array[11 + p_ofs]; return tr; } /* STRUCTURES */ -Transform3D Collada::Node::compute_transform(const Collada &state) const { +Transform3D Collada::Node::compute_transform(const Collada &p_state) const { Transform3D xform; for (int i = 0; i < xform_list.size(); i++) { @@ -160,7 +160,7 @@ Transform3D Collada::Node::compute_transform(const Collada &state) const { } #ifdef COLLADA_IMPORT_SCALE_SCENE - xform.origin *= state.state.unit_scale; + xform.origin *= p_state.state.unit_scale; #endif return xform; } @@ -243,41 +243,41 @@ Vector Collada::AnimationTrack::get_value_at_time(float p_time) const { ERR_FAIL_V(Vector()); } -void Collada::_parse_asset(XMLParser &parser) { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); +void Collada::_parse_asset(XMLParser &p_parser) { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "up_axis") { - parser.read(); - if (parser.get_node_data() == "X_UP") { + p_parser.read(); + if (p_parser.get_node_data() == "X_UP") { state.up_axis = Vector3::AXIS_X; } - if (parser.get_node_data() == "Y_UP") { + if (p_parser.get_node_data() == "Y_UP") { state.up_axis = Vector3::AXIS_Y; } - if (parser.get_node_data() == "Z_UP") { + if (p_parser.get_node_data() == "Z_UP") { state.up_axis = Vector3::AXIS_Z; } - COLLADA_PRINT("up axis: " + parser.get_node_data()); + COLLADA_PRINT("up axis: " + p_parser.get_node_data()); } else if (name == "unit") { - state.unit_scale = parser.get_named_attribute_value("meter").to_float(); + state.unit_scale = p_parser.get_named_attribute_value("meter").to_float(); COLLADA_PRINT("unit scale: " + rtos(state.unit_scale)); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "asset") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "asset") { break; //end of } } } -void Collada::_parse_image(XMLParser &parser) { - String id = parser.get_named_attribute_value("id"); +void Collada::_parse_image(XMLParser &p_parser) { + String id = p_parser.get_named_attribute_value("id"); if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } @@ -286,19 +286,19 @@ void Collada::_parse_image(XMLParser &parser) { if (state.version < State::Version(1, 4, 0)) { /* <1.4 */ - String path = parser.get_named_attribute_value("source").strip_edges(); + String path = p_parser.get_named_attribute_value("source").strip_edges(); if (!path.contains("://") && path.is_relative_path()) { // path is relative to file being loaded, so convert to a resource path image.path = ProjectSettings::get_singleton()->localize_path(state.local_path.get_base_dir().path_join(path.uri_decode())); } } else { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "init_from") { - parser.read(); - String path = parser.get_node_data().strip_edges().uri_decode(); + p_parser.read(); + String path = p_parser.get_node_data().strip_edges().uri_decode(); if (!path.contains("://") && path.is_relative_path()) { // path is relative to file being loaded, so convert to a resource path @@ -314,11 +314,11 @@ void Collada::_parse_image(XMLParser &parser) { } else if (name == "data") { ERR_PRINT("COLLADA Embedded image data not supported!"); - } else if (name == "extra" && !parser.is_empty()) { - parser.skip_section(); + } else if (name == "extra" && !p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "image") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "image") { break; //end of } } @@ -327,29 +327,29 @@ void Collada::_parse_image(XMLParser &parser) { state.image_map[id] = image; } -void Collada::_parse_material(XMLParser &parser) { +void Collada::_parse_material(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } Material material; - String id = parser.get_named_attribute_value("id"); - if (parser.has_attribute("name")) { - material.name = parser.get_named_attribute_value("name"); + String id = p_parser.get_named_attribute_value("id"); + if (p_parser.has_attribute("name")) { + material.name = p_parser.get_named_attribute_value("name"); } if (state.version < State::Version(1, 4, 0)) { /* <1.4 */ ERR_PRINT("Collada Materials < 1.4 are not supported (yet)"); } else { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT && parser.get_node_name() == "instance_effect") { - material.instance_effect = _uri_to_id(parser.get_named_attribute_value("url")); - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "material") { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT && p_parser.get_node_name() == "instance_effect") { + material.instance_effect = _uri_to_id(p_parser.get_named_attribute_value("url")); + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "material") { break; //end of } } @@ -359,8 +359,8 @@ void Collada::_parse_material(XMLParser &parser) { } //! reads floats from inside of xml element until end of xml element -Vector Collada::_read_float_array(XMLParser &parser) { - if (parser.is_empty()) { +Vector Collada::_read_float_array(XMLParser &p_parser) { + if (p_parser.is_empty()) { return Vector(); } @@ -371,16 +371,16 @@ Vector Collada::_read_float_array(XMLParser &parser) { splitters.push_back("\t"); Vector array; - while (parser.read() == OK) { + while (p_parser.read() == OK) { // TODO: check for comments inside the element // and ignore them. - if (parser.get_node_type() == XMLParser::NODE_TEXT) { + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { // parse float data - String str = parser.get_node_data(); + String str = p_parser.get_node_data(); array = str.split_floats_mk(splitters, false); //array=str.split_floats(" ",false); - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { break; // end parsing text } } @@ -388,21 +388,21 @@ Vector Collada::_read_float_array(XMLParser &parser) { return array; } -Vector Collada::_read_string_array(XMLParser &parser) { - if (parser.is_empty()) { +Vector Collada::_read_string_array(XMLParser &p_parser) { + if (p_parser.is_empty()) { return Vector(); } Vector array; - while (parser.read() == OK) { + while (p_parser.read() == OK) { // TODO: check for comments inside the element // and ignore them. - if (parser.get_node_type() == XMLParser::NODE_TEXT) { + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { // parse String data - String str = parser.get_node_data(); + String str = p_parser.get_node_data(); array = str.split_spaces(); - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { break; // end parsing text } } @@ -410,21 +410,21 @@ Vector Collada::_read_string_array(XMLParser &parser) { return array; } -Transform3D Collada::_read_transform(XMLParser &parser) { - if (parser.is_empty()) { +Transform3D Collada::_read_transform(XMLParser &p_parser) { + if (p_parser.is_empty()) { return Transform3D(); } Vector array; - while (parser.read() == OK) { + while (p_parser.read() == OK) { // TODO: check for comments inside the element // and ignore them. - if (parser.get_node_type() == XMLParser::NODE_TEXT) { + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { // parse float data - String str = parser.get_node_data(); + String str = p_parser.get_node_data(); array = str.split_spaces(); - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { break; // end parsing text } } @@ -439,332 +439,332 @@ Transform3D Collada::_read_transform(XMLParser &parser) { return _read_transform_from_array(farr); } -String Collada::_read_empty_draw_type(XMLParser &parser) { +String Collada::_read_empty_draw_type(XMLParser &p_parser) { String empty_draw_type = ""; - if (parser.is_empty()) { + if (p_parser.is_empty()) { return empty_draw_type; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_TEXT) { - empty_draw_type = parser.get_node_data(); - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { + empty_draw_type = p_parser.get_node_data(); + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END) { break; // end parsing text } } return empty_draw_type; } -Variant Collada::_parse_param(XMLParser &parser) { - if (parser.is_empty()) { +Variant Collada::_parse_param(XMLParser &p_parser) { + if (p_parser.is_empty()) { return Variant(); } - String from = parser.get_node_name(); + String from = p_parser.get_node_name(); Variant data; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "float") { - parser.read(); - if (parser.get_node_type() == XMLParser::NODE_TEXT) { - data = parser.get_node_data().to_float(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "float") { + p_parser.read(); + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { + data = p_parser.get_node_data().to_float(); } - } else if (parser.get_node_name() == "float2") { - Vector v2 = _read_float_array(parser); + } else if (p_parser.get_node_name() == "float2") { + Vector v2 = _read_float_array(p_parser); if (v2.size() >= 2) { data = Vector2(v2[0], v2[1]); } - } else if (parser.get_node_name() == "float3") { - Vector v3 = _read_float_array(parser); + } else if (p_parser.get_node_name() == "float3") { + Vector v3 = _read_float_array(p_parser); if (v3.size() >= 3) { data = Vector3(v3[0], v3[1], v3[2]); } - } else if (parser.get_node_name() == "float4") { - Vector v4 = _read_float_array(parser); + } else if (p_parser.get_node_name() == "float4") { + Vector v4 = _read_float_array(p_parser); if (v4.size() >= 4) { data = Color(v4[0], v4[1], v4[2], v4[3]); } - } else if (parser.get_node_name() == "sampler2D") { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "source") { - parser.read(); + } else if (p_parser.get_node_name() == "sampler2D") { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "source") { + p_parser.read(); - if (parser.get_node_type() == XMLParser::NODE_TEXT) { - data = parser.get_node_data(); + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { + data = p_parser.get_node_data(); } } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "sampler2D") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "sampler2D") { break; } } - } else if (parser.get_node_name() == "surface") { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "init_from") { - parser.read(); + } else if (p_parser.get_node_name() == "surface") { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "init_from") { + p_parser.read(); - if (parser.get_node_type() == XMLParser::NODE_TEXT) { - data = parser.get_node_data(); + if (p_parser.get_node_type() == XMLParser::NODE_TEXT) { + data = p_parser.get_node_data(); } } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "surface") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "surface") { break; } } } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == from) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == from) { break; } } - COLLADA_PRINT("newparam ending " + parser.get_node_name()); + COLLADA_PRINT("newparam ending " + p_parser.get_node_name()); return data; } -void Collada::_parse_effect_material(XMLParser &parser, Effect &effect, String &id) { +void Collada::_parse_effect_material(XMLParser &p_parser, Effect &p_effect, String &p_id) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { // first come the tags we descend, but ignore the top-levels - COLLADA_PRINT("node name: " + parser.get_node_name()); + COLLADA_PRINT("node name: " + p_parser.get_node_name()); - if (!parser.is_empty() && - (parser.get_node_name() == "profile_COMMON" || - parser.get_node_name() == "technique" || - parser.get_node_name() == "extra")) { - _parse_effect_material(parser, effect, id); // try again + if (!p_parser.is_empty() && + (p_parser.get_node_name() == "profile_COMMON" || + p_parser.get_node_name() == "technique" || + p_parser.get_node_name() == "extra")) { + _parse_effect_material(p_parser, p_effect, p_id); // try again - } else if (parser.get_node_name() == "newparam") { - String name = parser.get_named_attribute_value("sid"); - Variant value = _parse_param(parser); - effect.params[name] = value; + } else if (p_parser.get_node_name() == "newparam") { + String name = p_parser.get_named_attribute_value("sid"); + Variant value = _parse_param(p_parser); + p_effect.params[name] = value; COLLADA_PRINT("param: " + name + " value:" + String(value)); - } else if (parser.get_node_name() == "constant" || - parser.get_node_name() == "lambert" || - parser.get_node_name() == "phong" || - parser.get_node_name() == "blinn") { - COLLADA_PRINT("shade model: " + parser.get_node_name()); - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String what = parser.get_node_name(); + } else if (p_parser.get_node_name() == "constant" || + p_parser.get_node_name() == "lambert" || + p_parser.get_node_name() == "phong" || + p_parser.get_node_name() == "blinn") { + COLLADA_PRINT("shade model: " + p_parser.get_node_name()); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String what = p_parser.get_node_name(); if (what == "emission" || what == "diffuse" || what == "specular" || what == "reflective") { // color or texture types - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "color") { - Vector colorarr = _read_float_array(parser); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "color") { + Vector colorarr = _read_float_array(p_parser); COLLADA_PRINT("colorarr size: " + rtos(colorarr.size())); if (colorarr.size() >= 3) { // alpha strangely not alright? maybe it needs to be multiplied by value as a channel intensity Color color(colorarr[0], colorarr[1], colorarr[2], 1.0); if (what == "diffuse") { - effect.diffuse.color = color; + p_effect.diffuse.color = color; } if (what == "specular") { - effect.specular.color = color; + p_effect.specular.color = color; } if (what == "emission") { - effect.emission.color = color; + p_effect.emission.color = color; } COLLADA_PRINT(what + " color: " + color); } - } else if (parser.get_node_name() == "texture") { - String sampler = parser.get_named_attribute_value("texture"); - if (!effect.params.has(sampler)) { - ERR_PRINT(String("Couldn't find sampler: " + sampler + " in material:" + id).utf8().get_data()); + } else if (p_parser.get_node_name() == "texture") { + String sampler = p_parser.get_named_attribute_value("texture"); + if (!p_effect.params.has(sampler)) { + ERR_PRINT(String("Couldn't find sampler: " + sampler + " in material:" + p_id).utf8().get_data()); } else { - String surface = effect.params[sampler]; + String surface = p_effect.params[sampler]; - if (!effect.params.has(surface)) { - ERR_PRINT(String("Couldn't find surface: " + surface + " in material:" + id).utf8().get_data()); + if (!p_effect.params.has(surface)) { + ERR_PRINT(String("Couldn't find surface: " + surface + " in material:" + p_id).utf8().get_data()); } else { - String uri = effect.params[surface]; + String uri = p_effect.params[surface]; if (what == "diffuse") { - effect.diffuse.texture = uri; + p_effect.diffuse.texture = uri; } else if (what == "specular") { - effect.specular.texture = uri; + p_effect.specular.texture = uri; } else if (what == "emission") { - effect.emission.texture = uri; + p_effect.emission.texture = uri; } else if (what == "bump") { - if (parser.has_attribute("bumptype") && parser.get_named_attribute_value("bumptype") != "NORMALMAP") { + if (p_parser.has_attribute("bumptype") && p_parser.get_named_attribute_value("bumptype") != "NORMALMAP") { WARN_PRINT("'bump' texture type is not NORMALMAP, only NORMALMAP is supported."); } - effect.bump.texture = uri; + p_effect.bump.texture = uri; } COLLADA_PRINT(what + " texture: " + uri); } } - } else if (!parser.is_empty()) { - parser.skip_section(); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == what) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == what) { break; } } } else if (what == "shininess") { - effect.shininess = _parse_param(parser); + p_effect.shininess = _parse_param(p_parser); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && - (parser.get_node_name() == "constant" || - parser.get_node_name() == "lambert" || - parser.get_node_name() == "phong" || - parser.get_node_name() == "blinn")) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && + (p_parser.get_node_name() == "constant" || + p_parser.get_node_name() == "lambert" || + p_parser.get_node_name() == "phong" || + p_parser.get_node_name() == "blinn")) { break; } } - } else if (parser.get_node_name() == "double_sided" || parser.get_node_name() == "show_double_sided") { // colladamax / google earth + } else if (p_parser.get_node_name() == "double_sided" || p_parser.get_node_name() == "show_double_sided") { // colladamax / google earth // 3DS Max / Google Earth double sided extension - parser.read(); - effect.found_double_sided = true; - effect.double_sided = parser.get_node_data().to_int(); - COLLADA_PRINT("double sided: " + itos(parser.get_node_data().to_int())); - } else if (parser.get_node_name() == "unshaded") { - parser.read(); - effect.unshaded = parser.get_node_data().to_int(); - } else if (parser.get_node_name() == "bump") { + p_parser.read(); + p_effect.found_double_sided = true; + p_effect.double_sided = p_parser.get_node_data().to_int(); + COLLADA_PRINT("double sided: " + itos(p_parser.get_node_data().to_int())); + } else if (p_parser.get_node_name() == "unshaded") { + p_parser.read(); + p_effect.unshaded = p_parser.get_node_data().to_int(); + } else if (p_parser.get_node_name() == "bump") { // color or texture types - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "texture") { - String sampler = parser.get_named_attribute_value("texture"); - if (!effect.params.has(sampler)) { - ERR_PRINT(String("Couldn't find sampler: " + sampler + " in material:" + id).utf8().get_data()); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "texture") { + String sampler = p_parser.get_named_attribute_value("texture"); + if (!p_effect.params.has(sampler)) { + ERR_PRINT(String("Couldn't find sampler: " + sampler + " in material:" + p_id).utf8().get_data()); } else { - String surface = effect.params[sampler]; + String surface = p_effect.params[sampler]; - if (!effect.params.has(surface)) { - ERR_PRINT(String("Couldn't find surface: " + surface + " in material:" + id).utf8().get_data()); + if (!p_effect.params.has(surface)) { + ERR_PRINT(String("Couldn't find surface: " + surface + " in material:" + p_id).utf8().get_data()); } else { - String uri = effect.params[surface]; + String uri = p_effect.params[surface]; - if (parser.has_attribute("bumptype") && parser.get_named_attribute_value("bumptype") != "NORMALMAP") { + if (p_parser.has_attribute("bumptype") && p_parser.get_named_attribute_value("bumptype") != "NORMALMAP") { WARN_PRINT("'bump' texture type is not NORMALMAP, only NORMALMAP is supported."); } - effect.bump.texture = uri; + p_effect.bump.texture = uri; COLLADA_PRINT(" bump: " + uri); } } - } else if (!parser.is_empty()) { - parser.skip_section(); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "bump") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "bump") { break; } } - } else if (!parser.is_empty()) { - parser.skip_section(); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && - (parser.get_node_name() == "effect" || - parser.get_node_name() == "profile_COMMON" || - parser.get_node_name() == "technique" || - parser.get_node_name() == "extra")) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && + (p_parser.get_node_name() == "effect" || + p_parser.get_node_name() == "profile_COMMON" || + p_parser.get_node_name() == "technique" || + p_parser.get_node_name() == "extra")) { break; } } } -void Collada::_parse_effect(XMLParser &parser) { +void Collada::_parse_effect(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); Effect effect; - if (parser.has_attribute("name")) { - effect.name = parser.get_named_attribute_value("name"); + if (p_parser.has_attribute("name")) { + effect.name = p_parser.get_named_attribute_value("name"); } - _parse_effect_material(parser, effect, id); + _parse_effect_material(p_parser, effect, id); state.effect_map[id] = effect; COLLADA_PRINT("Effect ID:" + id); } -void Collada::_parse_camera(XMLParser &parser) { +void Collada::_parse_camera(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); state.camera_data_map[id] = CameraData(); CameraData &camera = state.camera_data_map[id]; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "perspective") { camera.mode = CameraData::MODE_PERSPECTIVE; } else if (name == "orthographic") { camera.mode = CameraData::MODE_ORTHOGONAL; } else if (name == "xfov") { - parser.read(); - camera.perspective.x_fov = parser.get_node_data().to_float(); + p_parser.read(); + camera.perspective.x_fov = p_parser.get_node_data().to_float(); } else if (name == "yfov") { - parser.read(); - camera.perspective.y_fov = parser.get_node_data().to_float(); + p_parser.read(); + camera.perspective.y_fov = p_parser.get_node_data().to_float(); } else if (name == "xmag") { - parser.read(); - camera.orthogonal.x_mag = parser.get_node_data().to_float(); + p_parser.read(); + camera.orthogonal.x_mag = p_parser.get_node_data().to_float(); } else if (name == "ymag") { - parser.read(); - camera.orthogonal.y_mag = parser.get_node_data().to_float(); + p_parser.read(); + camera.orthogonal.y_mag = p_parser.get_node_data().to_float(); } else if (name == "aspect_ratio") { - parser.read(); - camera.aspect = parser.get_node_data().to_float(); + p_parser.read(); + camera.aspect = p_parser.get_node_data().to_float(); } else if (name == "znear") { - parser.read(); - camera.z_near = parser.get_node_data().to_float(); + p_parser.read(); + camera.z_near = p_parser.get_node_data().to_float(); } else if (name == "zfar") { - parser.read(); - camera.z_far = parser.get_node_data().to_float(); + p_parser.read(); + camera.z_far = p_parser.get_node_data().to_float(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "camera") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "camera") { break; //end of } } @@ -772,22 +772,22 @@ void Collada::_parse_camera(XMLParser &parser) { COLLADA_PRINT("Camera ID:" + id); } -void Collada::_parse_light(XMLParser &parser) { +void Collada::_parse_light(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); state.light_data_map[id] = LightData(); LightData &light = state.light_data_map[id]; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "ambient") { light.mode = LightData::MODE_AMBIENT; @@ -798,8 +798,8 @@ void Collada::_parse_light(XMLParser &parser) { } else if (name == "spot") { light.mode = LightData::MODE_SPOT; } else if (name == "color") { - parser.read(); - Vector colorarr = _read_float_array(parser); + p_parser.read(); + Vector colorarr = _read_float_array(p_parser); COLLADA_PRINT("colorarr size: " + rtos(colorarr.size())); if (colorarr.size() >= 4) { @@ -809,24 +809,24 @@ void Collada::_parse_light(XMLParser &parser) { } } else if (name == "constant_attenuation") { - parser.read(); - light.constant_att = parser.get_node_data().to_float(); + p_parser.read(); + light.constant_att = p_parser.get_node_data().to_float(); } else if (name == "linear_attenuation") { - parser.read(); - light.linear_att = parser.get_node_data().to_float(); + p_parser.read(); + light.linear_att = p_parser.get_node_data().to_float(); } else if (name == "quadratic_attenuation") { - parser.read(); - light.quad_att = parser.get_node_data().to_float(); + p_parser.read(); + light.quad_att = p_parser.get_node_data().to_float(); } else if (name == "falloff_angle") { - parser.read(); - light.spot_angle = parser.get_node_data().to_float(); + p_parser.read(); + light.spot_angle = p_parser.get_node_data().to_float(); } else if (name == "falloff_exponent") { - parser.read(); - light.spot_exp = parser.get_node_data().to_float(); + p_parser.read(); + light.spot_exp = p_parser.get_node_data().to_float(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "light") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "light") { break; //end of } } @@ -834,10 +834,10 @@ void Collada::_parse_light(XMLParser &parser) { COLLADA_PRINT("Light ID:" + id); } -void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_name) { +void Collada::_parse_curve_geometry(XMLParser &p_parser, String p_id, String p_name) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } @@ -848,7 +848,7 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam CurveData &curvedata = state.curve_data_map[p_id]; curvedata.name = p_name; - String closed = parser.get_named_attribute_value_safe("closed").to_lower(); + String closed = p_parser.get_named_attribute_value_safe("closed").to_lower(); curvedata.closed = closed == "true" || closed == "1"; COLLADA_PRINT("curve name: " + p_name); @@ -856,16 +856,16 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam String current_source; // handles geometry node and the curve children in this loop // read sources with arrays and accessor for each curve - if (parser.is_empty()) { + if (p_parser.is_empty()) { return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "source") { - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); curvedata.sources[id] = CurveData::Source(); current_source = id; COLLADA_PRINT("source data: " + id); @@ -873,13 +873,13 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam } else if (section == "float_array" || section == "array") { // create a new array and read it. if (curvedata.sources.has(current_source)) { - curvedata.sources[current_source].array = _read_float_array(parser); + curvedata.sources[current_source].array = _read_float_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(curvedata.sources[current_source].array.size()) + " values."); } } else if (section == "Name_array") { // create a new array and read it. if (curvedata.sources.has(current_source)) { - curvedata.sources[current_source].sarray = _read_string_array(parser); + curvedata.sources[current_source].sarray = _read_string_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(curvedata.sources[current_source].array.size()) + " values."); } @@ -888,38 +888,38 @@ void Collada::_parse_curve_geometry(XMLParser &parser, String p_id, String p_nam } else if (section == "accessor") { // child of source (below a technique tag) if (curvedata.sources.has(current_source)) { - curvedata.sources[current_source].stride = parser.get_named_attribute_value("stride").to_int(); + curvedata.sources[current_source].stride = p_parser.get_named_attribute_value("stride").to_int(); COLLADA_PRINT("section: " + current_source + " stride " + itos(curvedata.sources[current_source].stride)); } } else if (section == "control_vertices") { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); curvedata.control_vertices[semantic] = source; COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } - } else if (!parser.is_empty()) { - parser.skip_section(); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "spline") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "spline") { break; } } } -void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name) { +void Collada::_parse_mesh_geometry(XMLParser &p_parser, String p_id, String p_name) { if (!(state.import_flags & IMPORT_FLAG_SCENE)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; } @@ -936,16 +936,16 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name String current_source; // handles geometry node and the mesh children in this loop // read sources with arrays and accessor for each mesh - if (parser.is_empty()) { + if (p_parser.is_empty()) { return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "source") { - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); meshdata.sources[id] = MeshData::Source(); current_source = id; COLLADA_PRINT("source data: " + id); @@ -953,7 +953,7 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name } else if (section == "float_array" || section == "array") { // create a new array and read it. if (meshdata.sources.has(current_source)) { - meshdata.sources[current_source].array = _read_float_array(parser); + meshdata.sources[current_source].array = _read_float_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(meshdata.sources[current_source].array.size()) + " values."); } } else if (section == "technique_common") { @@ -961,19 +961,19 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name } else if (section == "accessor") { // child of source (below a technique tag) if (meshdata.sources.has(current_source)) { - meshdata.sources[current_source].stride = parser.get_named_attribute_value("stride").to_int(); + meshdata.sources[current_source].stride = p_parser.get_named_attribute_value("stride").to_int(); COLLADA_PRINT("section: " + current_source + " stride " + itos(meshdata.sources[current_source].stride)); } } else if (section == "vertices") { MeshData::Vertices vert; - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); int last_ref = 0; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); if (semantic == "TEXCOORD") { semantic = "TEXCOORD" + itos(last_ref++); @@ -983,7 +983,7 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } @@ -997,23 +997,23 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name } MeshData::Primitives prim; - if (parser.has_attribute("material")) { - prim.material = parser.get_named_attribute_value("material"); + if (p_parser.has_attribute("material")) { + prim.material = p_parser.get_named_attribute_value("material"); } - prim.count = parser.get_named_attribute_value("count").to_int(); + prim.count = p_parser.get_named_attribute_value("count").to_int(); prim.vertex_size = 0; int last_ref = 0; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); if (semantic == "TEXCOORD") { semantic = "TEXCOORD" + itos(last_ref++); } - int offset = parser.get_named_attribute_value("offset").to_int(); + int offset = p_parser.get_named_attribute_value("offset").to_int(); MeshData::Primitives::SourceRef sref; sref.source = source; @@ -1023,9 +1023,9 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source + " offset: " + itos(offset)); - } else if (parser.get_node_name() == "p") { //indices + } else if (p_parser.get_node_name() == "p") { //indices - Vector values = _read_float_array(parser); + Vector values = _read_float_array(p_parser); if (polygons) { ERR_CONTINUE(prim.vertex_size == 0); prim.polygons.push_back(values.size() / prim.vertex_size); @@ -1041,49 +1041,49 @@ void Collada::_parse_mesh_geometry(XMLParser &parser, String p_id, String p_name COLLADA_PRINT("read " + itos(values.size()) + " index values"); - } else if (parser.get_node_name() == "vcount") { // primitive + } else if (p_parser.get_node_name() == "vcount") { // primitive - Vector values = _read_float_array(parser); + Vector values = _read_float_array(p_parser); prim.polygons = values; COLLADA_PRINT("read " + itos(values.size()) + " polygon values"); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } meshdata.primitives.push_back(prim); - } else if (parser.get_node_name() == "double_sided") { - parser.read(); + } else if (p_parser.get_node_name() == "double_sided") { + p_parser.read(); meshdata.found_double_sided = true; - meshdata.double_sided = parser.get_node_data().to_int(); + meshdata.double_sided = p_parser.get_node_data().to_int(); - } else if (parser.get_node_name() == "polygons") { + } else if (p_parser.get_node_name() == "polygons") { ERR_PRINT("Primitive type \"polygons\" not supported, re-export using \"polylist\" or \"triangles\"."); - } else if (!parser.is_empty()) { - parser.skip_section(); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "mesh") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "mesh") { break; } } } -void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { +void Collada::_parse_skin_controller(XMLParser &p_parser, String p_id) { state.skin_controller_data_map[p_id] = SkinControllerData(); SkinControllerData &skindata = state.skin_controller_data_map[p_id]; - skindata.base = _uri_to_id(parser.get_named_attribute_value("source")); + skindata.base = _uri_to_id(p_parser.get_named_attribute_value("source")); String current_source; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "bind_shape_matrix") { - skindata.bind_shape = _read_transform(parser); + skindata.bind_shape = _read_transform(p_parser); #ifdef COLLADA_IMPORT_SCALE_SCENE skindata.bind_shape.origin *= state.unit_scale; @@ -1091,7 +1091,7 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { COLLADA_PRINT("skeleton bind shape transform: " + skindata.bind_shape); } else if (section == "source") { - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); skindata.sources[id] = SkinControllerData::Source(); current_source = id; COLLADA_PRINT("source data: " + id); @@ -1099,7 +1099,7 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { } else if (section == "float_array" || section == "array") { // create a new array and read it. if (skindata.sources.has(current_source)) { - skindata.sources[current_source].array = _read_float_array(parser); + skindata.sources[current_source].array = _read_float_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(skindata.sources[current_source].array.size()) + " values."); } } else if (section == "Name_array" || section == "IDREF_array") { @@ -1109,7 +1109,7 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { skindata.use_idrefs = true; } if (skindata.sources.has(current_source)) { - skindata.sources[current_source].sarray = _read_string_array(parser); + skindata.sources[current_source].sarray = _read_string_array(p_parser); if (section == "IDREF_array") { Vector sa = skindata.sources[current_source].sarray; for (int i = 0; i < sa.size(); i++) { @@ -1124,8 +1124,8 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { if (skindata.sources.has(current_source)) { int stride = 1; - if (parser.has_attribute("stride")) { - stride = parser.get_named_attribute_value("stride").to_int(); + if (p_parser.has_attribute("stride")) { + stride = p_parser.get_named_attribute_value("stride").to_int(); } skindata.sources[current_source].stride = stride; @@ -1135,17 +1135,17 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { } else if (section == "joints") { SkinControllerData::Joints joint; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); joint.sources[semantic] = source; COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } @@ -1155,15 +1155,15 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { } else if (section == "vertex_weights") { SkinControllerData::Weights weights; - weights.count = parser.get_named_attribute_value("count").to_int(); + weights.count = p_parser.get_named_attribute_value("count").to_int(); - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); - int offset = parser.get_named_attribute_value("offset").to_int(); + int offset = p_parser.get_named_attribute_value("offset").to_int(); SkinControllerData::Weights::SourceRef sref; sref.source = source; @@ -1172,26 +1172,26 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source + " offset: " + itos(offset)); - } else if (parser.get_node_name() == "v") { //indices + } else if (p_parser.get_node_name() == "v") { //indices - Vector values = _read_float_array(parser); + Vector values = _read_float_array(p_parser); weights.indices = values; COLLADA_PRINT("read " + itos(values.size()) + " index values"); - } else if (parser.get_node_name() == "vcount") { // weightsitive + } else if (p_parser.get_node_name() == "vcount") { // weightsitive - Vector values = _read_float_array(parser); + Vector values = _read_float_array(p_parser); weights.sets = values; COLLADA_PRINT("read " + itos(values.size()) + " polygon values"); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } skindata.weights = weights; } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "skin") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "skin") { break; } } @@ -1224,20 +1224,20 @@ void Collada::_parse_skin_controller(XMLParser &parser, String p_id) { } } -void Collada::_parse_morph_controller(XMLParser &parser, String p_id) { +void Collada::_parse_morph_controller(XMLParser &p_parser, String p_id) { state.morph_controller_data_map[p_id] = MorphControllerData(); MorphControllerData &morphdata = state.morph_controller_data_map[p_id]; - morphdata.mesh = _uri_to_id(parser.get_named_attribute_value("source")); - morphdata.mode = parser.get_named_attribute_value("method"); + morphdata.mesh = _uri_to_id(p_parser.get_named_attribute_value("source")); + morphdata.mode = p_parser.get_named_attribute_value("method"); String current_source; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "source") { - String id = parser.get_named_attribute_value("id"); + String id = p_parser.get_named_attribute_value("id"); morphdata.sources[id] = MorphControllerData::Source(); current_source = id; COLLADA_PRINT("source data: " + id); @@ -1245,13 +1245,13 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) { } else if (section == "float_array" || section == "array") { // create a new array and read it. if (morphdata.sources.has(current_source)) { - morphdata.sources[current_source].array = _read_float_array(parser); + morphdata.sources[current_source].array = _read_float_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(morphdata.sources[current_source].array.size()) + " values."); } } else if (section == "Name_array" || section == "IDREF_array") { // create a new array and read it. if (morphdata.sources.has(current_source)) { - morphdata.sources[current_source].sarray = _read_string_array(parser); + morphdata.sources[current_source].sarray = _read_string_array(p_parser); COLLADA_PRINT("section: " + current_source + " read " + itos(morphdata.sources[current_source].array.size()) + " values."); } } else if (section == "technique_common") { @@ -1260,8 +1260,8 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) { if (morphdata.sources.has(current_source)) { int stride = 1; - if (parser.has_attribute("stride")) { - stride = parser.get_named_attribute_value("stride").to_int(); + if (p_parser.has_attribute("stride")) { + stride = p_parser.get_named_attribute_value("stride").to_int(); } morphdata.sources[current_source].stride = stride; @@ -1269,22 +1269,22 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) { } } else if (section == "targets") { - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "input") { - String semantic = parser.get_named_attribute_value("semantic"); - String source = _uri_to_id(parser.get_named_attribute_value("source")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "input") { + String semantic = p_parser.get_named_attribute_value("semantic"); + String source = _uri_to_id(p_parser.get_named_attribute_value("source")); morphdata.targets[semantic] = source; COLLADA_PRINT(section + " input semantic: " + semantic + " source: " + source); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == section) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == section) { break; } } } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "morph") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "morph") { break; } } @@ -1294,57 +1294,57 @@ void Collada::_parse_morph_controller(XMLParser &parser, String p_id) { } } -void Collada::_parse_controller(XMLParser &parser) { - String id = parser.get_named_attribute_value("id"); +void Collada::_parse_controller(XMLParser &p_parser) { + String id = p_parser.get_named_attribute_value("id"); - if (parser.is_empty()) { + if (p_parser.is_empty()) { return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "skin") { - _parse_skin_controller(parser, id); + _parse_skin_controller(p_parser, id); } else if (section == "morph") { - _parse_morph_controller(parser, id); + _parse_morph_controller(p_parser, id); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "controller") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "controller") { break; } } } -Collada::Node *Collada::_parse_visual_instance_geometry(XMLParser &parser) { - String type = parser.get_node_name(); +Collada::Node *Collada::_parse_visual_instance_geometry(XMLParser &p_parser) { + String type = p_parser.get_node_name(); NodeGeometry *geom = memnew(NodeGeometry); geom->controller = type == "instance_controller"; - geom->source = _uri_to_id(parser.get_named_attribute_value_safe("url")); + geom->source = _uri_to_id(p_parser.get_named_attribute_value_safe("url")); - if (parser.is_empty()) { //nothing else to parse... + if (p_parser.is_empty()) { //nothing else to parse... return geom; } // try to find also many materials and skeletons! - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "instance_material") { - String symbol = parser.get_named_attribute_value("symbol"); - String target = _uri_to_id(parser.get_named_attribute_value("target")); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "instance_material") { + String symbol = p_parser.get_named_attribute_value("symbol"); + String target = _uri_to_id(p_parser.get_named_attribute_value("target")); NodeGeometry::Material mat; mat.target = target; geom->material_map[symbol] = mat; COLLADA_PRINT("uses material: '" + target + "' on primitive'" + symbol + "'"); - } else if (parser.get_node_name() == "skeleton") { - parser.read(); - String uri = _uri_to_id(parser.get_node_data()); + } else if (p_parser.get_node_name() == "skeleton") { + p_parser.read(); + String uri = _uri_to_id(p_parser.get_node_data()); if (!uri.is_empty()) { geom->skeletons.push_back(uri); } } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == type) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == type) { break; } } @@ -1368,20 +1368,20 @@ Collada::Node *Collada::_parse_visual_instance_geometry(XMLParser &parser) { return geom; } -Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) { +Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &p_parser) { NodeCamera *cam = memnew(NodeCamera); - cam->camera = _uri_to_id(parser.get_named_attribute_value_safe("url")); + cam->camera = _uri_to_id(p_parser.get_named_attribute_value_safe("url")); if (state.up_axis == Vector3::AXIS_Z) { //collada weirdness cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math_PI * 0.5); } - if (parser.is_empty()) { //nothing else to parse... + if (p_parser.is_empty()) { //nothing else to parse... return cam; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "instance_camera") { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "instance_camera") { break; } } @@ -1389,20 +1389,20 @@ Collada::Node *Collada::_parse_visual_instance_camera(XMLParser &parser) { return cam; } -Collada::Node *Collada::_parse_visual_instance_light(XMLParser &parser) { +Collada::Node *Collada::_parse_visual_instance_light(XMLParser &p_parser) { NodeLight *cam = memnew(NodeLight); - cam->light = _uri_to_id(parser.get_named_attribute_value_safe("url")); + cam->light = _uri_to_id(p_parser.get_named_attribute_value_safe("url")); if (state.up_axis == Vector3::AXIS_Z) { //collada weirdness cam->post_transform.basis.rotate(Vector3(1, 0, 0), -Math_PI * 0.5); } - if (parser.is_empty()) { //nothing else to parse... + if (p_parser.is_empty()) { //nothing else to parse... return cam; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "instance_light") { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "instance_light") { break; } } @@ -1410,23 +1410,23 @@ Collada::Node *Collada::_parse_visual_instance_light(XMLParser &parser) { return cam; } -Collada::Node *Collada::_parse_visual_node_instance_data(XMLParser &parser) { - String instance_type = parser.get_node_name(); +Collada::Node *Collada::_parse_visual_node_instance_data(XMLParser &p_parser) { + String instance_type = p_parser.get_node_name(); if (instance_type == "instance_geometry" || instance_type == "instance_controller") { - return _parse_visual_instance_geometry(parser); + return _parse_visual_instance_geometry(p_parser); } else if (instance_type == "instance_camera") { - return _parse_visual_instance_camera(parser); + return _parse_visual_instance_camera(p_parser); } else if (instance_type == "instance_light") { - return _parse_visual_instance_light(parser); + return _parse_visual_instance_light(p_parser); } - if (parser.is_empty()) { //nothing else to parse... + if (p_parser.is_empty()) { //nothing else to parse... return nullptr; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == instance_type) { + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == instance_type) { break; } } @@ -1434,10 +1434,10 @@ Collada::Node *Collada::_parse_visual_node_instance_data(XMLParser &parser) { return nullptr; } -Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { +Collada::Node *Collada::_parse_visual_scene_node(XMLParser &p_parser) { String name; - String id = parser.get_named_attribute_value_safe("id"); + String id = p_parser.get_named_attribute_value_safe("id"); bool found_name = false; @@ -1455,25 +1455,25 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { Node *node = nullptr; - name = parser.has_attribute("name") ? parser.get_named_attribute_value_safe("name") : parser.get_named_attribute_value_safe("id"); + name = p_parser.has_attribute("name") ? p_parser.get_named_attribute_value_safe("name") : p_parser.get_named_attribute_value_safe("id"); if (name.is_empty()) { name = id; } else { found_name = true; } - if ((parser.has_attribute("type") && parser.get_named_attribute_value("type") == "JOINT") || state.idref_joints.has(name)) { + if ((p_parser.has_attribute("type") && p_parser.get_named_attribute_value("type") == "JOINT") || state.idref_joints.has(name)) { // handle a bone NodeJoint *joint = memnew(NodeJoint); - if (parser.has_attribute("sid")) { //bones may not have sid - joint->sid = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { //bones may not have sid + joint->sid = p_parser.get_named_attribute_value("sid"); //state.bone_map[joint->sid]=joint; } else if (state.idref_joints.has(name)) { joint->sid = name; //kind of a cheat but.. - } else if (parser.has_attribute("name")) { - joint->sid = parser.get_named_attribute_value_safe("name"); + } else if (p_parser.has_attribute("name")) { + joint->sid = p_parser.get_named_attribute_value_safe("name"); } if (!joint->sid.is_empty()) { @@ -1483,42 +1483,42 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { node = joint; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "translate") { Node::XForm xf; - if (parser.has_attribute("sid")) { - xf.id = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { + xf.id = p_parser.get_named_attribute_value("sid"); } xf.op = Node::XForm::OP_TRANSLATE; - Vector xlt = _read_float_array(parser); + Vector xlt = _read_float_array(p_parser); xf.data = xlt; xform_list.push_back(xf); } else if (section == "rotate") { Node::XForm xf; - if (parser.has_attribute("sid")) { - xf.id = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { + xf.id = p_parser.get_named_attribute_value("sid"); } xf.op = Node::XForm::OP_ROTATE; - Vector rot = _read_float_array(parser); + Vector rot = _read_float_array(p_parser); xf.data = rot; xform_list.push_back(xf); } else if (section == "scale") { Node::XForm xf; - if (parser.has_attribute("sid")) { - xf.id = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { + xf.id = p_parser.get_named_attribute_value("sid"); } xf.op = Node::XForm::OP_SCALE; - Vector scale = _read_float_array(parser); + Vector scale = _read_float_array(p_parser); xf.data = scale; @@ -1526,12 +1526,12 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { } else if (section == "matrix") { Node::XForm xf; - if (parser.has_attribute("sid")) { - xf.id = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { + xf.id = p_parser.get_named_attribute_value("sid"); } xf.op = Node::XForm::OP_MATRIX; - Vector matrix = _read_float_array(parser); + Vector matrix = _read_float_array(p_parser); xf.data = matrix; String mtx; @@ -1543,25 +1543,25 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { } else if (section == "visibility") { Node::XForm xf; - if (parser.has_attribute("sid")) { - xf.id = parser.get_named_attribute_value("sid"); + if (p_parser.has_attribute("sid")) { + xf.id = p_parser.get_named_attribute_value("sid"); } xf.op = Node::XForm::OP_VISIBILITY; - Vector visible = _read_float_array(parser); + Vector visible = _read_float_array(p_parser); xf.data = visible; xform_list.push_back(xf); } else if (section == "empty_draw_type") { - empty_draw_type = _read_empty_draw_type(parser); + empty_draw_type = _read_empty_draw_type(p_parser); } else if (section == "technique" || section == "extra") { } else if (section != "node") { //usually what defines the type of node if (section.begins_with("instance_")) { if (!node) { - node = _parse_visual_node_instance_data(parser); + node = _parse_visual_node_instance_data(p_parser); } else { ERR_PRINT("Multiple instance_* not supported."); @@ -1571,11 +1571,11 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { } else { /* Found a child node!! what to do..*/ - Node *child = _parse_visual_scene_node(parser); + Node *child = _parse_visual_scene_node(p_parser); children.push_back(child); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "node") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "node") { break; } } @@ -1608,29 +1608,29 @@ Collada::Node *Collada::_parse_visual_scene_node(XMLParser &parser) { return node; } -void Collada::_parse_visual_scene(XMLParser &parser) { - String id = parser.get_named_attribute_value("id"); +void Collada::_parse_visual_scene(XMLParser &p_parser) { + String id = p_parser.get_named_attribute_value("id"); - if (parser.is_empty()) { + if (p_parser.is_empty()) { return; } state.visual_scene_map[id] = VisualScene(); VisualScene &vscene = state.visual_scene_map[id]; - if (parser.has_attribute("name")) { - vscene.name = parser.get_named_attribute_value("name"); + if (p_parser.has_attribute("name")) { + vscene.name = p_parser.get_named_attribute_value("name"); } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String section = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String section = p_parser.get_node_name(); if (section == "node") { - vscene.root_nodes.push_back(_parse_visual_scene_node(parser)); + vscene.root_nodes.push_back(_parse_visual_scene_node(p_parser)); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "visual_scene") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "visual_scene") { break; } } @@ -1638,10 +1638,10 @@ void Collada::_parse_visual_scene(XMLParser &parser) { COLLADA_PRINT("Scene ID:" + id); } -void Collada::_parse_animation(XMLParser &parser) { +void Collada::_parse_animation(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_ANIMATION)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; @@ -1655,8 +1655,8 @@ void Collada::_parse_animation(XMLParser &parser) { HashMap> source_param_types; String id = ""; - if (parser.has_attribute("id")) { - id = parser.get_named_attribute_value("id"); + if (p_parser.has_attribute("id")) { + id = p_parser.get_named_attribute_value("id"); } String current_source; @@ -1664,54 +1664,54 @@ void Collada::_parse_animation(XMLParser &parser) { Vector channel_sources; Vector channel_targets; - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "source") { - current_source = parser.get_named_attribute_value("id"); + current_source = p_parser.get_named_attribute_value("id"); source_param_names[current_source] = Vector(); source_param_types[current_source] = Vector(); } else if (name == "float_array") { if (!current_source.is_empty()) { - float_sources[current_source] = _read_float_array(parser); + float_sources[current_source] = _read_float_array(p_parser); } } else if (name == "Name_array") { if (!current_source.is_empty()) { - string_sources[current_source] = _read_string_array(parser); + string_sources[current_source] = _read_string_array(p_parser); } } else if (name == "accessor") { - if (!current_source.is_empty() && parser.has_attribute("stride")) { - source_strides[current_source] = parser.get_named_attribute_value("stride").to_int(); + if (!current_source.is_empty() && p_parser.has_attribute("stride")) { + source_strides[current_source] = p_parser.get_named_attribute_value("stride").to_int(); } } else if (name == "sampler") { - current_sampler = parser.get_named_attribute_value("id"); + current_sampler = p_parser.get_named_attribute_value("id"); samplers[current_sampler] = HashMap(); } else if (name == "param") { - if (parser.has_attribute("name")) { - source_param_names[current_source].push_back(parser.get_named_attribute_value("name")); + if (p_parser.has_attribute("name")) { + source_param_names[current_source].push_back(p_parser.get_named_attribute_value("name")); } else { source_param_names[current_source].push_back(""); } - if (parser.has_attribute("type")) { - source_param_types[current_source].push_back(parser.get_named_attribute_value("type")); + if (p_parser.has_attribute("type")) { + source_param_types[current_source].push_back(p_parser.get_named_attribute_value("type")); } else { source_param_types[current_source].push_back(""); } } else if (name == "input") { if (!current_sampler.is_empty()) { - samplers[current_sampler][parser.get_named_attribute_value("semantic")] = parser.get_named_attribute_value("source"); + samplers[current_sampler][p_parser.get_named_attribute_value("semantic")] = p_parser.get_named_attribute_value("source"); } } else if (name == "channel") { - channel_sources.push_back(parser.get_named_attribute_value("source")); - channel_targets.push_back(parser.get_named_attribute_value("target")); + channel_sources.push_back(p_parser.get_named_attribute_value("source")); + channel_targets.push_back(p_parser.get_named_attribute_value("target")); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "animation") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "animation") { break; //end of } } @@ -1845,10 +1845,10 @@ void Collada::_parse_animation(XMLParser &parser) { } } -void Collada::_parse_animation_clip(XMLParser &parser) { +void Collada::_parse_animation_clip(XMLParser &p_parser) { if (!(state.import_flags & IMPORT_FLAG_ANIMATION)) { - if (!parser.is_empty()) { - parser.skip_section(); + if (!p_parser.is_empty()) { + p_parser.skip_section(); } return; @@ -1856,27 +1856,27 @@ void Collada::_parse_animation_clip(XMLParser &parser) { AnimationClip clip; - if (parser.has_attribute("name")) { - clip.name = parser.get_named_attribute_value("name"); - } else if (parser.has_attribute("id")) { - clip.name = parser.get_named_attribute_value("id"); + if (p_parser.has_attribute("name")) { + clip.name = p_parser.get_named_attribute_value("name"); + } else if (p_parser.has_attribute("id")) { + clip.name = p_parser.get_named_attribute_value("id"); } - if (parser.has_attribute("start")) { - clip.begin = parser.get_named_attribute_value("start").to_float(); + if (p_parser.has_attribute("start")) { + clip.begin = p_parser.get_named_attribute_value("start").to_float(); } - if (parser.has_attribute("end")) { - clip.end = parser.get_named_attribute_value("end").to_float(); + if (p_parser.has_attribute("end")) { + clip.end = p_parser.get_named_attribute_value("end").to_float(); } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "instance_animation") { - String url = _uri_to_id(parser.get_named_attribute_value("url")); + String url = _uri_to_id(p_parser.get_named_attribute_value("url")); clip.tracks.push_back(url); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "animation_clip") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "animation_clip") { break; //end of } } @@ -1884,79 +1884,79 @@ void Collada::_parse_animation_clip(XMLParser &parser) { state.animation_clips.push_back(clip); } -void Collada::_parse_scene(XMLParser &parser) { - if (parser.is_empty()) { +void Collada::_parse_scene(XMLParser &p_parser) { + if (p_parser.is_empty()) { return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); if (name == "instance_visual_scene") { - state.root_visual_scene = _uri_to_id(parser.get_named_attribute_value("url")); + state.root_visual_scene = _uri_to_id(p_parser.get_named_attribute_value("url")); } else if (name == "instance_physics_scene") { - state.root_physics_scene = _uri_to_id(parser.get_named_attribute_value("url")); + state.root_physics_scene = _uri_to_id(p_parser.get_named_attribute_value("url")); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "scene") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "scene") { break; //end of } } } -void Collada::_parse_library(XMLParser &parser) { - if (parser.is_empty()) { +void Collada::_parse_library(XMLParser &p_parser) { + if (p_parser.is_empty()) { return; } - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - String name = parser.get_node_name(); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + String name = p_parser.get_node_name(); COLLADA_PRINT("library name is: " + name); if (name == "image") { - _parse_image(parser); + _parse_image(p_parser); } else if (name == "material") { - _parse_material(parser); + _parse_material(p_parser); } else if (name == "effect") { - _parse_effect(parser); + _parse_effect(p_parser); } else if (name == "camera") { - _parse_camera(parser); + _parse_camera(p_parser); } else if (name == "light") { - _parse_light(parser); + _parse_light(p_parser); } else if (name == "geometry") { - String id = parser.get_named_attribute_value("id"); - String name2 = parser.get_named_attribute_value_safe("name"); - while (parser.read() == OK) { - if (parser.get_node_type() == XMLParser::NODE_ELEMENT) { - if (parser.get_node_name() == "mesh") { + String id = p_parser.get_named_attribute_value("id"); + String name2 = p_parser.get_named_attribute_value_safe("name"); + while (p_parser.read() == OK) { + if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT) { + if (p_parser.get_node_name() == "mesh") { state.mesh_name_map[id] = (!name2.is_empty()) ? name2 : id; - _parse_mesh_geometry(parser, id, name2); - } else if (parser.get_node_name() == "spline") { + _parse_mesh_geometry(p_parser, id, name2); + } else if (p_parser.get_node_name() == "spline") { state.mesh_name_map[id] = (!name2.is_empty()) ? name2 : id; - _parse_curve_geometry(parser, id, name2); - } else if (!parser.is_empty()) { - parser.skip_section(); + _parse_curve_geometry(p_parser, id, name2); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name() == "geometry") { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name() == "geometry") { break; } } } else if (name == "controller") { - _parse_controller(parser); + _parse_controller(p_parser); } else if (name == "animation") { - _parse_animation(parser); + _parse_animation(p_parser); } else if (name == "animation_clip") { - _parse_animation_clip(parser); + _parse_animation_clip(p_parser); } else if (name == "visual_scene") { COLLADA_PRINT("visual scene"); - _parse_visual_scene(parser); - } else if (!parser.is_empty()) { - parser.skip_section(); + _parse_visual_scene(p_parser); + } else if (!p_parser.is_empty()) { + p_parser.skip_section(); } - } else if (parser.get_node_type() == XMLParser::NODE_ELEMENT_END && parser.get_node_name().begins_with("library_")) { + } else if (p_parser.get_node_type() == XMLParser::NODE_ELEMENT_END && p_parser.get_node_name().begins_with("library_")) { break; //end of } } diff --git a/editor/import/collada.h b/editor/import/collada.h index 12b32f982d4..7877b1e86d4 100644 --- a/editor/import/collada.h +++ b/editor/import/collada.h @@ -69,7 +69,7 @@ public: bool double_sided = true; bool unshaded = false; - String get_texture_path(const String &p_source, Collada &state) const; + String get_texture_path(const String &p_source, Collada &p_state) const; Effect() { diffuse.color = Color(1, 1, 1, 1); @@ -266,7 +266,7 @@ public: } } - void fix_unit_scale(const Collada &state); + void fix_unit_scale(const Collada &p_state); bool operator<(const Vertex &p_vert) const { if (uid == p_vert.uid) { @@ -348,7 +348,7 @@ public: Node *parent = nullptr; - Transform3D compute_transform(const Collada &state) const; + Transform3D compute_transform(const Collada &p_state) const; Transform3D get_global_transform() const; Transform3D get_transform() const; @@ -526,39 +526,39 @@ public: private: // private stuff HashMap channel_map; - void _parse_asset(XMLParser &parser); - void _parse_image(XMLParser &parser); - void _parse_material(XMLParser &parser); - void _parse_effect_material(XMLParser &parser, Effect &effect, String &id); - void _parse_effect(XMLParser &parser); - void _parse_camera(XMLParser &parser); - void _parse_light(XMLParser &parser); - void _parse_animation_clip(XMLParser &parser); + void _parse_asset(XMLParser &p_parser); + void _parse_image(XMLParser &p_parser); + void _parse_material(XMLParser &p_parser); + void _parse_effect_material(XMLParser &p_parser, Effect &p_effect, String &p_id); + void _parse_effect(XMLParser &p_parser); + void _parse_camera(XMLParser &p_parser); + void _parse_light(XMLParser &p_parser); + void _parse_animation_clip(XMLParser &p_parser); - void _parse_mesh_geometry(XMLParser &parser, String p_id, String p_name); - void _parse_curve_geometry(XMLParser &parser, String p_id, String p_name); + void _parse_mesh_geometry(XMLParser &p_parser, String p_id, String p_name); + void _parse_curve_geometry(XMLParser &p_parser, String p_id, String p_name); - void _parse_skin_controller(XMLParser &parser, String p_id); - void _parse_morph_controller(XMLParser &parser, String p_id); - void _parse_controller(XMLParser &parser); + void _parse_skin_controller(XMLParser &p_parser, String p_id); + void _parse_morph_controller(XMLParser &p_parser, String p_id); + void _parse_controller(XMLParser &p_parser); - Node *_parse_visual_instance_geometry(XMLParser &parser); - Node *_parse_visual_instance_camera(XMLParser &parser); - Node *_parse_visual_instance_light(XMLParser &parser); + Node *_parse_visual_instance_geometry(XMLParser &p_parser); + Node *_parse_visual_instance_camera(XMLParser &p_parser); + Node *_parse_visual_instance_light(XMLParser &p_parser); - Node *_parse_visual_node_instance_data(XMLParser &parser); - Node *_parse_visual_scene_node(XMLParser &parser); - void _parse_visual_scene(XMLParser &parser); + Node *_parse_visual_node_instance_data(XMLParser &p_parser); + Node *_parse_visual_scene_node(XMLParser &p_parser); + void _parse_visual_scene(XMLParser &p_parser); - void _parse_animation(XMLParser &parser); - void _parse_scene(XMLParser &parser); - void _parse_library(XMLParser &parser); + void _parse_animation(XMLParser &p_parser); + void _parse_scene(XMLParser &p_parser); + void _parse_library(XMLParser &p_parser); - Variant _parse_param(XMLParser &parser); - Vector _read_float_array(XMLParser &parser); - Vector _read_string_array(XMLParser &parser); - Transform3D _read_transform(XMLParser &parser); - String _read_empty_draw_type(XMLParser &parser); + Variant _parse_param(XMLParser &p_parser); + Vector _read_float_array(XMLParser &p_parser); + Vector _read_string_array(XMLParser &p_parser); + Transform3D _read_transform(XMLParser &p_parser); + String _read_empty_draw_type(XMLParser &p_parser); void _joint_set_owner(Collada::Node *p_node, NodeSkeleton *p_owner); void _create_skeletons(Collada::Node **p_node, NodeSkeleton *p_skeleton = nullptr); diff --git a/editor/import/post_import_plugin_skeleton_rest_fixer.cpp b/editor/import/post_import_plugin_skeleton_rest_fixer.cpp index e105135c116..6214a2b70d5 100644 --- a/editor/import/post_import_plugin_skeleton_rest_fixer.cpp +++ b/editor/import/post_import_plugin_skeleton_rest_fixer.cpp @@ -669,7 +669,7 @@ void PostImportPluginSkeletonRestFixer::internal_process(InternalImportCategory StringName bn = skin->get_bind_name(i); int bone_idx = src_skeleton->find_bone(bn); if (bone_idx >= 0) { - Transform3D new_rest = silhouette_diff[i] * src_skeleton->get_bone_global_rest(bone_idx); + Transform3D new_rest = silhouette_diff[bone_idx] * src_skeleton->get_bone_global_rest(bone_idx); skin->set_bind_pose(i, new_rest.inverse() * ibm_diff[bone_idx]); } } diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 0aef364c2de..204d783df13 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -436,7 +436,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla switch (shape_type) { case CAPSULE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); float radius = shape->get_radius(); @@ -451,7 +451,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case CIRCLE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(1); handles.write[0] = Point2(shape->get_radius(), 0); @@ -467,7 +467,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case WORLD_BOUNDARY_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); handles.write[0] = shape->get_normal() * shape->get_distance(); @@ -479,7 +479,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case SEPARATION_RAY_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(1); handles.write[0] = Point2(0, shape->get_length()); @@ -489,7 +489,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case RECTANGLE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(8); Vector2 ext = shape->get_size() / 2; @@ -501,7 +501,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case SEGMENT_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); handles.write[0] = shape->get_a(); diff --git a/editor/plugins/material_editor_plugin.cpp b/editor/plugins/material_editor_plugin.cpp index 36c143ca8d8..32d237e411d 100644 --- a/editor/plugins/material_editor_plugin.cpp +++ b/editor/plugins/material_editor_plugin.cpp @@ -157,9 +157,19 @@ void MaterialEditor::_button_pressed(Node *p_button) { MaterialEditor::MaterialEditor() { // canvas item + vc_2d = memnew(SubViewportContainer); + vc_2d->set_stretch(true); + add_child(vc_2d); + vc_2d->set_anchors_and_offsets_preset(PRESET_FULL_RECT); + + viewport_2d = memnew(SubViewport); + vc_2d->add_child(viewport_2d); + viewport_2d->set_disable_input(true); + viewport_2d->set_transparent_background(true); + layout_2d = memnew(HBoxContainer); layout_2d->set_alignment(BoxContainer::ALIGNMENT_CENTER); - add_child(layout_2d); + viewport_2d->add_child(layout_2d); layout_2d->set_anchors_and_offsets_preset(PRESET_FULL_RECT); rect_instance = memnew(ColorRect); diff --git a/editor/plugins/material_editor_plugin.h b/editor/plugins/material_editor_plugin.h index 63ee053b1d1..7a610d860ce 100644 --- a/editor/plugins/material_editor_plugin.h +++ b/editor/plugins/material_editor_plugin.h @@ -50,6 +50,8 @@ class MaterialEditor : public Control { Vector2 rot; + SubViewportContainer *vc_2d = nullptr; + SubViewport *viewport_2d = nullptr; HBoxContainer *layout_2d = nullptr; ColorRect *rect_instance = nullptr; diff --git a/editor/plugins/node_3d_editor_plugin.cpp b/editor/plugins/node_3d_editor_plugin.cpp index e110e524543..d3e0c7e64c9 100644 --- a/editor/plugins/node_3d_editor_plugin.cpp +++ b/editor/plugins/node_3d_editor_plugin.cpp @@ -8340,8 +8340,6 @@ Node3DEditor::Node3DEditor() { snap_scale->set_select_all_on_focus(true); snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"), snap_scale); - _snap_update(); - /* SETTINGS DIALOG */ settings_dialog = memnew(ConfirmationDialog); @@ -8545,9 +8543,11 @@ void fragment() { sun_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(sun_color->get_picker())); sun_energy = memnew(EditorSpinSlider); + sun_energy->set_max(64.0); + sun_energy->set_min(0); + sun_energy->set_step(0.05); sun_vb->add_margin_child(TTR("Sun Energy"), sun_energy); sun_energy->connect("value_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); - sun_energy->set_max(64.0); sun_max_distance = memnew(EditorSpinSlider); sun_vb->add_margin_child(TTR("Shadow Max Distance"), sun_max_distance); @@ -8596,8 +8596,10 @@ void fragment() { environ_ground_color->get_popup()->connect("about_to_popup", callable_mp(EditorNode::get_singleton(), &EditorNode::setup_color_picker).bind(environ_ground_color->get_picker())); environ_vb->add_margin_child(TTR("Ground Color"), environ_ground_color); environ_energy = memnew(EditorSpinSlider); - environ_energy->connect("value_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); environ_energy->set_max(8.0); + environ_energy->set_min(0); + environ_energy->set_step(0.05); + environ_energy->connect("value_changed", callable_mp(this, &Node3DEditor::_preview_settings_changed).unbind(1)); environ_vb->add_margin_child(TTR("Sky Energy"), environ_energy); HBoxContainer *fx_vb = memnew(HBoxContainer); fx_vb->set_h_size_flags(SIZE_EXPAND_FILL); @@ -8657,7 +8659,7 @@ void fragment() { _load_default_preview_settings(); _preview_settings_changed(); } - clear(); // Make sure values are initialized. + clear(); // Make sure values are initialized. Will call _snap_update() for us. } Node3DEditor::~Node3DEditor() { memdelete(preview_node); diff --git a/editor/plugins/node_3d_editor_plugin.h b/editor/plugins/node_3d_editor_plugin.h index c4193f0420d..2e898ff3263 100644 --- a/editor/plugins/node_3d_editor_plugin.h +++ b/editor/plugins/node_3d_editor_plugin.h @@ -402,8 +402,8 @@ private: Camera3D *previewing = nullptr; Camera3D *preview = nullptr; - bool previewing_camera; - bool previewing_cinema; + bool previewing_camera = false; + bool previewing_cinema = false; bool _is_node_locked(const Node *p_node); void _preview_exited_scene(); void _toggle_camera_preview(bool); @@ -580,8 +580,8 @@ private: bool origin_enabled = false; RID grid[3]; RID grid_instance[3]; - bool grid_visible[3]; //currently visible - bool grid_enable[3]; //should be always visible if true + bool grid_visible[3] = { false, false, false }; //currently visible + bool grid_enable[3] = { false, false, false }; //should be always visible if true bool grid_enabled = false; bool grid_init_draw = false; Camera3D::ProjectionType grid_camera_last_update_perspective = Camera3D::PROJECTION_PERSPECTIVE; diff --git a/editor/plugins/physical_bone_3d_editor_plugin.cpp b/editor/plugins/physical_bone_3d_editor_plugin.cpp index b716cee3ffa..a8d3ab948fb 100644 --- a/editor/plugins/physical_bone_3d_editor_plugin.cpp +++ b/editor/plugins/physical_bone_3d_editor_plugin.cpp @@ -96,8 +96,9 @@ void PhysicalBone3DEditorPlugin::make_visible(bool p_visible) { } void PhysicalBone3DEditorPlugin::edit(Object *p_node) { - selected = static_cast(p_node); // Trust it - ERR_FAIL_COND(!selected); - - physical_bone_editor.set_selected(selected); + PhysicalBone3D *bone = Object::cast_to(p_node); + if (bone) { + selected = bone; + physical_bone_editor.set_selected(selected); + } } diff --git a/editor/plugins/script_editor_plugin.cpp b/editor/plugins/script_editor_plugin.cpp index 46218869b36..d0d4c87c1ca 100644 --- a/editor/plugins/script_editor_plugin.cpp +++ b/editor/plugins/script_editor_plugin.cpp @@ -1643,6 +1643,7 @@ void ScriptEditor::_notification(int p_what) { get_tree()->connect("tree_changed", callable_mp(this, &ScriptEditor::_tree_changed)); InspectorDock::get_singleton()->connect("request_help", callable_mp(this, &ScriptEditor::_help_class_open)); EditorNode::get_singleton()->connect("request_help_search", callable_mp(this, &ScriptEditor::_help_search)); + EditorNode::get_singleton()->connect("scene_closed", callable_mp(this, &ScriptEditor::_close_builtin_scripts_from_scene)); } break; case NOTIFICATION_EXIT_TREE: { @@ -1677,7 +1678,7 @@ bool ScriptEditor::can_take_away_focus() const { } } -void ScriptEditor::close_builtin_scripts_from_scene(const String &p_scene) { +void ScriptEditor::_close_builtin_scripts_from_scene(const String &p_scene) { for (int i = 0; i < tab_container->get_tab_count(); i++) { ScriptEditorBase *se = Object::cast_to(tab_container->get_tab_control(i)); @@ -1687,7 +1688,7 @@ void ScriptEditor::close_builtin_scripts_from_scene(const String &p_scene) { continue; } - if (scr->is_built_in() && scr->get_path().begins_with(p_scene)) { //is an internal script and belongs to scene being closed + if (scr->is_built_in() && scr->get_path().begins_with(p_scene)) { // Is an internal script and belongs to scene being closed. _close_tab(i, false); i--; } diff --git a/editor/plugins/script_editor_plugin.h b/editor/plugins/script_editor_plugin.h index 7d2f5ad22a5..10dfe0f199a 100644 --- a/editor/plugins/script_editor_plugin.h +++ b/editor/plugins/script_editor_plugin.h @@ -482,6 +482,7 @@ class ScriptEditor : public PanelContainer { void _on_find_in_files_modified_files(PackedStringArray paths); static void _open_script_request(const String &p_path); + void _close_builtin_scripts_from_scene(const String &p_scene); static ScriptEditor *script_editor; @@ -523,8 +524,6 @@ public: void notify_script_close(const Ref