WebXR 레이어 API 레벨 1

W3C 작업 초안,

이 문서에 대한 자세한 정보
이 버전:
https://www.w3.org/TR/2026/WD-webxrlayers-1-20260122/
최신 공개 버전:
https://www.w3.org/TR/webxrlayers-1/
편집자 초안:
https://immersive-web.github.io/layers/
이전 버전:
이력:
https://www.w3.org/standards/history/webxrlayers-1/
피드백:
GitHub
명세 내 인라인
편집자:
(Meta)
참여:
이슈 제기 (열린 이슈)
메일링 리스트 아카이브
W3C의 #immersive-web IRC

초록

이 명세는 WebXR 세션에서 사용되는 다양한 레이어 유형에 대한 지원을 설명합니다.

이 문서의 상태

이 절은 이 문서가 발행된 시점의 상태를 설명합니다. 현재 W3C 발행물 목록과 이 기술 보고서의 최신 개정판은 W3C 표준 및 초안 색인에서 확인할 수 있습니다.

Immersive Web Working Group은 그룹이 아직 처리하지 않은 모든 버그 보고서 목록을 관리합니다. 이 초안은 작업 그룹에서 아직 논의해야 하는 일부 보류 중인 이슈를 강조합니다. 이러한 이슈의 결과에 대해서는, 그것이 유효한지 여부를 포함하여 어떤 결정도 내려지지 않았습니다. 미해결 이슈에 대해 제안된 명세 텍스트가 포함된 풀 리퀘스트를 강력히 권장합니다.

이 문서는 Immersive Web Working Group권고안 트랙을 사용하여 작업 초안으로 발행했습니다. 이 문서는 W3C 권고안이 되는 것을 목적으로 합니다.

작업 초안으로 발행되었다고 해서 W3C 및 그 회원의 승인을 의미하지는 않습니다. 이 문서는 초안 문서이며 언제든지 다른 문서로 업데이트되거나, 대체되거나, 폐기될 수 있습니다. 진행 중인 작업 이외의 것으로 이 문서를 인용하는 것은 부적절합니다.

이 문서는 W3C 특허 정책에 따라 운영되는 그룹이 작성했습니다. W3C는 그룹의 결과물과 관련하여 이루어진 모든 특허 공개의 공개 목록을 관리합니다. 해당 페이지에는 특허를 공개하기 위한 지침도 포함되어 있습니다. 개인이 필수 청구항을 포함한다고 믿는 특허에 대해 실제 지식을 가진 경우, W3C 특허 정책 제6절에 따라 해당 정보를 공개해야 합니다.

이 문서는 2025년 8월 18일 W3C Process Document의 적용을 받습니다.

1. 소개

이 명세는 WebXR 명세에 `composition` 레이어 지원을 추가합니다. 레이어의 이점은 다음과 같습니다.

1.1. 용어

1.2. 애플리케이션 흐름

작성자가 GL 레이어를 사용하려는 경우, 다음 단계를 거쳐야 합니다.

  1. XRProjectionLayer 이외의 모든 레이어 유형에 대해서는 requiredFeatures 또는 optionalFeatures를 통해 requestSession()에서 지원을 요청합니다.

  2. XRWebGLBinding 또는 XRMediaBinding을 생성합니다.

  3. 이 객체들로 레이어를 생성합니다.

  4. 레이어를 XRRenderStateInit에 추가하고 updateRenderState()를 호출합니다.

  5. WebGL 레이어의 경우 requestAnimationFrame() 동안 각 WebGL 레이어에 콘텐츠를 그립니다.

2. 초기화

애플리케이션이 세션 중 XRProjectionLayer 유형 이외의 레이어를 생성하려는 경우, 해당 세션은 적절한 feature descriptor와 함께 요청되어야 합니다. 문자열 "layers"는 이 모듈에서 WebXR Layers 기능을 위한 새로운 유효한 feature descriptor로 도입됩니다.

XRProjectionLayer 유형의 레이어는 feature descriptor가 요청되었는지 여부와 관계없이 항상 지원되어야 합니다.

다음 코드는 layers를 선택적 기능으로 요청합니다.
navigator.xr.requestSession('immersive-vr', {
    optionalFeatures: ['layers']
  }

레이어는 XRSessionMode가 "immersive-vr" 또는 "immersive-ar"인 XRSessions에 대해서만 지원됩니다. "inline" 세션은 레이어를 지원해서는 안 됩니다.

"layers" feature descriptorfeature requirement를 가지며, 이는 active immersive session이 있을 때 활성화될 수 없다는 것입니다.

NOTE: 이는 "layers"와 함께 request(permissionDesc) API를 실행해도 현재 활성 세션에 대한 layers 지원이 활성화되지 않음을 의미합니다.

3. 레이어 유형

3.1. 모노 및 스테레오 레이어

스테레오 레이어는 각 뷰에 대해 렌더링 대상이 되는 XRSubImage를 제공해야 합니다.

모노 레이어는 각 뷰에 표시되는 단일 XRSubImage를 제공해야 합니다.

XR Compositor는 레이어가 관찰자에게 스테레오로 올바르게 표시되도록 보장해야 합니다.

3.2. XRLayerLayout

XRLayerLayout enum은 레이어의 레이아웃을 정의합니다.
enum XRLayerLayout {
  "default",
  "mono",
  "stereo",
  "stereo-left-right",
  "stereo-top-bottom"
};

NOTE: XRCompositionLayer"default" 또는 "stereo" XRLayerLayout으로 생성되는 경우, "texture-array" 텍스처 유형으로 할당하는 것을 강력히 권장합니다.

Note: "stereo-left-right""stereo-top-bottom" 레이아웃은 이미 스테레오인 콘텐츠(예: 스테레오 비디오 또는 이미지)에 대한 draw 호출을 최소화하도록 설계되었습니다. 이러한 자산 유형이 필요하지 않은 경험은 "default" 또는 "stereo" 레이아웃을 사용해야 합니다.

3.3. XRLayerQuality

XRLayerQuality enum은 레이어의 표시 품질을 정의합니다.
enum XRLayerQuality {
  "default",
  "text-optimized",
  "graphics-optimized"
};

NOTE: text-optimizedgraphics-optimized 플래그는 XR Compositor의 추가 처리를 초래할 수 있으며, 이는 성능에 영향을 줄 수 있습니다.

3.4. XRCompositionLayer

XRCompositionLayer는 특정 레이어 유형 전반에 공통되는 속성과 동작의 집합을 정의합니다.
[Exposed=Window] interface XRCompositionLayer : XRLayer {
  readonly attribute XRLayerLayout layout;

  attribute boolean blendTextureSourceAlpha;
  attribute boolean forceMonoPresentation;
  attribute float opacity;
  readonly attribute unsigned long mipLevels;
  attribute XRLayerQuality quality;

  readonly attribute boolean needsRedraw;

  undefined destroy();
};

layout 속성은 레이어의 레이아웃을 반환합니다.

blendTextureSourceAlpha 속성은 레이어의 텍스처 알파 채널을 활성화합니다.

forceMonoPresentation 속성은 오른쪽 눈이 왼쪽 눈과 동일한 레이어 구성을 사용하도록 강제합니다. 이는 XR Compositor에 신호를 보내 이 XRCompositionLayerstereo 효과를 제거해야 합니다. true로 설정해도 mono 레이어에는 아무 효과가 없습니다.

NOTE: 이 속성은 XRSession이 반환하는 다른 정보에는 부수 효과가 없습니다. 이 설정의 영향을 받는 것은 XR Compositor의 동작뿐이며, 경험은 양쪽 눈 모두에 계속 그려야 합니다.

opacity 속성은 레이어의 픽셀에 적용되는 불투명도를 설정합니다. XR Compositor는 각 픽셀(프리멀티플라이드 공간에서)에 이 값을 곱해야 합니다. opacity의 기본값은 1.0입니다. opacity0보다 작은 값으로 설정하면 0으로 설정되고, 1.0보다 큰 값으로 설정하면 1.0으로 설정됩니다.

needsRedraw 속성은 XRCompositionLayer가 다음 XR animation frame에서 다시 렌더링되어야 함을 나타냅니다. 이는 레이어의 기본 리소스가 손실되었거나 XR Compositor가 더 이상 레이어를 재투영할 수 없을 때 설정될 수 있습니다. 다음 XR animation frame에서 콘텐츠를 다시 그리지 않으면 깜박임이나 기타 부수 효과가 발생할 수 있습니다.

mipLevels 속성은 mip 체인의 깊이를 반환합니다. 이는 mipLevels에서 요청한 값과 같거나 작아야 합니다.

NOTE: 일부 플랫폼은 mip 레벨을 지원하지 않습니다. 작성자는 특정 mip 레벨을 대상으로 할 수 있는지 확인하기 위해 mipLevels를 질의해야 하며, mipLevels에 전달한 값에 의존해서는 안 됩니다.

quality 속성은 XRCompositionLayer의 품질을 설정하고 반환합니다. default가 초기값입니다.

XRCompositionLayer layer에 대해 레이어의 기본 리소스가 손실되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. layerneedsRedrawtrue로 설정합니다.

  2. layerXRProjectionLayer가 아닌 경우, layer에서 XRLayerEvent를 사용하여 redraw라는 이름의 이벤트를 발생시키도록 태스크를 큐에 추가합니다.

destroy()는 기본 attachment를 삭제합니다. attachment가 없으면 이 함수는 아무것도 하지 않습니다.

XRSession sessionWebGLRenderingContext 또는 WebGL2RenderingContext context의 선택적 인스턴스로 컴포지션 레이어를 초기화하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. this sessionsession으로 설정합니다.

  2. context가 정의되어 있으면, this contextcontext로 설정합니다.

  3. this blendTextureSourceAlphatrue로 설정합니다.

  4. this opacity1.0으로 설정합니다.

destroy()를 호출할 때, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. this colorTextures 배열을 빈 배열로 설정합니다.

  2. this depthStencilTextures 배열을 빈 배열로 설정합니다.

  3. 기본 GL attachment를 파기합니다.

XRCompositionLayer에는 null 또는 WebGLRenderingContext 또는 WebGL2RenderingContext의 인스턴스인 context 객체와, null 또는 HTMLVideoElement의 인스턴스인 media 객체가 있습니다.

XRCompositionLayer에는 생성될 때 사용된 XRSession인 관련 session이 있습니다.

XRSpace spaceXRCompositionLayer layer레이어의 space를 설정할 때, 사용자 에이전트는 space가 유효한지 검증하기 위해 다음 단계를 실행해야 합니다.

  1. spacenull이면, TypeError를 throw하고 이 단계를 중단합니다.

  2. spacesessionlayersession과 같지 않으면, TypeError를 throw하고 이 단계를 중단합니다.

XRCompositionLayer에는 작성자가 needsRedrawtrue일 때에만 이 레이어에 그릴 수 있음을 나타내는 내부 불리언 isStatic이 있습니다.

NOTE: isStatictrue이면 작성자는 생성 후 한 번 또는 redraw 이벤트 후 한 번만 레이어에 그릴 수 있습니다. 이를 통해 UA는 단일 GPU 버퍼만 할당할 수 있습니다.

XRCompositionLayer 또는 그 파생 클래스 중 하나에서 쓰기 가능한 속성이 설정되면, 해당 속성을 읽을 때 그 값을 반환해야 합니다. requestAnimationFrame() 콜백이 끝날 때, 그 값은 기본 XR Compositor로 전송되어야 합니다. XR CompositorrequestAnimationFrame() 콜백에 전달된 XRFrame을 다음에 표시할 때 해당 값을 적용해야 합니다.

NOTE: 이는 XR Compositor가 새 XRFrame을 사용하여 장면을 다시 그릴 때, colorTextureXRCompositionLayer와 관련하여 변경되지 않았거나, 미디어 레이어와 관련된 videoframe이 변경되지 않았더라도 값을 적용해야 함을 의미합니다. XR Compositor가 이전 XRFrame의 상태로 장면을 다시 그리는 경우, 새 값을 사용해서는 안 됩니다.

3.5. XRProjectionLayer

XRProjectionLayer는 관찰자의 전체 뷰를 채우는 레이어입니다. Projection 레이어는 장치의 네이티브 프레임 레이트에 가깝게 새로 고쳐져야 합니다.

projection 레이어의 표현

[Exposed=Window] interface XRProjectionLayer : XRCompositionLayer {
  readonly attribute unsigned long textureWidth;
  readonly attribute unsigned long textureHeight;
  readonly attribute unsigned long textureArrayLength;

  readonly attribute boolean ignoreDepthValues;
  attribute float? fixedFoveation;
  attribute XRRigidTransform? deltaPose;
};

textureWidth 속성은 이 레이어의 colorTextures 텍스처의 너비를 픽셀 단위로 반환합니다.

textureHeight 속성은 이 레이어의 colorTextures 텍스처의 높이를 픽셀 단위로 반환합니다.

textureArrayLength 속성은 XRProjectionLayertextureType "texture-array"로 초기화된 경우, 이 레이어의 colorTextures 텍스처의 레이어 수를 반환합니다. 그렇지 않으면 1을 반환합니다.

fixedFoveation 속성은 XR Compositor가 사용하는 foveation의 양을 제어합니다. 사용자 에이전트 또는 장치가 이 속성을 지원하지 않는 경우, getting 시 null을 반환해야 하며, setting은 no-op이어야 합니다. fixedFoveation0보다 작은 값으로 설정하면 0으로 설정되고, 1보다 큰 값으로 설정하면 1로 설정됩니다. 0은 foveation의 최소량을 설정하고, 1은 최대량을 설정합니다. XR Compositor가 이러한 값을 어떻게 해석하는지는 사용자 에이전트에 달려 있습니다. fixedFoveation 레벨이 변경되면, 이는 다음 XRFrame에서 적용됩니다.

ignoreDepthValues 속성이 true이면, XR Compositor가 렌더링 시 depth buffer attachment의 값을 사용해서는 안 됨을 나타냅니다. 속성이 false이면 depth buffer attachment의 콘텐츠가 XR Compositor에 의해 사용되며, 레이어에 렌더링된 장면을 대표할 것으로 기대됨을 나타냅니다.

deltaPose attribute는 XR Compositor가 사용하는 foveation의 양을 제어합니다. 사용자 에이전트 또는 장치가 이 attribute를 지원하지 않거나 "space-warp" feature descriptor가 요청되지 않은 경우, getting 시 null을 반환해야 하며, setting은 no-op이어야 합니다. 이 attribute는 view에 영향을 주는, 이전 frame 이후의 incremental application-applied transform이 있다면 이를 설명합니다. artificial locomotion이 발생하면, experience는 frame 사이에서 전체 world를 하나의 application pose에서 다른 pose로 transform하며, deltaPose에는 scene의 world position 차이가 채워져야 합니다. deltaPose는 이전 frame과 현재 XRFrame 사이에 transform이 없을 때 identity이어야 합니다.

3.6. XRQuadLayer

XRQuadLayer는 가상 환경에서 평평한 직사각형 공간을 차지하는 레이어를 렌더링합니다. 레이어의 앞면만 보여야 하며, 뒷면은 XR Compositor가 그려서는 안 됩니다.

XRQuadLayer에는 두께가 없습니다. 이는 3D 공간에 위치하고 방향이 지정된 2차원 객체입니다. quad의 위치는 quad의 중심을 가리킵니다.

quad 레이어의 표현

[Exposed=Window] interface XRQuadLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float width;
  attribute float height;

  // Events
  attribute EventHandler onredraw;
};

transform 속성은 space 속성에 대한 상대적 오프셋과 방향을 설정하고 반환합니다. transformspace 속성은 사용자의 물리적 환경 내에서 레이어의 공간적 관계를 설정합니다. space를 설정할 때는 먼저 레이어의 space를 설정하는 단계를 실행합니다.

widthheight 속성은 레이어의 너비와 높이를 미터 단위로 설정하고 반환합니다.

XRQuadLayerInit init으로 XRQuadLayer layer초기화할 때, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. layerwidthinitwidth로 초기화합니다.

  2. layerheightinitheight로 초기화합니다.

  3. layerspaceinitspace로 둡니다.

  4. layertransform을 다음과 같이 초기화합니다.

    inittransform이 설정된 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 두고, inittransformpositionorientation으로 초기화합니다.
    그렇지 않은 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 두고, DOMPointInit position { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }로 초기화합니다.
  5. layerisStaticinitisStatic으로 초기화합니다.

onredraw 속성은 redraw 이벤트 유형에 대한 Event handler IDL 속성입니다.

3.7. XRCylinderLayer

XRCylinderLayer는 가상 환경에서 곡면 직사각형 공간을 차지하는 레이어를 렌더링합니다. 레이어의 앞면만 보여야 하며, 뒷면은 XR Compositor가 그려서는 안 됩니다.

cylinder 레이어의 표현

XRCylinderLayer에는 두께가 없습니다. 이는 3D 공간에 위치하고 방향이 지정된 2차원 객체입니다. cylinder의 위치는 quad의 중심을 가리킵니다.

[Exposed=Window] interface XRCylinderLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float radius;
  attribute float centralAngle;
  attribute float aspectRatio;

  // Events
  attribute EventHandler onredraw;
};

transform 속성은 space 속성에 대한 상대적 오프셋과 방향을 설정하고 반환합니다. transformspace 속성은 사용자의 물리적 환경 내에서 레이어의 공간적 관계를 설정합니다. space를 설정할 때는 먼저 레이어의 space를 설정하는 단계를 실행합니다.

radius 속성은 cylinder의 반지름을 미터 단위로 제어합니다.

centralAngle 속성은 cylinder의 보이는 부분의 각도를 라디안 단위로 제어합니다. 이는 0 각도를 중심으로 대칭적으로 커집니다.

aspectRatio 속성은 보이는 cylinder 부분의 비율을 제어합니다. 이는 cylinder의 보이는 부분의 너비를 그 높이로 나눈 비율입니다. 너비는 radiuscentralAngle을 곱하여 계산됩니다.

cylinder 레이어의 매개변수 설명

XRCylinderLayerInit init으로 XRCylinderLayer layer초기화할 때, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. layerradiusinitradius로 초기화합니다.

  2. layercentralAngleinitcentralAngle로 초기화합니다.

  3. layeraspectRatioinitaspectRatio로 초기화합니다.

  4. layerspaceinitspace로 둡니다.

  5. layertransform을 다음과 같이 초기화합니다.

    inittransform이 설정된 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 두고, inittransformpositionorientation으로 초기화합니다.
    그렇지 않은 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 두고, DOMPointInit position { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }로 초기화합니다.
  6. layerisStaticinitisStatic으로 초기화합니다.

onredraw 속성은 redraw 이벤트 유형에 대한 Event handler IDL 속성입니다.

3.8. XREquirectLayer

XREquirectLayerXR Compositor가 equirectangular 인코딩 데이터를 구의 안쪽에 매핑해야 하는 레이어를 렌더링합니다.

equirect 레이어의 표현

이 절은 명확화가 필요합니다

[Exposed=Window] interface XREquirectLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float radius;
  attribute float centralHorizontalAngle;
  attribute float upperVerticalAngle;
  attribute float lowerVerticalAngle;

  // Events
  attribute EventHandler onredraw;
};

transform 속성은 space에 대한 상대적 오프셋과 방향을 설정하고 반환합니다. transform 속성과 space는 사용자의 물리적 환경 내에서 레이어의 공간적 관계를 설정합니다.

radius 속성은 구의 음수가 아닌 반지름을 미터 단위로 나타냅니다. zero 또는 infinity 값은 무한한 구로 취급됩니다.

radius0보다 작은 값으로 설정하면 0으로 설정됩니다.

centralHorizontalAngle, upperVerticalAnglelowerVerticalAngle 속성은 텍스처가 구에 매핑되는 방식을 설정하고 반환합니다.

centralHorizontalAngle을 0보다 작은 값으로 설정하면 0으로 설정되고, 2π보다 큰 값으로 설정하면 2π로 설정됩니다.

upperVerticalAngle 또는 lowerVerticalAngle을 -π/2보다 작은 값으로 설정하면 -π/2로 설정되고, π/2보다 큰 값으로 설정하면 π/2로 설정됩니다.

equirect 레이어의 매개변수 설명

XRSpacespace 속성에 할당할 때는 먼저 다음 단계를 실행합니다.

XRSpace spaceXREquirectLayer layersetting the space on an equirect layer를 수행할 때, 사용자 에이전트는 space가 유효한지 검증하기 위해 다음 단계를 실행해야 합니다.

  1. initspaceXRReferenceSpace 유형의 인스턴스가 아니면, TypeError를 throw하고 이 단계를 중단합니다.

  2. initspace"viewer" type을 가지면, TypeError를 throw하고 이 단계를 중단합니다.

  3. spacelayer레이어의 space를 설정하는 단계를 실행합니다.

XREquirectLayerInit init으로 XREquirectLayer layer초기화할 때, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. layerradiusinitradius로 초기화합니다.

  2. layercentralHorizontalAngleinitcentralHorizontalAngle로 초기화합니다.

  3. layerupperVerticalAngleinitupperVerticalAngle로 초기화합니다.

  4. layerlowerVerticalAngleinitlowerVerticalAngle로 초기화합니다.

  5. layerspaceinitspace로 둡니다.

  6. layertransform을 다음과 같이 초기화합니다.

    inittransform이 설정된 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 두고, inittransformpositionorientation으로 초기화합니다.
    그렇지 않은 경우
    layertransformlayerrelevant realm에서 new XRRigidTransform로 둡니다.
  7. layerisStaticinitisStatic으로 초기화합니다.

onredraw 속성은 redraw 이벤트 유형에 대한 Event handler IDL 속성입니다.

3.9. XRCubeLayer

XRCubeLayerXR Compositor가 cubemap에서 직접 렌더링하는 레이어를 렌더링합니다.

cube 레이어의 표현

이 절은 명확화가 필요합니다

[Exposed=Window] interface XRCubeLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute DOMPointReadOnly orientation;

  // Events
  attribute EventHandler onredraw;
};

orientation 속성은 space 속성에 대한 상대적 방향을 설정하고 반환합니다. orientationspace 속성은 사용자의 물리적 환경 내에서 레이어의 공간적 관계를 설정합니다. XRCubeLayer를 배치할 때는 space의 방향만 고려됩니다. cube 레이어는 항상 시점이 중심에 있는 상태로 렌더링됩니다.

XRSpacespace 속성에 할당할 때는 먼저 다음 단계를 실행합니다.

XRSpace spaceXRCubeLayer layersetting the space on an cube layer를 수행할 때, 사용자 에이전트는 space가 유효한지 검증하기 위해 다음 단계를 실행해야 합니다.

  1. initspaceXRReferenceSpace 유형의 인스턴스가 아니면, TypeError를 throw하고 이 단계를 중단합니다.

  2. initspace"viewer" type을 가지면, TypeError를 throw하고 이 단계를 중단합니다.

  3. spacelayer레이어의 space를 설정하는 단계를 실행합니다.

onredraw 속성은 redraw 이벤트 유형에 대한 Event handler IDL 속성입니다.

4. 공간

XRProjectionLayerXRWebGLLayer에는 관련 XRSpace가 없습니다. 이들은 전체 프레임에 렌더링하기 때문입니다.

XRCubeLayerXREquirectLayerXRReferenceSpaces"viewer" 유형이 아닌 것만 지원해야 합니다.

XRQuadLayerXRCylinderLayer는 모든 XRSpace 유형을 지원해야 합니다.

일반적으로 개발자는 레이어를 안정화하기 위해 "viewer" space를 사용하지 않는 것이 좋습니다. 이는 거의 항상 위치 또는 회전 재투영을 무력화하여, 월드에 대한 렌더링된 콘텐츠의 안정성을 잃게 하기 때문입니다. 예외는 gaze cursor나 targeting reticle과 같은 작은 UI 요소입니다.

다음은 레이어 유형과 함께 사용할 space에 대한 몇 가지 모범 사례입니다.

5. 렌더링

5.1. XRSubImage

XRSubImage 객체는 GPU 텍스처의 어떤 viewport를 사용할지 나타냅니다.
[Exposed=Window] interface XRSubImage {
  [SameObject] readonly attribute XRViewport viewport;
};

NOTE: 이 클래스는 향후 확장을 수용하도록 설계되었습니다

viewport 속성은 sub image를 렌더링할 때 사용할 XRViewport를 반환합니다.

5.2. XRWebGLSubImage

XRWebGLSubImage 객체는 레이어 렌더링 중에 사용됩니다.
[Exposed=Window] interface XRWebGLSubImage : XRSubImage {
  [SameObject] readonly attribute WebGLTexture colorTexture;
  [SameObject] readonly attribute WebGLTexture? depthStencilTexture;
  [SameObject] readonly attribute WebGLTexture? motionVectorTexture;

  readonly attribute unsigned long? imageIndex;
  readonly attribute unsigned long colorTextureWidth;
  readonly attribute unsigned long colorTextureHeight;
  readonly attribute unsigned long? depthStencilTextureWidth;
  readonly attribute unsigned long? depthStencilTextureHeight;
  readonly attribute unsigned long? motionVectorTextureWidth;
  readonly attribute unsigned long? motionVectorTextureHeight;
};

colorTexture 속성은 XRCompositionLayer에 대한 컬러 opaque texture를 반환합니다.

depthStencilTexture 속성은 XRCompositionLayer에 대한 depth/stencil opaque texture를 반환합니다. 레이어가 depth/stencil 없이 생성된 경우, 이 속성은 null을 반환합니다.

motionVectorTexture 속성은 XRProjectionLayer에 대한 motion opaque texture를 반환합니다. XRSessionspace-warp feature descriptor 없이 생성되었거나 레이어가 XRProjectionLayer가 아닌 경우, 이 속성은 null을 반환해야 합니다.

imageIndex 속성은 texture array 안의 오프셋을 반환합니다. texture-array로 요청된 레이어에 대해서만 유효합니다.

colorTextureWidthdepthStencilTextureHeight 속성은 GL depth attachment의 너비와 높이를 픽셀 단위로 반환합니다

depthStencilTextureWidthcolorTextureHeight 속성은 GL color attachment의 너비와 높이를 픽셀 단위로 반환합니다. 레이어가 depth/stencil 없이 생성된 경우, 이 속성은 null을 반환합니다.

motionVectorTextureWidthmotionVectorTextureHeight 속성은 GL motion vector attachment의 너비와 높이를 픽셀 단위로 반환합니다. XRSessionspace-warp feature descriptor 없이 생성되었거나 레이어가 XRProjectionLayer가 아닌 경우, 이 속성들은 null을 반환해야 합니다.

5.3. XRTextureType

XRTextureType enum은 어떤 유형의 텍스처가 할당되는지를 정의합니다.
enum XRTextureType {
  "texture",
  "texture-array"
};

6. GPU 레이어 및 뷰 생성

6.1. 개요

레이어가 생성되면, 일반적으로 텍스처인 GPU 리소스가 뒷받침하며, 이는 웹 플랫폼의 그래픽 API 중 하나가 제공합니다. 레이어의 GPU 리소스를 제공하는 API를 지정하기 위해 해당 API에 대한 XRWebGLBinding을 생성해야 합니다. 각 그래픽 API에는 레이어 생성에 context를 사용하기 전에 충족되어야 하는 고유한 요구 사항이 있을 수 있습니다. 예를 들어, WebGLRenderingContextXRWebGLBinding 인스턴스의 생성자에 전달되기 전에 xrCompatible 플래그가 설정되어 있어야 합니다.

XRSession과 그래픽 API 사이의 모든 상호작용, 예를 들어 텍스처를 할당하거나 가져오는 동작은 이 XRWebGLBinding 인스턴스를 통해 이루어지며, 상호작용의 정확한 메커니즘은 일반적으로 API별로 다릅니다. 이를 통해 WebXR API의 나머지 부분은 그래픽 API에 구애받지 않으며, 향후 렌더링 기술의 발전에 더 쉽게 적응할 수 있습니다.

XRWebGLBinding 인스턴스를 획득하면, 이를 사용하여 다양한 XRCompositionLayer를 생성할 수 있습니다. 해당 인스턴스가 생성한 모든 레이어는 이후 각 프레임마다 관련 GPU 리소스를 질의할 수 있으며, 이는 일반적으로 네이티브 API의 텍스처 인터페이스일 것으로 예상됩니다.

여러 레이어 유형은 XRWebGLBinding 인스턴스의 create____Layer 계열 메서드로 생성됩니다. depth buffer 또는 alpha channel을 할당할지 여부와 같은 필요한 그래픽 리소스에 대한 정보는 레이어 생성 시 전달되며, 레이어의 수명 동안 변경할 수 없습니다. 이 메서드는 관련 XRCompositionLayer 유형을 반환합니다.

XRSession이 "layers" feature descriptor로 생성된 경우, 모든 레이어 유형을 지원해야 합니다. 레이어 유형이 지원되지 않으면 해당 생성 메서드는 예외를 throw해야 합니다. XRProjectionLayer는 "layers" feature descriptor로 생성되었는지 여부와 관계없이, 모든 XRSession에서 지원되어야 합니다.

6.2. Opaque 텍스처

WebXR GPU 레이어를 사용할 때, XRWebGLBinding 객체는 color 및 depth/stencil attachment에 대한 opaque texture 인스턴스를 반환합니다.

opaque texture는 다음 변경 사항을 제외하고 표준 WebGLTexture와 동일하게 동작합니다.

opaque texture에 첨부된 버퍼는 clearOnAccesstrue일 때, 각 XR animation frame에서 getViewSubImage() 또는 getSubImage()의 첫 번째 호출을 처리하는 동안 아래 표의 값으로 지워져야 합니다. clearOnAccessfalse이면, opaque texture에 첨부된 버퍼는 처음 접근될 때 지워져야 합니다. 이후 프레임에서의 후속 접근은 버퍼를 지우지 않을 수 있습니다.

버퍼 Clear 값
Color (0, 0, 0, 0)
Depth 1.0
Stencil 0

opaque texture2개 이상의 mipLevels로 생성된 경우, 작성자는 모든 mip 레벨을 채워야 합니다. 사용자 에이전트는 자신이 mip 레벨을 생성해야 한다고 가정해서는 안 됩니다.

NOTE: opaque textures는 레이어가 생성될 때 allocate color texturesallocate depth textures 알고리즘을 사용하여 할당됩니다. 이 사전 할당의 부수 효과는 동일한 매개변수로 getSubImage()getViewSubImage()를 호출하면 항상 동일한 텍스처 객체가 반환된다는 것입니다.

NOTE: opaque textures의 치수나 형식 변경은 허용되지 않습니다. GL 명령은 texel 값과 텍스처 매개변수만 변경할 수 있습니다. WebGLTexture에 다음 명령 중 하나를 사용하면, 치수나 형식에 영향을 주지 않더라도 INVALID_OPERATION 오류가 생성됩니다: TexImage*, CompressedTexImage*, CopyTexImage* 및 TexStorage*. OpenGL ES 3.0 명세의 "Immutable-Format Texture Images" 절은 이러한 제한을 더 자세히 정의합니다.

레이어의 리소스(예: 메모리) 할당은 WebGL과 동일한 메커니즘을 통해 수행되어야 합니다.

XRLayerRGBA 또는 RGB colorFormat으로 할당된 경우, 그 colorTexturesRGBA 또는 RGBWebGLRenderingContext context에 노출되어야 합니다. 그러나 XR CompositorcolorTextures의 픽셀을 SRGB8_ALPHA8 또는 SRGB8 colorFormat에 있는 것처럼 취급해야 합니다.

NOTE: 이는 XR CompositorcolorTextures를 처리할 때 linear RGBA 또는 RGB에서 어떤 gamma 변환도 수행해서는 안 된다는 의미입니다. 그렇지 않으면 최종 렌더링의 픽셀이 너무 밝게 보이며, 일반 2D WebGLRenderingContext context에서의 렌더링과 일치하지 않습니다.

6.3. XRProjectionLayerInit

XRProjectionLayerInit dictionary는 XRProjectionLayer가 어떻게 초기화되는지를 설명하는 구성 가능한 값의 집합을 나타냅니다.
dictionary XRProjectionLayerInit {
  XRTextureType textureType = "texture";
  GLenum colorFormat = 0x1908; // RGBA
  GLenum depthFormat = 0x1902; // DEPTH_COMPONENT
  double scaleFactor = 1.0;
  boolean clearOnAccess = true;
};

textureType 속성은 레이어가 가질 텍스처의 유형을 정의합니다.

colorFormat 속성은 color texture 데이터의 데이터 유형을 정의합니다.

다음은 XR Compositor가 지원해야 하는 projection 레이어의 color format 목록입니다.

WebGL2 context의 경우 다음 추가 형식이 지원됩니다.

depthFormat 속성은 depth texture 데이터의 데이터 유형을 정의합니다. depthFormat0이면 레이어는 depth/stencil texture를 제공하지 않습니다.

다음은 XR Compositor가 지원해야 하는 projection 레이어의 depth format 목록입니다.

'WEBGL_depth_texture' extension이 활성화된 WebGLRenderingContext context 또는 WebGL2 context의 경우:

extension이 활성화되지 않은 경우, depth texture 요청은 무시됩니다.

NOTE: 작성자가 depth texture를 기대할 수 있으므로 혼란스러울 수 있습니다. 가능하면 texture가 생성되지 않은 이유를 포함한 경고를 제공하세요.

WebGL2RenderingContext context의 경우 다음 추가 형식이 지원됩니다.

scaleFactor 속성은 레이어 attachment의 해상도를 결정할 때 sessionrecommended WebGL framebuffer resolution에 곱해야 하는 값을 정의합니다.

clearOnAccess 속성은 이 레이어와 관련된 texture가 초기 프레임에서 지워져야 하는지, 또는 매 프레임마다 지워져야 하는지를 정의합니다.

NOTE: XRProjectionLayerInit dictionary는 XRLayerInit처럼 mipLevels를 구성하는 기능을 지원하지 않습니다. 사용자 에이전트가 projection 레이어에서 mipmapping을 지원하려는 경우, mips가 포함된 texture를 자유롭게 할당할 수 있습니다. 이 경우 모든 mip 레벨을 생성할 책임은 작성자가 아니라 사용자 에이전트에게 있습니다.

6.4. XRLayerInit

XRLayerInit dictionary는 XRQuadLayer, XRCylinderLayer, XREquirectLayerXRCubeLayer에 대한 공통 구성 가능 값의 집합을 나타냅니다.
dictionary XRLayerInit {
  required XRSpace space;
  XRTextureType textureType = "texture";
  GLenum colorFormat = 0x1908; // RGBA
  GLenum? depthFormat;
  unsigned long mipLevels = 1;
  required unsigned long viewPixelWidth;
  required unsigned long viewPixelHeight;
  XRLayerLayout layout = "mono";
  boolean isStatic = false;
  boolean clearOnAccess = true;
};

space 속성은 사용자의 물리적 환경과의 공간적 관계를 정의합니다.

textureType 속성은 레이어 텍스처의 유형을 정의합니다. XR Compositor는 다음을 지원해야 합니다.

WebGL2RenderingContext의 경우 다음 추가 유형이 지원됩니다.

colorFormat 속성은 color texture 데이터의 데이터 유형을 정의합니다.

다음은 XR Compositor가 지원해야 하는 non-projection 레이어의 color format 목록입니다.

WebGL2 context의 경우 다음 추가 형식이 지원됩니다.

'WEBGL_compressed_texture_etc' extension이 활성화된 context의 경우 다음 추가 형식이 지원됩니다.

'WEBGL_compressed_texture_astc' extension이 활성화된 context의 경우 해당 extension의 모든 형식이 지원됩니다.

depthFormat 속성은 depth texture 데이터의 데이터 유형을 정의합니다. depthFormat이 제공되지 않으면 레이어는 depth/stencil texture를 제공하지 않습니다.

다음은 XR Compositor가 지원해야 하는 non-projection 레이어의 depth format 목록입니다.

'WEBGL_depth_texture' extension이 활성화된 WebGLRenderingContext context 또는 WebGL2 context의 경우:

WebGL2RenderingContext context의 경우 다음 추가 형식이 지원됩니다.

mipLevels 속성은 color 및 texture 데이터에서 원하는 mip 레벨 수를 정의합니다. 사용자 에이전트가 요청된 수를 생성할 수 없는 경우 더 적게 생성할 수 있습니다. 작성자는 실제 mip 레벨 수를 확인하기 위해 mipLevels를 질의해야 합니다.

viewPixelWidthviewPixelHeight 속성은 XRCompositionLayer의 직사각형 치수를 정의합니다.

layout 속성은 레이어의 레이아웃을 정의합니다.

clearOnAccess 속성은 이 레이어와 관련된 texture가 초기 프레임에서 지워져야 하는지, 또는 매 프레임마다 지워져야 하는지를 정의합니다.

6.5. XRQuadLayerInit

XRQuadLayerInit dictionary는 XRQuadLayer가 어떻게 초기화되는지를 설명하는 구성 가능한 값의 집합을 나타냅니다.

dictionary XRQuadLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float width = 1.0;
  float height = 1.0;
};

6.6. XRCylinderLayerInit

XRCylinderLayerInit dictionary는 XRCylinderLayer가 어떻게 초기화되는지를 설명하는 구성 가능한 값의 집합을 나타냅니다.

dictionary XRCylinderLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float radius = 2.0;
  float centralAngle = 0.78539;
  float aspectRatio = 2.0;
};

centralAngle의 기본값은 π / 4입니다.

6.7. XREquirectLayerInit

XREquirectLayerInit dictionary는 XREquirectLayer가 어떻게 초기화되는지를 설명하는 구성 가능한 값의 집합을 나타냅니다.

dictionary XREquirectLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float radius = 0;
  float centralHorizontalAngle = 6.28318;
  float upperVerticalAngle = 1.570795;
  float lowerVerticalAngle = -1.570795;
};

centralHorizontalAngle의 기본값은 2π입니다. upperVerticalAngle의 기본값은 π/2입니다. lowerVerticalAngle의 기본값은 -π/2입니다.

6.8. XRCubeLayerInit

XRCubeLayerInit dictionary는 XRCubeLayer가 어떻게 초기화되는지를 설명하는 구성 가능한 값의 집합을 나타냅니다.

dictionary XRCubeLayerInit : XRLayerInit {
  DOMPointReadOnly? orientation;
};

6.9. XRWebGLBinding

XRWebGLBinding 객체는 GPU 백엔드를 가지는 레이어를 생성하는 데 사용됩니다.
[Exposed=Window] interface XRWebGLBinding {
  constructor(XRSession session, XRWebGLRenderingContext context);

  readonly attribute double nativeProjectionScaleFactor;
  readonly attribute boolean usesDepthValues;

  XRProjectionLayer createProjectionLayer(optional XRProjectionLayerInit init = {});
  XRQuadLayer createQuadLayer(optional XRQuadLayerInit init = {});
  XRCylinderLayer createCylinderLayer(optional XRCylinderLayerInit init = {});
  XREquirectLayer createEquirectLayer(optional XREquirectLayerInit init = {});
  XRCubeLayer createCubeLayer(optional XRCubeLayerInit init = {});

  XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
  XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);

  undefined foveateBoundTexture(GLenum target, float fixed_foveation);
};

init dictionary는 optional이어서는 안 됩니다. 이는 bikeshed issue 1566입니다.

XRWebGLBinding에는 XRWebGLRenderingContext 유형의 context 객체가 있으며, 이는 WebGLRenderingContext 또는 WebGL2RenderingContext의 인스턴스입니다.

XRWebGLBinding에는 연결된 session이 있으며, 이는 생성 시 사용된 XRSession입니다.

XRWebGLBinding에는 내부 WeakSet foveatedTextures가 있으며, 이는 foveateBoundTexture를 호출할 때 지정된 target에 바인딩된 텍스처에 대한 약한 참조를 보관합니다.

NOTE: 둘 이상의 XRWebGLBinding를 생성할 수 있습니다. XRWebGLBinding 인스턴스로 생성된 모든 레이어는, 둘 다 동일한 session 및 동일한 context로 생성된 경우 다른 XRWebGLBinding 인스턴스와 함께 사용할 수 있습니다. 레이어 또는 XRWebGLSubImage 인스턴스의 수명은 이를 생성한 XRWebGLBinding의 수명에 묶이지 않습니다.

XRWebGLBinding을 통해 생성된 각 XRCompositionLayer에는 color texture에 대한 WebGLTexturesarray인 내부 colorTextures 배열과, depth/stencil texture에 대한 opaque texturesarray인 내부 depthStencilTextures, 그리고 motion texture에 대한 opaque texturesarray인 내부 motionVectorTextures가 있습니다.

XRWebGLBinding을 통해 생성된 각 XRProjectionLayer에는 color texture에 대한 opaque texturesarray인 내부 secondary view용 colorTextures 배열과, secondary views를 렌더링하는 데 사용되는 depth/stencil texture에 대한 opaque texturesarray인 내부 secondary view용 depthStencilTextures 배열이 있습니다.

XRWebGLBinding(session, context) constructor는 호출될 때 다음 단계를 수행해야 합니다.

  1. bindingsessionrelevant realm 안의 new XRWebGLBinding으로 둡니다.

  2. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  3. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  4. sessionimmersive session이 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. contextXR compatible boolean이 false이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. bindingcontextcontext로 초기화합니다.

  7. bindingsessionsession으로 초기화합니다.

  8. bindingsessionbindings에 추가합니다.

  9. binding을 반환합니다.

nativeProjectionScaleFactor function은 sessionrecommended WebGL framebuffer resolution에 곱하여 sessionnative WebGL framebuffer resolution을 산출해야 하는 값을 반환합니다.

크기로 인해 레이아웃이 변경되는 경우의 특수한 UA 동작(예: 요청된 너비가 "stereo-left-right"에서 한계를 초과하는 경우)

usesDepthValues 속성이 false이면, depth buffer attachment가 있더라도 XR Compositor가 값을 사용해서는 안 됨을 나타냅니다. 이 속성이 true이면, depth buffer attachment의 콘텐츠가 XR Compositor에 의해 사용되며, 레이어에 렌더링된 장면을 대표할 것으로 기대됨을 나타냅니다.

XRTextureType textureType, XRWebGLRenderingContext contextXRLayerLayout layout을 사용하여 layout 속성을 결정하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. contextWebGL2RenderingContext가 아니고 textureType"texture-array"이면, TypeError를 throw하고 이 단계를 중단합니다.

  2. textureType"texture-array"이고 session의 list of views 안의 모든 views가 동일한 recommended WebGL color texture resolution을 갖지 않으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. layout"mono"이면, layout을 반환하고 이 단계를 중단합니다.

  4. layout"default"이면, 다음 단계를 실행합니다.

    1. list of views의 크기가 1이면, "mono"를 반환하고 이 단계를 중단합니다.

    2. textureType"texture-array"이면, layout을 반환하고 이 단계를 중단합니다.

  5. layout"default" 또는 "stereo"이고 textureType"texture"이면, 다음 단계를 실행합니다.

    1. 사용자 에이전트가 "stereo-left-right" layout을 선호하면, "stereo-left-right"를 반환하고 이 단계를 중단합니다.

    2. 사용자 에이전트가 "stereo-top-bottom" layout을 선호하면, "stereo-top-bottom"를 반환하고 이 단계를 중단합니다.

  6. layout을 반환합니다.

XRSession session, XRWebGLRenderingContext contextXRLayerLayout layout을 사용하여 최대 scalefactor를 결정하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. largest widthsecondary views를 제외한 sessionlist of views에서 recommended WebGL color texture resolution의 가장 큰 너비로 둡니다.

  2. largest heightsecondary views를 제외한 sessionlist of views에서 recommended WebGL color texture resolution의 가장 큰 높이로 둡니다.

  3. layout"stereo-left-right" layout이면, largest width2를 곱합니다.

  4. layout"stereo-top-bottom" layout이면, largest height2를 곱합니다.

  5. largest view dimensionlargest width 또는 largest height 중 더 큰 값으로 둡니다.

  6. largest texture dimensioncontext가 생성한 WebGLTexture의 가장 큰 치수로 둡니다.

  7. largest texture dimensionlargest view dimension으로 나눈 값을 반환합니다.

XRProjectionLayer layer, XRTextureType textureType, GLenum textureFormat 및 float scaleFactor를 사용하여 projection 레이어용 color texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. arraycontextrelevant realm 안의 new array로 둡니다.

  2. contextlayercontext로 둡니다.

  3. sessionlayersession으로 둡니다.

  4. numViewssecondary views를 제외한 sessionlist of views의 수로 둡니다.

  5. viewsessionlist of views에서 secondary views가 아닌 첫 번째 항목으로 둡니다.

  6. widthviewrecommended WebGL color texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

  7. heightviewrecommended WebGL color texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

  8. textureFormatprojection 레이어용 color format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  9. layerlayout"mono" 또는 "default"인 경우:

    textureType"texture-array"인 경우:
    secondary views를 제외하고 session의 list of views 안의 모든 views가 동일한 recommended WebGL color texture resolution을 갖지 않으면, NotSupportedError를 throw하고 이 단계를 중단합니다.
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, widthheight를 사용하여 numViews 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.
    array를 반환하고 이 단계를 중단합니다.
    그렇지 않은 경우
    sessionlist of views 안의 각 view에 대해:
    1. viewsecondary view이면 계속합니다.

    2. widthviewrecommended WebGL color texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

    3. heightviewrecommended WebGL color texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

    4. texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, widthheight를 사용하여 TEXTURE_2D texture로 생성됩니다.

    5. texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

    6. texturearray에 추가합니다.

    array를 반환하고 이 단계를 중단합니다.
  10. secondary views를 제외하고 session의 list of views 안의 views가 모두 동일한 recommended WebGL color texture resolution을 갖지 않으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  11. layerlayoutstereo-left-right이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, numViewswidth를 곱한 값 및 height를 사용하여 textureType texture로 생성됩니다.

  12. layerlayoutstereo-top-bottom이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, widthnumViewsheight를 곱한 값을 사용하여 textureType texture로 생성됩니다.

  13. opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

  14. array를 반환합니다.

XRProjectionLayer layer, XRTextureType textureType, GLenum textureFormat 및 float scaleFactor를 사용하여 projection 레이어용 depth texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. arraycontextrelevant realm 안의 new array로 둡니다.

  2. contextlayercontext로 둡니다.

  3. sessionlayersession으로 둡니다.

  4. textureFormat0이면, array를 반환하고 이 단계를 중단합니다.

  5. contextWebGLRenderingContext이고 WEBGL_depth_texture extensioncontext에서 활성화되어 있지 않으면, array를 반환하고 이 단계를 중단합니다.

  6. textureFormatprojection 레이어용 depth format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  7. numViewssecondary views를 제외한 sessionlist of views의 수로 둡니다.

  8. viewsessionlist of views에서 secondary view가 아닌 첫 번째 항목으로 둡니다.

  9. widthviewrecommended WebGL depth texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

  10. heightviewrecommended WebGL depth texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

  11. layerlayout"mono" 또는 "default"인 경우:

    textureType"texture-array"인 경우:
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, stencil, widthheight를 사용하여 numViews 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.
    array를 반환하고 이 단계를 중단합니다.
    그렇지 않은 경우
    sessionlist of views 안의 각 view에 대해:
    1. viewsecondary view이면 계속합니다.

    2. widthviewrecommended WebGL depth texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

    3. heightviewrecommended WebGL depth texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

    4. texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, stencil, widthheight를 사용하여 TEXTURE_2D texture로 생성됩니다.

    5. texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

    6. texturearray에 추가합니다.

    array를 반환하고 이 단계를 중단합니다.
  12. secondary views를 제외하고 session의 list of views 안의 views가 모두 동일한 recommended WebGL color texture resolution을 갖지 않으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  13. layerlayoutstereo-left-right이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, stencil, numViewswidth를 곱한 값 및 height를 사용하여 textureType texture로 생성됩니다.

  14. layerlayoutstereo-top-bottom이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, textureFormat, stencil, widthnumViewsheight를 곱한 값을 사용하여 textureType texture로 생성됩니다.

  15. opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

  16. array를 반환합니다.

XRProjectionLayer layer를 사용하여 projection 레이어용 motion vector texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. arraycontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  2. contextlayercontext로 둡니다.

  3. sessionlayersession으로 둡니다.

  4. session이 "space-warp" feature descriptor로 생성되지 않았다면, array를 반환하고 이 단계를 중단합니다.

  5. contextWebGLRenderingContext이고 WEBGL_depth_texture extensioncontext에서 활성화되어 있지 않으면, array를 반환하고 이 단계를 중단합니다.

  6. numViewssecondary views를 제외한 sessionlist of views의 수로 둡니다.

  7. viewsessionlist of views에서 secondary view가 아닌 첫 번째 항목으로 둡니다.

  8. widthviewrecommended motion vector texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

  9. heightviewrecommended motion vector texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

  10. layerlayout"mono" 또는 "default"인 경우:

    textureType"texture-array"인 경우:
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, RGBA16F, widthheight를 사용하여 numViews 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.
    array를 반환하고 이 단계를 중단합니다.
    그렇지 않은 경우
    sessionlist of views 안의 각 view에 대해:
    1. viewsecondary view이면 계속합니다.

    2. widthviewrecommended motion vector texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

    3. heightviewrecommended motion vector texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

    4. texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, RGBA16F, widthheight를 사용하여 TEXTURE_2D texture로 생성됩니다.

    5. texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

    6. texturearray에 추가합니다.

    array를 반환하고 이 단계를 중단합니다.
  11. secondary views를 제외하고 session의 list of views 안의 views가 모두 동일한 recommended motion vector texture resolution을 갖지 않으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  12. layerlayoutstereo-left-right이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, RGBA16F, numViewswidth를 곱한 값 및 height를 사용하여 textureType texture로 생성됩니다.

  13. layerlayoutstereo-top-bottom이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 context, RGBA16F, widthnumViewsheight를 곱한 값을 사용하여 textureType texture로 생성됩니다.

  14. opaque texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

  15. array를 반환합니다.

XRProjectionLayer layer, XRTextureType textureType, GLenum textureFormat 및 float scaleFactor를 사용하여 secondary view용 color texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. contextlayercontext로 둡니다.

  2. sessionlayersession으로 둡니다.

  3. arraycontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  4. textureFormatprojection 레이어용 color format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  5. sessionlist of views 안의 각 view에 대해:

    1. viewsecondary view가 아니면 계속합니다.

    2. widthviewrecommended WebGL color texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

    3. heightviewrecommended WebGL color texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

    4. texture를 다음과 같이 초기화합니다.

      textureType"texture-array"인 경우:
      texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, widthheight를 사용하여 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, widthheight를 사용하여 TEXTURE_2D texture로 생성됩니다.
    5. texture가 어떤 이유로든 생성될 수 없으면, OperationError를 throw하고 이 단계를 중단합니다.

    6. texturearray에 추가합니다.

  6. array를 반환하고 이 단계를 중단합니다.

XRProjectionLayer layer, XRTextureType textureType, GLenum textureFormat 및 float scaleFactor를 사용하여 secondary view용 depth texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. contextlayercontext로 둡니다.

  2. sessionlayersession으로 둡니다.

  3. textureFormat0이면, array를 반환하고 이 단계를 중단합니다.

  4. contextWebGLRenderingContext이고 WEBGL_depth_texture extensioncontext에서 활성화되어 있지 않으면, array를 반환하고 이 단계를 중단합니다.

  5. textureFormatprojection 레이어용 depth format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  6. arraycontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  7. sessionlist of views 안의 각 view에 대해:

    1. viewsecondary view가 아니면 계속합니다.

    2. widthviewrecommended WebGL depth texture resolution의 너비에 scaleFactor를 곱한 값으로 둡니다.

    3. heightviewrecommended WebGL depth texture resolution의 높이에 scaleFactor를 곱한 값으로 둡니다.

    4. texture를 다음과 같이 초기화합니다.

      textureType"texture-array"인 경우:
      texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, stencil, widthheight를 사용하여 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      texturecontextrelevant realm 안의 new opaque texture 인스턴스로 둡니다. 이는 context, textureFormat, stencil, widthheight를 사용하여 TEXTURE_2D texture로 생성됩니다.
    5. texturearray에 추가합니다.

  8. array를 반환하고 이 단계를 중단합니다.

scaleFactor는 secondary view용으로 다시 계산되어야 합니다.

XRCompositionLayer layer, XRTextureType textureTypeXRLayerInit init을 사용하여 color texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. arraycontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  2. contextlayercontext로 둡니다.

  3. initcolorFormatnon-projection 레이어용 color format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  4. initmipLevels1보다 작으면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. initmipLevels1보다 크고 viewPixelWidthviewPixelHeight2의 거듭제곱이 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다

  6. layerlayout"mono"인 경우:

    textureType"texture-array"인 경우:
    array를 이 contextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 1개의 내부 texture를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    그렇지 않은 경우
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_2D texture로 생성됩니다.
  7. layerlayout"stereo"인 경우:

    textureType"texture-array"인 경우:
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 2개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    array를 반환하고 이 단계를 중단합니다.
    그렇지 않은 경우
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 2개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_2D texture로 생성됩니다.
    array를 반환하고 이 단계를 중단합니다.
  8. layerlayoutstereo-left-right이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidth의 두 배 및 viewPixelHeight 값을 사용하여 textureType texture로 생성됩니다.

  9. layerlayoutstereo-top-bottom이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight의 두 배 값을 사용하여 textureType texture로 생성됩니다.

  10. array를 반환합니다.

XRCompositionLayer layer, XRTextureType textureTypeXRLayerInit init을 사용하여 depth texture를 할당하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. arraycontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  2. contextlayercontext로 둡니다.

  3. initdepthFormat이 설정되어 있지 않으면, array를 반환하고 이 단계를 중단합니다.

  4. initdepthFormatnon-projection 레이어용 depth format 목록에 없으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  5. initmipLevels1보다 작으면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. initmipLevels1보다 크고 viewPixelWidthviewPixelHeight2의 거듭제곱이 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  7. layerlayout"mono"인 경우:

    textureType"texture-array"인 경우:
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 1개의 내부 texture를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    그렇지 않은 경우
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_2D texture로 생성됩니다.
  8. layerlayout"stereo"인 경우:

    textureType"texture-array"인 경우:
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 2개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
    array를 반환하고 이 단계를 중단합니다.
    그렇지 않은 경우
    arraycontextrelevant realm 안의 new opaque texture 인스턴스 2개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_2D texture로 생성됩니다.
    array를 반환하고 이 단계를 중단합니다.
  9. layerlayoutstereo-left-right이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidth의 두 배 및 viewPixelHeight 값을 사용하여 textureType texture로 생성됩니다.

  10. layerlayoutstereo-top-bottom이면, arraycontextrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight의 두 배 값을 사용하여 textureType texture로 생성됩니다.

  11. array를 반환합니다.

createProjectionLayer(optional XRProjectionLayerInit init) method는 새 XRProjectionLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. contextthis context로 둡니다.

  3. layerthisrelevant realm 안의 new XRProjectionLayer로 둡니다.

  4. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. sessioncontextlayer에 대해 initialize a composition layer를 실행합니다.

  7. layerisStaticfalse로 초기화합니다.

  8. layerignoreDepthValues를 다음과 같이 초기화합니다.

    initdepthFormatfalse이고 XR Compositor가 depth 값을 사용할 경우
    layerignoreDepthValuesfalse로 초기화합니다
    그렇지 않은 경우
    layerignoreDepthValuestrue로 초기화합니다
  9. layerfixedFoveation0으로 초기화합니다.

  10. layoutinittextureType, context"default"를 사용하여 layout 속성을 결정한 결과로 둡니다.

  11. maximum scalefactorsession, contextlayout최대 scalefactor를 결정한 결과로 둡니다.

  12. scaleFactormaximum scalefactor보다 크면, scaleFactormaximum scalefactor로 설정합니다.

  13. layerlayoutlayout으로 초기화합니다.

  14. layerneedsRedrawtrue로 초기화합니다.

  15. layercolorTextureslayer, inittextureType, initcolorFormatinitscaleFactorprojection 레이어용 color texture를 할당한 결과로 둡니다.

  16. layerdepthStencilTextureslayer, inittextureType, initdepthFormatinitscaleFactorprojection 레이어용 depth texture를 할당한 결과로 둡니다.

  17. layermotionVectorTextureslayer, initdepthFormatinitscaleFactorprojection 레이어용 motion vector texture를 할당한 결과로 둡니다.

  18. secondary view용 colortextures를 다음과 같이 초기화합니다.

    session이 "secondary-views"가 활성화된 상태로 생성된 경우
    secondary view용 colortextureslayer, inittextureType, initcolorFormatinitscaleFactorsecondary view용 color texture를 할당한 결과로 둡니다.
    그렇지 않은 경우
    secondary view용 colortexturesnull로 둡니다.
  19. secondary view용 depthstenciltextures를 다음과 같이 초기화합니다.

    session이 "secondary-views"가 활성화된 상태로 생성된 경우
    secondary view용 depthstenciltextureslayer, inittextureType, initdepthFormatinitscaleFactorsecondary view용 depth texture를 할당한 결과로 둡니다.
    그렇지 않은 경우
    secondary view용 depthstenciltexturesnull로 둡니다.
  20. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  21. layer를 반환합니다.

createQuadLayer(XRQuadLayerInit init) method는 새 XRQuadLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. contextthis context로 둡니다.

  4. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. layout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  7. layerthisrelevant realm 안의 new XRQuadLayer로 둡니다.

  8. sessioncontextlayer에 대해 initialize a composition layer를 실행합니다.

  9. layerinit으로 initialize a quad layer를 실행합니다.

  10. layoutinittextureType, contextinitlayout을 사용하여 layout 속성을 결정한 결과로 둡니다.

  11. layerlayoutlayout으로 초기화합니다.

  12. layerneedsRedrawtrue로 초기화합니다.

  13. layercolorTextureslayer, inittextureTypeinit으로 color texture를 할당한 결과로 둡니다.

  14. layerdepthStencilTextureslayer, inittextureTypeinit으로 depth texture를 할당한 결과로 둡니다.

  15. layermotionVectorTexturescontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  16. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  17. layer를 반환합니다.

createCylinderLayer(XRCylinderLayerInit init) method는 새 XRCylinderLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. contextthis context로 둡니다.

  4. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. layout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  7. layerthisrelevant realm 안의 new XRCylinderLayer로 둡니다.

  8. sessioncontextlayer에 대해 initialize a composition layer를 실행합니다.

  9. layerinit으로 initialize a cylinder layer를 실행합니다.

  10. layoutinittextureType, contextinitlayout을 사용하여 layout 속성을 결정한 결과로 둡니다.

  11. layerlayoutlayout으로 초기화합니다.

  12. layerneedsRedrawtrue로 초기화합니다.

  13. layercolorTextureslayer, inittextureTypeinit으로 color texture를 할당한 결과로 둡니다.

  14. layerdepthStencilTextureslayer, inittextureTypeinit으로 depth texture를 할당한 결과로 둡니다.

  15. layermotionVectorTexturescontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  16. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  17. layer를 반환합니다.

createEquirectLayer(XREquirectLayerLayerInit init) method는 새 XREquirectLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. contextthis context로 둡니다.

  4. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. layout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  7. initspaceXRReferenceSpace 유형의 인스턴스가 아니면, TypeError를 throw하고 이 단계를 중단합니다.

  8. initspace"viewer" type을 가지면, TypeError를 throw하고 이 단계를 중단합니다.

  9. layerthisrelevant realm 안의 new XREquirectLayer로 둡니다.

  10. sessioncontextlayer에 대해 initialize a composition layer를 실행합니다.

  11. layerinit으로 initialize a equirect layer를 실행합니다.

  12. layoutinittextureType, contextinitlayout을 사용하여 layout 속성을 결정한 결과로 둡니다.

  13. layerlayoutlayout으로 초기화합니다.

  14. layerneedsRedrawtrue로 초기화합니다.

  15. layercolorTextureslayer, inittextureTypeinit으로 color texture를 할당한 결과로 둡니다.

  16. layerdepthStencilTextureslayer, inittextureTypeinit으로 depth texture를 할당한 결과로 둡니다.

  17. layermotionVectorTexturescontextnew array로 둡니다. 이 array는 relevant realm 안에 있습니다.

  18. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  19. layer를 반환합니다.

createCubeLayer(XRCubeLayerInit init) method는 새 XRCubeLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. contextthis context로 둡니다.

  4. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. contextWebGL2RenderingContext context가 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. context가 lost이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  7. initspaceXRReferenceSpace 유형의 인스턴스가 아니면, TypeError를 throw하고 이 단계를 중단합니다.

  8. initspace"viewer" type을 가지면, TypeError를 throw하고 이 단계를 중단합니다.

  9. layerthisrelevant realm 안의 new XRCubeLayer로 둡니다.

  10. sessioncontextlayer에 대해 initialize a composition layer를 실행합니다.

  11. layerspaceinitspace로 둡니다.

  12. layerisStaticinitisStatic으로 초기화합니다

  13. layerorientation을 다음과 같이 초기화합니다.

    initorientation이 설정된 경우
    layerorientationinitorientation으로 fromPoint를 실행한 결과로 둡니다.
    그렇지 않은 경우
    layerorientationthisrelevant realm 안의 new DOMPointReadOnly로 둡니다.
  14. layoutinitlayout으로 둡니다.

  15. textureTypeinittextureType으로 둡니다.

  16. layerneedsRedrawtrue로 초기화합니다.

  17. layout"default" 또는 "stereo-left-right" 또는 "stereo-top-bottom"이면, TypeError를 throw하고 이 단계를 중단합니다.

  18. layercolorTextures를 이 XRCubeLayerrelevant realm 안의 new array로 둡니다.

  19. layout 값에 따라 layercolorTextures를 다음과 같이 초기화합니다.

    1. layerlayout"mono"인 경우:

      textureType"texture-array"인 경우:
      colorTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 6개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      colorTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_CUBE_MAP texture로 생성됩니다.
    2. 그렇지 않고, layerlayout"stereo"인 경우:

      textureType"texture-array"인 경우:
      colorTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitcolorFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 12개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      colorTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 2개로 초기화합니다. 이는 contextinitcolorFormat, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_CUBE_MAP texture로 생성됩니다.
  20. layerdepthStencilTextures를 이 XRCubeLayerrelevant realm 안의 new array로 둡니다.

  21. layermotionVectorTextures를 이 XRCubeLayerrelevant realm 안의 new array로 둡니다.

  22. initdepthFormat이 설정되어 있으면, layerdepthStencilTextures를 다음과 같이 초기화합니다.

    1. contextWebGL2RenderingContext가 아니고 WEBGL_depth_texture extensioncontext에서 활성화되어 있지 않으면, TypeError를 throw하고 이 단계를 중단합니다.

    2. layerlayout"mono"인 경우:

      textureType"texture-array"인 경우:
      depthStencilTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 6개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      depthStencilTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_CUBE_MAP texture로 생성됩니다.
    3. 그렇지 않고, layerlayout"stereo"인 경우:

      textureType"texture-array"인 경우:
      depthStencilTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 1개로 초기화합니다. 이는 contextinitdepthFormat, mipLevels, viewPixelWidthviewPixelHeight 값을 사용하여 12개 레이어를 가진 TEXTURE_2D_ARRAY texture로 생성됩니다.
      그렇지 않은 경우
      depthStencilTextures를 이 XRCubeLayerrelevant realm 안의 new opaque texture 인스턴스 2개로 초기화합니다. 이는 contextinitdepthFormat, viewPixelWidthviewPixelHeight 값을 사용하여 TEXTURE_CUBE_MAP texture로 생성됩니다.
  23. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  24. layer를 반환합니다.

textureType"texture-array"인 경우, XRCubeLayer는 cube map의 각 면을 저장하기 위해 다음 순서로 6개의 texture layer를 사용해야 합니다. [TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X, TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y, TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z]

textureType"texture-array"이고 layout"stereo"인 경우, 왼쪽 눈의 콘텐츠는 layer index 0부터 저장되어야 하며 오른쪽 눈의 콘텐츠는 layer index 6부터 저장되어야 합니다.

cubemap 크기가 어떻게 결정되는지 정의하세요.

space는 어떻게 처리해야 하는가. cubemap의 가장자리까지 걸어갈 수 있는가?

orientation의 초기 상태를 결정하세요.

XRCompositionLayer layerXRFrame frame 매개변수로 XRWebGLBinding bindingXRWebGLSubImage 생성 함수의 상태를 검증하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. framesessionlayersession과 같지 않으면, false를 반환하고 이 단계를 중단합니다.

  2. frameactive boolean이 false이면, false를 반환하고 이 단계를 중단합니다.

  3. frameanimationFrame boolean이 false이면, false를 반환하고 이 단계를 중단합니다.

  4. bindingsessionlayersession과 같지 않으면, false를 반환하고 이 단계를 중단합니다.

  5. bindingcontextlayercontext와 같지 않으면, false를 반환하고 이 단계를 중단합니다.

  6. layercolorTextures array가 비어 있거나 없으면, false를 반환하고 이 단계를 중단합니다.

  7. layerisStatictrue이고 layerneedsRedrawfalse이면, false를 반환하고 이 단계를 중단합니다.

  8. true를 반환합니다.

opaque texture texture, XRLayerLayout layout, integer offset 및 integer num을 사용하여 XRViewport viewportviewport를 초기화하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. viewportx0으로 설정합니다.

  2. viewporty0으로 설정합니다.

  3. viewportwidthtexture의 픽셀 너비로 설정합니다.

  4. viewportheighttexture의 픽셀 높이로 설정합니다.

  5. viewport를 다음과 같이 업데이트합니다.

    layout"stereo-left-right"인 경우
    viewportxtexture의 픽셀 너비에 offset을 곱하고 num으로 나눈 값으로 설정합니다.
    viewportwidthsubimagetexture 픽셀 너비를 num으로 나눈 값으로 설정합니다.
    그렇지 않고 layout"stereo-top-bottom"인 경우
    viewportytexture의 픽셀 높이에 offset을 곱하고 num으로 나눈 값으로 설정합니다.
    viewportheightsubimagetexture 픽셀 높이를 num으로 나눈 값으로 설정합니다.
getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none") method는 새 XRWebGLSubImage를 생성합니다.

이 method가 XRWebGLBinding binding에서 호출되면, 다음 단계를 실행해야 합니다.

  1. subimage를 다음과 같이 초기화합니다.

    getSubImage()가 이전에 동일한 binding, layereye로 호출된 경우, 사용자 에이전트는 다음을 할 수 있습니다.
    subimage를 동일한 인수로 이전 호출에서 반환된 동일한 XRWebGLSubImage 객체로 둡니다.
    그렇지 않은 경우
    subimagethisrelevant realm 안의 new XRWebGLSubImage로 둡니다.
    subimageviewportthisrelevant realm 안의 new XRViewport로 둡니다.
  2. sessionthis session으로 둡니다.

  3. layersessionlayers array 안에 없으면, TypeError를 throw하고 이 단계를 중단합니다.

  4. layer의 type이 XRProjectionLayer이면, TypeError를 throw하고 이 단계를 중단합니다.

  5. layerlayout attribute가 "default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  6. index0으로 둡니다.

  7. layerlayout attribute가 "stereo"인 경우:

    1. eye"none"이면, TypeError를 throw하고 이 단계를 중단합니다.

    2. eye"right"인 경우:

      layerXRCubeLayer type인 경우
      index6으로 설정합니다
      그렇지 않은 경우
      index1로 설정합니다
  8. layerframe으로 XRWebGLSubImage 생성 함수의 상태를 검증한 결과가 false이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  9. subimageimageIndex를 다음과 같이 초기화합니다.

    layer"texture-array" textureType으로 생성된 경우
    subimageimageIndexindex로 초기화합니다.
    그렇지 않은 경우
    subimageimageIndex0으로 초기화합니다.
  10. subimagecolorTexture를 다음과 같이 초기화합니다.

    layer"texture" textureType으로 생성된 경우
    subimagecolorTexturelayercolorTextures array에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않은 경우
    subimagecolorTexturelayercolorTextures array의 첫 번째 요소로 초기화합니다.
  11. subimagedepthStencilTexture를 다음과 같이 초기화합니다.

    layerdepthStencilTextures가 빈 array인 경우
    subimagedepthStencilTexturenull로 초기화합니다.
    그렇지 않고 layer"texture" textureType으로 생성된 경우
    subimagedepthStencilTexturelayerdepthStencilTextures array에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않은 경우
    subimagedepthStencilTexturelayerdepthStencilTextures array의 첫 번째 요소로 초기화합니다.
  12. subimagemotionVectorTexture, motionVectorTextureWidthmotionVectorTextureHeightnull로 초기화합니다.

  13. subimagecolorTextureWidthsubimagecolorTexture의 픽셀 너비로 설정합니다.

  14. subimagecolorTextureHeightsubimagecolorTexture의 픽셀 높이로 설정합니다.

  15. subimagedepthStencilTexturenull이 아니면, subimagedepthStencilTextureWidthdepthStencilTexture array의 첫 번째 texture의 픽셀 너비로 설정합니다.

  16. subimagedepthStencilTexturenull이 아니면, subimagedepthStencilTextureHeightdepthStencilTexture array의 첫 번째 texture의 픽셀 높이로 설정합니다.

  17. viewsPerTexture1로 둡니다.

  18. layerlayout attribute가 "stereo-left-right" 또는 "stereo-top-bottom"이면, viewsPerTexture2로 설정합니다.

  19. subimageviewport에 대해 subimagecolorTexture, layerlayout, indexviewsPerTextureviewport를 초기화합니다.

  20. needsRedrawfalse로 설정하기 위해 task를 queue합니다.

  21. subimage를 반환합니다.

getViewSubImage(XRProjectionLayer layer, XRView view) method는 새 XRWebGLSubImage를 생성합니다.

이 method가 XRWebGLBinding binding에서 호출되면, 다음 단계를 실행해야 합니다.

  1. subimage를 다음과 같이 초기화합니다.

    getViewSubImage()가 이전에 동일한 binding, layerview로 호출된 경우, 사용자 에이전트는 다음을 할 수 있습니다.
    subimage를 동일한 인수로 이전 호출에서 반환된 동일한 XRWebGLSubImage 객체로 둡니다.
    그렇지 않은 경우
    subimagethisrelevant realm 안의 new XRWebGLSubImage로 둡니다.
    subimageviewportthisrelevant realm 안의 new XRViewport로 둡니다.
  2. frameviewframe으로 둡니다.

  3. sessionthis session으로 둡니다.

  4. layerframe으로 XRWebGLSubImage 생성 함수의 상태를 검증한 결과가 false이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  5. layersessionlayers array 안에 없으면, TypeError를 throw하고 이 단계를 중단합니다.

  6. viewactive flag가 false이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  7. index를 다음과 같이 초기화합니다.

    viewsessionlist of viewssecondary view인 경우
    indexprimary views를 제외한 sessionlist of views에서 viewview의 오프셋으로 둡니다.
    그렇지 않은 경우
    indexsecondary views를 제외한 sessionlist of views에서 viewview의 오프셋으로 둡니다.
  8. subimageimageIndex를 다음과 같이 초기화합니다.

    layer"texture-array" textureType으로 생성된 경우:
    subimageimageIndexindex로 초기화합니다.
    그렇지 않은 경우
    subimageimageIndex0으로 초기화합니다.
  9. subimagecolorTexture를 다음과 같이 초기화합니다.

    viewsessionlist of viewssecondary view인 경우
    subimagecolorTexturelayersecondary view용 colorTextures에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않고 layerlayout"default"이고 layer"texture" textureType으로 생성된 경우
    subimagecolorTexturelayercolorTextures array에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않은 경우
    subimagecolorTexturelayercolorTextures array의 첫 번째 요소로 초기화합니다.
  10. subimagedepthStencilTexture를 다음과 같이 초기화합니다.

    layerdepthStencilTextures가 빈 array인 경우
    subimagedepthStencilTexturenull로 초기화합니다.
    그렇지 않고 viewsessionlist of viewssecondary view인 경우
    subimagecolorTexturelayersecondary view용 depthStencilTextures에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않고 layerlayout"default"이고 layer"texture" textureType으로 생성된 경우
    subimagedepthStencilTexturelayerdepthStencilTextures array에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않은 경우
    subimagedepthStencilTexturelayerdepthStencilTextures array의 첫 번째 요소로 초기화합니다.
  11. subimagemotionVectorTexture를 다음과 같이 초기화합니다.

    layermotionVectorTextures가 빈 array이거나 viewsessionlist of viewssecondary view인 경우
    subimagemotionVectorTexturenull로 초기화합니다.
    그렇지 않고 layer"texture" textureType으로 생성된 경우
    subimagemotionVectorTexturelayermotionVectorTextures array에서 index 오프셋의 요소로 초기화합니다.
    그렇지 않은 경우
    subimagemotionVectorTexturelayermotionVectorTextures array의 첫 번째 요소로 초기화합니다.
  12. subimagecolorTextureWidthsubimagecolorTexture의 픽셀 너비로 설정합니다.

  13. subimagecolorTextureHeightsubimagecolorTexture의 픽셀 높이로 설정합니다.

  14. subimagedepthStencilTexturenull이 아니면, subimagedepthStencilTextureWidthdepthStencilTexture array의 첫 번째 texture의 픽셀 너비로 설정합니다.

  15. subimagedepthStencilTexturenull이 아니면, subimagedepthStencilTextureHeightdepthStencilTexture array의 첫 번째 texture의 픽셀 높이로 설정합니다.

  16. subimagemotionVectorTexturenull이 아니면, subimagemotionVectorTextureWidthmotionVectorTexture array의 첫 번째 texture의 픽셀 너비로 설정합니다.

  17. subimagemotionVectorTexturenull이 아니면, subimagemotionVectorTextureHeightmotionVectorTexture array의 첫 번째 texture의 픽셀 높이로 설정합니다.

  18. subimageviewport에 대해 subimagecolorTexture, layerlayout, indexsessionlist of views의 수로 viewport를 초기화합니다.

  19. needsRedrawfalse로 설정합니다.

  20. subimage를 반환합니다

NOTE: 세션은 getSubImage()getViewSubImage() 호출을 경험이 WebGL을 사용하여 그리기를 시작하는 시점까지 지연하려고 해야 합니다. 일반적으로 이는 게임 로직이 실행된 후입니다. 특정 사용자 에이전트에서는 CPU 및 GPU 의존 코드에 대한 별도 단계를 두면 시스템 리소스를 동적으로 최적화할 수 있습니다.

foveateBoundTexture(GLenum target, float fixed_foveation)는 현재 바인딩된 texture 또는 texture array에 foveation을 적용합니다.

이 method가 XRWebGLBinding binding에서 호출되면, 다음 단계를 실행해야 합니다.

  1. targetTEXTURE_2D 또는 TEXTURE_2D_ARRAY type이 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  2. 사용자 에이전트 또는 장치가 foveation을 지원하지 않으면, 이 단계를 중단합니다.

  3. fixed_foveation0보다 작으면, 이를 0으로 설정합니다.

  4. fixed_foveation1보다 크면, 이를 1로 설정합니다.

  5. bindingcontext에서 target에 texture가 바인딩되어 있지 않으면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. fixedFoveation과 동일한 알고리즘을 사용하여 bindingcontext를 통해 fixed_foveationtarget에 적용합니다.

  7. bindingcontext를 사용하여 target에 바인딩된 texture를 foveatedTextures에 추가합니다.

NOTE: foveation의 효과는 즉시 적용됩니다.

XRLayerlayers array의 멤버인 경우, 이전 XR animation frame 이후 다음 중 하나 이상이 발생했다면, XR animation frame이 완료된 직후 immersive XR device에 표시되어야 합니다.

opaque framebuffer 또는 colorTexture texture가 immersive XR device에 표시되기 전에, 사용자 에이전트는 모든 rendering operation이 flushed되었는지 보장해야 합니다.

7. Video layer 생성

7.1. XRMediaLayerInit

XRMediaLayerInit dictionary는 video를 포함하는 XRCompositionLayer가 어떻게 초기화되는지를 설명하는 configurable 값들의 집합을 나타냅니다.
dictionary XRMediaLayerInit {
  required XRSpace space;
  XRLayerLayout layout = "mono";
  boolean invertStereo = false;
};

space attribute는 사용자의 물리적 환경과의 공간적 관계를 정의합니다.

layout attribute는 XRCompositionLayer에서 video의 layout을 정의합니다.

invertStereo attribute는 video에서 각 view의 자연스러운 위치가 반전되어야 하는지를 정의합니다.

7.2. XRMediaQuadLayerInit

XRMediaQuadLayerInit dictionary는 video를 포함하는 XRQuadLayer가 어떻게 초기화되는지를 설명하는 configurable 값들의 집합을 나타냅니다.
dictionary XRMediaQuadLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float? width;
  float? height;
};

7.3. XRMediaCylinderLayerInit

XRMediaCylinderLayerInit dictionary는 video를 포함하는 XRCylinderLayer가 어떻게 초기화되는지를 설명하는 configurable 값들의 집합을 나타냅니다.
dictionary XRMediaCylinderLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float radius = 2.0;
  float centralAngle = 0.78539;
  float? aspectRatio;
};

7.4. XRMediaEquirectLayerInit

XRMediaEquirectLayerInit dictionary는 video를 포함하는 XREquirectLayer가 어떻게 초기화되는지를 설명하는 configurable 값들의 집합을 나타냅니다.
dictionary XRMediaEquirectLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float radius = 0.0;
  float centralHorizontalAngle = 6.28318;
  float upperVerticalAngle = 1.570795;
  float lowerVerticalAngle = -1.570795;
};

7.5. XRMediaBinding

XRMediaBinding 객체는 HTMLVideoElement의 콘텐츠를 표시하는 layer를 생성하는 데 사용됩니다.
[Exposed=Window] interface XRMediaBinding {
  constructor(XRSession session);

  XRQuadLayer createQuadLayer(HTMLVideoElement video, optional XRMediaQuadLayerInit init = {});
  XRCylinderLayer createCylinderLayer(HTMLVideoElement video, optional XRMediaCylinderLayerInit init = {});
  XREquirectLayer createEquirectLayer(HTMLVideoElement video, optional XRMediaEquirectLayerInit init = {});
};

init dictionary들은 optional이어서는 안 됩니다. 이는 bikeshed issue 1566입니다.

XRMediaBinding에는 연결된 session이 있으며, 이는 생성 시 사용된 XRSession입니다.

NOTE: 둘 이상의 XRMediaBinding를 생성할 수 있습니다. layer의 수명은 이를 생성한 XRMediaBinding의 수명에 묶이지 않습니다.

XRMediaBinding을 통해 생성된 각 layer에는 내부 HTMLVideoElement media가 있습니다. layer가 session의 renderState의 일부이면, video의 현재 frame을 표시합니다. layer는 XR device 또는 video 중 더 낮은 native framerate로 update됩니다.

NOTE: layer에는 video frame만 표시됩니다. Video controls는 작성자가 구현해야 하며, 다른 layer에 그려야 합니다.

video가 layer에 어떻게 blit되는지에 대한 더 많은 명확화가 필요합니다.

XRCompositionLayer layerHTMLVideoElement media를 rendering해야 하는 경우, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. usabilitymedia에 대해 usability를 확인한 결과로 둡니다.

  2. usabilitybad이면, layer를 투명한 검정으로 채우고 이 단계를 중단합니다.

  3. layermedia 요소의 콘텐츠로 채웁니다.

drawing을 설명하는 더 나은 알고리즘을 추가하세요.

XRMediaBinding(XRSession session) constructor는 호출될 때 다음 단계를 수행해야 합니다.

  1. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  2. sessionimmersive session이 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  3. bindingsessionrelevant realm 안의 new XRMediaBinding으로 둡니다.

  4. bindingsessionsession으로 초기화합니다.

  5. binding을 반환합니다.

HTMLVideoElement videoXRLayerLayout layoutaspect ratio를 계산하려면, 다음 단계를 실행합니다.
  1. widthvideovideoWidth로 둡니다.

  2. heightvideovideoHeight로 둡니다.

  3. layout"stereo-left-right"이면, width2로 나눕니다.

  4. layout"stereo-top-bottom"이면, height2로 나눕니다.

  5. widthheight로 나눈 값을 반환합니다.

createQuadLayer(HTMLVideoElement video, XRMediaQuadLayerInit init) method는 새 XRQuadLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  4. initlayout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  5. layerthisrelevant realm 안의 new XRQuadLayer로 둡니다.

  6. session으로 layer에 대해 initialize a composition layer를 실행합니다.

  7. layermediavideo로 초기화합니다.

  8. layerneedsRedrawfalse로 초기화합니다.

  9. aspectRatiovideoinitlayout으로 aspect ratio를 계산한 결과로 둡니다.

  10. initwidthheightundefined이면, width1로 설정합니다.

  11. initheightundefined이면, heightwidthaspectRatio로 나눈 값으로 설정합니다.

  12. initwidthundefined이면, widthheightaspectRatio를 곱한 값으로 설정합니다.

  13. layerinit으로 initialize a quad layer를 실행합니다.

  14. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  15. layer를 반환합니다.

createCylinderLayer(HTMLVideoElement video, XRMediaCylinderLayerInit init) method는 새 XRCylinderLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  4. initlayout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  5. layerthisrelevant realm 안의 new XRCylinderLayer로 둡니다.

  6. session으로 layer에 대해 initialize a composition layer를 실행합니다.

  7. layermediavideo로 초기화합니다.

  8. layerneedsRedrawfalse로 초기화합니다.

  9. aspectRatiovideoinitlayout으로 aspect ratio를 계산한 결과로 둡니다.

  10. initaspectRatioundefined이면, aspectRatioaspectRatio로 설정합니다.

  11. layerinit으로 initialize a cylinder layer를 실행합니다.

  12. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  13. layer를 반환합니다.

createEquirectLayer(HTMLVideoElement video, XRMediaEquirectLayerInit init) method는 새 XREquirectLayer layer를 생성합니다.

이 method가 호출되면, 사용자 에이전트는 다음 단계를 실행해야 합니다.

  1. sessionthis session으로 둡니다.

  2. session이 "layers"가 활성화된 상태로 생성되지 않았다면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  3. sessionended 값이 true이면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  4. initlayout"default"이면, TypeError를 throw하고 이 단계를 중단합니다.

  5. initspaceXRReferenceSpace type의 인스턴스가 아니면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  6. initspace"viewer" type을 가지면, InvalidStateError를 throw하고 이 단계를 중단합니다.

  7. layerthisrelevant realm 안의 new XREquirectLayer로 둡니다.

  8. session으로 layer에 대해 initialize a composition layer를 실행합니다.

  9. layermediavideo로 초기화합니다.

  10. layerneedsRedrawfalse로 초기화합니다.

  11. layerinit으로 initialize a equirect layer를 실행합니다.

  12. XR Compositor가 어떤 이유로든 layer용 리소스를 생성할 수 없다는 것을 알고 있으면, OperationError를 throw하고 이 단계를 중단합니다.

  13. layer를 반환합니다.

XREquirectLayer의 매개변수가 video 표시 방식에 어떻게 영향을 주는지 정의하세요.

8. Events

8.1. XRLayerEvent

XRLayerEventXRLayer의 상태 변경을 나타내기 위해 fire됩니다.

[SecureContext, Exposed=Window] interface XRLayerEvent : Event {
  constructor(DOMString type, XRLayerEventInit eventInitDict);
  [SameObject] readonly attribute XRLayer layer;
};

dictionary XRLayerEventInit : EventInit {
  required XRLayer layer;
};

layer attribute는 event를 생성한 XRLayer를 나타냅니다.

8.2. Event Types

사용자 에이전트는 다음 새 event를 제공해야 합니다. event의 등록 및 firing은 DOM4 Events의 일반적인 동작을 따라야 합니다.

사용자 에이전트는 layer의 underlying resources가 lost되거나 XR Compositor가 더 이상 layer를 reproject할 수 없을 때, XRLayer 객체에서 redraw event를 fire할 수 있습니다.

작성자는 다음 XR animation frame에서 layer의 콘텐츠를 다시 그려야 합니다. event는 XRLayerEvent type이어야 합니다.

9. Layer 간 depth sorting

기본적으로 layers array는 layer들의 composition 순서를 정의하며, 각 layer는 이전 layer 위에 그려집니다. 애플리케이션이 depth로 정렬되는 layer를 가지려면, "depth-sorted-layers" feature descriptor를 사용하여 session을 요청해야 합니다.

XRSession이 "depth-sorted-layers" feature descriptor로 생성되면, XRProjectionLayer, XRQuadLayerXRCylinderLayer layer는 layers array에서의 위치가 아니라 depth에 기반하여 표시되어야 합니다. 다른 layer type은 이전처럼 계속 정렬되어야 합니다.

XRQuadLayerXRCylinderLayer layer는 그 dimensions(예: width 또는 centralAngle), transform 및 space에 따라 정렬되어야 합니다.

XRProjectionLayer layer는 해당 depthStencilTexture의 값에 따라 정렬되어야 합니다. 이는 또한 "depth-sorted-layers"가 활성화된 경우, XR Compositor가 depth values를 사용해야 하며 ignoreDepthValuesusesDepthValues가 `true`로 설정되어야 함을 의미합니다.

10. Space warp

Space warpXR Compositor의 reprojection을 향상시키는 기술입니다. motionVectorTexturedepthStencilTexture와 함께 제출함으로써, XR Compositor는 고품질 frame extrapolation 및 reprojection을 수행할 수 있으며, 이를 통해 사용자 에이전트는 낮은 framerate로 실행하면서도 사용자에게 부드러운 경험을 제공할 수 있습니다.

space warp를 활성화하려면 XRSession이 "space-warp" feature descriptor로 생성되어야 합니다. "space-warp"가 활성화되면, XR Compositor는 depth values를 사용해야 하며, ignoreDepthValues는 `false`로 설정되어야 하고 usesDepthValues는 `true`로 설정되어야 합니다.

motionVectorTextureRGBA16F format이어야 합니다. 작성자는 이 texture의 RGB components를 해당 영역의 초당 미터 단위 속도로 채워야 하며, red pixel은 x axis, green은 y axis, blue는 z axis에 대응합니다.

11. WebXR Device API 통합

11.1. XRRenderState 변경 사항

이 module은 XRRenderStateInitXRRenderState interfaces를 layers라는 새 optional array로 확장하며, 이 array는 XRLayer 인스턴스를 포함합니다.
[SecureContext, Exposed=Window] partial interface XRRenderState {
  readonly attribute FrozenArray<XRLayer> layers;
};

layers attribute는 XR Compositor가 표시하는 XRLayer 인스턴스를 포함하는 array를 반환합니다.

기본적으로 layers array는 layer들의 composition 순서를 정의합니다. XR Compositorsource-over blending을 사용하여 array 내 위치 순서대로 각 layer를 그려야 합니다. "depth-sorted-layers" feature descriptor가 활성화되어 있지 않은 한, XR Compositor는 layer에 어떠한 depth sorting도 적용해서는 안 됩니다.

NOTE: 이는 각 layer가 이전 layer들이 viewer에 가상적으로 더 가까운지 여부와 관계없이 이전 layer들을 잠재적으로 덮어쓸 수 있음을 의미합니다.

이 module은 initialize the render state에 주어진 단계를 대체합니다. 대신 XRRenderState 객체 stateXRSession session에 대해 생성될 때, 사용자 에이전트는 다음 단계를 실행하여 render state를 초기화해야 합니다.
  1. render state를 초기화하는 원래 단계를 실행하여 state를 초기화합니다.

  2. statelayerssessionrelevant realm 안의 new empty array로 초기화합니다.

11.2. updateRenderState 변경 사항

이 module은 WebXR specification의 "update the pending layers state"에 주어진 단계를 대체합니다. 대신 사용자 에이전트가 XRSession sessionXRRenderStateInit newStatepending layers state를 update하려는 경우, 다음 단계를 실행해야 합니다.

  1. newStatebaseLayernewStatelayers가 모두 설정되어 있으면, NotSupportedError를 throw하고 이 단계를 중단합니다.

  2. activeStatesessionactive render state로 둡니다.

  3. newStatebaseLayer가 설정되어 있으면:

    1. sessionpending render statenull이면, 이를 activeState의 copy로 설정합니다.

    2. sessionpending render statelayersnull로 설정합니다.

  4. newStatelayers가 설정되어 있으면:

    1. session이 "layers"가 활성화된 상태로 생성되지 않았고 newStatelayers1개보다 많은 인스턴스를 포함하면, NotSupportedError를 throw하고 이 단계를 중단합니다.

    2. newStatelayersmaxRenderLayers보다 많은 entries를 포함하면, NotSupportedError를 throw하고 이 단계를 중단합니다.

    3. sessionpending render statenull이면, 이를 activeState의 copy로 설정합니다.

    4. newStatelayers가 duplicate instances를 포함하면, TypeError를 throw하고 이 단계를 중단합니다.

    5. newStatelayers의 각 layer에 대해:

      1. layerXRCompositionLayer이고 layersessionsession과 다르면, TypeError를 throw하고 이 단계를 중단합니다.

      2. layerXRWebGLLayer이고 layersessionsession과 다르면, TypeError를 throw하고 이 단계를 중단합니다.

    6. sessionpending render statebaseLayernull로 설정합니다.

    7. sessionpending render statelayersnewStatelayers로 설정합니다.

11.3. XRCompositor 변경 사항

XR Compositorlayers array의 모든 XRLayer 인스턴스가 동시에 composited되도록 확장되어야 합니다. WebXR에 대한 다른 모든 요구사항은 계속 적용되어야 합니다.

XR Compositor"none"XREye를 가진 view로 rendering하고 있으며, XRProjectionLayer가 아니고 layout"mono"가 아닌 XRCompositionLayer를 drawing하는 경우, XR Compositor는 그 layer를 view"left"XREye를 가진 것처럼 render해야 합니다.

NOTE: 이는 layer의 오른쪽 눈에 대한 쪽이 무시된다는 의미입니다. 이를 통해 작성자는 stereoscopic 및 monoscopic device에 동일한 assets를 사용할 수 있습니다.

11.4. XRView 변경 사항

view는 view를 포함하기에 충분히 큰 WebGL texture resolution의 최선의 추정치를 나타내는 recommended WebGL color texture resolution을 정의해야 합니다.

XRSession이 "space-warp" feature descriptor로 생성된 경우, 각 viewrecommended WebGL color texture resolution에 기반한 recommended motion vector texture resolution을 정의해야 합니다.

view는 또한 recommended WebGL color texture resolutionrecommended motion vector texture resolution에 기반한 recommended WebGL depth texture resolution도 정의해야 합니다. 사용자 에이전트는 "space-warp"가 활성화된 경우 recommended WebGL depth texture resolution을 줄이기로 결정할 수 있습니다.

"depth-sorted-layers" feature descriptor가 활성화된 경우, recommended WebGL depth texture resolutionrecommended WebGL color texture resolution과 같아야 합니다.

11.5. Animation frames 변경 사항

이 module은 WebXR specification의 "check the layers state"에 주어진 단계를 대체합니다. 대신 renderState statelayers state를 check하려면, 사용자 에이전트는 다음 단계를 실행해야 합니다.
  1. statebaseLayernull이 아니면, true를 반환합니다.

  2. statelayers가 비어 있지 않으면, true를 반환합니다.

  3. false를 반환합니다.

11.6. XRSession 변경 사항

이 module은 XRSession interface에 다음을 확장 및 추가합니다.
[SecureContext, Exposed=Window] partial interface XRSession {
  readonly attribute unsigned long maxRenderLayers;
};

maxRenderLayers는 compositor가 처리해야 하는 최대 layer 수, 따라서 모든 XRRenderStateInitlayers array의 최대 크기를 나타냅니다. 주어진 시점에 이 수보다 많은 layer를 생성할 수 있어야 합니다.

NOTE: 이 guidance는 Allocation of layers에 설명된 것처럼 사용자 에이전트가 할당할 수 있는 layer 수에 대한 제한을 제공하려는 것이 아닙니다. User Agents는 예를 들어 20개의 layer 생성을 허용하면서도, updateRenderState()를 통해 한 번에 설정할 수 있는 수는 10개로 제한할 수 있습니다. 또한 서로 다른 layer가 서로 다른 양의 backend power 또는 objects를 요구할 수 있기 때문에, user agents는 적어도 그만큼 많은 layer가 render될 수 있도록 `maxRenderLayers` 값을 설정하는 데 일정한 재량을 가진다는 점도 주목할 만합니다. 그러나 user agents는 여전히 더 많은 layer가 전달될 때는 reject해야 하며, updateRenderState에 더 적은 layer가 전달될 때는 reject할 수 없습니다.

XRSession에는 그 session으로 생성된 각 XRWebGLBinding에 대한 약한 참조를 보관하는 내부 WeakSet bindings가 있습니다.

이 module은 WebXR specification의 "shut down the session"에 단계를 추가합니다. 목록에 다음을 추가하세요:

  1. session|bindings 안의 각 binding에 대해:

    1. bindingfoveatedTextures 안의 각 texture에 대해:

    2. texture에서 foveation을 제거합니다.

12. 보안 및 개인정보 보호 고려사항

12.1. Composition의 timing

Composition timing은 rendering되는 콘텐츠와 독립적이어야 합니다. 또한 layer 안의 콘텐츠는 다른 layer에서 observable해서는 안 됩니다.

가능하다면 layer의 composition은 timing attack 또는 기타 보안 취약점의 위험을 줄이기 위해 브라우저 밖에서 발생해야 합니다.

12.2. Layer 할당

사용자 에이전트는 GPU hardware의 식별 가능성을 줄이기 위해 최대 pixel size 또는 layer 수와 같은 모든 resource allocation에 제한을 둘 수 있습니다.

변경 사항

2020년 12월 3일 최초 공개 작업 초안 이후 변경 사항

새 기능:

변경 사항:

적합성

문서 규약

적합성 요구사항은 설명적 주장과 RFC 2119 용어의 조합으로 표현됩니다. 이 문서의 규범적 부분에서 핵심 단어 “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, “OPTIONAL”은 RFC 2119에 설명된 대로 해석해야 합니다. 하지만 가독성을 위해 이 명세에서 이러한 단어들이 모두 대문자로 나타나지는 않습니다.

이 명세의 모든 텍스트는 명시적으로 비규범으로 표시된 섹션, 예제 및 노트를 제외하고 규범적입니다. [RFC2119]

이 명세의 예제는 “for example”이라는 단어로 소개되거나 class="example"을 사용하여 규범 텍스트와 구분됩니다. 예를 들면 다음과 같습니다.

이는 정보 제공용 예제의 예입니다.

정보 제공용 노트는 “Note”라는 단어로 시작하며 class="note"를 사용하여 규범 텍스트와 구분됩니다. 예를 들면 다음과 같습니다.

Note, 이는 정보 제공용 노트입니다.

적합한 알고리즘

알고리즘의 일부로 명령형으로 표현된 요구사항 (예: "strip any leading space characters" 또는 "return false and abort these steps")은 알고리즘을 소개할 때 사용된 핵심 단어 ("must", "should", "may" 등)의 의미로 해석해야 합니다.

알고리즘 또는 특정 단계로 표현된 적합성 요구사항은 최종 결과가 동등하다면 어떤 방식으로든 구현될 수 있습니다. 특히 이 명세에서 정의된 알고리즘은 이해하기 쉽게 작성된 것이며 성능을 목적으로 한 것은 아닙니다. 구현자는 최적화하는 것이 권장됩니다.

색인

이 명세에서 정의하는 용어

참조로 정의되는 용어

참고 문헌

규범적 참고 문헌

[COMPOSITING-1]
Chris Harrelson. Compositing and Blending Level 1. 2024년 3월 21일. CRD. URL: https://www.w3.org/TR/compositing-1/
[DOM]
Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[ECMASCRIPT]
ECMAScript Language Specification. URL: https://tc39.es/ecma262/multipage/
[GEOMETRY-1]
Sebastian Zartner; Yehonatan Daniv. Geometry Interfaces Module Level 1. 2025년 12월 4일. CRD. URL: https://www.w3.org/TR/geometry-1/
[HTML]
Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. 1997년 3월. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119
[WEBGL-2]
Dean Jackson; Jeff Gilbert. WebGL 2.0 Specification. 2017년 8월 12일. URL: https://www.khronos.org/registry/webgl/specs/latest/2.0/
[WEBIDL]
Edgar Chen; Timothy Gu. Web IDL Standard. Living Standard. URL: https://webidl.spec.whatwg.org/
[WEBXR]
Brandon Jones; Manish Goregaokar; Rik Cabanier. WebXR Device API. 2025년 10월 1일. CRD. URL: https://www.w3.org/TR/webxr/
[WEBXR-AR-MODULE-1]
Brandon Jones; Manish Goregaokar; Rik Cabanier. WebXR Augmented Reality Module - Level 1. 2025년 4월 25일. CRD. URL: https://www.w3.org/TR/webxr-ar-module-1/

정보성 참고 문헌

[PERMISSIONS-REQUEST]
Requesting Permissions. Draft Community Group Report. URL: https://wicg.github.io/permissions-request/

IDL 색인

enum XRLayerLayout {
  "default",
  "mono",
  "stereo",
  "stereo-left-right",
  "stereo-top-bottom"
};

enum XRLayerQuality {
  "default",
  "text-optimized",
  "graphics-optimized"
};

[Exposed=Window] interface XRCompositionLayer : XRLayer {
  readonly attribute XRLayerLayout layout;

  attribute boolean blendTextureSourceAlpha;
  attribute boolean forceMonoPresentation;
  attribute float opacity;
  readonly attribute unsigned long mipLevels;
  attribute XRLayerQuality quality;

  readonly attribute boolean needsRedraw;

  undefined destroy();
};

[Exposed=Window] interface XRProjectionLayer : XRCompositionLayer {
  readonly attribute unsigned long textureWidth;
  readonly attribute unsigned long textureHeight;
  readonly attribute unsigned long textureArrayLength;

  readonly attribute boolean ignoreDepthValues;
  attribute float? fixedFoveation;
  attribute XRRigidTransform? deltaPose;
};

[Exposed=Window] interface XRQuadLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float width;
  attribute float height;

  // Events
  attribute EventHandler onredraw;
};

[Exposed=Window] interface XRCylinderLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float radius;
  attribute float centralAngle;
  attribute float aspectRatio;

  // Events
  attribute EventHandler onredraw;
};

[Exposed=Window] interface XREquirectLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute XRRigidTransform transform;

  attribute float radius;
  attribute float centralHorizontalAngle;
  attribute float upperVerticalAngle;
  attribute float lowerVerticalAngle;

  // Events
  attribute EventHandler onredraw;
};

[Exposed=Window] interface XRCubeLayer : XRCompositionLayer {
  attribute XRSpace space;
  attribute DOMPointReadOnly orientation;

  // Events
  attribute EventHandler onredraw;
};

[Exposed=Window] interface XRSubImage {
  [SameObject] readonly attribute XRViewport viewport;
};

[Exposed=Window] interface XRWebGLSubImage : XRSubImage {
  [SameObject] readonly attribute WebGLTexture colorTexture;
  [SameObject] readonly attribute WebGLTexture? depthStencilTexture;
  [SameObject] readonly attribute WebGLTexture? motionVectorTexture;

  readonly attribute unsigned long? imageIndex;
  readonly attribute unsigned long colorTextureWidth;
  readonly attribute unsigned long colorTextureHeight;
  readonly attribute unsigned long? depthStencilTextureWidth;
  readonly attribute unsigned long? depthStencilTextureHeight;
  readonly attribute unsigned long? motionVectorTextureWidth;
  readonly attribute unsigned long? motionVectorTextureHeight;
};

enum XRTextureType {
  "texture",
  "texture-array"
};

dictionary XRProjectionLayerInit {
  XRTextureType textureType = "texture";
  GLenum colorFormat = 0x1908; // RGBA
  GLenum depthFormat = 0x1902; // DEPTH_COMPONENT
  double scaleFactor = 1.0;
  boolean clearOnAccess = true;
};

dictionary XRLayerInit {
  required XRSpace space;
  XRTextureType textureType = "texture";
  GLenum colorFormat = 0x1908; // RGBA
  GLenum? depthFormat;
  unsigned long mipLevels = 1;
  required unsigned long viewPixelWidth;
  required unsigned long viewPixelHeight;
  XRLayerLayout layout = "mono";
  boolean isStatic = false;
  boolean clearOnAccess = true;
};

dictionary XRQuadLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float width = 1.0;
  float height = 1.0;
};

dictionary XRCylinderLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float radius = 2.0;
  float centralAngle = 0.78539;
  float aspectRatio = 2.0;
};

dictionary XREquirectLayerInit : XRLayerInit {
  XRRigidTransform? transform;
  float radius = 0;
  float centralHorizontalAngle = 6.28318;
  float upperVerticalAngle = 1.570795;
  float lowerVerticalAngle = -1.570795;
};

dictionary XRCubeLayerInit : XRLayerInit {
  DOMPointReadOnly? orientation;
};

[Exposed=Window] interface XRWebGLBinding {
  constructor(XRSession session, XRWebGLRenderingContext context);

  readonly attribute double nativeProjectionScaleFactor;
  readonly attribute boolean usesDepthValues;

  XRProjectionLayer createProjectionLayer(optional XRProjectionLayerInit init = {});
  XRQuadLayer createQuadLayer(optional XRQuadLayerInit init = {});
  XRCylinderLayer createCylinderLayer(optional XRCylinderLayerInit init = {});
  XREquirectLayer createEquirectLayer(optional XREquirectLayerInit init = {});
  XRCubeLayer createCubeLayer(optional XRCubeLayerInit init = {});

  XRWebGLSubImage getSubImage(XRCompositionLayer layer, XRFrame frame, optional XREye eye = "none");
  XRWebGLSubImage getViewSubImage(XRProjectionLayer layer, XRView view);

  undefined foveateBoundTexture(GLenum target, float fixed_foveation);
};

dictionary XRMediaLayerInit {
  required XRSpace space;
  XRLayerLayout layout = "mono";
  boolean invertStereo = false;
};

dictionary XRMediaQuadLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float? width;
  float? height;
};

dictionary XRMediaCylinderLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float radius = 2.0;
  float centralAngle = 0.78539;
  float? aspectRatio;
};

dictionary XRMediaEquirectLayerInit : XRMediaLayerInit {
  XRRigidTransform? transform;
  float radius = 0.0;
  float centralHorizontalAngle = 6.28318;
  float upperVerticalAngle = 1.570795;
  float lowerVerticalAngle = -1.570795;
};

[Exposed=Window] interface XRMediaBinding {
  constructor(XRSession session);

  XRQuadLayer createQuadLayer(HTMLVideoElement video, optional XRMediaQuadLayerInit init = {});
  XRCylinderLayer createCylinderLayer(HTMLVideoElement video, optional XRMediaCylinderLayerInit init = {});
  XREquirectLayer createEquirectLayer(HTMLVideoElement video, optional XRMediaEquirectLayerInit init = {});
};

[SecureContext, Exposed=Window] interface XRLayerEvent : Event {
  constructor(DOMString type, XRLayerEventInit eventInitDict);
  [SameObject] readonly attribute XRLayer layer;
};

dictionary XRLayerEventInit : EventInit {
  required XRLayer layer;
};

[SecureContext, Exposed=Window] partial interface XRRenderState {
  readonly attribute FrozenArray<XRLayer> layers;
};

[SecureContext, Exposed=Window] partial interface XRSession {
  readonly attribute unsigned long maxRenderLayers;
};

이슈 색인

이 섹션은 명확화가 필요합니다
이 섹션은 명확화가 필요합니다
init dictionary들은 optional이어서는 안 됩니다. 이는 bikeshed issue 1566입니다.
크기로 인해 layout이 변경되는 경우의 특수한 UA 동작(예: 요청된 width가 "stereo-left-right"에서 한계를 초과하는 경우)
scaleFactor는 secondary view용으로 다시 계산되어야 합니다.
cubemap 크기가 어떻게 결정되는지 정의하세요.
space는 어떻게 처리해야 하는가. cubemap의 가장자리까지 걸어갈 수 있는가?
orientation의 초기 상태를 결정하세요.
init dictionary들은 optional이어서는 안 됩니다. 이는 bikeshed issue 1566입니다.
video가 layer에 어떻게 blit되는지에 대한 더 많은 명확화가 필요합니다.
drawing을 설명하는 더 나은 알고리즘을 추가하세요.
XREquirectLayer의 매개변수가 video 표시 방식에 어떻게 영향을 주는지 정의하세요.