CesiumGS / obj2gltf

Convert OBJ assets to glTF
Apache License 2.0
1.71k stars 307 forks source link

load .obj mtl material data #249

Closed HappyKuTou closed 4 years ago

HappyKuTou commented 4 years ago

Describe the issue

I have to convert obj to gltf by c++ data in obj mtl file is not pbr data how can I fill the tinygltf material struct after load obj mtl file

To Reproduce

Expected behaviour

I need to write mtl data in tinygltf material struct

Screenshots this is tinygltf material struct image

this is obj mtl file image

lilleyse commented 4 years ago

@HappyKuTou this area of the code is how obj2gltf converts .mtl to glTF PBR materials: https://github.com/CesiumGS/obj2gltf/blob/79848febe31d3fb5024767c7e8a481728dd491e1/lib/loadMtl.js#L733-L755

Ultimately there's not a perfect conversion from the blinn/phong model to metallic-roughness so we approximated it as best we could. Hopefully this is enough to get started with your converter. I'm going to close the issue since there's no action here for obj2gltf.

HappyKuTou commented 4 years ago

thanks

Sean Lilley notifications@github.com 于2020年8月28日周五 下午9:49写道:

Closed #249 https://github.com/CesiumGS/obj2gltf/issues/249.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CesiumGS/obj2gltf/issues/249#event-3704045046, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKGJOIWEQH5SCBBASCAEWCTSC6YWHANCNFSM4QNSQOZQ .