Skip to content

Commit

Permalink
WebGLProgram: Avoid breaking when passing unsupported encodings and t…
Browse files Browse the repository at this point in the history
…oneMappings.
  • Loading branch information
mrdoob committed Jun 11, 2020
1 parent ef8f40f commit beb878c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/renderers/webgl/WebGLProgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ function getEncodingComponents( encoding ) {
case LogLuvEncoding:
return [ 'LogLuv', '( value )' ];
default:
throw new Error( 'unsupported encoding: ' + encoding );
console.warn( 'THREE.WebGLProgram: Unsupported encoding:', encoding );
return [ 'Linear', '( value )' ];

}

Expand Down Expand Up @@ -103,7 +104,8 @@ function getToneMappingFunction( functionName, toneMapping ) {
break;

default:
throw new Error( 'unsupported toneMapping: ' + toneMapping );
console.warn( 'THREE.WebGLProgram: Unsupported toneMapping:', toneMapping );
toneMappingName = 'Linear';

}

Expand Down

0 comments on commit beb878c

Please sign in to comment.