viromedia/viro

My texture of Viro3DObject doesn't work properly.

PhamTrungMinh opened this issue · 0 comments

I'm new to React Native as well as AR and viro-react.
Here is my code i've been working on:
const InitialScene = () => {
ViroMaterials.createMaterials({
aodai: {
diffuseTexture: require('../assets/3d-model/aodai_Base_color.jpg'),
metalness: 1,
metalnessTexture: require('../assets/3d-model/aodai_Metallic.jpg'),
normalIntensity: 0.8,
normalTexture: require('../assets/3d-model/aodai_Normal.jpg'),
roughness: 1,
roughnessTexture: require('../assets/3d-model/aodai_Roughness.jpg'),
},
quanvai: {
diffuseTexture: require('../assets/3d-model/quanvai_Base_color.jpg'),
metalness: 1,
metalnessTexture: require('../assets/3d-model/quanvai_Metallic.jpg'),
normalIntensity: 0.8,
normalTexture: require('../assets/3d-model/quanvai_Normal.jpg'),
roughness: 1,
roughnessTexture: require('../assets/3d-model/quanvai_Roughness.jpg'),
}
})

return (

<ViroAmbientLight
color={"#ffffff"}
intensity={150}
/>
<ViroDirectionalLight
color={"#ffffff"}
direction={[0.5, -1, 0.5]}
castsShadow={true}
/>
<Viro3DObject
source={require('../assets/3d-model/aodai.obj')}
lightReceivingBitMask={3}
resources={[
require('../assets/3d-model/aodai.mtl'),
require('../assets/3d-model/aodai_Base_color.png'),
require('../assets/3d-model/aodai_Metallic.png'),
require('../assets/3d-model/aodai_Normal.png'),
require('../assets/3d-model/aodai_Opacity.png'),
require('../assets/3d-model/aodai_Roughness.png'),
]}
position={[0, 0.5, 0]}
scale={[1.5, 1.5, 1.5]}
type='OBJ'
animation={{ name: 'rotate', loop: true, run: true }}
/>

);
}

Here is the error i received:
image

I'm quite sure all the paths are correct. And there is only the model with no texture on the screen. Can anyone help?