Cubemap

package
v0.0.0-...-0d6c339 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 26 Imported by: 0

Documentation

Overview

A cubemap is made of 6 textures organized in layers. They are typically used for faking reflections in 3D rendering (see graphics.gd/classdb/ReflectionProbe). It can be used to make an object look as if it's reflecting its surroundings. This usually delivers much better performance than other reflection methods.

This resource is typically used as a uniform in custom shaders. Few core Godot methods make use of graphics.gd/classdb/Cubemap resources.

To create such a texture file yourself, reimport your image files using the Godot Editor import presets. To create a Cubemap from code, use graphics.gd/classdb/ImageTextureLayered.Instance.CreateFromImages on an instance of the Cubemap 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)

- 3×2 cubemap template

- 1×6 cubemap template

- 6×1 cubemap template

Note: Godot doesn't support using cubemaps in a graphics.gd/classdb/PanoramaSkyMaterial. To use a cubemap as a skybox, convert the default graphics.gd/classdb/PanoramaSkyMaterial to a graphics.gd/classdb/ShaderMaterial using the Convert to ShaderMaterial resource dropdown option, then replace its code with the following:

After replacing the shader code and saving, specify the imported Cubemap resource in the Shader Parameters section of the ShaderMaterial in the inspector.

Alternatively, you can use this tool to convert a cubemap to an equirectangular sky map and use graphics.gd/classdb/PanoramaSkyMaterial as usual.

Index

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 Any

type Any interface {
	gd.IsClass
	AsCubemap() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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]) AsCubemap

func (self *Extension[T]) AsCubemap() Instance

func (*Extension[T]) AsImageTextureLayered

func (self *Extension[T]) AsImageTextureLayered() ImageTextureLayered.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

func (*Extension[T]) AsTexture

func (self *Extension[T]) AsTexture() Texture.Instance

func (*Extension[T]) AsTextureLayered

func (self *Extension[T]) AsTextureLayered() TextureLayered.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.Cubemap

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 New

func New() Instance

func (Instance) AsCubemap

func (self Instance) AsCubemap() Instance

func (Instance) AsImageTextureLayered

func (self Instance) AsImageTextureLayered() ImageTextureLayered.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTexture

func (self Instance) AsTexture() Texture.Instance

func (Instance) AsTextureLayered

func (self Instance) AsTextureLayered() TextureLayered.Instance

func (Instance) CreatePlaceholder

func (self Instance) CreatePlaceholder() Resource.Instance

Creates a placeholder version of this resource (graphics.gd/classdb/PlaceholderCubemap).

func (Instance) ID

func (self Instance) ID() ID

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL