XRCompositionLayer.chromaticAberrationCorrection

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

No specification found

No specification data found for api.XRCompositionLayer.chromaticAberrationCorrection.
Check for problems with this page or contribute a missing spec_url to mdn/browser-compat-data. Also make sure the specification is included in w3c/browser-specs.

Browser compatibility

No compatibility data found for api.XRCompositionLayer.chromaticAberrationCorrection.
Check for problems with this page or contribute missing data to mdn/browser-compat-data.

See also

© 2005–2021 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRCompositionLayer/chromaticAberrationCorrection