diff --git a/src/mesh.cpp b/src/mesh.cpp index 0bf0ec6..a17d196 100644 --- a/src/mesh.cpp +++ b/src/mesh.cpp @@ -241,7 +241,7 @@ void Mesh::RenderByOpenGL(OpenGLRenderingContext context, aiNode *node) glEnableVertexAttribArray(1); glEnableVertexAttribArray(2); - for (int i = 0; i < node->mNumMeshes; i++) + for (unsigned int i = 0; i < node->mNumMeshes; i++) { auto &obj = m_Entries[node->mMeshes[i]]; @@ -276,7 +276,7 @@ void Mesh::RenderByOpenGL(OpenGLRenderingContext context, aiNode *node) glDisableVertexAttribArray(1); glDisableVertexAttribArray(2); - for (int i = 0; i < node->mNumChildren; i++) + for (unsigned int i = 0; i < node->mNumChildren; i++) { RenderByOpenGL(context, node->mChildren[i]); } @@ -299,7 +299,7 @@ boost::optional Mesh::Raytrace(const glm::vec3 &source, const auto &vertices = obj.first.vertices_; const auto &indices = obj.first.indices_; - for (int i = 0; i < indices.size(); i += 3) + for (unsigned int i = 0; i < indices.size(); i += 3) { auto vertex1 = vertices[indices[i + 0]]; auto vertex2 = vertices[indices[i + 1]]; diff --git a/src/raytracer.cpp b/src/raytracer.cpp index aa22cc7..48eee7d 100644 --- a/src/raytracer.cpp +++ b/src/raytracer.cpp @@ -6,7 +6,7 @@ boost::optional Raytracer::Trace(glm::vec3 source, glm::vec3 targe const Scene &scene) { boost::optional intersection_so_far; - auto intersection_dist_so_far = std::numeric_limits::infinity(); + // auto intersection_dist_so_far = std::numeric_limits::infinity(); OpenGLRenderingContext ctx; ctx.lights_ = scene.point_lights_; ctx.ambient = scene.ambient_light_; @@ -15,11 +15,11 @@ boost::optional Raytracer::Trace(glm::vec3 source, glm::vec3 targe { if (auto intersection = renderable->Raytrace(source, target, ctx, 1)) { - auto intersection_dist = glm::length(source - intersection->position); + // auto intersection_dist = glm::length(source - intersection->position); // if (intersection_dist < intersection_dist_so_far) //{ intersection_so_far = intersection; - intersection_dist_so_far = intersection_dist; + // intersection_dist_so_far = intersection_dist; // } break; } diff --git a/src/view_raytracer.cpp b/src/view_raytracer.cpp index bba0964..f96b0af 100644 --- a/src/view_raytracer.cpp +++ b/src/view_raytracer.cpp @@ -64,7 +64,7 @@ void ViewRaytracer::TakePicture(glm::vec3 camera_pos, glm::mat4 mvp, const Scene auto rt_func = [&](int x_start, int cols) -> void { for (int x = x_start; x < x_start + cols; x += 1) { - for (int y = 0; y < ry_; y += 1) + for (unsigned int y = 0; y < ry_; y += 1) { float xr = (float(x) - float(rx_ / 2)) / (float(rx_ / 2)); float yr = (float(y) - float(ry_ / 2)) / (float(ry_ / 2)); @@ -107,7 +107,7 @@ void ViewRaytracer::TakePicture(glm::vec3 camera_pos, glm::mat4 mvp, const Scene auto threads_num = Config::inst().GetOption("threads"); auto cols_per_thread = Config::inst().GetOption("cols_per_thread"); - for (int x = 0; x < rx_; x += threads_num * cols_per_thread) + for (unsigned int x = 0; x < rx_; x += threads_num * cols_per_thread) { std::vector threads; for (int t = 0; t < threads_num; t++)