reactjsthree.jsreact-three-fiber

Color differences between threejs + vanilla js and react-three-fiber + create-react-app


This has been bugging me for a while. Why the material colors in react-three-fiber appears to be dull than in threejs

Threejs

enter image description here

react-three-fiber

enter image description here


Solution

  • r3f uses correct gamma in a srgb colorspace and automatically converts colors and textures to srgb. this is similar to what aframe does. threejs has incorrect gamma settings in a linear colorspace, which is not very usable. wrong gamma is the #1 reason for cheap, plasticy looking 3d scenes. see: https://www.donmccurdy.com/2020/06/17/color-management-in-threejs

    if you want a linear colorspace, just do: <Canvas colorManagement={false}> and now your colors will match.