PacktPublishing / Mastering-Graphics-Programming-with-Vulkan

MIT License
539 stars 73 forks source link

Loading gltf files bug makes it impossible to open gltf files #46

Closed GideonUng closed 1 year ago

GideonUng commented 1 year ago

most of the gltf files supply their paths relative to the gltf file. the engine does not take this into account and tries to open the uri directly through stb. file path correctness IS NOT CHECKED! so uninitialized int values are then used for mip calculations for example.

when the working directory is set to the same directory as the gltf file the gltf file cant be opened since file_directory_from_path cannot deal with paths not including at least one forward or backslash.

as a purchaser of the book i am very disappointment in the quality and robustness of these examples. there are countless trivial issues i find just by reading through the code that shouldnt make it past any reasonable code review. neither on windows nor on linux the example works out of the box. It makes following the book a lot harder and diminishes some of the value of the purchase.

theWatchmen commented 1 year ago

most of the gltf files supply their paths relative to the gltf file. the engine does not take this into account and tries to open the uri directly through stb. file path correctness IS NOT CHECKED! so uninitialized int values are then used for mip calculations for example.

Given the timeline for the project, we could only do so much testing. We have improved the permutations of glTF files supported by the framework since the book release, but we limited our testing to the glTF samples provided by Khronos. If there are issues with other models, please share which model you are trying to load and we can look into it.

when the working directory is set to the same directory as the gltf file the gltf file cant be opened since file_directory_from_path cannot deal with paths not including at least one forward or backslash.

This is not a scenario we have considered. We'll take a look.

as a purchaser of the book i am very disappointment in the quality and robustness of these examples.

While I can understand the frustration, we clearly state in the book that this is not meant to be production quality code. As I mentioned, we had a limited time frame to complete the project and we focused on the algorithms implementation rather than making the code robust to all possible scenarios.

there are countless trivial issues i find just by reading through the code that shouldnt make it past any reasonable code review. neither on windows nor on linux the example works out of the box. It makes following the book a lot harder and diminishes some of the value of the purchase.

While this might have been true at the time of release, we fixed some of the minor issues that were reported and most people seem happy with what we have delivered. As with any software project, there will be use cases we didn't think of. If you'd like to provide more details - or even better a PR - we'd be happy to look into it.

theWatchmen commented 1 year ago

Closing due to inactivity. Feel free to re-open if needed.