From 2e0035a8d4151c6e066c8f6f2148cb543a53be45 Mon Sep 17 00:00:00 2001 From: Joey de Vries Date: Thu, 21 Sep 2017 08:35:13 +0200 Subject: [PATCH] fix: use radians instead of degrees for camera zoom. --- src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp | 2 +- .../1.2.depth_testing_view/depth_testing_view.cpp | 2 +- .../11.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp | 2 +- src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp | 2 +- src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp | 2 +- src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp | 2 +- src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp | 2 +- .../5.2.framebuffers_exercise1/framebuffers_exercise1.cpp | 2 +- src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp | 2 +- .../cubemaps_environment_mapping.cpp | 2 +- .../1.advanced_lighting/advanced_lighting.cpp | 2 +- src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp | 2 +- .../3.1.2.shadow_mapping_base/shadow_mapping_base.cpp | 2 +- src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp | 2 +- src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp | 2 +- .../3.2.2.point_shadows_soft/point_shadows_soft.cpp | 2 +- src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp | 2 +- .../5.1.parallax_mapping/parallax_mapping.cpp | 2 +- .../5.2.steep_parallax_mapping/steep_parallax_mapping.cpp | 2 +- .../parallax_occlusion_mapping.cpp | 2 +- src/5.advanced_lighting/6.hdr/hdr.cpp | 2 +- src/5.advanced_lighting/7.bloom/bloom.cpp | 2 +- src/6.pbr/1.1.lighting/lighting.cpp | 2 +- src/6.pbr/1.2.lighting_textured/lighting_textured.cpp | 2 +- .../ibl_irradiance_conversion.cpp | 2 +- src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp | 2 +- src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp | 2 +- src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp b/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp index 32fd6fa..588512c 100644 --- a/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp +++ b/src/4.advanced_opengl/1.1.depth_testing/depth_testing.cpp @@ -193,7 +193,7 @@ int main() shader.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("view", view); shader.setMat4("projection", projection); // cubes diff --git a/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp b/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp index 0bfc711..e6b6aad 100644 --- a/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp +++ b/src/4.advanced_opengl/1.2.depth_testing_view/depth_testing_view.cpp @@ -193,7 +193,7 @@ int main() shader.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("view", view); shader.setMat4("projection", projection); // cubes diff --git a/src/4.advanced_opengl/11.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp b/src/4.advanced_opengl/11.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp index ce62568..2a8ec4e 100644 --- a/src/4.advanced_opengl/11.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp +++ b/src/4.advanced_opengl/11.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp @@ -230,7 +230,7 @@ int main() // set transformation matrices shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 1000.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 1000.0f); shader.setMat4("projection", projection); shader.setMat4("view", camera.GetViewMatrix()); shader.setMat4("model", glm::mat4()); diff --git a/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp b/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp index 8c43b3f..8d54e97 100644 --- a/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp +++ b/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp @@ -198,7 +198,7 @@ int main() shaderSingleColor.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shaderSingleColor.setMat4("view", view); shaderSingleColor.setMat4("projection", projection); diff --git a/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp b/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp index aed79a0..24eabca 100644 --- a/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp +++ b/src/4.advanced_opengl/3.1.blending_discard/blending_discard.cpp @@ -223,7 +223,7 @@ int main() // draw objects shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); glm::mat4 model; shader.setMat4("projection", projection); diff --git a/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp b/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp index 551f84c..dbb4713 100644 --- a/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp +++ b/src/4.advanced_opengl/3.2.blending_sort/blending_sorted.cpp @@ -234,7 +234,7 @@ int main() // draw objects shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); glm::mat4 model; shader.setMat4("projection", projection); diff --git a/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp b/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp index fedd96d..a8f5fce 100644 --- a/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp +++ b/src/4.advanced_opengl/5.1.framebuffers/framebuffers.cpp @@ -248,7 +248,7 @@ int main() shader.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("view", view); shader.setMat4("projection", projection); // cubes diff --git a/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp b/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp index be5a8e0..1146c9e 100644 --- a/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp +++ b/src/4.advanced_opengl/5.2.framebuffers_exercise1/framebuffers_exercise1.cpp @@ -256,7 +256,7 @@ int main() camera.Yaw -= 180.0f; // reset it back to its original orientation camera.Pitch -= 180.0f; camera.ProcessMouseMovement(0, 0, true); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("view", view); shader.setMat4("projection", projection); // cubes diff --git a/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp b/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp index 61011ac..8ac3971 100644 --- a/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp +++ b/src/4.advanced_opengl/6.1.cubemaps_skybox/cubemaps_skybox.cpp @@ -239,7 +239,7 @@ int main() shader.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("model", model); shader.setMat4("view", view); shader.setMat4("projection", projection); diff --git a/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp b/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp index 036ad88..47461be 100644 --- a/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp +++ b/src/4.advanced_opengl/6.2.cubemaps_environment_mapping/cubemaps_environment_mapping.cpp @@ -237,7 +237,7 @@ int main() shader.use(); glm::mat4 model; glm::mat4 view = camera.GetViewMatrix(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.setMat4("model", model); shader.setMat4("view", view); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp b/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp index d4bec55..23349fd 100644 --- a/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp +++ b/src/5.advanced_lighting/1.advanced_lighting/advanced_lighting.cpp @@ -144,7 +144,7 @@ int main() // draw objects shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp b/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp index 0973140..90eddc0 100644 --- a/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp +++ b/src/5.advanced_lighting/2.gamma_correction/gamma_correction.cpp @@ -156,7 +156,7 @@ int main() // draw objects shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp b/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp index 9592136..c013687 100644 --- a/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp +++ b/src/5.advanced_lighting/3.1.2.shadow_mapping_base/shadow_mapping_base.cpp @@ -200,7 +200,7 @@ int main() glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp b/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp index 47fccd2..be71a63 100644 --- a/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp +++ b/src/5.advanced_lighting/3.1.3.shadow_mapping/shadow_mapping.cpp @@ -208,7 +208,7 @@ int main() glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp b/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp index 8f1930a..87b2f50 100644 --- a/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp +++ b/src/5.advanced_lighting/3.2.1.point_shadows/point_shadows.cpp @@ -176,7 +176,7 @@ int main() glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp b/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp index 33900dc..54d04ff 100644 --- a/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp +++ b/src/5.advanced_lighting/3.2.2.point_shadows_soft/point_shadows_soft.cpp @@ -176,7 +176,7 @@ int main() glViewport(0, 0, SCR_WIDTH, SCR_HEIGHT); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); shader.use(); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.setMat4("projection", projection); shader.setMat4("view", view); diff --git a/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp b/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp index 3a84c2f..aa33cab 100644 --- a/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp +++ b/src/5.advanced_lighting/4.normal_mapping/normal_mapping.cpp @@ -115,7 +115,7 @@ int main() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // configure view/projection matrices - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.use(); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp b/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp index 226e970..1e8e6ed 100644 --- a/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp +++ b/src/5.advanced_lighting/5.1.parallax_mapping/parallax_mapping.cpp @@ -121,7 +121,7 @@ int main() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // configure view/projection matrices - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.use(); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp b/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp index cc8b6f5..5a50315 100644 --- a/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp +++ b/src/5.advanced_lighting/5.2.steep_parallax_mapping/steep_parallax_mapping.cpp @@ -121,7 +121,7 @@ int main() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // configure view/projection matrices - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.use(); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp b/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp index c786ac6..be130e3 100644 --- a/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp +++ b/src/5.advanced_lighting/5.3.parallax_occlusion_mapping/parallax_occlusion_mapping.cpp @@ -121,7 +121,7 @@ int main() glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // configure view/projection matrices - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.use(); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/6.hdr/hdr.cpp b/src/5.advanced_lighting/6.hdr/hdr.cpp index 713ad2f..0353373 100644 --- a/src/5.advanced_lighting/6.hdr/hdr.cpp +++ b/src/5.advanced_lighting/6.hdr/hdr.cpp @@ -158,7 +158,7 @@ int main() // ----------------------------------------------- glBindFramebuffer(GL_FRAMEBUFFER, hdrFBO); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glm::mat4 projection = glm::perspective(camera.Zoom, (GLfloat)SCR_WIDTH / (GLfloat)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (GLfloat)SCR_WIDTH / (GLfloat)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); shader.use(); shader.setMat4("projection", projection); diff --git a/src/5.advanced_lighting/7.bloom/bloom.cpp b/src/5.advanced_lighting/7.bloom/bloom.cpp index 1ef70cf..401618b 100644 --- a/src/5.advanced_lighting/7.bloom/bloom.cpp +++ b/src/5.advanced_lighting/7.bloom/bloom.cpp @@ -194,7 +194,7 @@ int main() // ----------------------------------------------- glBindFramebuffer(GL_FRAMEBUFFER, hdrFBO); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); glm::mat4 view = camera.GetViewMatrix(); glm::mat4 model; shader.use(); diff --git a/src/6.pbr/1.1.lighting/lighting.cpp b/src/6.pbr/1.1.lighting/lighting.cpp index 2e08151..6e6db8e 100644 --- a/src/6.pbr/1.1.lighting/lighting.cpp +++ b/src/6.pbr/1.1.lighting/lighting.cpp @@ -105,7 +105,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.use(); shader.setMat4("projection", projection); 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 3bfb631..dafafb8 100644 --- a/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp +++ b/src/6.pbr/1.2.lighting_textured/lighting_textured.cpp @@ -110,7 +110,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); shader.use(); shader.setMat4("projection", projection); diff --git a/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp b/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp index a906d93..9e554c2 100644 --- a/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp +++ b/src/6.pbr/2.1.1.ibl_irradiance_conversion/ibl_irradiance_conversion.cpp @@ -197,7 +197,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); pbrShader.use(); pbrShader.setMat4("projection", projection); backgroundShader.use(); diff --git a/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp b/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp index cbbbf25..238cfcc 100644 --- a/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp +++ b/src/6.pbr/2.1.2.ibl_irradiance/ibl_irradiance.cpp @@ -238,7 +238,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); pbrShader.use(); pbrShader.setMat4("projection", projection); backgroundShader.use(); diff --git a/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp b/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp index e00819b..72679c0 100644 --- a/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp +++ b/src/6.pbr/2.2.1.ibl_specular/ibl_specular.cpp @@ -326,7 +326,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); pbrShader.use(); pbrShader.setMat4("projection", projection); backgroundShader.use(); diff --git a/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp b/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp index 5278503..e6fc516 100644 --- a/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp +++ b/src/6.pbr/2.2.2.ibl_specular_textured/ibl_specular_textured.cpp @@ -366,7 +366,7 @@ int main() // initialize static shader uniforms before rendering // -------------------------------------------------- - glm::mat4 projection = glm::perspective(camera.Zoom, (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); + glm::mat4 projection = glm::perspective(glm::radians(camera.Zoom), (float)SCR_WIDTH / (float)SCR_HEIGHT, 0.1f, 100.0f); pbrShader.use(); pbrShader.setMat4("projection", projection); backgroundShader.use();