CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.72k stars 308 forks source link

Emissive color resets to default #312

Open radim-nedved opened 1 month ago

radim-nedved commented 1 month ago

When I include both the Ke (emissive color) property and map_Ke (emissive texture) in my .mtl file, the Ke color value resets to white (1 1 1) after conversion. However, if I only use the Ke property without map_Ke, the emissive color remains as expected.

javagl commented 1 month ago

This seems to be hard-wired at https://github.com/CesiumGS/obj2gltf/blob/ce0c36e28193205f6465a22c03f554fe22597f46/lib/loadMtl.js#L911 , but I don't see an obvious reason why this should be happening. I'd say that whenever a value is not given, then it should have its default (i.e. preferably simply be omitted from the glTF material definition), and the presence of textures should not affect the respective factors.