KhronosGroup / glTF-Blender-IO

Blender glTF 2.0 importer and exporter
https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html
Apache License 2.0
1.48k stars 316 forks source link

T60890: 2.8 GLTF/GLB Vertex Colors incorrect #261

Closed julienduroure closed 5 years ago

julienduroure commented 5 years ago

On blender issue tracker: https://developer.blender.org/T60890

I asked some example files

julienduroure commented 5 years ago

Linked to #127 ?

julienduroure commented 5 years ago

The user added a test file and some details on blender issue tracker

donmccurdy commented 5 years ago

Posted an update on https://developer.blender.org/T60890 – I think the importer may need to convert, similarly to this PR: https://github.com/KhronosGroup/glTF-Blender-Exporter/pull/209/files. I can't reproduce an issue in the exporter, but only tested 2.80 so far. It's also possible that Godot is not handling vertex colors quite correctly; we should encourage users to compare at least one of the online viewers as well.

donmccurdy commented 5 years ago

colorTest.gltf.zip

julienduroure commented 5 years ago

@donmccurdy Fixed it in branch import_vertexcolor_linear2sRGB

Can you please test it on your side? 4 eyes are better than 2 for color issues :)

capnm commented 5 years ago

I'm only looking at the for import-export-import-... increased computing effort and precision lost.

I wonder if glTF should not support a proper color management as usual in the professional printing industry (ie ICC profiles)?

donmccurdy commented 5 years ago

@julienduroure this looks very, very close. On a roundtrip import/export the color becomes slightly darker, though – I've left a comment with what I think is the cause https://github.com/KhronosGroup/glTF-Blender-IO/commit/08987ef4b8503275c875c2097e0ea842643d08fb.

I wonder if glTF should not support a proper color management as usual in the professional printing industry (ie ICC profiles)?

glTF is deliberately specific about how its colors must be managed, and exporters must convert data to that. glTF does not allow arbitrary color profiles to be used inside the file – while that makes sense when the final output is a printed product, the data passed to a realtime engine needs to match what engines support.

julienduroure commented 5 years ago

You're right, I miss-read the formula. Will fix it asap

julienduroure commented 5 years ago

@donmccurdy I just pushed a fix :)

donmccurdy commented 5 years ago

@julienduroure the fix looks correct now, thanks! roundtrip import/export is giving the same vertex colors for me. :)