From ac1784f29b98f50bcac38ab224a19cd377a0912d Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 10 Apr 2018 16:47:20 +0300 Subject: [PATCH 1/2] Update lighting.cpp Real fix for missing rows and columns. --- src/6.pbr/1.1.lighting/lighting.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/6.pbr/1.1.lighting/lighting.cpp b/src/6.pbr/1.1.lighting/lighting.cpp index a804357..38d4c07 100644 --- a/src/6.pbr/1.1.lighting/lighting.cpp +++ b/src/6.pbr/1.1.lighting/lighting.cpp @@ -132,10 +132,10 @@ int main() // render rows*column number of spheres with varying metallic/roughness values scaled by rows and columns respectively glm::mat4 model; - for (unsigned int row = 0; row < nrRows; ++row) + for (int row = 0; row < nrRows; ++row) { shader.setFloat("metallic", (float)row / (float)nrRows); - for (unsigned int col = 0; col < nrColumns; ++col) + for (int col = 0; col < nrColumns; ++col) { // we clamp the roughness to 0.025 - 1.0 as perfectly smooth surfaces (roughness of 0.0) tend to look a bit off // on direct lighting. @@ -143,8 +143,8 @@ int main() model = glm::mat4(); model = glm::translate(model, glm::vec3( - (col - (nrColumns / 2.)) * spacing, - (row - (nrRows / 2.)) * spacing, + (col - (nrColumns / 2)) * spacing, + (row - (nrRows / 2)) * spacing, 0.0f )); shader.setMat4("model", model); From 686797546a697ed6bf4dd4b7a7abde0ff3e53665 Mon Sep 17 00:00:00 2001 From: Erik Date: Tue, 10 Apr 2018 16:47:52 +0300 Subject: [PATCH 2/2] Update lighting_textured.cpp Real fix for missing rows and columns. --- src/6.pbr/1.2.lighting_textured/lighting_textured.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp b/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp index 91f2596..f37876c 100644 --- a/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp +++ b/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp @@ -148,9 +148,9 @@ int main() // render rows*column number of spheres with material properties defined by textures (they all have the same material properties) glm::mat4 model; - for (unsigned int row = 0; row < nrRows; ++row) + for (int row = 0; row < nrRows; ++row) { - for (unsigned int col = 0; col < nrColumns; ++col) + for (int col = 0; col < nrColumns; ++col) { model = glm::mat4(); model = glm::translate(model, glm::vec3(