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 db600d2..4a7a85f 100644 --- a/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp +++ b/src/4.advanced_opengl/2.stencil_testing/stencil_testing.cpp @@ -170,7 +170,7 @@ int main() // shader configuration // -------------------- shader.use(); - shader.setInt("ourTexture", 0); + shader.setInt("texture1", 0); // render loop // ----------- @@ -243,12 +243,12 @@ int main() model = glm::mat4(); model = glm::translate(model, glm::vec3(-1.0f, 0.0f, -1.0f)); model = glm::scale(model, glm::vec3(scale, scale, scale)); - shader.setMat4("model", model); + shaderSingleColor.setMat4("model", model); glDrawArrays(GL_TRIANGLES, 0, 36); model = glm::mat4(); model = glm::translate(model, glm::vec3(2.0f, 0.0f, 0.0f)); model = glm::scale(model, glm::vec3(scale, scale, scale)); - shader.setMat4("model", model); + shaderSingleColor.setMat4("model", model); glDrawArrays(GL_TRIANGLES, 0, 36); glBindVertexArray(0); glStencilMask(0xFF); diff --git a/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp b/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp index e7c4b5e..75c0c4e 100644 --- a/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp +++ b/src/5.advanced_lighting/8.2.deferred_shading_volumes/deferred_shading_volumes.cpp @@ -224,7 +224,7 @@ int main() shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Quadratic", quadratic); // then calculate radius of light volume/sphere const float maxBrightness = std::fmaxf(std::fmaxf(lightColors[i].r, lightColors[i].g), lightColors[i].b); - float radius = (-linear + std::sqrtf(linear * linear - 4 * quadratic * (constant - (256.0f / 5.0f) * maxBrightness))) / (2.0f * quadratic); + float radius = (-linear + std::sqrt(linear * linear - 4 * quadratic * (constant - (256.0f / 5.0f) * maxBrightness))) / (2.0f * quadratic); shaderLightingPass.setFloat("lights[" + std::to_string(i) + "].Radius", radius); } shaderLightingPass.setVec3("viewPos", camera.Position);