OpenXRCompositionLayer

package
v0.0.0-...-fa94a0d Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: MIT Imports: 31 Imported by: 0

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

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
	AsOpenXRCompositionLayer() 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]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

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

func (*Extension[T]) AsOpenXRCompositionLayer

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

type Filter

type Filter int //gd:OpenXRCompositionLayer.Filter
const (
	// Perform nearest-neighbor filtering when sampling the texture.
	FilterNearest Filter = 0
	// Perform linear filtering when sampling the texture.
	FilterLinear Filter = 1
	// Perform cubic filtering when sampling the texture.
	FilterCubic Filter = 2
)

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.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 New

func New() Instance

func (Instance) AlphaBlend

func (self Instance) AlphaBlend() bool

func (Instance) AndroidSurfaceSize

func (self Instance) AndroidSurfaceSize() Vector2i.XY

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

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

func (Instance) AsOpenXRCompositionLayer

func (self Instance) AsOpenXRCompositionLayer() Instance

func (Instance) EnableHolePunch

func (self Instance) EnableHolePunch() bool

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) ID

func (self Instance) ID() ID

func (Instance) IntersectsRay

func (self Instance) IntersectsRay(origin Vector3.XYZ, direction Vector3.XYZ) Vector2.XY

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

func (self Instance) IsNativelySupported() bool

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 (self Instance) SetAlphaBlend(value bool)

func (Instance) SetAndroidSurfaceSize

func (self Instance) SetAndroidSurfaceSize(value Vector2i.XY)

func (Instance) SetEnableHolePunch

func (self Instance) SetEnableHolePunch(value bool)

func (Instance) SetLayerViewport

func (self Instance) SetLayerViewport(value SubViewport.Instance)

func (*Instance) SetObject

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

func (Instance) SetSortOrder

func (self Instance) SetSortOrder(value int)

func (Instance) SetSwapchainStateAlphaSwizzle

func (self Instance) SetSwapchainStateAlphaSwizzle(value Swizzle)

func (Instance) SetSwapchainStateBlueSwizzle

func (self Instance) SetSwapchainStateBlueSwizzle(value Swizzle)

func (Instance) SetSwapchainStateBorderColor

func (self Instance) SetSwapchainStateBorderColor(value Color.RGBA)

func (Instance) SetSwapchainStateGreenSwizzle

func (self Instance) SetSwapchainStateGreenSwizzle(value Swizzle)

func (Instance) SetSwapchainStateHorizontalWrap

func (self Instance) SetSwapchainStateHorizontalWrap(value Wrap)

func (Instance) SetSwapchainStateMagFilter

func (self Instance) SetSwapchainStateMagFilter(value Filter)

func (Instance) SetSwapchainStateMaxAnisotropy

func (self Instance) SetSwapchainStateMaxAnisotropy(value Float.X)

func (Instance) SetSwapchainStateMinFilter

func (self Instance) SetSwapchainStateMinFilter(value Filter)

func (Instance) SetSwapchainStateMipmapMode

func (self Instance) SetSwapchainStateMipmapMode(value MipmapMode)

func (Instance) SetSwapchainStateRedSwizzle

func (self Instance) SetSwapchainStateRedSwizzle(value Swizzle)

func (Instance) SetSwapchainStateVerticalWrap

func (self Instance) SetSwapchainStateVerticalWrap(value Wrap)

func (Instance) SetUseAndroidSurface

func (self Instance) SetUseAndroidSurface(value bool)

func (Instance) SortOrder

func (self Instance) SortOrder() int

func (Instance) SwapchainStateAlphaSwizzle

func (self Instance) SwapchainStateAlphaSwizzle() Swizzle

func (Instance) SwapchainStateBlueSwizzle

func (self Instance) SwapchainStateBlueSwizzle() Swizzle

func (Instance) SwapchainStateBorderColor

func (self Instance) SwapchainStateBorderColor() Color.RGBA

func (Instance) SwapchainStateGreenSwizzle

func (self Instance) SwapchainStateGreenSwizzle() Swizzle

func (Instance) SwapchainStateHorizontalWrap

func (self Instance) SwapchainStateHorizontalWrap() Wrap

func (Instance) SwapchainStateMagFilter

func (self Instance) SwapchainStateMagFilter() Filter

func (Instance) SwapchainStateMaxAnisotropy

func (self Instance) SwapchainStateMaxAnisotropy() Float.X

func (Instance) SwapchainStateMinFilter

func (self Instance) SwapchainStateMinFilter() Filter

func (Instance) SwapchainStateMipmapMode

func (self Instance) SwapchainStateMipmapMode() MipmapMode

func (Instance) SwapchainStateRedSwizzle

func (self Instance) SwapchainStateRedSwizzle() Swizzle

func (Instance) SwapchainStateVerticalWrap

func (self Instance) SwapchainStateVerticalWrap() Wrap

func (Instance) UseAndroidSurface

func (self Instance) UseAndroidSurface() bool

func (Instance) Virtual

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

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
)

Jump to

Keyboard shortcuts

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