On some OBJ-models exported from Blender (or 3ds Max) textures displays wrong.
I tried to use BABYLON.OBJFileLoader.OPTIMIZE_WITH_UV = true before calling BABYLON.SceneLoader.Append(...), but this had no effect.
Autodesk FBX Review displays the model correctly.
I attach link (Yandex.Disk) to the model itself and screenshots of how it should be and how it is.
Pinging @brianzinn to see if he has an idea
I checked out the shared files - the textures are 60MB of .dds files. It looks like the normals are displayed wrong (there are images of actual vs expected), but when you load it in the sandbox the normals are correct.
Unfortunately, I have 2 issues I am looking into in the forum - one with the OBJ exporter and the other with adding smoothing groups feature to OBJ loader. I don't have any more bandwidth to take this on. I'm already struggling to find time for these 2. If this isn't fixed when the other 2 are done then I will definitely start, but cannot make any commitments on time. Thanks for asking - looks like an interesting one to solve :)
No worries..@drigax should soon be able to have a look at it
@shults-s I was able to take a look at the model, I noticed that blender and 3ds Max imported your OBJ without issue. The model also loaded your model exported as GLTF without issue as well, but our texture coordinates appear to be inverted when we import OBJ into Babylon.
I added some OBJ loader settings to give you more control over how your model's texture coordinates are loaded, setting:
BABYLON.OBJFileLoader.UV_SCALE = new Vector2(1, -1);
in your scene before loading the model should allow it to be displayed as intended as a workaround.
However, I am interested in seeing if there is a pattern to this, whether it is the texture format (@PatrickRyanMS noticed that the DDS were inverted on importing, while loading a jpeg conversion of the texture worked as intended) or the exporting modeling program.
I tried loading some arbitrary OBJ models as well through the importer, but couldn't quite reproduce this issue.
Please feel free to reopen this let me know if you run into any other inconsistencies when loading your assets.
@deltakosh @brianzinn @Drigax
Thank you so much for your help! Apparently, this is a really strange exporter of 3DS Max. It seems that it's time to switch to GLTF, there are no such problems with exporters :)
Babylon.js allowed me to write a bachelor's diploma in a quality and a very short time, when I thought that I was no longer in time. Thank you.
Lovely feedback thanks a lot!
Pinging @PirateJC FYI :)
Amazing @shults-s! Thanks so much for all of the feedback! This is incredible to hear!
Most helpful comment
@deltakosh @brianzinn @Drigax
Thank you so much for your help! Apparently, this is a really strange exporter of 3DS Max. It seems that it's time to switch to GLTF, there are no such problems with exporters :)
Babylon.js allowed me to write a bachelor's diploma in a quality and a very short time, when I thought that I was no longer in time. Thank you.