pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
733 stars 119 forks source link

fix: Add support for sRGBTransferOETF to fix the runtime error `'LinearTosRGB' : no matching overloaded function found` #380

Closed gumob closed 1 month ago

gumob commented 1 month ago

Add support for sRGBTransferOETF to fix the runtime error below.

THREE.WebGLProgram: Shader Error 0 - VALIDATE_STATUS false

Material Name: 
Material Type: ShaderMaterial

Program Info Log: Fragment shader is not compiled.

FRAGMENT

ERROR: 0:173: 'LinearTosRGB' : no matching overloaded function found
ERROR: 0:173: '=' : dimension mismatch
ERROR: 0:173: 'assign' : cannot convert from 'const mediump float' to 'out highp 4-component vector of float'

  168: 
  169: uniform sampler2D tDiffuse;
  170: varying vec2 vUv;
  171: void main() {
  172:  vec4 tex = texture2D( tDiffuse, vUv );
> 173:  gl_FragColor = LinearTosRGB( tex );
  174: }
codesandbox-ci[bot] commented 1 month ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.