Skip to content

Commit af020fd

Browse files
committed
TextureNode: Temporary hack to fix colorspace.
1 parent 3ddd6b1 commit af020fd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/js/nodes/inputs/TextureNode.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,19 @@ THREE.TextureNode.prototype.generate = function ( builder, output ) {
4949
if ( bias ) code = method + '(' + tex + ',' + coord + ',' + bias + ')';
5050
else code = method + '(' + tex + ',' + coord + ')';
5151

52+
// TODO: This is a hack, but WebGLProgram does not know enough about
53+
// node materials to infer correct colorspace.
5254
if ( builder.isSlot( 'color' ) ) {
5355

54-
code = 'mapTexelToLinear(' + code + ')';
56+
code = 'sRGBToLinear(' + code + ')';
5557

5658
} else if ( builder.isSlot( 'emissive' ) ) {
5759

58-
code = 'emissiveMapTexelToLinear(' + code + ')';
60+
code = 'sRGBToLinear(' + code + ')';
5961

6062
} else if ( builder.isSlot( 'environment' ) ) {
6163

62-
code = 'envMapTexelToLinear(' + code + ')';
64+
code = 'sRGBToLinear(' + code + ')';
6365

6466
}
6567

0 commit comments

Comments
 (0)