Search code examples
three.jsshader

The color of MeshMatcapMaterial looks very light?


I use MeshMatcapMaterial in threejs for rendering

const matCapMaterial = new THREE.MeshMatcapMaterial({
      matcap: matcapTexture
})

Here are the texture and result

The color is supppose to be darker

How can I fix this

Thanks !

enter image description here

enter image description here


Solution

  • Might be a colorspace encoding issue. Hard to tell for certain with such little code, but maybe you'd like to change from the default THREE.LinearEncoding to sRGB colorspace:

    matcapTexture.encoding = THREE.sRGBEncoding;
    
    const matCapMaterial = new THREE.MeshMatcapMaterial({
          matcap: matcapTexture
    });
    

    See the docs for more details on texture encoding.