Skip to content
6 changes: 5 additions & 1 deletion webxrlayers-1.bs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ XRCompositionLayer defines a set of common attributes and behaviors across certa

attribute boolean blendTextureSourceAlpha;
attribute boolean? chromaticAberrationCorrection;
attribute float opacity;
readonly attribute unsigned long mipLevels;

readonly attribute boolean needsRedraw;
Expand All @@ -338,6 +339,9 @@ enable optical chromatic aberration correction for the layer. If the user agent
should return <code>null</code> on getting, and setting should be a <code>no-op</code>.
If the {{XRCompositionLayer/chromaticAberrationCorrection}} was changed, it will take effect at the next {{XRFrame}}.

The <dfn attribute for="XRCompositionLayer">opacity</dfn> attribute sets the opacity that is applied to the pixels of the layer. The [=XR Compositor=] MUST multiply each pixel (in premultiplied space) by this value.
{{XRCompositionLayer/opacity}} is <code>1.0</code> by default. Setting {{XRCompositionLayer/opacity}} to a value less than <code>0</code> will set it to <code>0</code> and setting it to a value higher than <code>1.0</code> will set it to <code>1.0</code>.

The <dfn attribute for="XRCompositionLayer">needsRedraw</dfn> attribute signals that the {{XRCompositionLayer}} should be
rerendered in the next [=XR animation frame=]. It MAY be set when [=the underlying resources of a layer are lost=] or
when the [=XR Compositor=] can no longer reproject the layer. Failing to redraw the content in the next [=XR animation frame=]
Expand Down Expand Up @@ -373,6 +377,7 @@ or a {{WebGL2RenderingContext}} |context|, the user agent MUST run the following
<dt> Otherwise
<dd> Set [=this=] {{XRCompositionLayer/chromaticAberrationCorrection}} to <code>null</code>.
</dl>
1. Set [=this=] {{XRCompositionLayer/opacity}} to <code>1.0</code>.

</div>

Expand Down Expand Up @@ -2023,4 +2028,3 @@ Changes:
- Moved foveation to projection layer (<a href="https://github.com/immersive-web/layers/pull/247">GitHub #247</a>)
- Rename textureLayers to textureArrayLength (<a href="https://github.com/immersive-web/layers/pull/242">GitHub #242</a>)
- Clarify that opaque textures are always initialized at the start of the frame (<a href="https://github.com/immersive-web/layers/pull/234">GitHub #234</a>)