feat: updated engine

This commit is contained in:
Sara Gerretsen 2026-07-10 17:04:34 +02:00
parent cbe99774ff
commit f4cf6b3999
6607 changed files with 910135 additions and 430025 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="Image" inherits="Resource" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<class name="Image" inherits="Resource" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
<brief_description>
Image datatype.
</brief_description>
@ -79,11 +79,11 @@
<return type="int" enum="Error" />
<param index="0" name="mode" type="int" enum="Image.CompressMode" />
<param index="1" name="source" type="int" enum="Image.CompressSource" default="0" />
<param index="2" name="astc_format" type="int" enum="Image.ASTCFormat" default="0" />
<param index="2" name="profile" type="int" enum="Image.CompressProfile" default="0" />
<description>
Compresses the image with a VRAM-compressed format 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.
The [param source] parameter helps to pick the best compression method for DXT and ETC2 formats. It is ignored for ASTC compression.
The [param astc_format] parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
The [param profile] lets the user pick whether the compression should prioritize quality or a smaller size. Only ASTC compression uses this currently.
[b]Note:[/b] [method compress] is only supported in editor builds. When run in an exported project, this method always returns [constant ERR_UNAVAILABLE].
</description>
</method>
@ -91,11 +91,11 @@
<return type="int" enum="Error" />
<param index="0" name="mode" type="int" enum="Image.CompressMode" />
<param index="1" name="channels" type="int" enum="Image.UsedChannels" />
<param index="2" name="astc_format" type="int" enum="Image.ASTCFormat" default="0" />
<param index="2" name="profile" type="int" enum="Image.CompressProfile" default="0" />
<description>
Compresses the image with a VRAM-compressed format 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.
This is an alternative to [method compress] that lets the user supply the channels used in order for the compressor to pick the best DXT and ETC2 formats. For other formats (non DXT or ETC2), this argument is ignored.
The [param astc_format] parameter is only taken into account when using ASTC compression; it is ignored for all other formats.
This is an alternative to [method compress] that lets the user supply the channels used in order for the compressor to pick the best DXT, ETC2, and ASTC formats. For other formats (non DXT, ETC2, or ASTC), this argument is ignored.
The [param profile] lets the user pick whether the compression should prioritize quality or a smaller size. Only ASTC compression uses this currently.
[b]Note:[/b] [method compress_from_channels] is only supported in editor builds. When run in an exported project, this method always returns [constant ERR_UNAVAILABLE].
</description>
</method>
@ -446,6 +446,7 @@
<param index="2" name="interpolation" type="int" enum="Image.Interpolation" default="1" />
<description>
Resizes the image to the given [param width] and [param height]. New pixels are calculated using the [param interpolation] mode defined via [enum Interpolation] constants.
[b]Note:[/b] If the image's format is [constant FORMAT_RGBA4444], [constant FORMAT_RGB565], or [constant FORMAT_RGBE9995], it will be temporarily converted to either [constant FORMAT_RGBA8] or [constant FORMAT_RGBAH]. This can affect the quality of the resized image.
</description>
</method>
<method name="resize_to_po2">
@ -494,15 +495,21 @@
<return type="int" enum="Error" />
<param index="0" name="path" type="String" />
<param index="1" name="grayscale" type="bool" default="false" />
<param index="2" name="color_image" type="bool" default="false" />
<param index="3" name="max_linear_value" type="float" default="-1.0" />
<description>
Saves the image as an EXR file to [param path]. If [param grayscale] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module.
Saves the image as an EXR file to [param path]. If [param grayscale] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. Set [param color_image] to [code]true[/code] when saving a color image, such as a screenshot. Negative values will be included when [param color_image] is [code]false[/code], which may be useful for saving raw floating point data such as a lightmap that includes negative light information. Color component values in the resulting EXR file will not exceed [param max_linear_value] if [param max_linear_value] is not negative. This function will return [constant ERR_UNAVAILABLE] if Godot was compiled without the TinyEXR module.
When saving screenshots of a project that uses HDR output, use [method Window.get_output_max_linear_value] for [param max_linear_value].
</description>
</method>
<method name="save_exr_to_buffer" qualifiers="const">
<return type="PackedByteArray" />
<param index="0" name="grayscale" type="bool" default="false" />
<param index="1" name="color_image" type="bool" default="false" />
<param index="2" name="max_linear_value" type="float" default="-1.0" />
<description>
Saves the image as an EXR file to a byte array. If [param grayscale] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. This function will return an empty byte array if Godot was compiled without the TinyEXR module.
Saves the image as an EXR file to a byte array. If [param grayscale] is [code]true[/code] and the image has only one channel, it will be saved explicitly as monochrome rather than one red channel. Set [param color_image] to [code]true[/code] when saving a color image, such as a screenshot. Negative values will be included when [param color_image] is [code]false[/code], which may be useful for saving raw floating point data such as a lightmap that includes negative light information. Color component values in the resulting EXR file will not exceed [param max_linear_value] if [param max_linear_value] is not negative. This function will return an empty byte array if Godot was compiled without the TinyEXR module.
When saving screenshots of a project that uses HDR output, use [method Window.get_output_max_linear_value] for [param max_linear_value].
</description>
</method>
<method name="save_jpg" qualifiers="const">
@ -808,7 +815,13 @@
[b]Note:[/b] When used in a shader, the texture requires usage of [code]usampler[/code] samplers. Additionally, it only supports nearest-neighbor filtering under the Compatibility renderer.
[b]Note:[/b] When sampling using [method Image.get_pixel], returned [Color]s have to be divided by [code]65535[/code] to get the correct color value.
</constant>
<constant name="FORMAT_MAX" value="47" enum="Format">
<constant name="FORMAT_ASTC_6x6" value="47" enum="Format">
[url=https://en.wikipedia.org/wiki/Adaptive_scalable_texture_compression]Adaptive Scalable Texture Compression[/url]. This implements the 6×6 (medium quality) mode.
</constant>
<constant name="FORMAT_ASTC_6x6_HDR" value="48" enum="Format">
Same format as [constant FORMAT_ASTC_6x6], but with the hint to let the GPU know it is used for HDR.
</constant>
<constant name="FORMAT_MAX" value="49" enum="Format">
Represents the size of the [enum Format] enum.
</constant>
<constant name="INTERPOLATE_NEAREST" value="0" enum="Interpolation">
@ -884,6 +897,21 @@
<constant name="COMPRESS_SOURCE_NORMAL" value="2" enum="CompressSource">
Source texture (before compression) is a normal texture (e.g. it can be compressed into two channels).
</constant>
<constant name="COMPRESS_PROFILE_AUTOMATIC" value="0" enum="CompressProfile">
Automatically adjusts the quality level based on the number of unique color channels present in the image. For ASTC, this corresponds to picking 8x8 when only one channel is detected (R, L), 6x6 when two channels are detected (RG, LA), and 4x4 in all other cases.
</constant>
<constant name="COMPRESS_PROFILE_MAX_QUALITY" value="1" enum="CompressProfile">
Prioritizes highest quality over compression. For ASTC, this corresponds to using a 4x4 block size.
</constant>
<constant name="COMPRESS_PROFILE_COMPRESSED" value="2" enum="CompressProfile">
Prioritizes some compression over quality. For ASTC, this corresponds to using a 6x6 block size.
</constant>
<constant name="COMPRESS_PROFILE_MAX_COMPRESSION" value="3" enum="CompressProfile">
Prioritizes highest compression over quality. For ASTC, this corresponds to using an 8x8 block size.
</constant>
<constant name="COMPRESS_PROFILE_MAX" value="4" enum="CompressProfile">
Represents the size of the [enum CompressProfile] enum.
</constant>
<constant name="ASTC_FORMAT_4x4" value="0" enum="ASTCFormat">
Hint to indicate that the high quality 4×4 ASTC compression format should be used.
</constant>