Exporting a textured image from Blender and using with React Three FIber (shaders?)

Viewed 9

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):

materials in blender

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:

ring result in browser

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:

material properties

  • 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. If it is an issue with the way I'm using Blender, I'll close this question and re-ask it on https://blender.stackexchange.com.

Thanks for the help.

0 Answers
Related