possible to have Gltf-Jsx pull material properties? (feature request) #583
BryanChrisBrown
started this conversation in
General
Replies: 1 comment
-
you can do that. const texture = useState(state => state.currentTexture)
return <mesh geometry={nodes.mesh.geometry} material={nodes.mesh.material} material-map={texture} /> the reason it doesn't re-create the materials is because they're often shared, and that would create bad perf and some other complications. the first version had what you wanted but it was quickly revealed that this will just be creating serious bugs. with object-piercing you have the power to set individual props, even if they're nested within the mesh - they can go as deep as you want. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Currently, the gltf-jsx add on exposes geometry nodes, but for materials It just lists the material name assigned to the geometry. In the demo video of gltf-jsx it shows having the metalness and color of some materials exposed, but It does not expose texture assignments.
This would be useful for cases like furniture customizers, where there are a lot of variants with only minor changes, that don't necessitate a whole model change. A good example of this would be Ikea's wooden veneers, to switch something like this out we'd need to change the diffuse texture rather than just the base color of the object.
I would find it useful to have a command line argument like
--material
to expose the parameters of the gltf's materials, that way it'd be easier to switch out texture maps and other material properties.gltf-jsx is alreay an incredibly useful tool and It's made my life way easier working with react-three-fiber. A feature like this would make it even better :)
Beta Was this translation helpful? Give feedback.
All reactions