mirror of
https://github.com/JoeyDeVries/LearnOpenGL.git
synced 2026-01-30 20:13:22 +08:00
refactored CMakeLists to build for Linux Mint 17.2, and removed std::sqrtf which is not apart of GCC C++ libraries apparently
This commit is contained in:
@@ -219,7 +219,7 @@ int main()
|
||||
// Then calculate radius of light volume/sphere
|
||||
const GLfloat lightThreshold = 5.0; // 5 / 256
|
||||
const GLfloat maxBrightness = std::fmaxf(std::fmaxf(lightColors[i].r, lightColors[i].g), lightColors[i].b);
|
||||
GLfloat radius = (-linear + std::sqrtf(linear * linear - 4 * quadratic * (constant - (256.0 / lightThreshold) * maxBrightness))) / (2 * quadratic);
|
||||
GLfloat radius = (-linear + static_cast<float>(std::sqrt(linear * linear - 4 * quadratic * (constant - (256.0 / lightThreshold) * maxBrightness)))) / (2 * quadratic);
|
||||
glUniform1f(glGetUniformLocation(shaderLightingPass.Program, ("lights[" + std::to_string(i) + "].Radius").c_str()), radius);
|
||||
}
|
||||
glUniform3fv(glGetUniformLocation(shaderLightingPass.Program, "viewPos"), 1, &camera.Position[0]);
|
||||
@@ -434,4 +434,4 @@ void mouse_callback(GLFWwindow* window, double xpos, double ypos)
|
||||
void scroll_callback(GLFWwindow* window, double xoffset, double yoffset)
|
||||
{
|
||||
camera.ProcessMouseScroll(yoffset);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user