OpenXRCompositionLayer
Shared base for OpenXR composition-layer surfaces.
Base Entity3D for presenting a separate surface through the OpenXR compositor. Use a concrete Quad/Cylinder/Equirect shape. LayerViewport, AlphaBlend and native SortOrder are not ordinary GUI z-index. Assign a distinct viewport with positive Size and explicit Always update; the reference transfers no ownership.
Entity existence and IsNativelySupported establish no ready swapchain/frame. Editor/no-API and unsupported-runtime paths may use mesh fallback with different quality, depth behavior and spectator visibility. SortOrder does not order fallback meshes.
A camera ancestor selects head-locked space; otherwise world-locked. Avoid scale/shear in the hierarchy and change shape dimensions instead. LocalFloor does not place a menu in front of a moved player. Hole punching requires negative SortOrder and device-level composition verification.
Setup and QuadUiRay. Twenty headless checks cover ray-to-pixel helper and metadata, not native submission, GUI events, hole-punch pixels, headset or export. This review covers selected core base members, not its entire API.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties19
AlphaBlendProperty
public bool AlphaBlend { get; set; }Enables composition using layer alpha; initially false. Transparent UI also needs viewport TransparentBg and an actually transparent UI background. The setter updates the native flag and fallback material without establishing visible headset output.
AndroidSurfaceSizeProperty
public Vector2I AndroidSurfaceSize { get; set; }Requested Android surface pixel size, initially 1024×1024. Set positive components before obtaining the surface. Does not change LayerViewport.Size. Resizing an existing surface requires the Android swapchain-update extension; the getter reports the request, not an acknowledged producer size.
EnableHolePunchProperty
public bool EnableHolePunch { get; set; }Enables hole-punch mesh/material behavior, initially false. Native composition requires negative SortOrder, for example -1; a nonnegative order produces a configuration warning. The flag alone establishes no correct occlusion. Fallback material depth-test behavior changes; pixels were not tested.
EyeVisibilityProperty
public OpenXRCompositionLayer.EyeVisibilityEnum EyeVisibility { get; set; }Eyes receiving the native layer: Both by default, Left or Right. Neither an Entity visibility mask nor a viewport selector. Updates native Quad/Cylinder/Equirect state; equivalent ordinary mesh-fallback behavior is not established.
LayerViewportProperty
public SubViewport LayerViewport { get; set; }Assigned SubViewport or null. A viewport cannot be used by multiple in-tree layers. Assignment changes WhenVisible/WhenParentVisible to Always with a warning; Disabled is not automatically repaired. A nonnull viewport is rejected while Android surface mode is enabled. The borrowed reference transfers no ownership; detach it before deleting a separately owned viewport.
ProtectedContentProperty
public bool ProtectedContent { get; set; }Protected-content request, initially false. Passed as an XR swapchain creation flag; set before creating the surface/swapchain. The getter reads the request, not protection status. It establishes no DRM or capture-prevention guarantee: verify support, creation errors and security on the target device.
SortOrderProperty
public int SortOrder { get; set; }Native composition order, initially 1: higher values appear in front. The main projection occupies 0; avoid equality with 0, which may conflict with it. Negative order places the layer behind the projection and is required for hole punching. Does not order an ordinary fallback mesh; neither GUI z-index nor physical distance.
SwapchainStateAlphaSwizzleProperty
public OpenXRCompositionLayer.Swizzle SwapchainStateAlphaSwizzle { get; set; }Source of the output alpha channel when sampling the layer, initially Alpha. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateBlueSwizzleProperty
public OpenXRCompositionLayer.Swizzle SwapchainStateBlueSwizzle { get; set; }Source of the output blue channel when sampling the layer, initially Blue. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateBorderColorProperty
public Color SwapchainStateBorderColor { get; set; }Out-of-texture sample color for ClampToBorder, initially transparent black Color(0,0,0,0). Does not recolor the viewport or UI background. Alpha visibility also depends on AlphaBlend and transparent content; setting this color alone does not establish transparent composition. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateGreenSwizzleProperty
public OpenXRCompositionLayer.Swizzle SwapchainStateGreenSwizzle { get; set; }Source of the output green channel when sampling the layer, initially Green. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateHorizontalWrapProperty
public OpenXRCompositionLayer.Wrap SwapchainStateHorizontalWrap { get; set; }Horizontal texture addressing, initially ClampToBorder. Repeat tiles, MirroredRepeat alternates direction, ClampToEdge extends the edge, and ClampToBorder uses BorderColor. OpenGL ES maps MirrorClampToEdge to ClampToEdge without mirroring. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateMagFilterProperty
public OpenXRCompositionLayer.Filter SwapchainStateMagFilter { get; set; }Layer image magnification filter, initially Linear. Nearest uses hard pixel sampling; Linear interpolates. Cubic requires the corresponding graphics-extension support. Does not increase LayerViewport resolution. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateMaxAnisotropyProperty
public float SwapchainStateMaxAnisotropy { get; set; }Requested maximum anisotropy, initially 1. Can improve oblique-surface sampling when supported by the compositor. Use a finite value >=1 within device limits. The setter even stores zero without validation; its getter establishes neither GPU validity nor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateMinFilterProperty
public OpenXRCompositionLayer.Filter SwapchainStateMinFilter { get; set; }Layer image minification filter, initially Linear. Nearest keeps hard pixel sampling; Linear interpolates samples. Cubic is forwarded as a graphics-extension mode and needs device support. A stored enum does not confirm compositor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateMipmapModeProperty
public OpenXRCompositionLayer.MipmapMode SwapchainStateMipmapMode { get; set; }Mip-level selection for minification, initially Linear; Nearest and Disabled are also available. Does not generate mipmaps. Current Vulkan mapping forwards Disabled as Linear too: do not assume it disables mip selection on every backend. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateRedSwizzleProperty
public OpenXRCompositionLayer.Swizzle SwapchainStateRedSwizzle { get; set; }Source of the output red channel when sampling the layer, initially Red. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
SwapchainStateVerticalWrapProperty
public OpenXRCompositionLayer.Wrap SwapchainStateVerticalWrap { get; set; }Vertical texture addressing, initially ClampToBorder. Controls sampling outside the texture, not surface or viewport height. OpenGL ES maps MirrorClampToEdge to ClampToEdge; equal stored enums need not produce equal backend imagery. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
UseAndroidSurfaceProperty
public bool UseAndroidSurface { get; set; }Selects Android surface input instead of SubViewport, initially false. Enabling clears LayerViewport; disabling does not restore it, so assign it again. Requires Android and XR_FB_android_surface_swapchain_create. Successful flag assignment on Windows creates no surface and establishes no support.
Methods41
GetAlphaBlendbool
public bool GetAlphaBlend();Returns the stored value. Enables composition using layer alpha; initially false. Transparent UI also needs viewport TransparentBg and an actually transparent UI background. The setter updates the native flag and fallback material without establishing visible headset output.
boolEnables composition using layer alpha; initially false. Transparent UI also needs viewport TransparentBg and an actually transparent UI background. The setter updates the native flag and fallback material without establishing visible headset output.
GetAlphaSwizzleOpenXRCompositionLayer.Swizzle
public OpenXRCompositionLayer.Swizzle GetAlphaSwizzle();Reads the stored request. Source of the output alpha channel when sampling the layer, initially Alpha. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.SwizzleStored setting value; does not acknowledge compositor application.
GetAndroidSurfaceJavaObject
public JavaObject GetAndroidSurface();Returns the layer-held JavaObject for android.view.Surface, or null. On Android the getter may lazily create the surface; it is not a passive readiness query. Requires UseAndroidSurface and the corresponding OpenXR extension. Do not dispose the borrowed wrapper; stop the external producer before deleting the layer. Windows XR-off execution established only null.
JavaObjectReturns the layer-held JavaObject for android.view.Surface, or null. On Android the getter may lazily create the surface; it is not a passive readiness query. Requires UseAndroidSurface and the corresponding OpenXR extension. Do not dispose the borrowed wrapper; stop the external producer before deleting the layer. Windows XR-off execution established only null.
GetAndroidSurfaceSizeVector2I
public Vector2I GetAndroidSurfaceSize();Reads the stored request. Requested Android surface pixel size, initially 1024×1024. Set positive components before obtaining the surface. Does not change LayerViewport.Size. Resizing an existing surface requires the Android swapchain-update extension; the getter reports the request, not an acknowledged producer size.
Vector2IStored setting value; does not acknowledge compositor application.
GetBlueSwizzleOpenXRCompositionLayer.Swizzle
public OpenXRCompositionLayer.Swizzle GetBlueSwizzle();Reads the stored request. Source of the output blue channel when sampling the layer, initially Blue. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.SwizzleStored setting value; does not acknowledge compositor application.
GetBorderColorColor
public Color GetBorderColor();Reads the stored request. Out-of-texture sample color for ClampToBorder, initially transparent black Color(0,0,0,0). Does not recolor the viewport or UI background. Alpha visibility also depends on AlphaBlend and transparent content; setting this color alone does not establish transparent composition. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
ColorStored setting value; does not acknowledge compositor application.
GetEnableHolePunchbool
public bool GetEnableHolePunch();Returns the stored value. Enables hole-punch mesh/material behavior, initially false. Native composition requires negative SortOrder, for example -1; a nonnegative order produces a configuration warning. The flag alone establishes no correct occlusion. Fallback material depth-test behavior changes; pixels were not tested.
boolEnables hole-punch mesh/material behavior, initially false. Native composition requires negative SortOrder, for example -1; a nonnegative order produces a configuration warning. The flag alone establishes no correct occlusion. Fallback material depth-test behavior changes; pixels were not tested.
GetEyeVisibilityOpenXRCompositionLayer.EyeVisibilityEnum
public OpenXRCompositionLayer.EyeVisibilityEnum GetEyeVisibility();Reads the stored request. Eyes receiving the native layer: Both by default, Left or Right. Neither an Entity visibility mask nor a viewport selector. Updates native Quad/Cylinder/Equirect state; equivalent ordinary mesh-fallback behavior is not established.
OpenXRCompositionLayer.EyeVisibilityEnumStored setting value; does not acknowledge compositor application.
GetGreenSwizzleOpenXRCompositionLayer.Swizzle
public OpenXRCompositionLayer.Swizzle GetGreenSwizzle();Reads the stored request. Source of the output green channel when sampling the layer, initially Green. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.SwizzleStored setting value; does not acknowledge compositor application.
GetHorizontalWrapOpenXRCompositionLayer.Wrap
public OpenXRCompositionLayer.Wrap GetHorizontalWrap();Reads the stored request. Horizontal texture addressing, initially ClampToBorder. Repeat tiles, MirroredRepeat alternates direction, ClampToEdge extends the edge, and ClampToBorder uses BorderColor. OpenGL ES maps MirrorClampToEdge to ClampToEdge without mirroring. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.WrapStored setting value; does not acknowledge compositor application.
GetLayerViewportSubViewport
public SubViewport GetLayerViewport();Returns the stored value. Assigned SubViewport or null. A viewport cannot be used by multiple in-tree layers. Assignment changes WhenVisible/WhenParentVisible to Always with a warning; Disabled is not automatically repaired. A nonnull viewport is rejected while Android surface mode is enabled. The borrowed reference transfers no ownership; detach it before deleting a separately owned viewport.
SubViewportBorrowed assigned viewport or null; ownership is not transferred.
GetMagFilterOpenXRCompositionLayer.Filter
public OpenXRCompositionLayer.Filter GetMagFilter();Reads the stored request. Layer image magnification filter, initially Linear. Nearest uses hard pixel sampling; Linear interpolates. Cubic requires the corresponding graphics-extension support. Does not increase LayerViewport resolution. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.FilterStored setting value; does not acknowledge compositor application.
GetMaxAnisotropyfloat
public float GetMaxAnisotropy();Reads the stored request. Requested maximum anisotropy, initially 1. Can improve oblique-surface sampling when supported by the compositor. Use a finite value >=1 within device limits. The setter even stores zero without validation; its getter establishes neither GPU validity nor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
floatStored setting value; does not acknowledge compositor application.
GetMinFilterOpenXRCompositionLayer.Filter
public OpenXRCompositionLayer.Filter GetMinFilter();Reads the stored request. Layer image minification filter, initially Linear. Nearest keeps hard pixel sampling; Linear interpolates samples. Cubic is forwarded as a graphics-extension mode and needs device support. A stored enum does not confirm compositor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.FilterStored setting value; does not acknowledge compositor application.
GetMipmapModeOpenXRCompositionLayer.MipmapMode
public OpenXRCompositionLayer.MipmapMode GetMipmapMode();Reads the stored request. Mip-level selection for minification, initially Linear; Nearest and Disabled are also available. Does not generate mipmaps. Current Vulkan mapping forwards Disabled as Linear too: do not assume it disables mip selection on every backend. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.MipmapModeStored setting value; does not acknowledge compositor application.
GetRedSwizzleOpenXRCompositionLayer.Swizzle
public OpenXRCompositionLayer.Swizzle GetRedSwizzle();Reads the stored request. Source of the output red channel when sampling the layer, initially Red. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.SwizzleStored setting value; does not acknowledge compositor application.
GetSortOrderint
public int GetSortOrder();Returns the stored value. Native composition order, initially 1: higher values appear in front. The main projection occupies 0; avoid equality with 0, which may conflict with it. Negative order places the layer behind the projection and is required for hole punching. Does not order an ordinary fallback mesh; neither GUI z-index nor physical distance.
intNative composition order, initially 1: higher values appear in front. The main projection occupies 0; avoid equality with 0, which may conflict with it. Negative order places the layer behind the projection and is required for hole punching. Does not order an ordinary fallback mesh; neither GUI z-index nor physical distance.
GetUseAndroidSurfacebool
public bool GetUseAndroidSurface();Reads the stored request. Selects Android surface input instead of SubViewport, initially false. Enabling clears LayerViewport; disabling does not restore it, so assign it again. Requires Android and XR_FB_android_surface_swapchain_create. Successful flag assignment on Windows creates no surface and establishes no support.
boolStored setting value; does not acknowledge compositor application.
GetVerticalWrapOpenXRCompositionLayer.Wrap
public OpenXRCompositionLayer.Wrap GetVerticalWrap();Reads the stored request. Vertical texture addressing, initially ClampToBorder. Controls sampling outside the texture, not surface or viewport height. OpenGL ES maps MirrorClampToEdge to ClampToEdge; equal stored enums need not produce equal backend imagery. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
OpenXRCompositionLayer.WrapStored setting value; does not acknowledge compositor application.
IntersectsRayVector2
public Vector2 IntersectsRay(Vector3 origin, Vector3 direction);Returns world-space ray intersection UV for the concrete layer shape; miss is Vector2(-1,-1). The base implementation always misses; shapes override it. Quad was tested with orthonormal transforms without scale/shear; UV Y points downward. Neither a physics/occlusion or visibility check nor GUI input dispatch. Validate the hit and convert UV to viewport pixels.
| Name | Type | Default |
|---|---|---|
origin | Vector3 | — |
direction | Vector3 | — |
originRay origin in global coordinates, not controller-local position. Supply finite values and check current tracking.
directionGlobal-space ray direction, not a target point. Use a finite nonzero normalized vector, normally the controller’s -GlobalTransform.Basis.Z.
Vector2Intersection UV or (-1,-1); does not establish absence of occluding geometry.
IsNativelySupportedbool
public bool IsNativelySupported();Queries the concrete layer type through the current OpenXR API/extension. False without them; Quad needs no separate shape extension, whereas Cylinder/Equirect require their extensions. Use after session startup to select a path. True guarantees no working swapchain, assigned viewport, submitted layer or visible pixels; false does not prevent fallback.
boolType support in the current API/extension, not display readiness.
IsProtectedContentbool
public bool IsProtectedContent();Reads the stored request. Protected-content request, initially false. Passed as an XR swapchain creation flag; set before creating the surface/swapchain. The getter reads the request, not protection status. It establishes no DRM or capture-prevention guarantee: verify support, creation errors and security on the target device.
boolStored setting value; does not acknowledge compositor application.
SetAlphaBlendvoid
public void SetAlphaBlend(bool enabled);Stores configuration. Enables composition using layer alpha; initially false. Transparent UI also needs viewport TransparentBg and an actually transparent UI background. The setter updates the native flag and fallback material without establishing visible headset output.
| Name | Type | Default |
|---|---|---|
enabled | bool | — |
enabledEnable layer-alpha composition; configure viewport/UI transparency too.
SetAlphaSwizzlevoid
public void SetAlphaSwizzle(OpenXRCompositionLayer.Swizzle mode);Source of the output alpha channel when sampling the layer, initially Alpha. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Swizzle | — |
modeSource of the output alpha channel when sampling the layer, initially Alpha. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions.
SetAndroidSurfaceSizevoid
public void SetAndroidSurfaceSize(Vector2I size);Requested Android surface pixel size, initially 1024×1024. Set positive components before obtaining the surface. Does not change LayerViewport.Size. Resizing an existing surface requires the Android swapchain-update extension; the getter reports the request, not an acknowledged producer size.
| Name | Type | Default |
|---|---|---|
size | Vector2I | — |
sizePositive surface pixel dimensions, not viewport dimensions.
SetBlueSwizzlevoid
public void SetBlueSwizzle(OpenXRCompositionLayer.Swizzle mode);Source of the output blue channel when sampling the layer, initially Blue. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Swizzle | — |
modeSource of the output blue channel when sampling the layer, initially Blue. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions.
SetBorderColorvoid
public void SetBorderColor(Color color);Out-of-texture sample color for ClampToBorder, initially transparent black Color(0,0,0,0). Does not recolor the viewport or UI background. Alpha visibility also depends on AlphaBlend and transparent content; setting this color alone does not establish transparent composition. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
color | Color | — |
colorOut-of-texture sample color for ClampToBorder, initially transparent black Color(0,0,0,0). Does not recolor the viewport or UI background. Alpha visibility also depends on AlphaBlend and transparent content; setting this color alone does not establish transparent composition.
SetEnableHolePunchvoid
public void SetEnableHolePunch(bool enable);Stores configuration. Enables hole-punch mesh/material behavior, initially false. Native composition requires negative SortOrder, for example -1; a nonnegative order produces a configuration warning. The flag alone establishes no correct occlusion. Fallback material depth-test behavior changes; pixels were not tested.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableEnable hole punching; native composition also needs SortOrder<0. Establishes no correct pixels.
SetEyeVisibilityvoid
public void SetEyeVisibility(OpenXRCompositionLayer.EyeVisibilityEnum eyeVisibility);Eyes receiving the native layer: Both by default, Left or Right. Neither an Entity visibility mask nor a viewport selector. Updates native Quad/Cylinder/Equirect state; equivalent ordinary mesh-fallback behavior is not established.
| Name | Type | Default |
|---|---|---|
eyeVisibility | OpenXRCompositionLayer.EyeVisibilityEnum | — |
eyeVisibilityEyes receiving the native layer: Both by default, Left or Right. Neither an Entity visibility mask nor a viewport selector. Updates native Quad/Cylinder/Equirect state; equivalent ordinary mesh-fallback behavior is not established.
SetGreenSwizzlevoid
public void SetGreenSwizzle(OpenXRCompositionLayer.Swizzle mode);Source of the output green channel when sampling the layer, initially Green. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Swizzle | — |
modeSource of the output green channel when sampling the layer, initially Green. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions.
SetHorizontalWrapvoid
public void SetHorizontalWrap(OpenXRCompositionLayer.Wrap mode);Horizontal texture addressing, initially ClampToBorder. Repeat tiles, MirroredRepeat alternates direction, ClampToEdge extends the edge, and ClampToBorder uses BorderColor. OpenGL ES maps MirrorClampToEdge to ClampToEdge without mirroring. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Wrap | — |
modeHorizontal texture addressing, initially ClampToBorder. Repeat tiles, MirroredRepeat alternates direction, ClampToEdge extends the edge, and ClampToBorder uses BorderColor. OpenGL ES maps MirrorClampToEdge to ClampToEdge without mirroring.
SetLayerViewportvoid
public void SetLayerViewport(SubViewport viewport);Stores configuration. Assigned SubViewport or null. A viewport cannot be used by multiple in-tree layers. Assignment changes WhenVisible/WhenParentVisible to Always with a warning; Disabled is not automatically repaired. A nonnull viewport is rejected while Android surface mode is enabled. The borrowed reference transfers no ownership; detach it before deleting a separately owned viewport.
| Name | Type | Default |
|---|---|---|
viewport | SubViewport | — |
viewportBorrowed SubViewport, or null to detach. Needs positive pixel Size and a deliberate update mode; do not share one viewport across in-tree layers.
SetMagFiltervoid
public void SetMagFilter(OpenXRCompositionLayer.Filter mode);Layer image magnification filter, initially Linear. Nearest uses hard pixel sampling; Linear interpolates. Cubic requires the corresponding graphics-extension support. Does not increase LayerViewport resolution. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Filter | — |
modeLayer image magnification filter, initially Linear. Nearest uses hard pixel sampling; Linear interpolates. Cubic requires the corresponding graphics-extension support. Does not increase LayerViewport resolution.
SetMaxAnisotropyvoid
public void SetMaxAnisotropy(float value);Requested maximum anisotropy, initially 1. Can improve oblique-surface sampling when supported by the compositor. Use a finite value >=1 within device limits. The setter even stores zero without validation; its getter establishes neither GPU validity nor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
value | float | — |
valueFinite value >=1 within target-device limits; not automatically validated.
SetMinFiltervoid
public void SetMinFilter(OpenXRCompositionLayer.Filter mode);Layer image minification filter, initially Linear. Nearest keeps hard pixel sampling; Linear interpolates samples. Cubic is forwarded as a graphics-extension mode and needs device support. A stored enum does not confirm compositor application. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Filter | — |
modeLayer image minification filter, initially Linear. Nearest keeps hard pixel sampling; Linear interpolates samples. Cubic is forwarded as a graphics-extension mode and needs device support. A stored enum does not confirm compositor application.
SetMipmapModevoid
public void SetMipmapMode(OpenXRCompositionLayer.MipmapMode mode);Mip-level selection for minification, initially Linear; Nearest and Disabled are also available. Does not generate mipmaps. Current Vulkan mapping forwards Disabled as Linear too: do not assume it disables mip selection on every backend. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.MipmapMode | — |
modeMip-level selection for minification, initially Linear; Nearest and Disabled are also available. Does not generate mipmaps. Current Vulkan mapping forwards Disabled as Linear too: do not assume it disables mip selection on every backend.
SetProtectedContentvoid
public void SetProtectedContent(bool protectedContent);Protected-content request, initially false. Passed as an XR swapchain creation flag; set before creating the surface/swapchain. The getter reads the request, not protection status. It establishes no DRM or capture-prevention guarantee: verify support, creation errors and security on the target device.
| Name | Type | Default |
|---|---|---|
protectedContent | bool | — |
protectedContentProtection request for swapchain creation, not protection confirmation.
SetRedSwizzlevoid
public void SetRedSwizzle(OpenXRCompositionLayer.Swizzle mode);Source of the output red channel when sampling the layer, initially Red. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Swizzle | — |
modeSource of the output red channel when sampling the layer, initially Red. Choose Red, Green, Blue, Alpha, Zero or One; Zero/One supply constants. Changes sampler mapping, not source resource pixels; actual application depends on OpenXR sampler extensions.
SetSortOrdervoid
public void SetSortOrder(int order);Stores configuration. Native composition order, initially 1: higher values appear in front. The main projection occupies 0; avoid equality with 0, which may conflict with it. Negative order places the layer behind the projection and is required for hole punching. Does not order an ordinary fallback mesh; neither GUI z-index nor physical distance.
| Name | Type | Default |
|---|---|---|
order | int | — |
orderNative layer order: negative behind projection, positive in front. Avoid 0; does not order the fallback mesh.
SetUseAndroidSurfacevoid
public void SetUseAndroidSurface(bool enable);Selects Android surface input instead of SubViewport, initially false. Enabling clears LayerViewport; disabling does not restore it, so assign it again. Requires Android and XR_FB_android_surface_swapchain_create. Successful flag assignment on Windows creates no surface and establishes no support.
| Name | Type | Default |
|---|---|---|
enable | bool | — |
enableTrue clears LayerViewport; false does not restore it.
SetVerticalWrapvoid
public void SetVerticalWrap(OpenXRCompositionLayer.Wrap mode);Vertical texture addressing, initially ClampToBorder. Controls sampling outside the texture, not surface or viewport height. OpenGL ES maps MirrorClampToEdge to ClampToEdge; equal stored enums need not produce equal backend imagery. Native application requires XR_FB_swapchain_update_state and the active Vulkan/OpenGL ES backend extension; without them it is not applied.
| Name | Type | Default |
|---|---|---|
mode | OpenXRCompositionLayer.Wrap | — |
modeVertical texture addressing, initially ClampToBorder. Controls sampling outside the texture, not surface or viewport height. OpenGL ES maps MirrorClampToEdge to ClampToEdge; equal stored enums need not produce equal backend imagery.
OpenXRCompositionLayer.EyeVisibilityEnum
OpenXRCompositionLayer.Filter
| Value | Description |
|---|---|
Cubic = 2 | Perform cubic filtering when sampling the texture. |
Linear = 1 | Perform linear filtering when sampling the texture. |
Nearest = 0 | Perform nearest-neighbor filtering when sampling the texture. |
OpenXRCompositionLayer.MipmapMode
| Value | Description |
|---|---|
Disabled = 0 | Disable mipmapping. Note: Mipmapping can only be disabled in the Compatibility renderer. |
Linear = 2 | Use linear interpolation of the two mipmaps of the nearest resolution. |
Nearest = 1 | Use the mipmap of the nearest resolution. |
OpenXRCompositionLayer.Swizzle
| Value | Description |
|---|---|
Alpha = 3 | Maps a color channel to the value of the alpha channel. |
Blue = 2 | Maps a color channel to the value of the blue channel. |
Green = 1 | Maps a color channel to the value of the green channel. |
One = 5 | Maps a color channel to the value of one. |
Red = 0 | Maps a color channel to the value of the red channel. |
Zero = 4 | Maps a color channel to the value of zero. |
OpenXRCompositionLayer.Wrap
| Value | Description |
|---|---|
ClampToBorder = 0 | Clamp the texture to its specified border color. |
ClampToEdge = 1 | Clamp the texture to its edge color. |
MirrorClampToEdge = 4 | Mirror the texture once and then clamp the texture to its edge color. Note: This wrap mode is not available in the Compatibility renderer. |
MirroredRepeat = 3 | Repeat the texture infinitely, mirroring it on each repeat. |
Repeat = 2 | Repeat the texture infinitely. |