xeogl icon indicating copy to clipboard operation
xeogl copied to clipboard

GLTFModel does not set Texture encoding correctly for PBR materials

Open xeolabs opened this issue 6 years ago • 1 comments

Textures loaded by GLTFModel should be sRGB when they are for PBR materials, and GLTFModel attempts to set the encoding property as such, however that property is read only. Therefore, they are always linear.

https://github.com/xeolabs/xeogl/blob/master/examples/js/models/glTFModel.js#L876

xeolabs avatar Nov 06 '18 20:11 xeolabs

When I use "pbrMetallicRoughness" in my model.gltf, it shows this following error: Cannot set property encoding of #<Texture> which has only a getter. or TypeError: Attempted to assign to readonly property.

----------------model.gltf--------------------------------- "materials" : [ { "name" : "160802_mia337_001149_finalOBJ", "pbrMetallicRoughness" : { "baseColorFactor" : [ 0.6400000190734865, 0.6400000190734865, 0.6400000190734865, 1.0 ], "baseColorTexture" : { "index" : 0 }, "metallicFactor" : 0.0 } } ],

So I'm wondering that my issue is relevant of your notification. Can you give me some advice to fix it?

yihoo avatar Mar 20 '19 12:03 yihoo