Documentation
¶
Overview ¶
CubemapArrays are made of an array of Cubemaps. Like Cubemaps, they are made of multiple textures, the amount of which must be divisible by 6 (one for each face of the cube).
The primary benefit of CubemapArrays is that they can be accessed in shader code using a single texture reference. In other words, you can pass multiple Cubemaps into a shader using a single CubemapArray. Cubemaps are allocated in adjacent cache regions on the GPU, which makes CubemapArrays the most efficient way to store multiple Cubemaps.
Godot uses CubemapArrays internally for many effects, including the Sky if you set ProjectSettings "rendering/reflections/sky_reflections/texture_array_reflections" to true.
To create such a texture file yourself, reimport your image files using the Godot Editor import presets. To create a CubemapArray from code, use ImageTextureLayered.CreateFromImages on an instance of the CubemapArray class.
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:
- 2×3 cubemap template (default layout option)
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).
Note: CubemapArray is not supported in the Compatibility renderer due to graphics API limitations.
Index ¶
- type Advanced
- type Any
- type Extension
- func (self *Extension[T]) AsCubemapArray() Instance
- func (self *Extension[T]) AsImageTextureLayered() ImageTextureLayered.Instance
- func (self *Extension[T]) AsObject() [1]gd.Object
- func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
- func (self *Extension[T]) AsResource() Resource.Instance
- func (self *Extension[T]) AsTexture() Texture.Instance
- func (self *Extension[T]) AsTextureLayered() TextureLayered.Instance
- type ID
- type Instance
- func (self Instance) AsCubemapArray() Instance
- func (self Instance) AsImageTextureLayered() ImageTextureLayered.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTexture() Texture.Instance
- func (self Instance) AsTextureLayered() TextureLayered.Instance
- func (self Instance) CreatePlaceholder() Resource.Instance
- func (self Instance) ID() ID
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) Virtual(name string) reflect.Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsCubemapArray ¶
func (*Extension[T]) AsImageTextureLayered ¶
func (self *Extension[T]) AsImageTextureLayered() ImageTextureLayered.Instance
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
func (*Extension[T]) AsTextureLayered ¶
func (self *Extension[T]) AsTextureLayered() TextureLayered.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
type Instance [1]gdclass.CubemapArray
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsCubemapArray ¶
func (Instance) AsImageTextureLayered ¶
func (self Instance) AsImageTextureLayered() ImageTextureLayered.Instance
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTextureLayered ¶
func (self Instance) AsTextureLayered() TextureLayered.Instance
func (Instance) CreatePlaceholder ¶
Creates a placeholder version of this resource (PlaceholderCubemapArray).