0.2.0-dev Download ZIP
29 lines ·2.7 KB Raw
| 1 | <?xml version="1.0" encoding="UTF-8" ?> |
| 2 | <class name="CubemapArray" inherits="ImageTextureLayered" api_type="core" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> |
| 3 | <brief_description> |
| 4 | An array of [Cubemap]s, stored together and with a single reference. |
| 5 | </brief_description> |
| 6 | <description> |
| 7 | [CubemapArray]s are made of an array of [Cubemap]s. Like [Cubemap]s, they are made of multiple textures, the amount of which must be divisible by 6 (one for each face of the cube). |
| 8 | The primary benefit of [CubemapArray]s is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple [Cubemap]s into a shader using a single [CubemapArray]. [Cubemap]s are allocated in adjacent cache regions on the GPU, which makes [CubemapArray]s the most efficient way to store multiple [Cubemap]s. |
| 9 | Godot uses [CubemapArray]s internally for many effects, including the [Sky] if you set [member ProjectSettings.rendering/reflections/sky_reflections/texture_array_reflections] to [code]true[/code]. |
| 10 | To create such a texture file yourself, reimport your image files using the Godot Editor import presets. To create a CubemapArray from code, use [method ImageTextureLayered.create_from_images] on an instance of the CubemapArray class. |
| 11 | The expected image order is X+, X-, Y+, Y-, Z+, Z- (in Godot's coordinate system, so Y+ is "up" and Z- is "forward"). You can use one of the following templates as a base: |
| 12 | - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/tutorials/assets_pipeline/img/cubemap_template_2x3.webp]2×3 cubemap template (default layout option)[/url] |
| 13 | - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/tutorials/assets_pipeline/img/cubemap_template_3x2.webp]3×2 cubemap template[/url] |
| 14 | - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/tutorials/assets_pipeline/img/cubemap_template_1x6.webp]1×6 cubemap template[/url] |
| 15 | - [url=https://raw.githubusercontent.com/godotengine/godot-docs/master/tutorials/assets_pipeline/img/cubemap_template_6x1.webp]6×1 cubemap template[/url] |
| 16 | Multiple layers are stacked on top of each other when using the default vertical import option (with the first layer at the top). Alternatively, you can choose a horizontal layout in the import options (with the first layer at the left). |
| 17 | [b]Note:[/b] [CubemapArray] is not supported in the Compatibility renderer due to graphics API limitations. |
| 18 | </description> |
| 19 | <tutorials> |
| 20 | </tutorials> |
| 21 | <methods> |
| 22 | <method name="create_placeholder" qualifiers="const"> |
| 23 | <return type="Resource" /> |
| 24 | <description> |
| 25 | Creates a placeholder version of this resource ([PlaceholderCubemapArray]). |
| 26 | </description> |
| 27 | </method> |
| 28 | </methods> |
| 29 | </class> |