-
` React.useLayoutEffect(() => {
}, []);` I am doing like this right now but not working I don't see any changes. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
i would suggest you always use useLoader or useXYZ drei abstractions like useGLTF, useTexture and so on. you can work with plain three loaders yourself as well ofc but they're async and messy to handle. one of the larger issues is that they're not cached and their data isn't easily re-usable. https://codesandbox.io/s/react-postprocessing-dof-blob-forked-u1nle?file=/src/App.js function Model() {
const envMap = useCubeTexture(['px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png'], { path: '/cube/' })
return (
<mesh>
<meshStandardMaterial envMap={envMap} ... you also don't need to traverse in react, use https://github.com/pmndrs/gltfjsx |
Beta Was this translation helpful? Give feedback.
-
Answering my own question, So I have fbx model and i am converting it into glb and for some reasons it is losing its UVs and thats why I am not able to apply any texture upon it. |
Beta Was this translation helpful? Give feedback.
Answering my own question, So I have fbx model and i am converting it into glb and for some reasons it is losing its UVs and thats why I am not able to apply any texture upon it.