diff options
Diffstat (limited to 'doc/classes')
25 files changed, 178 insertions, 35 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 9cfe494b7f..41cc043a74 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -1,13 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="@GlobalScope" version="4.0"> <brief_description> - Global scope constants and variables. + Global scope constants and functions. </brief_description> <description> - Global scope constants and variables. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc. + A list of global scope enumerated constants and built-in functions. This is all that resides in the globals, constants regarding error codes, keycodes, property hints, etc. Singletons are also documented here, since they can be accessed from anywhere. + For the entries related to GDScript which can be accessed in any script see [@GDScript]. </description> <tutorials> + <link title="Random number generation">$DOCS_URL/tutorials/math/random_number_generation.html</link> </tutorials> <methods> <method name="abs"> @@ -248,9 +250,9 @@ - 1.0: Linear - Between -1.0 and 0.0 (exclusive): Ease out-in - 0.0: Constant - - Between 0.0 to 1.0 (exclusive): Ease in + - Between 0.0 to 1.0 (exclusive): Ease out - 1.0: Linear - - Greater than 1.0 (exclusive): Ease out + - Greater than 1.0 (exclusive): Ease in [/codeblock] [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/img/ease_cheatsheet.png]ease() curve values cheatsheet[/url] See also [method smoothstep]. If you need to perform more advanced transitions, use [Tween] or [AnimationPlayer]. diff --git a/doc/classes/Array.xml b/doc/classes/Array.xml index b74d4c1d3d..d505ee98cc 100644 --- a/doc/classes/Array.xml +++ b/doc/classes/Array.xml @@ -194,7 +194,7 @@ <return type="void" /> <argument index="0" name="value" type="Variant" /> <description> - Removes the first occurrence of a value from the array. To remove an element by index, use [method remove] instead. + Removes the first occurrence of a value from the array. To remove an element by index, use [method remove_at] instead. [b]Note:[/b] This method acts in-place and doesn't return a value. [b]Note:[/b] On large arrays, this method will be slower if the removed element is close to the beginning of the array (index 0). This is because all elements placed after the removed element have to be reindexed. </description> @@ -400,7 +400,7 @@ [/codeblock] </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="position" type="int" /> <description> diff --git a/doc/classes/Control.xml b/doc/classes/Control.xml index 668912b6bd..8739e0157d 100644 --- a/doc/classes/Control.xml +++ b/doc/classes/Control.xml @@ -720,6 +720,12 @@ Removes a local override for a theme [StyleBox] with the specified [code]name[/code] previously added by [method add_theme_stylebox_override] or via the Inspector dock. </description> </method> + <method name="reset_size"> + <return type="void" /> + <description> + Resets the size to [method get_combined_minimum_size]. This is equivalent to calling [code]set_size(Vector2())[/code] (or any size below the minimum). + </description> + </method> <method name="set_anchor"> <return type="void" /> <argument index="0" name="side" type="int" enum="Side" /> diff --git a/doc/classes/Image.xml b/doc/classes/Image.xml index d2b1b5c004..8a4bbee0fa 100644 --- a/doc/classes/Image.xml +++ b/doc/classes/Image.xml @@ -154,7 +154,15 @@ <return type="void" /> <argument index="0" name="color" type="Color" /> <description> - Fills the image with a given [Color]. + Fills the image with [code]color[/code]. + </description> + </method> + <method name="fill_rect"> + <return type="void" /> + <argument index="0" name="rect" type="Rect2" /> + <argument index="1" name="color" type="Color" /> + <description> + Fills [code]rect[/code] with [code]color[/code]. </description> </method> <method name="fix_alpha_edges"> diff --git a/doc/classes/Input.xml b/doc/classes/Input.xml index 4ee319f554..cd5ba2e17f 100644 --- a/doc/classes/Input.xml +++ b/doc/classes/Input.xml @@ -236,6 +236,13 @@ Returns [code]true[/code] if you are pressing the mouse button specified with [enum MouseButton]. </description> </method> + <method name="is_physical_key_pressed" qualifiers="const"> + <return type="bool" /> + <argument index="0" name="keycode" type="int" enum="Key" /> + <description> + Returns [code]true[/code] if you are pressing the key in the physical location on the 101/102-key US QWERTY keyboard. You can pass a [enum Key] constant. + </description> + </method> <method name="joy_connection_changed"> <return type="void" /> <argument index="0" name="device" type="int" /> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index 423002d058..c75b2e305e 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -233,6 +233,14 @@ <description> Returns an array listing the groups that the node is a member of. [b]Note:[/b] For performance reasons, the order of node groups is [i]not[/i] guaranteed. The order of node groups should not be relied upon as it can vary across project runs. + [b]Note:[/b] The engine uses some group names internally (all starting with an underscore). To avoid conflicts with internal groups, do not add custom groups whose name starts with an underscore. To exclude internal groups while looping over [method get_groups], use the following snippet: + [codeblock] + # Stores the node's non-internal groups only (as an array of Strings). + var non_internal_groups = [] + for group in get_groups(): + if not group.begins_with("_"): + non_internal_groups.push_back(group) + [/codeblock] </description> </method> <method name="get_index" qualifiers="const"> @@ -563,6 +571,7 @@ <description> Replaces a node in a scene by the given one. Subscriptions that pass through this node will be lost. If [code]keep_groups[/code] is [code]true[/code], the [code]node[/code] is added to the same groups that the replaced node is in. + Note that the replaced node is not automatically freed, so you either need to keep it in a variable for later use or free it using [method Object.free]. </description> </method> <method name="request_ready"> @@ -782,8 +791,8 @@ <constant name="NOTIFICATION_DRAG_END" value="22"> Notification received when a drag ends. </constant> - <constant name="NOTIFICATION_PATH_CHANGED" value="23"> - Notification received when the node's [NodePath] changed. + <constant name="NOTIFICATION_PATH_RENAMED" value="23"> + Notification received when the node's name or one of its parents' name is changed. This notification is [i]not[/i] received when the node is removed from the scene tree to be added to another parent later on. </constant> <constant name="NOTIFICATION_INTERNAL_PROCESS" value="25"> Notification received every frame when the internal process flag is set (see [method set_process_internal]). diff --git a/doc/classes/Object.xml b/doc/classes/Object.xml index df9da7561e..860e252805 100644 --- a/doc/classes/Object.xml +++ b/doc/classes/Object.xml @@ -350,6 +350,7 @@ <argument index="0" name="property" type="NodePath" /> <description> Gets the object's property indexed by the given [NodePath]. The node path should be relative to the current object and can use the colon character ([code]:[/code]) to access nested properties. Examples: [code]"position:x"[/code] or [code]"material:next_pass:blend_mode"[/code]. + [b]Note:[/b] Even though the method takes [NodePath] argument, it doesn't support actual paths to [Node]s in the scene tree, only colon-separated sub-property paths. For the purpose of nodes, use [method Node.get_node_and_resource] instead. </description> </method> <method name="get_instance_id" qualifiers="const"> diff --git a/doc/classes/PackedByteArray.xml b/doc/classes/PackedByteArray.xml index f951df1eb7..fd098481e4 100644 --- a/doc/classes/PackedByteArray.xml +++ b/doc/classes/PackedByteArray.xml @@ -332,7 +332,7 @@ Appends an element at the end of the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedColorArray.xml b/doc/classes/PackedColorArray.xml index 4aa8a19630..f69c5504da 100644 --- a/doc/classes/PackedColorArray.xml +++ b/doc/classes/PackedColorArray.xml @@ -95,7 +95,7 @@ Appends a value to the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedFloat32Array.xml b/doc/classes/PackedFloat32Array.xml index 68fb45a62a..ccac607386 100644 --- a/doc/classes/PackedFloat32Array.xml +++ b/doc/classes/PackedFloat32Array.xml @@ -96,7 +96,7 @@ Appends an element at the end of the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedFloat64Array.xml b/doc/classes/PackedFloat64Array.xml index 740591a0c0..b164283b3e 100644 --- a/doc/classes/PackedFloat64Array.xml +++ b/doc/classes/PackedFloat64Array.xml @@ -96,7 +96,7 @@ Appends an element at the end of the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedInt32Array.xml b/doc/classes/PackedInt32Array.xml index 7a01bb6c7c..c6ff31ebdd 100644 --- a/doc/classes/PackedInt32Array.xml +++ b/doc/classes/PackedInt32Array.xml @@ -96,7 +96,7 @@ Appends a value to the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedInt64Array.xml b/doc/classes/PackedInt64Array.xml index c7b69d4ad5..ff48eb1aad 100644 --- a/doc/classes/PackedInt64Array.xml +++ b/doc/classes/PackedInt64Array.xml @@ -96,7 +96,7 @@ Appends a value to the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedScene.xml b/doc/classes/PackedScene.xml index d0579c6f6f..d3a770b35b 100644 --- a/doc/classes/PackedScene.xml +++ b/doc/classes/PackedScene.xml @@ -5,7 +5,7 @@ </brief_description> <description> A simplified interface to a scene file. Provides access to operations and checks that can be performed on the scene resource itself. - Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see [code]owner[/code] property on [Node]). + Can be used to save a node to a file. When saving, the node as well as all the nodes it owns get saved (see [member Node.owner] property). [b]Note:[/b] The node doesn't need to own itself. [b]Example of loading a saved scene:[/b] [codeblocks] @@ -22,7 +22,7 @@ AddChild(scene); [/csharp] [/codeblocks] - [b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [code]Node2D[/code] ([code]node[/code]), [code]RigidDynamicBody2D[/code] ([code]body[/code]) and [code]CollisionObject2D[/code] ([code]collision[/code]). [code]collision[/code] is a child of [code]body[/code] which is a child of [code]node[/code]. Only [code]body[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code]. + [b]Example of saving a node with different owners:[/b] The following example creates 3 objects: [Node2D] ([code]node[/code]), [RigidDynamicBody2D] ([code]body[/code]) and [CollisionObject2D] ([code]collision[/code]). [code]collision[/code] is a child of [code]body[/code] which is a child of [code]node[/code]. Only [code]body[/code] is owned by [code]node[/code] and [code]pack[/code] will therefore only save those two nodes, but not [code]collision[/code]. [codeblocks] [gdscript] # Create the objects. diff --git a/doc/classes/PackedStringArray.xml b/doc/classes/PackedStringArray.xml index dfebfb718b..4204277ea2 100644 --- a/doc/classes/PackedStringArray.xml +++ b/doc/classes/PackedStringArray.xml @@ -96,7 +96,7 @@ Appends a string element at end of the array. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedVector2Array.xml b/doc/classes/PackedVector2Array.xml index bf9b7e97d4..e6a7b2fa41 100644 --- a/doc/classes/PackedVector2Array.xml +++ b/doc/classes/PackedVector2Array.xml @@ -96,7 +96,7 @@ Inserts a [Vector2] at the end. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/PackedVector3Array.xml b/doc/classes/PackedVector3Array.xml index b439f8f217..6992bbca01 100644 --- a/doc/classes/PackedVector3Array.xml +++ b/doc/classes/PackedVector3Array.xml @@ -95,7 +95,7 @@ Inserts a [Vector3] at the end. </description> </method> - <method name="remove"> + <method name="remove_at"> <return type="void" /> <argument index="0" name="index" type="int" /> <description> diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index cb26d8d445..7fdac7ccd4 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -196,13 +196,17 @@ Background color for the boot splash. </member> <member name="application/boot_splash/fullsize" type="bool" setter="" getter="" default="true"> - If [code]true[/code], scale the boot splash image to the full window length when engine starts. If [code]false[/code], the engine will leave it at the default pixel size. + If [code]true[/code], scale the boot splash image to the full window size (preserving the aspect ratio) when the engine starts. If [code]false[/code], the engine will leave it at the default pixel size. </member> <member name="application/boot_splash/image" type="String" setter="" getter="" default=""""> - Path to an image used as the boot splash. + Path to an image used as the boot splash. If left empty, the default Godot Engine splash will be displayed instead. + [b]Note:[/b] Only effective if [member application/boot_splash/show_image] is [code]true[/code]. + </member> + <member name="application/boot_splash/show_image" type="bool" setter="" getter="" default="true"> + If [code]true[/code], displays the image specified in [member application/boot_splash/image] when the engine starts. If [code]false[/code], only displays the plain color specified in [member application/boot_splash/bg_color]. </member> <member name="application/boot_splash/use_filter" type="bool" setter="" getter="" default="true"> - If [code]true[/code], applies linear filtering when scaling the image (recommended for high resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art). + If [code]true[/code], applies linear filtering when scaling the image (recommended for high-resolution artwork). If [code]false[/code], uses nearest-neighbor interpolation (recommended for pixel art). </member> <member name="application/config/custom_user_dir_name" type="String" setter="" getter="" default=""""> This user directory is used for storing persistent data ([code]user://[/code] filesystem). If left empty, [code]user://[/code] resolves to a project-specific folder in Godot's own configuration folder (see [method OS.get_user_data_dir]). If a custom directory name is defined, this name will be used instead and appended to the system-specific user data directory (same parent folder as the Godot configuration folder documented in [method OS.get_user_data_dir]). @@ -368,6 +372,9 @@ <member name="debug/gdscript/warnings/return_value_discarded" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables warnings when calling a function without using its return value (by assigning it to a variable or using it as a function argument). Such return values are sometimes used to denote possible errors using the [enum Error] enum. </member> + <member name="debug/gdscript/warnings/shadowed_global_identifier" type="bool" setter="" getter="" default="true"> + If [code]true[/code], enables warnings when defining a local or subclass member variable, signal, or enum that would have the same name as a built-in function or global class name, which possibly shadow it. + </member> <member name="debug/gdscript/warnings/shadowed_variable" type="bool" setter="" getter="" default="true"> If [code]true[/code], enables warnings when defining a local or subclass member variable that would shadow a variable at an upper level (such as a member variable). </member> @@ -1499,12 +1506,8 @@ </member> <member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> </member> - <member name="rendering/3d/viewport/scale" type="float" setter="" getter="" default="1.0"> - Scales the 3D render buffer based on the viewport size and displays the result with linear filtering. Values lower than [code]1.0[/code] can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than [code]1.0[/code] can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [member rendering/anti_aliasing/quality/msaa] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons. - [b]Note:[/b] This property is only read when the project starts. To change the 3D rendering resolution scale at runtime, set [member Viewport.scale_3d] instead. - </member> <member name="rendering/anti_aliasing/quality/msaa" type="int" setter="" getter="" default="0"> - Sets the number of MSAA samples to use (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 [member rendering/3d/viewport/scale] for supersampling, which provides higher quality but is much more expensive. + Sets the number of MSAA samples to use (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. </member> <member name="rendering/anti_aliasing/quality/screen_space_aa" type="int" setter="" getter="" default="0"> Sets the screen-space antialiasing mode for the default screen [Viewport]. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. @@ -1711,6 +1714,18 @@ <member name="rendering/reflections/sky_reflections/texture_array_reflections.mobile" type="bool" setter="" getter="" default="false"> Lower-end override for [member rendering/reflections/sky_reflections/texture_array_reflections] on mobile devices, due to performance concerns or driver support. </member> + <member name="rendering/scaling_3d/fsr_mipmap_bias" type="float" setter="" getter="" default="0.0"> + Affects the final texture sharpness by reading from a lower or higher mipmap. Negative values make textures sharper, while positive values make textures blurrier. When using FSR, this value is used to adjust the mipmap bias calculated internally which is based on the selected quality. The formula for this is [code]-log2(1.0 / scale) + mipmap_bias[/code] + </member> + <member name="rendering/scaling_3d/fsr_sharpness" type="float" setter="" getter="" default="0.2"> + Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference. + </member> + <member name="rendering/scaling_3d/mode" type="int" setter="" getter="" default="0"> + Sets the 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. + </member> + <member name="rendering/scaling_3d/scale" type="float" setter="" getter="" default="1.0"> + Scales the 3D render buffer based on the viewport size uses an image filter specified in [member rendering/scaling_3d/mode] to scale the output image to the full viewport size. Values lower than [code]1.0[/code] can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than [code]1.0[/code] are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [member rendering/anti_aliasing/quality/msaa] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons. + </member> <member name="rendering/shader_compiler/shader_cache/compress" type="bool" setter="" getter="" default="true"> </member> <member name="rendering/shader_compiler/shader_cache/enabled" type="bool" setter="" getter="" default="true"> diff --git a/doc/classes/ReferenceRect.xml b/doc/classes/ReferenceRect.xml index 1db6879b45..99ad067469 100644 --- a/doc/classes/ReferenceRect.xml +++ b/doc/classes/ReferenceRect.xml @@ -16,7 +16,7 @@ Sets the border width of the [ReferenceRect]. The border grows both inwards and outwards with respect to the rectangle box. </member> <member name="editor_only" type="bool" setter="set_editor_only" getter="get_editor_only" default="true"> - If set to [code]true[/code], the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in game. + If [code]true[/code], the [ReferenceRect] will only be visible while in editor. Otherwise, [ReferenceRect] will be visible in the running project. </member> </members> </class> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 7f4d5cf1cd..0700650a91 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -3100,6 +3100,22 @@ If [code]true[/code], rendering of a viewport's environment is disabled. </description> </method> + <method name="viewport_set_fsr_mipmap_bias"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="mipmap_bias" type="float" /> + <description> + Affects the final texture sharpness by reading from a lower or higher mipmap. Negative values make textures sharper, while positive values make textures blurrier. When using FSR, this value is used to adjust the mipmap bias calculated internally which is based on the selected quality. The formula for this is [code]-log2(1.0 / scale) + mipmap_bias[/code] + </description> + </method> + <method name="viewport_set_fsr_sharpness"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="sharpness" type="float" /> + <description> + Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference. + </description> + </method> <method name="viewport_set_global_canvas_transform"> <return type="void" /> <argument index="0" name="viewport" type="RID" /> @@ -3151,12 +3167,21 @@ 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 viewport to the root viewport. While this optimization can result in a significant increase in speed (especially on older devices), it comes at a cost of usability. When this is enabled, you cannot read from the viewport or from the [code]SCREEN_TEXTURE[/code]. You also lose the benefit of certain window settings, such as the various stretch modes. Another consequence to be aware of is that in 2D the rendering happens in window coordinates, so if you have a viewport that is double the size of the window, and you set this, then only the portion that fits within the window will be drawn, no automatic scaling is possible, even if your game scene is significantly larger than the window size. </description> </method> - <method name="viewport_set_scale_3d"> + <method name="viewport_set_scaling_3d_mode"> + <return type="void" /> + <argument index="0" name="viewport" type="RID" /> + <argument index="1" name="scaling_3d_mode" type="int" enum="RenderingServer.ViewportScaling3DMode" /> + <description> + 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. + </description> + </method> + <method name="viewport_set_scaling_3d_scale"> <return type="void" /> <argument index="0" name="viewport" type="RID" /> <argument index="1" name="scale" type="float" /> <description> - Sets the scale at which we render 3D contents. + 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 full viewport size. Values lower than [code]1.0[/code] can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than [code]1.0[/code] are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [enum ViewportMSAA] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons. + When using FSR upscaling, AMD recommends exposing the following values as preset options to users "Ultra Quality: 0.77", "Quality: 0.67", "Balanced: 0.59", "Performance: 0.5" instead of exposing the entire scale. </description> </method> <method name="viewport_set_scenario"> @@ -3844,6 +3869,14 @@ <constant name="FOG_VOLUME_SHAPE_WORLD" value="2" enum="FogVolumeShape"> [FogVolume] will have no shape, will cover the whole world and will not be culled. </constant> + <constant name="VIEWPORT_SCALING_3D_MODE_BILINEAR" value="0" enum="ViewportScaling3DMode"> + Enables bilinear scaling on 3D viewports. 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. + </constant> + <constant name="VIEWPORT_SCALING_3D_MODE_FSR" value="1" enum="ViewportScaling3DMode"> + Enables FSR upscaling on 3D viewports. 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 supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + </constant> + <constant name="VIEWPORT_SCALING_3D_MODE_MAX" value="2" enum="ViewportScaling3DMode"> + </constant> <constant name="VIEWPORT_UPDATE_DISABLED" value="0" enum="ViewportUpdateMode"> Do not update the viewport. </constant> diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 400fae4aad..16d8595b4e 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -362,6 +362,24 @@ Returns OpenType feature [code]tag[/code]. </description> </method> + <method name="get_pos_at_line_column" qualifiers="const"> + <return type="Vector2i" /> + <argument index="0" name="line" type="int" /> + <argument index="1" name="column" type="int" /> + <description> + Returns the local position for the given [code]line[/code] and [code]column[/code]. If [code]x[/code] or [code]y[/code] of the returned vector equal [code]-1[/code], the position is outside of the viewable area of the control. + [b]Note:[/b] The Y position corresponds to the bottom side of the line. Use [method get_rect_at_line_column] to get the top side position. + </description> + </method> + <method name="get_rect_at_line_column" qualifiers="const"> + <return type="Rect2i" /> + <argument index="0" name="line" type="int" /> + <argument index="1" name="column" type="int" /> + <description> + Returns the local position and size for the grapheme at the given [code]line[/code] and [code]column[/code]. If [code]x[/code] or [code]y[/code] position of the returned rect equal [code]-1[/code], the position is outside of the viewable area of the control. + [b]Note:[/b] The Y position of the returned rect corresponds to the top side of the line, unlike [method get_pos_at_line_column] which returns the bottom side. + </description> + </method> <method name="get_saved_version" qualifiers="const"> <return type="int" /> <description> diff --git a/doc/classes/TextServer.xml b/doc/classes/TextServer.xml index e1c05165de..512078c56c 100644 --- a/doc/classes/TextServer.xml +++ b/doc/classes/TextServer.xml @@ -1028,6 +1028,14 @@ Returns text glyphs in the visual order. </description> </method> + <method name="shaped_text_get_grapheme_bounds" qualifiers="const"> + <return type="Vector2" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="pos" type="int" /> + <description> + Returns composite character's bounds as offsets from the start of the line. + </description> + </method> <method name="shaped_text_get_line_breaks" qualifiers="const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/TextServerExtension.xml b/doc/classes/TextServerExtension.xml index 684a1aa755..32f8107e0a 100644 --- a/doc/classes/TextServerExtension.xml +++ b/doc/classes/TextServerExtension.xml @@ -1037,6 +1037,14 @@ Copies text glyphs in the visual order, into preallocated array of the size returned by [method _shaped_text_get_glyph_count]. </description> </method> + <method name="_shaped_text_get_grapheme_bounds" qualifiers="virtual const"> + <return type="Vector2" /> + <argument index="0" name="shaped" type="RID" /> + <argument index="1" name="pos" type="int" /> + <description> + Returns composite character's bounds as offsets from the start of the line. + </description> + </method> <method name="_shaped_text_get_line_breaks" qualifiers="virtual const"> <return type="PackedInt32Array" /> <argument index="0" name="shaped" type="RID" /> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index d83645a8af..0418f29808 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -194,6 +194,14 @@ <member name="disable_3d" type="bool" setter="set_disable_3d" getter="is_3d_disabled" default="false"> Disable 3D rendering (but keep 2D rendering). </member> + <member name="fsr_mipmap_bias" type="float" setter="set_fsr_mipmap_bias" getter="get_fsr_mipmap_bias" default="0.0"> + Affects the final texture sharpness by reading from a lower or higher mipmap when using FSR. Mipmap bias does nothing when FSR is not being used. Negative values make textures sharper, while positive values make textures blurrier. This value is used to adjust the mipmap bias calculated internally which is based on the selected quality. The formula for this is [code]-log2(1.0 / scale) + mipmap_bias[/code]. This updates the rendering server's mipmap bias when called + To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/fsr_mipmap_bias] project setting. + </member> + <member name="fsr_sharpness" type="float" setter="set_fsr_sharpness" getter="get_fsr_sharpness" default="0.2"> + Determines how sharp the upscaled image will be when using the FSR upscaling mode. Sharpness halves with every whole number. Values go from 0.0 (sharpest) to 2.0. Values above 2.0 won't make a visible difference. + To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/fsr_sharpness] project setting. + </member> <member name="global_canvas_transform" type="Transform2D" setter="set_global_canvas_transform" getter="get_global_canvas_transform"> The global canvas transform of the viewport. The canvas transform is relative to this. </member> @@ -210,7 +218,7 @@ <member name="lod_threshold" type="float" setter="set_lod_threshold" getter="get_lod_threshold" default="1.0"> </member> <member name="msaa" type="int" setter="set_msaa" getter="get_msaa" enum="Viewport.MSAA" default="0"> - The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also [member scale_3d] for supersampling, which provides higher quality but is much more expensive. + The multisample anti-aliasing mode. A higher number results in smoother edges at the cost of significantly worse performance. A value of 2 or 4 is best unless targeting very high-end systems. See also bilinear scaling 3d [member scaling_3d_mode] for supersampling, which provides higher quality but is much more expensive. </member> <member name="own_world_3d" type="bool" setter="set_use_own_world_3d" getter="is_using_own_world_3d" default="false"> If [code]true[/code], the viewport will use the [World3D] defined in [member world_3d]. @@ -218,9 +226,14 @@ <member name="physics_object_picking" type="bool" setter="set_physics_object_picking" getter="get_physics_object_picking" default="false"> If [code]true[/code], the objects rendered by viewport become subjects of mouse picking process. </member> - <member name="scale_3d" type="float" setter="set_scale_3d" getter="get_scale_3d" default="1.0"> - Scales the 3D render buffer based on the viewport size and displays the result with linear filtering. Values lower than [code]1.0[/code] can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than [code]1.0[/code] can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [member msaa] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons. - To control this property on the root viewport, set the [member ProjectSettings.rendering/3d/viewport/scale] project setting. + <member name="scaling_3d_mode" type="int" setter="set_scaling_3d_mode" getter="get_scaling_3d_mode" enum="Viewport.Scaling3DMode" default="0"> + 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. + To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/mode] project setting. + </member> + <member name="scaling_3d_scale" type="float" setter="set_scaling_3d_scale" getter="get_scaling_3d_scale" default="1.0"> + Scales the 3D render buffer based on the viewport size uses an image filter specified in [member ProjectSettings.rendering/scaling_3d/mode] to scale the output image to the full viewport size. Values lower than [code]1.0[/code] can be used to speed up 3D rendering at the cost of quality (undersampling). Values greater than [code]1.0[/code] are only valid for bilinear mode and can be used to improve 3D rendering quality at a high performance cost (supersampling). See also [member ProjectSettings.rendering/anti_aliasing/quality/msaa] for multi-sample antialiasing, which is significantly cheaper but only smoothens the edges of polygons. + When using FSR upscaling, AMD recommends exposing the following values as preset options to users "Ultra Quality: 0.77", "Quality: 0.67", "Balanced: 0.59", "Performance: 0.5" instead of exposing the entire scale. + To control this property on the root viewport, set the [member ProjectSettings.rendering/scaling_3d/scale] project setting. </member> <member name="screen_space_aa" type="int" setter="set_screen_space_aa" getter="get_screen_space_aa" enum="Viewport.ScreenSpaceAA" default="0"> Sets the screen-space antialiasing method used. Screen-space antialiasing works by selectively blurring edges in a post-process shader. It differs from MSAA which takes multiple coverage samples while rendering objects. Screen-space AA methods are typically faster than MSAA and will smooth out specular aliasing, but tend to make scenes appear blurry. @@ -306,6 +319,15 @@ <constant name="SHADOW_ATLAS_QUADRANT_SUBDIV_MAX" value="7" enum="ShadowAtlasQuadrantSubdiv"> Represents the size of the [enum ShadowAtlasQuadrantSubdiv] enum. </constant> + <constant name="SCALING_3D_MODE_BILINEAR" value="0" enum="Scaling3DMode"> + Enables bilinear scaling on 3D viewports. 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. + </constant> + <constant name="SCALING_3D_MODE_FSR" value="1" enum="Scaling3DMode"> + Enables FSR upscaling on 3D viewports. 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 supersampling will be used instead. A value of [code]1.0[/code] disables scaling. + </constant> + <constant name="SCALING_3D_MODE_MAX" value="2" enum="Scaling3DMode"> + Represents the size of the [enum Scaling3DMode] enum. + </constant> <constant name="MSAA_DISABLED" value="0" enum="MSAA"> Multisample antialiasing mode disabled. This is the default value, and is also the fastest setting. </constant> diff --git a/doc/classes/Window.xml b/doc/classes/Window.xml index f36b926bef..3fee1feae8 100644 --- a/doc/classes/Window.xml +++ b/doc/classes/Window.xml @@ -230,6 +230,12 @@ <description> </description> </method> + <method name="reset_size"> + <return type="void" /> + <description> + Resets the size to the minimum size, which is the max of [member min_size] and (if [member wrap_controls] is enabled) [method get_contents_minimum_size]. This is equivalent to calling [code]set_size(Vector2i())[/code] (or any size below the minimum). + </description> + </method> <method name="set_flag"> <return type="void" /> <argument index="0" name="flag" type="int" enum="Window.Flags" /> |