Skip to content

Use of environmentBlendMode is incorrect #19386

@Manishearth

Description

@Manishearth
Description of the problem

Three.js currently has the following check to see if it should render a background:

if ( session && session.environmentBlendMode === 'additive' ) {
background = null;
}

environmentBlendMode is not an indication of the session mode, the session mode used at creation should be held on to (perhaps by creating a .mode field on the XRSession) if we want this check.

Now, if we switch the check to be xr.mode == "immrsive-ar", this will stop rendering the background on opaque-display VR devices that claim to support AR mode. This seems ... okay to me; as far as I understand it no browser has made this choice yet, but if it were to it would likely be to make it possible to tsst out AR-specific content on VR devices, in which case we should probably have things render as close to that as possible.

If we do want to render the background even on opaque-display VR displays claiming to be AR, this check should instead check for either "additive" or "alpha-blend" blend modes

Three.js version
  • Dev
  • r116
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions