Documentation
¶
Overview ¶
Composition layers allow 2D viewports to be displayed inside of the headset by the XR compositor through special projections that retain their quality. This allows for rendering clear text while keeping the layer at a native resolution.
Note: If the OpenXR runtime doesn't support the given composition layer type, a fallback mesh can be generated with a ViewportTexture, in order to emulate the composition layer.
Index ¶
- type Advanced
- type Any
- type Extension
- type Filter
- type ID
- type Instance
- func (self Instance) AlphaBlend() bool
- func (self Instance) AndroidSurfaceSize() Vector2i.XY
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsOpenXRCompositionLayer() Instance
- func (self Instance) EnableHolePunch() bool
- func (self Instance) GetAndroidSurface() JavaObject.Instance
- func (self Instance) ID() ID
- func (self Instance) IntersectsRay(origin Vector3.XYZ, direction Vector3.XYZ) Vector2.XY
- func (self Instance) IsNativelySupported() bool
- func (self Instance) LayerViewport() SubViewport.Instance
- func (self Instance) SetAlphaBlend(value bool)
- func (self Instance) SetAndroidSurfaceSize(value Vector2i.XY)
- func (self Instance) SetEnableHolePunch(value bool)
- func (self Instance) SetLayerViewport(value SubViewport.Instance)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetSortOrder(value int)
- func (self Instance) SetSwapchainStateAlphaSwizzle(value Swizzle)
- func (self Instance) SetSwapchainStateBlueSwizzle(value Swizzle)
- func (self Instance) SetSwapchainStateBorderColor(value Color.RGBA)
- func (self Instance) SetSwapchainStateGreenSwizzle(value Swizzle)
- func (self Instance) SetSwapchainStateHorizontalWrap(value Wrap)
- func (self Instance) SetSwapchainStateMagFilter(value Filter)
- func (self Instance) SetSwapchainStateMaxAnisotropy(value Float.X)
- func (self Instance) SetSwapchainStateMinFilter(value Filter)
- func (self Instance) SetSwapchainStateMipmapMode(value MipmapMode)
- func (self Instance) SetSwapchainStateRedSwizzle(value Swizzle)
- func (self Instance) SetSwapchainStateVerticalWrap(value Wrap)
- func (self Instance) SetUseAndroidSurface(value bool)
- func (self Instance) SortOrder() int
- func (self Instance) SwapchainStateAlphaSwizzle() Swizzle
- func (self Instance) SwapchainStateBlueSwizzle() Swizzle
- func (self Instance) SwapchainStateBorderColor() Color.RGBA
- func (self Instance) SwapchainStateGreenSwizzle() Swizzle
- func (self Instance) SwapchainStateHorizontalWrap() Wrap
- func (self Instance) SwapchainStateMagFilter() Filter
- func (self Instance) SwapchainStateMaxAnisotropy() Float.X
- func (self Instance) SwapchainStateMinFilter() Filter
- func (self Instance) SwapchainStateMipmapMode() MipmapMode
- func (self Instance) SwapchainStateRedSwizzle() Swizzle
- func (self Instance) SwapchainStateVerticalWrap() Wrap
- func (self Instance) UseAndroidSurface() bool
- func (self Instance) Virtual(name string) reflect.Value
- type MipmapMode
- type Swizzle
- type Wrap
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]) AsOpenXRCompositionLayer ¶
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.OpenXRCompositionLayer
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) AlphaBlend ¶
func (Instance) AndroidSurfaceSize ¶
func (Instance) AsOpenXRCompositionLayer ¶
func (Instance) EnableHolePunch ¶
func (Instance) GetAndroidSurface ¶
func (self Instance) GetAndroidSurface() JavaObject.Instance
Returns a JavaObject representing an android.view.Surface if UseAndroidSurface is enabled and OpenXR has created the surface. Otherwise, this will return null.
Note: The surface can only be created during an active OpenXR session. So, if UseAndroidSurface is enabled outside of an OpenXR session, it won't be created until a new session fully starts.
func (Instance) IntersectsRay ¶
Returns UV coordinates where the given ray intersects with the composition layer. 'origin' and 'direction' must be in global space.
Returns Vector2(-1.0, -1.0) if the ray doesn't intersect.
func (Instance) IsNativelySupported ¶
Returns true if the OpenXR runtime natively supports this composition layer type.
Note: This will only return an accurate result after the OpenXR session has started.
func (Instance) LayerViewport ¶
func (self Instance) LayerViewport() SubViewport.Instance
func (Instance) SetAlphaBlend ¶
func (Instance) SetAndroidSurfaceSize ¶
func (Instance) SetEnableHolePunch ¶
func (Instance) SetLayerViewport ¶
func (self Instance) SetLayerViewport(value SubViewport.Instance)
func (Instance) SetSortOrder ¶
func (Instance) SetSwapchainStateAlphaSwizzle ¶
func (Instance) SetSwapchainStateBlueSwizzle ¶
func (Instance) SetSwapchainStateBorderColor ¶
func (Instance) SetSwapchainStateGreenSwizzle ¶
func (Instance) SetSwapchainStateHorizontalWrap ¶
func (Instance) SetSwapchainStateMagFilter ¶
func (Instance) SetSwapchainStateMaxAnisotropy ¶
func (Instance) SetSwapchainStateMinFilter ¶
func (Instance) SetSwapchainStateMipmapMode ¶
func (self Instance) SetSwapchainStateMipmapMode(value MipmapMode)
func (Instance) SetSwapchainStateRedSwizzle ¶
func (Instance) SetSwapchainStateVerticalWrap ¶
func (Instance) SetUseAndroidSurface ¶
func (Instance) SwapchainStateAlphaSwizzle ¶
func (Instance) SwapchainStateBlueSwizzle ¶
func (Instance) SwapchainStateBorderColor ¶
func (Instance) SwapchainStateGreenSwizzle ¶
func (Instance) SwapchainStateHorizontalWrap ¶
func (Instance) SwapchainStateMagFilter ¶
func (Instance) SwapchainStateMaxAnisotropy ¶
func (Instance) SwapchainStateMinFilter ¶
func (Instance) SwapchainStateMipmapMode ¶
func (self Instance) SwapchainStateMipmapMode() MipmapMode
func (Instance) SwapchainStateRedSwizzle ¶
func (Instance) SwapchainStateVerticalWrap ¶
func (Instance) UseAndroidSurface ¶
type MipmapMode ¶
type MipmapMode int //gd:OpenXRCompositionLayer.MipmapMode
const ( // Disable mipmapping. // // Note: Mipmapping can only be disabled in the Compatibility renderer. MipmapModeDisabled MipmapMode = 0 // Use the mipmap of the nearest resolution. MipmapModeNearest MipmapMode = 1 // Use linear interpolation of the two mipmaps of the nearest resolution. MipmapModeLinear MipmapMode = 2 )
type Swizzle ¶
type Swizzle int //gd:OpenXRCompositionLayer.Swizzle
const ( // Maps a color channel to the value of the red channel. SwizzleRed Swizzle = 0 // Maps a color channel to the value of the green channel. SwizzleGreen Swizzle = 1 // Maps a color channel to the value of the blue channel. SwizzleBlue Swizzle = 2 // Maps a color channel to the value of the alpha channel. SwizzleAlpha Swizzle = 3 // Maps a color channel to the value of zero. SwizzleZero Swizzle = 4 // Maps a color channel to the value of one. SwizzleOne Swizzle = 5 )
type Wrap ¶
type Wrap int //gd:OpenXRCompositionLayer.Wrap
const ( // Clamp the texture to its specified border color. WrapClampToBorder Wrap = 0 // Clamp the texture to its edge color. WrapClampToEdge Wrap = 1 // Repeat the texture infinitely. WrapRepeat Wrap = 2 // Repeat the texture infinitely, mirroring it on each repeat. WrapMirroredRepeat Wrap = 3 // Mirror the texture once and then clamp the texture to its edge color. // // Note: This wrap mode is not available in the Compatibility renderer. WrapMirrorClampToEdge Wrap = 4 )