瀏覽代碼

Convert baseColorFactor to linear space

Popov72 4 年之前
父節點
當前提交
b9ca04170d
共有 2 個文件被更改,包括 2 次插入0 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 1 0
      loaders/src/glTF/2.0/glTFLoader.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -117,6 +117,7 @@
 - Fix for warning in chrome about passive wheel events ([#9777](https://github.com/BabylonJS/Babylon.js/pull/9777)) ([kaliatech](https://github.com/kaliatech))
 - Fix crash when cloning material in `AssetContainer.instantiateModelsToScene` when mesh is an instanced mesh ([Popov72](https://github.com/Popov72))
 - Fix issue with NinePatch displaying half pixel gaps between slices on Firefox browsers. ([Pryme8](https://github.com/Pryme8))
+- Fix `baseColorFactor` not being converted to linear space when reading a gltf/glb file ([Popov72](https://github.com/Popov72))
 
 ## Breaking changes
 

+ 1 - 0
loaders/src/glTF/2.0/glTFLoader.ts

@@ -1708,6 +1708,7 @@ export class GLTFLoader implements IGLTFLoader {
             if (properties.baseColorFactor) {
                 babylonMaterial.albedoColor = Color3.FromArray(properties.baseColorFactor);
                 babylonMaterial.alpha = properties.baseColorFactor[3];
+                babylonMaterial.albedoColor.toLinearSpaceToRef(babylonMaterial.albedoColor);
             }
             else {
                 babylonMaterial.albedoColor = Color3.White();