OpenDroneMap / Obj2Tiles

Converts OBJ files to OGC 3D tiles by performing splitting, decimation and conversion
GNU Affero General Public License v3.0
196 stars 58 forks source link

added support for meshes with diffuse AND normal map #51

Closed charly-perspectives closed 9 months ago

charly-perspectives commented 11 months ago

Hey there.

Following the issue #47, I modified obj2tiles in order tu support normal maps.

If you add the norm attribute in the .mtl file, the output 3DTiles will contain the normal map in its material. Example:

newmtl default
Kd 0.5000000000 0.5000000000 0.5000000000
Ks 1.0000000000 1.0000000000 1.0000000000
Tr 0.0000000000
d 1.0000000000
Tf 1.0000000000 1.0000000000 1.0000000000
Pr 0.0000000000
Pm 0.0000000000
Pc 0.0000000000
Pcr 0.0000000000
Ni 1.5199999809
Ke 0.0000000000 0.0000000000 0.0000000000
illum 2
map_Kd textures\trap.png
norm textures\Box002NormalsMap.tga.png

Thank you for reading me, I'd like to know what do you expect for this PR to be mergeable.

pierotofy commented 9 months ago

Hi @charly-perspectives :wave: thanks for the PR (and sorry for the late review). This is certainly an interesting addition. I have no insights into the issue of needing both a diffuse and normal map, perhaps this is something glTF specific.