Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLTFModel does not set Texture encoding correctly for PBR materials #289

Open
xeolabs opened this issue Nov 6, 2018 · 1 comment
Open

Comments

@xeolabs
Copy link
Owner

xeolabs commented Nov 6, 2018

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

@yihoo
Copy link

yihoo commented Mar 20, 2019

When I use "pbrMetallicRoughness" in my model.gltf, it shows this following error:
Cannot set property encoding of # 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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants