XRCompositionLayer.chromaticAberrationCorrection

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The chromaticAberrationCorrection property of the XRCompositionLayer interface is a boolean enabling the layer's optical chromatic aberration correction.

Chromatic aberration ("color fringing") is an imperfection wherein a lens fails to focus all wavelengths of colors at the same point. This effect results in a seven-colored rainbow. To remove these imperfections a process called chromatic aberration correction is needed. For more information, read Chromatic aberration on Wikipedia.

Value

A boolean. true enables chromatic aberration correction for the layer; false disables it. If the device doesn't support this feature, chromaticAberrationCorrection is null and setting it will not do anything.

If chromaticAberrationCorrection was changed, it will take effect in the next frame.

Examples

Setting a layer's chromatic aberration correction

The following code snippet enables the layer's chromatic aberration correction.

myLayer.chromaticAberrationCorrection = true;

Specifications

Specification
WebXR Layers API Level 1
# dom-xrcompositionlayer-chromaticaberrationcorrection

Browser compatibility

BCD tables only load in the browser

See also