I'm still pretty new to 3d with blender (and coding in 3d), but I'm trying to create and export a material using nodes (instead of a jpg image):
In React, I'm coding as follows:
export default function Ring({ ...props }: JSX.IntrinsicElements['group']) {
const group = useRef<THREE.Group>(null)
const { nodes, materials } = useGLTF('../assets/ring.glb', 'https://www.gstatic.com/draco/versioned/decoders/1.4.1/') as GLTFResult
return (
<group ref={group} {...props} dispose={null}>
<mesh castShadow receiveShadow geometry={nodes.ring.geometry} material={materials['Material.001']} />
</group>
)
}
However, in the browser I am getting this result:
I'm trying to figure out if the issue is:
- a. There is nothing to reflect, and therefore no color (I added <Sky .. /> and <Environment .. /> tags hoping this would solve it.
- b. The code needs some extra code to pull in other parameters which are part of the object itself:
- c. I need to add extra shaders or something because of 'unknown unknowns' in the way I'm using things.
- d. I've exported it wrongly - which might be the case because I've tried importing here: https://3dviewer.net/ and it is still white. (I tried using 'apply modifiers' when exporting).
Either way, I need to figure out if this is an exporting issue, or a coding issue.
Thanks for the help.


