瀏覽代碼

Fix glTF Specular-Glossiness material by converting specularMap in sRGB space

Takahiro 7 年之前
父節點
當前提交
1bc987e707
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      examples/js/loaders/GLTFLoader.js

+ 1 - 0
examples/js/loaders/GLTFLoader.js

@@ -529,6 +529,7 @@ THREE.GLTFLoader = ( function () {
 					'vec3 specularFactor = specular;',
 					'vec3 specularFactor = specular;',
 					'#ifdef USE_SPECULARMAP',
 					'#ifdef USE_SPECULARMAP',
 					'	vec4 texelSpecular = texture2D( specularMap, vUv );',
 					'	vec4 texelSpecular = texture2D( specularMap, vUv );',
+					'	texelSpecular = sRGBToLinear( texelSpecular );',
 					'	// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture',
 					'	// reads channel RGB, compatible with a glTF Specular-Glossiness (RGBA) texture',
 					'	specularFactor *= texelSpecular.rgb;',
 					'	specularFactor *= texelSpecular.rgb;',
 					'#endif'
 					'#endif'