diff --git a/data/models/backpack/diffuse.jpg b/data/models/backpack/diffuse.jpg index e971a33..f7f6bdb 100644 Binary files a/data/models/backpack/diffuse.jpg and b/data/models/backpack/diffuse.jpg differ diff --git a/data/models/backpack/normal.png b/data/models/backpack/normal.png index 3a8a103..74fd343 100644 Binary files a/data/models/backpack/normal.png and b/data/models/backpack/normal.png differ diff --git a/data/models/backpack/roughness.jpg b/data/models/backpack/roughness.jpg index 9f50e67..667aef0 100644 Binary files a/data/models/backpack/roughness.jpg and b/data/models/backpack/roughness.jpg differ diff --git a/data/models/backpack/specular.jpg b/data/models/backpack/specular.jpg index 1fd675a..9897069 100644 Binary files a/data/models/backpack/specular.jpg and b/data/models/backpack/specular.jpg differ diff --git a/src/main.cpp b/src/main.cpp index 336f19c..82d4e21 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,8 +3,6 @@ // Make sure Glew is loaded first #include #include -#include -#include // Not used yet #include #include @@ -76,116 +74,6 @@ int main(int argc, char **argv) { ShaderLoader shader(ROOT_DIR "data/shaders/vertex.glsl", ROOT_DIR "data/shaders/fragment.glsl"); - // Load texture image - // SDL_Surface *image = IMG_Load(ROOT_DIR "data/container.jpg"); - // if (image == nullptr) { - // error.crash("SDL2_image was unable to load a texture", IMG_GetError()); - //} - - // create and bind texture object - // unsigned int texture; - // glGenTextures(1, &texture); - //// glBindTexture(GL_TEXTURE_2D, texture); - - //// Handle different SDL Surface data types - // int mode = GL_RGB; - // if (image->format->BytesPerPixel == 4) { - // mode = GL_RGBA; - //} - - //// Generate texture and mipmap from image - // glTexImage2D(GL_TEXTURE_2D, 0, mode, image->w, image->h, 0, mode, - // GL_UNSIGNED_BYTE, image->pixels); - // glGenerateMipmap(GL_TEXTURE_2D); - - // remove image surface now it's no longer needed to create texture - // SDL_FreeSurface(image); - // image = nullptr; - - // Generate Mesh - // Define some useful structures to be used in the mesh object - // struct Vertex { - // glm::vec3 Position; - // glm::vec3 Normal; - // glm::vec2 TexCoords; - // }; - // struct Texture { - // unsigned int id; - // std::string type; - // }; - float vertices[] = { - // positions // texture Co-ords - 0.5f, 0.5f, 0.0f, 1.0f, 1.0f, // top right - 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, // bottom right - -0.5f, -0.5f, 0.0f, 0.0f, 0.0f, // bottom left - -0.5f, 0.5f, 0.0f, 0.0f, 1.0f // top left - }; - - // unsigned int indices[] = { - // 0, 1, 3, // First triangle - // 1, 2, 3 // Second triangle - //}; - - // std::vector mvertices; - // Vertex vertex; - // vertex.Position = glm::vec3(0.5f, 0.5f, 0.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(1.0f, 1.0f); - // mvertices.push_back(vertex); - // vertex.Position = glm::vec3(0.5f, -0.5f, 0.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(1.0f, 0.0f); - // mvertices.push_back(vertex); - // vertex.Position = glm::vec3(-0.5f, -0.5f, 0.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(0.0f, 0.0f); - // mvertices.push_back(vertex); - // vertex.Position = glm::vec3(-0.5f, 0.5f, 0.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(0.0f, 1.0f); - // mvertices.push_back(vertex); - - // std::vector mindices{ - // 0, 3, 1, // First triangle - // 1, 3, 2 // Second triangle - //}; - - // std::vector mtextures; - // Texture mtexture; - // mtexture.id = texture; - // mtexture.type = "texture_diffuse"; - - // Mesh mesh(mvertices, mindices, mtextures); - - // std::vector mvertices2; - // vertex.Position = glm::vec3(0.5f, 0.5f, 1.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(1.0f, 1.0f); - // mvertices2.push_back(vertex); - // vertex.Position = glm::vec3(0.5f, -0.5f, 1.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(1.0f, 0.0f); - // mvertices2.push_back(vertex); - // vertex.Position = glm::vec3(-0.5f, -0.5f, 1.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(0.0f, 0.0f); - // mvertices2.push_back(vertex); - // vertex.Position = glm::vec3(-0.5f, 0.5f, 1.0f); - // vertex.Normal = glm::vec3(); - // vertex.TexCoords = glm::vec2(0.0f, 1.0f); - // mvertices2.push_back(vertex); - - // Mesh mesh2(mvertices2, mindices, mtextures); - - // std::vector modelMeshes; - // modelMeshes.push_back(mesh); - // modelMeshes.push_back(mesh2); - // Model model(modelMeshes); - - // Model model2(mesh); - - // model.translate(glm::vec3(1.0f, 0.0f, 0.0f)); - Model backpack(ROOT_DIR "data/models/backpack/backpack.obj"); // Model cube(ROOT_DIR "data/models/cube/cube.obj"); @@ -228,8 +116,6 @@ int main(int argc, char **argv) { shader.setMat4("MVP", camera.getMVP()); // Draw Meshes - // model2.draw(shader); - // model.draw(shader); // cube.draw(shader); backpack.draw(shader);