Skip to content
Snippets Groups Projects
Commit 8ba16eb5 authored by Trevor Hollmann's avatar Trevor Hollmann
Browse files

[#79] Add some TODO comments.

parent a2969528
No related branches found
No related tags found
1 merge request!69Resolve "Rework Asset Loader API"
Pipeline #25911 failed
...@@ -313,7 +313,7 @@ int loadScene(const std::string &path, Scene &scene){ ...@@ -313,7 +313,7 @@ int loadScene(const std::string &path, Scene &scene){
} }
const size_t numVertexGroups = objectMesh.primitives.size(); const size_t numVertexGroups = objectMesh.primitives.size();
vertexGroups.reserve(numVertexGroups); vertexGroups.reserve(numVertexGroups); // FIXME this is a bug
vertexGroups.push_back({ vertexGroups.push_back({
static_cast<PrimitiveMode>(objectPrimitive.mode), static_cast<PrimitiveMode>(objectPrimitive.mode),
...@@ -349,6 +349,8 @@ int loadScene(const std::string &path, Scene &scene){ ...@@ -349,6 +349,8 @@ int loadScene(const std::string &path, Scene &scene){
for(int k = 0; k < sceneObjects.textures.size(); k++){ for(int k = 0; k < sceneObjects.textures.size(); k++){
const fx::gltf::Texture &tex = sceneObjects.textures[k]; const fx::gltf::Texture &tex = sceneObjects.textures[k];
const fx::gltf::Image &img = sceneObjects.images[tex.source]; const fx::gltf::Image &img = sceneObjects.images[tex.source];
// TODO Image objects in glTF can have a URI _or_ a bufferView and
// a mimeType; but here we are assuming to always find a URI.
std::string img_uri = dir + "/" + img.uri; std::string img_uri = dir + "/" + img.uri;
int w, h, c; int w, h, c;
uint8_t *data = stbi_load(img_uri.c_str(), &w, &h, &c, 4); uint8_t *data = stbi_load(img_uri.c_str(), &w, &h, &c, 4);
...@@ -391,7 +393,7 @@ int loadScene(const std::string &path, Scene &scene){ ...@@ -391,7 +393,7 @@ int loadScene(const std::string &path, Scene &scene){
// materials textureMask like this: // materials textureMask like this:
// mat.textureMask |= bitflag(asset::normal); // mat.textureMask |= bitflag(asset::normal);
materials.push_back({ materials.push_back({
0, 0, // TODO
material.pbrMetallicRoughness.baseColorTexture.index, material.pbrMetallicRoughness.baseColorTexture.index,
material.pbrMetallicRoughness.metallicRoughnessTexture.index, material.pbrMetallicRoughness.metallicRoughnessTexture.index,
material.normalTexture.index, material.normalTexture.index,
......
...@@ -59,7 +59,7 @@ int main(int argc, const char** argv) { ...@@ -59,7 +59,7 @@ int main(int argc, const char** argv) {
} }
else { else {
std::cout << "Mesh loading failed: " << result << std::endl; std::cout << "Mesh loading failed: " << result << std::endl;
return 1; return EXIT_FAILURE;
} }
assert(!scene.vertexGroups.empty()); assert(!scene.vertexGroups.empty());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment