JoeyDeVries / LearnOpenGL

Code repository of all OpenGL chapters from the book and its accompanying website https://learnopengl.com
https://learnopengl.com
Other
10.86k stars 2.78k forks source link

Missing textures on "nanosuit.obj" #152

Open ArtemBorodinEvgenyevich opened 4 years ago

ArtemBorodinEvgenyevich commented 4 years ago

I've been following your tutorials on loading models with assimp and project can't load textures on the provided model (also on my models with edited path in .mtl file)

Project gives me a following error -

"Texture failed to load at path: "

without no path displayed. Same thing happened in your git project when I've compiled it.

Is that an issue or maybe I should write some additional code for path on Linux (currently using Kubuntu 19.04)?

JoeyDeVries commented 4 years ago

Hmm, I'm currently rewriting large parts of LearnOpenGL for physical book copy, including a revised look at the source code. I'll check to see if your issue persists on my Windows machines; can't check on Linux, but if it does work on my machines it's likely something unique to Linux. I'll get back to you on this.

ArtemBorodinEvgenyevich commented 4 years ago

@JoeyDeVries , ok thanks, looking forward to your reply!

waxenegger commented 4 years ago

@ArtemBorodinEvgenyevich assimp seems to have various versions that show one or another issue when reading the texture path...

when I debugged the problem I had with the 3.something version that I use when calling GetTexture I noticed that the internal char buffer (in type aiString) starts with 4 '\0' characters after which the actual texture name can be found. I worked around this eliminating the leading zeros since such a c string will be empty.

that said I don't know what causes my problem (distro package, bug in the version I use) let alone yours but it might be worth having a look in the debugger and inspect the variables in question to see what's there.