Skip to content

Commit

Permalink
GLTFLoader: Fix color space for specular map. (#23630)
Browse files Browse the repository at this point in the history
* GLTFLoader: Fix color space for specular map.

* GLTFLoader: Add more missing sRGBEncoding.

* Update GLTFLoader.js
  • Loading branch information
Mugen87 authored Mar 2, 2022
1 parent e8672fd commit c5e0fdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -3308,9 +3308,12 @@ class GLTFParser {

if ( materialDef.name ) material.name = materialDef.name;

// baseColorTexture, emissiveTexture, and specularGlossinessTexture use sRGB encoding.
// baseColorTexture, emissiveTexture, sheenColorMap, specularColorMap and specularGlossinessTexture use sRGB encoding.
if ( material.map ) material.map.encoding = sRGBEncoding;
if ( material.emissiveMap ) material.emissiveMap.encoding = sRGBEncoding;
if ( material.sheenColorMap ) material.sheenColorMap.encoding = sRGBEncoding;
if ( material.specularColorMap ) material.specularColorMap.encoding = sRGBEncoding;
if ( material.specularMap ) material.specularMap.encoding = sRGBEncoding;

assignExtrasToUserData( material, materialDef );

Expand Down

0 comments on commit c5e0fdf

Please sign in to comment.