Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My texture of Viro3DObject doesn't work properly. #988

Open
PhamTrungMinh opened this issue May 12, 2023 · 0 comments
Open

My texture of Viro3DObject doesn't work properly. #988

PhamTrungMinh opened this issue May 12, 2023 · 0 comments

Comments

@PhamTrungMinh
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant