files/en-us/web/api/xrsession/environmentblendmode/index.md
{{APIRef("WebXR Device API")}}{{SeeCompatTable}}{{SecureContext_Header}}
The {{domxref("XRSession")}} interface's read-only environmentBlendMode
property identifies if, and to what degree, the computer-generated imagery is overlaid atop the real world.
This is used to differentiate between fully-immersive VR sessions and AR sessions which render over a pass-through image of the real world, possibly partially transparently.
A string defining if and how virtual, rendered content is overlaid atop the image of the real world.
Possible values are:
opaque
baseLayer field are ignored since the alpha values for the rendered imagery are all treated as being 1.0 (fully opaque).additive
additive blending mode is designed to be used in a situation in which the device has no control over the background and its brightness, since that isn't being digitally controlled. All the device can do is add more light to the image; it can't make things get darker. Therefore, black is rendered as fully transparent, and there's no way to make a pixel fully opaque. As with the opaque setting, alpha values specified are ignored and treated as if they were 1.0.alpha-blend
XRSession's renderState.baseLayer property provides relative weights of the artificial layer during the compositing process. Pixels whose alpha value is 1.0 are rendered fully opaque, totally obscuring the real world, while pixels with an alpha of 0.0 are totally transparent, leaving the surrounding environment to pass through.{{Specifications}}
{{Compat}}