expo / expo-three

Utilities for using THREE.js on Expo
MIT License
738 stars 89 forks source link

Skybox doesn't show up on android but works on web #303

Closed Sai-Smaran closed 4 months ago

Sai-Smaran commented 5 months ago

Skyboxes don't seem to work on android and render a white void instead of rendering the skybox.

Expected result(on web):

web

Actual outcome(android):

Android

Sai-Smaran commented 4 months ago

OK I figured it out now:

import { loadCubeTextureAsync } from "expo-three";

scene.background = await loadCubeTextureAsync({
      assetForDirection: {
       px: require("./assets/skybox/posx.jpg"),
       nx: require("./assets/skybox/negx.jpg"),
       py: require("./assets/skybox/posy.jpg"),
       ny: require("./assets/skybox/negy.jpg"),
       pz: require("./assets/skybox/posz.jpg"),
       nz: require("./assets/skybox/negz.jpg"),
      },
    });

Weird why this isn't documented yet :/