Skip to content

Commit

Permalink
[Oculus] Fix immersive environments
Browse files Browse the repository at this point in the history
To construct the immersive environment, Wolvic creates an OpenXR
cubemap layer and applies textures to it.

For Oculus, we were using compressed textures loaded from KTX files.

Starting with version 69 of the Meta OS, this method stopped working
and the environments just looked pitch black. It seems that the
problem is caused by a bug on the system that breaks the use
of compressed textures on a cubemap layer.

While this bug is fixed upstream, this patch forces Oculus devices
to load the immersive environments from PNG files.

Fixes #1535
  • Loading branch information
felipeerias authored and svillar committed Sep 11, 2024
1 parent 0cf2896 commit 22da6fa
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class EnvironmentUtils {

public static final String ENVS_FOLDER = "envs";
public static final String BUILTIN_ENVS_PREFIX = "cubemap/";
public static String[] SUPPORTED_ENV_EXTENSIONS = (DeviceType.isPicoXR()) ?
public static String[] SUPPORTED_ENV_EXTENSIONS = (DeviceType.isPicoXR() || DeviceType.isOculusBuild()) ?
new String[]{".jpg", ".png"} : new String[]{".ktx", ".jpg", ".png"};

/**
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/cpp/BrowserWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1991,8 +1991,9 @@ BrowserWorld::CreateSkyBox(const std::string& aBasePath, const std::string& aExt
const std::string extension = aExtension.empty() ? ".png" : aExtension;
GLenum glFormat = GL_SRGB8_ALPHA8;
#elif OCULUSVR
const std::string extension = aExtension.empty() ? ".ktx" : aExtension;
GLenum glFormat = extension == ".ktx" ? GL_COMPRESSED_SRGB8_ETC2 : GL_SRGB8_ALPHA8;
// Meta Quest (after v69) does not support compressed textures for the cubemap.
const std::string extension = aExtension.empty() ? ".png" : aExtension;
GLenum glFormat = GL_SRGB8_ALPHA8;
#else
const std::string extension = aExtension.empty() ? ".ktx" : aExtension;
GLenum glFormat = extension == ".ktx" ? GL_COMPRESSED_RGB8_ETC2 : GL_RGBA8;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 22da6fa

Please sign in to comment.