Skip to content

Commit 6a896da

Browse files
authored
Merge pull request immersive-web#305 from cabanier/srgb
Clarify rgb/srgb behavior
2 parents c97b985 + 805f743 commit 6a896da

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

webxrlayers-1.bs

+17-11
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ spec: webxr;
5454
type: dfn; text: primary view
5555
type: dfn; text: secondary view
5656
type: dfn; text: active; for: view
57+
type: enum-value; text: local
5758
spec: html;
5859
type: dfn; text: check the usability of the image argument
5960
type: dfn; text: request the xr permission
@@ -275,7 +276,7 @@ navigator.xr.requestSession('immersive-vr', {
275276
</div>
276277

277278
Layers are only supported for XRSessions created with XRSessionMode of {{XRSessionMode/"immersive-vr"}}
278-
or {{XRSessionMode/"immersive-ar"}}. {{XRSessionMode/"inline"}} sessions MUST not support layers.
279+
or {{XRSessionMode/"immersive-ar"}}. {{XRSessionMode/"inline"}} sessions MUST NOT support layers.
279280

280281
The "[=feature descriptor/layers=]" [=feature descriptor=] has a [=feature requirement=] that it cannot be enabled when there is an [=active immersive session=].
281282

@@ -460,7 +461,7 @@ XRProjectionLayer {#xrprojectionlayertype}
460461
An {{XRProjectionLayer}} is a layer that fills the entire view of the observer.
461462
Projection layers should be refreshed close to the device's native frame rate.
462463

463-
<img alt="representation of a projection layer" src="images/projection-layer.jpg" style="width:50%; height: 50%; border-style: ridge;"/>
464+
<img alt="representation of a projection layer" src="images/projection-layer.jpg" style="width:50%; height: 50%; border-style: ridge;">
464465

465466
<pre class="idl">
466467
[Exposed=Window] interface XRProjectionLayer : XRCompositionLayer {
@@ -513,12 +514,12 @@ The {{XRProjectionLayer/deltaPose}} should be identity when there is no transfor
513514
XRQuadLayer {#xrquadlayertype}
514515
-----------
515516
An {{XRQuadLayer}} renders a layer that takes up a flat rectangular space in the virtual environment.
516-
Only the front of the layer MUST be visible; the back face MUST not be drawn by the [=XR Compositor=].
517+
Only the front of the layer MUST be visible; the back face MUST NOT be drawn by the [=XR Compositor=].
517518

518519
A XRQuadLayer has no thicknes. It is a two-dimensional object positioned and oriented in 3D space. The position
519520
of a quad refers to the center of the quad.
520521

521-
<img alt="representation of a quad layer" src="images/quad-layer.jpg" style="width:50%; height: 50%; border-style: ridge;"/>
522+
<img alt="representation of a quad layer" src="images/quad-layer.jpg" style="width:50%; height: 50%; border-style: ridge;">
522523

523524
<pre class="idl">
524525
[Exposed=Window] interface XRQuadLayer : XRCompositionLayer {
@@ -562,9 +563,9 @@ The <dfn attribute for="XRQuadLayer">onredraw</dfn> attribute is an Event handle
562563
XRCylinderLayer {#xrcylinderayertype}
563564
---------------
564565
An {{XRCylinderLayer}} renders a layer that takes up a curved rectangular space in the virtual environment.
565-
Only the front of the layer MUST be visible; the back face MUST not be drawn by the [=XR Compositor=].
566+
Only the front of the layer MUST be visible; the back face MUST NOT be drawn by the [=XR Compositor=].
566567

567-
<img alt="representation of a cylinder layer" src="images/cylinder-layer.png" style="width:50%; height: 50%; border-style: ridge;"/>
568+
<img alt="representation of a cylinder layer" src="images/cylinder-layer.png" style="width:50%; height: 50%; border-style: ridge;">
568569

569570
A XRCylinderLayer has no thicknes. It is a two-dimensional object positioned and oriented in 3D space. The position
570571
of the cylinder refers to the center of the quad.
@@ -595,7 +596,7 @@ It grows symmetrically around the 0 angle.
595596

596597
The <dfn attribute for="XRCylinderLayer">aspectRatio</dfn> attribute controls the ratio of the visible cylinder section. It is the ratio of the width of the visible section of the cylinder divided by its height. The width is calculated by multiplying the {{XRCylinderLayer/radius}} with the {{XRCylinderLayer/centralAngle}}.
597598

598-
<img alt="description of the parameters of a cylinder layer"src="images/cylinder_layer_params.png" style="width: 80%; height: 80%;"/>
599+
<img alt="description of the parameters of a cylinder layer" src="images/cylinder_layer_params.png" style="width: 80%; height: 80%;">
599600

600601
<div class="algorithm" data-algorithm="initCylinderLayerAlgo">
601602
When <dfn lt="initialize a cylinder layer">initializing an {{XRCylinderLayer}} |layer| with an {{XRCylinderLayerInit}} |init|</dfn>, the user agent MUST run the following steps:
@@ -620,7 +621,7 @@ XREquirectLayer {#xrequirectlayertype}
620621
---------------
621622
An {{XREquirectLayer}} renders a layer where the [=XR Compositor=] MUST map an equirectangular coded data onto the inside of a sphere.
622623

623-
<img alt="representation of an equirect layer" src="images/equirect-layer.png" style="width:50%; height: 50%; border-style: ridge;"/>
624+
<img alt="representation of an equirect layer" src="images/equirect-layer.png" style="width:50%; height: 50%; border-style: ridge;">
624625

625626
ISSUE: this section needs clarification
626627

@@ -656,7 +657,7 @@ a value higher than 2π will set it to 2π.
656657
Setting {{XREquirectLayer/upperVerticalAngle}} or {{XREquirectLayer/lowerVerticalAngle}} to a value less than -π/2 will set it
657658
to -π/2 and setting it to a value higher than π/2 will set it to π/2.
658659

659-
<img alt="description of the parameters of an equirect layer" src="images/equirect.png" style="width:50%; height: 50%;"/>
660+
<img alt="description of the parameters of an equirect layer" src="images/equirect.png" style="width:50%; height: 50%;">
660661

661662
When assigning an {{XRSpace}} to the {{XREquirectLayer/space}} attribute, first run the following steps.
662663

@@ -693,7 +694,7 @@ XRCubeLayer {#xcubelayertype}
693694
-----------
694695
A {{XRCubeLayer}} renders a layer where the [=XR Compositor=] renders directly from a cubemap.
695696

696-
<img alt="representation of a cube layer" src="images/cube-layer.jpg" style="width:50%; height: 50%; border-style: ridge;"/>
697+
<img alt="representation of a cube layer" src="images/cube-layer.jpg" style="width:50%; height: 50%; border-style: ridge;">
697698

698699
ISSUE: this section needs clarification
699700

@@ -909,6 +910,11 @@ section in the OpenGL ES 3.0 spec defines these limitations in more detail.
909910

910911
Allocation of the resources for layers (such as memory) MUST be done through the same mechanism as WebGL.
911912

913+
If an {{XRLayer}} is allocated with the {{RGBA}} or {{RGB}} {{XRLayerInit/colorFormat}}, its [=colorTextures=] MUST be exposed as {{RGBA}} or {{RGB}} to the {{WebGLRenderingContext}} context.
914+
However, the [=XR Compositor=] MUST treat the [=colorTextures=]'s pixels as if they were in the {{SRGB8_ALPHA8}} or {{SRGB8}} {{XRLayerInit/colorFormat}}.
915+
916+
NOTE: this means that the [=XR Compositor=] MUST NOT do any gamma conversion from linear {{RGBA}} or {{RGB}} when it processes the [=colorTextures=]. Otherwise, the pixels in the final rendering will appear too bright which will not match the rendering on a regular 2D {{WebGLRenderingContext}} context.
917+
912918
XRProjectionLayerInit {#xrprojectionlayerinittype}
913919
---------------------
914920
The {{XRProjectionLayerInit}} dictionary represents a set of configurable values that describe how an {{XRProjectionLayer}}
@@ -2144,7 +2150,7 @@ Timing of the composition {#xrcompositiontiming}
21442150
-------------------------
21452151

21462152
Composition timing MUST be independent of the content that is rendered.
2147-
Moreover, content in a layer MUST not be observable in other layers.
2153+
Moreover, content in a layer MUST NOT be observable in other layers.
21482154

21492155
If possible, composition of layers should happen outside the browser to reduce risk of timing attacks or other security vulnerabilities.
21502156

0 commit comments

Comments
 (0)