I exported a glb file from blender. It has texture applied. But when I load it on web through R3F, it looks too much exposed and texture is very weird and low quality with no color. But when I load this in gltf Viewer it looks perfect. Below is the output images and code.
Output Images:
React Three Js output
Gltf Viewer Output
import { Canvas } from "@react-three/fiber";
import { useGLTF, Stage, PresentationControls } from "@react-three/drei";
import { useCreateAvatarStore } from "../store/store";
function Model(props) {
const avatarUrl = useCreateAvatarStore(state => state.garmentAvatarVariable.avatar_url);
const { scene } = useGLTF(`http://localhost:8080/${avatarUrl}`);
return <primitive object={scene} {...props} />;
}
export default function DressedAvatar() {
return (
<Canvas
dpr={[2, 2]}
camera={{ fov: 45 }}
style={{ height: "100%", width: "100%" }}
gl={{ toneMapping: 0, exposure: 0 }}
>
<ambientLight intensity={0.3} />
<directionalLight intensity={2.5} />
<color attach="background" args={["#808080"]} />
<PresentationControls speed={1.5} global zoom={0.5} polar={[-0.1, Math.PI / 4]}>
<Stage environment={null}>
<Model scale={0.01} />
</Stage>
</PresentationControls>
</Canvas>
);
}