expo / expo-three

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

envmap reflection not working on Android build #168

Open davidcandreva opened 4 years ago

davidcandreva commented 4 years ago

Does anyone have a working example of reflectionCube working on expo-three? Renders perfect on iOs and Android during development "production mode" but when validating the internal build on Android it doesn't have any reflection.

Ideas or suggestions are more than welcome.

const hdr2asset = require('../../assets/hdr2.jpg');
    const hdr2 = Asset.fromModule(hdr2asset);

    if (!hdr2.localUri) {
      await hdr2.downloadAsync();
    }

    const skyAsset = require('../../assets/hdr.jpg');
    const sky = Asset.fromModule(skyAsset);
    if (!sky.localUri) {
      await sky.downloadAsync();
    }
    bumpMap = new TextureLoader().load(hdr2.localUri);

    const SkyboxImages = {
      nx: sky.localUri,
      ny: sky.localUri,
      nz: sky.localUri,
      px: sky.localUri,
      py: sky.localUri,
      pz: sky.localUri,
    };
    reflectionCube = await loadCubeTextureAsync({
      assetForDirection: (direction) => {
        return SkyboxImages[direction];
      },
    });
testMaterial: new MeshPhysicalMaterial({
      color: 0xffffff,
      roughness: 0.47,
      metalness: 1,
      envMap: reflectionCube,
      envMapIntensity: 1,
      bumpMap,
      bumpScale: 0.2,
    }),
Screenshot 2020-04-27 at 22 02 56 Screenshot 2020-04-27 at 22 02 42
krjk333 commented 3 years ago

Does gltf loader is working for android.? How to do that, Please help me on the same. How do you load the model @davidcandreva