|
|
|
@ -31,8 +31,8 @@ GLuint programTex;
|
|
|
|
|
GLuint programPbr;
|
|
|
|
|
GLuint programSun;
|
|
|
|
|
GLuint programSkyBox;
|
|
|
|
|
GLuint programBloomFinal;
|
|
|
|
|
GLuint programBlur;
|
|
|
|
|
GLuint programBloomFinal;
|
|
|
|
|
|
|
|
|
|
Core::Shader_Loader shaderLoader;
|
|
|
|
|
|
|
|
|
@ -44,7 +44,7 @@ const char* const planetTexPaths[] = { "./textures/planets/mercury.png", "./text
|
|
|
|
|
"./textures/planets/volcanic.png", "./textures/planets/desert.png", "./textures/planets/tropical.png", "./textures/planets/toxic.jpg", "./textures/planets/swamp.png",
|
|
|
|
|
"./textures/planets/savannah.png", "./textures/planets/alpine.png", "./textures/planets/ceres.jpg", "./textures/planets/eris.jpg", "./textures/planets/haumea.jpg",
|
|
|
|
|
"./textures/planets/makemake.jpg" };
|
|
|
|
|
int planetTexIndex = 80;
|
|
|
|
|
int planetTexIndex = 0;
|
|
|
|
|
GLuint planetTex;
|
|
|
|
|
|
|
|
|
|
glm::vec3 planetPos = glm::vec3(0.f, 0.f, 0.f);
|
|
|
|
@ -54,15 +54,17 @@ float planetRough = 0.5f;
|
|
|
|
|
float planetMetal = 0.5f;
|
|
|
|
|
|
|
|
|
|
const char* const sunTexPaths[] = { "./textures/suns/lava.png", "./textures/suns/sol.jpg", "./textures/suns/orange.jpg", "./textures/suns/star.png", "./textures/suns/sun.jpg" };
|
|
|
|
|
int sunTexIndex = 20;
|
|
|
|
|
int sunTexIndex = 0;
|
|
|
|
|
GLuint sunTex;
|
|
|
|
|
|
|
|
|
|
glm::vec3 sunPos = glm::vec3(20.f, 0.f, 20.f);
|
|
|
|
|
glm::vec3 sunDir = glm::vec3(1.f, 0.f, 1.f);
|
|
|
|
|
float sunSize = 0.05f;
|
|
|
|
|
|
|
|
|
|
bool glowCheck = false;
|
|
|
|
|
bool atmosphereCheck = false;
|
|
|
|
|
bool lightingCheck = false;
|
|
|
|
|
bool skyBoxCheck = false;
|
|
|
|
|
|
|
|
|
|
const char* skyBoxPaths[] = { "./textures/skybox/space_rt.png", "./textures/skybox/space_lf.png", "./textures/skybox/space_up.png", "./textures/skybox/space_dn.png",
|
|
|
|
|
"./textures/skybox/space_bk.png", "./textures/skybox/space_ft.png" };
|
|
|
|
@ -83,7 +85,6 @@ unsigned int colorBuffers[2];
|
|
|
|
|
|
|
|
|
|
unsigned int rboDepth;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned int pingpongFBO[2];
|
|
|
|
|
unsigned int pingpongColorbuffers[2];
|
|
|
|
|
|
|
|
|
@ -101,6 +102,8 @@ float cloudIntensity = 15.f;
|
|
|
|
|
float cloudMotion = 0.f;
|
|
|
|
|
float cloudBrightness = 0.08f;
|
|
|
|
|
|
|
|
|
|
float PI = 3.14159f;
|
|
|
|
|
|
|
|
|
|
glm::mat4 createCameraMatrix() {
|
|
|
|
|
glm::vec3 cameraSide = glm::normalize(glm::cross(cameraDir, glm::vec3(0.f, 1.f, 0.f)));
|
|
|
|
|
glm::vec3 cameraUp = glm::normalize(glm::cross(cameraSide, cameraDir));
|
|
|
|
@ -124,7 +127,6 @@ glm::mat4 createPerspectiveMatrix() {
|
|
|
|
|
float n = 0.01f;
|
|
|
|
|
float f = 200.f;
|
|
|
|
|
float fov = 105.f;
|
|
|
|
|
float PI = 3.14159f;
|
|
|
|
|
float S = 1 / (tan((fov / 2) * (PI / 180)));
|
|
|
|
|
|
|
|
|
|
perspectiveMatrix = glm::mat4({
|
|
|
|
@ -168,36 +170,90 @@ void renderQuad()
|
|
|
|
|
glBindVertexArray(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void showGUI() {
|
|
|
|
|
ImGui_ImplOpenGL3_NewFrame();
|
|
|
|
|
ImGui_ImplGlfw_NewFrame();
|
|
|
|
|
ImGui::NewFrame();
|
|
|
|
|
ImGui::Begin("Menu");
|
|
|
|
|
ImGui::SliderFloat("Size", &planetSize, 0.001f, 0.01f);
|
|
|
|
|
ImGui::SliderFloat("Rotation", &planetRot, -1.5f, 1.5f);
|
|
|
|
|
ImGui::SliderFloat("Light Power", &lightPower, 0.01f, 20.0f);
|
|
|
|
|
ImGui::SliderInt("Bloom", &blur_count, 0, 6);
|
|
|
|
|
if (ImGui::Button("Texture", ImVec2(60, 20))) {
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[std::abs(++planetTexIndex % 20)]);
|
|
|
|
|
}
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
if (ImGui::Button("Sun", ImVec2(60, 20))) {
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[std::abs(++sunTexIndex % 5)]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::Text("PBR Settings");
|
|
|
|
|
ImGui::Checkbox("Lighting Model", &lightingCheck);
|
|
|
|
|
ImGui::SliderFloat("Metal", &planetMetal, 0.01f, 1.0f);
|
|
|
|
|
ImGui::SliderFloat("Roughness", &planetRough, 0.01f, 1.0f);
|
|
|
|
|
if (ImGui::Begin("General"))
|
|
|
|
|
{
|
|
|
|
|
ImGui::Checkbox("SkyBox", &skyBoxCheck);
|
|
|
|
|
ImGui::Checkbox("Lighting Model: ", &lightingCheck);
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
|
|
|
|
|
ImGui::Text("Atmosphere Settings"); ImGui::Checkbox("Atmosphere", &atmosphereCheck);
|
|
|
|
|
if (lightingCheck) {
|
|
|
|
|
ImGui::Text("PBR");
|
|
|
|
|
ImGui::SliderFloat("Roughness", &planetRough, 0.0f, 1.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
ImGui::SliderFloat("Metallicity", &planetMetal, 0.0f, 1.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ImGui::Text("Diffuse");
|
|
|
|
|
|
|
|
|
|
ImGui::SliderFloat("Cloud Intensity", &cloudIntensity, 0.01f, 20.0f);
|
|
|
|
|
ImGui::SliderFloat("Cloud Brightness", &cloudBrightness, 0.01f, 0.28f);
|
|
|
|
|
ImGui::SliderFloat("Cloud Motion", &cloudMotion, 0.01f, 8.0f);
|
|
|
|
|
ImGui::SliderFloat("Exposure", &lightPower, 1.0f, 20.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
ImGui::SliderInt("Bloom Level", &blur_count, 1, 5, "%d", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
|
|
|
|
|
}ImGui::End();
|
|
|
|
|
|
|
|
|
|
if(ImGui::Begin("Planet"))
|
|
|
|
|
{
|
|
|
|
|
ImGui::Text("Texture");
|
|
|
|
|
if (ImGui::Button("Prev", ImVec2(60, 20))) {
|
|
|
|
|
--planetTexIndex;
|
|
|
|
|
|
|
|
|
|
if (planetTexIndex < 0)
|
|
|
|
|
planetTexIndex = sizeof(planetTexPaths) / sizeof(planetTexPaths[0]) - 1;
|
|
|
|
|
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[planetTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
if (ImGui::Button("Next", ImVec2(60, 20))) {
|
|
|
|
|
++planetTexIndex;
|
|
|
|
|
|
|
|
|
|
if (planetTexIndex > sizeof(planetTexPaths) / sizeof(planetTexPaths[0]) - 1)
|
|
|
|
|
planetTexIndex = 0;
|
|
|
|
|
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[planetTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::SliderFloat("Size", &planetSize, 0.001f, 0.01f, "%.5f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
ImGui::SliderFloat("Rotation", &planetRot, -2.0f, 2.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
|
|
|
|
|
ImGui::Checkbox("Atmosphere", &atmosphereCheck);
|
|
|
|
|
if (atmosphereCheck) {
|
|
|
|
|
ImGui::Text("Clouds");
|
|
|
|
|
ImGui::SliderFloat("Intensity", &cloudIntensity, 0.0f, 100.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
ImGui::SliderFloat("Brightness", &cloudBrightness, 0.01f, 0.20f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
ImGui::SliderFloat("Motion", &cloudMotion, -0.5f, 0.5f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
}
|
|
|
|
|
}ImGui::End();
|
|
|
|
|
|
|
|
|
|
if (ImGui::Begin("Sun"))
|
|
|
|
|
{
|
|
|
|
|
ImGui::Text("Texture");
|
|
|
|
|
if (ImGui::Button("Prev", ImVec2(60, 20))) {
|
|
|
|
|
--sunTexIndex;
|
|
|
|
|
|
|
|
|
|
if (sunTexIndex < 0)
|
|
|
|
|
sunTexIndex = sizeof(sunTexPaths) / sizeof(sunTexPaths[0]) - 1;
|
|
|
|
|
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
ImGui::SameLine();
|
|
|
|
|
if (ImGui::Button("Next", ImVec2(60, 20))) {
|
|
|
|
|
++sunTexIndex;
|
|
|
|
|
|
|
|
|
|
if (sunTexIndex > sizeof(sunTexPaths) / sizeof(sunTexPaths[0]) - 1)
|
|
|
|
|
sunTexIndex = 0;
|
|
|
|
|
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ImGui::SliderFloat("Size", &sunSize, 0.01f, 0.1f, "%.4f", ImGuiSliderFlags_AlwaysClamp);
|
|
|
|
|
|
|
|
|
|
ImGui::Checkbox("Glow", &glowCheck);
|
|
|
|
|
|
|
|
|
|
}ImGui::End();
|
|
|
|
|
|
|
|
|
|
ImGui::Render();
|
|
|
|
|
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
|
|
|
@ -337,7 +393,7 @@ void drawSun(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint texture
|
|
|
|
|
|
|
|
|
|
glUniform3f(glGetUniformLocation(programSun, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z);
|
|
|
|
|
|
|
|
|
|
glUniform1i(glGetUniformLocation(programSun, "atmosphereCheck"), atmosphereCheck);
|
|
|
|
|
glUniform1i(glGetUniformLocation(programSun, "glowCheck"), glowCheck);
|
|
|
|
|
glUniform1f(glGetUniformLocation(programSun, "time"), glfwGetTime());
|
|
|
|
|
|
|
|
|
|
Core::DrawContext(context);
|
|
|
|
@ -358,12 +414,11 @@ void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint text
|
|
|
|
|
glUseProgram(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void drawPlanetBlur() {
|
|
|
|
|
void drawBlur() {
|
|
|
|
|
bool horizontal = true, first_iteration = true;
|
|
|
|
|
unsigned int amount = 10;
|
|
|
|
|
glUseProgram(programBlur);
|
|
|
|
|
glUniform1i(glGetUniformLocation(programBlur, "count"), blur_count);
|
|
|
|
|
for (unsigned int i = 0; i < amount; i++)
|
|
|
|
|
for (unsigned int i = 0; i < blur_count * 2; i++)
|
|
|
|
|
{
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, pingpongFBO[horizontal]);
|
|
|
|
|
glUniform1i(glGetUniformLocation(programBlur, "horizontal"), horizontal);
|
|
|
|
@ -389,7 +444,7 @@ void drawPlanetBlur() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void renderScene(GLFWwindow* window) {
|
|
|
|
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
|
|
|
|
glClearColor(0.0f, 0.0f, 0.05f, 1.0f);
|
|
|
|
|
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
|
|
|
|
float time = glfwGetTime();
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, hdrFBO);
|
|
|
|
@ -408,7 +463,7 @@ void renderScene(GLFWwindow* window) {
|
|
|
|
|
//rysowanie słońca
|
|
|
|
|
glm::mat4 sunScale = glm::scale(glm::vec3(sunSize));
|
|
|
|
|
glm::mat4 sunTranslate = glm::translate(sunPos);
|
|
|
|
|
glm::mat4 sunRotate = glm::rotate(180.f, glm::vec3(0, 1, 0));
|
|
|
|
|
glm::mat4 sunRotate = glm::rotate(PI, glm::vec3(0, 1, 0));
|
|
|
|
|
|
|
|
|
|
drawSun(sphereContext, sunTranslate * sunRotate * sunScale, sunTex);
|
|
|
|
|
|
|
|
|
@ -417,15 +472,15 @@ void renderScene(GLFWwindow* window) {
|
|
|
|
|
glm::mat4 skyBoxScale = glm::scale(glm::vec3(skyBoxSize));
|
|
|
|
|
glm::mat4 skyBoxTranslate = glm::translate(skyBoxPos);
|
|
|
|
|
|
|
|
|
|
drawSkyBox(cubeContext, skyBoxTranslate * skyBoxScale, skyBoxTex);
|
|
|
|
|
if (skyBoxCheck)
|
|
|
|
|
drawSkyBox(cubeContext, skyBoxTranslate * skyBoxScale, skyBoxTex);
|
|
|
|
|
|
|
|
|
|
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
|
|
|
|
|
|
|
|
|
drawPlanetBlur();
|
|
|
|
|
drawBlur();
|
|
|
|
|
|
|
|
|
|
showGUI();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glfwSwapBuffers(window);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -453,16 +508,40 @@ void loadModelToContext(std::string path, Core::RenderContext& context) {
|
|
|
|
|
void key_callback(GLFWwindow* window, int key, int scancode, int action, int mods)
|
|
|
|
|
{
|
|
|
|
|
//tekstura planety
|
|
|
|
|
if (key == GLFW_KEY_T && action == GLFW_PRESS)
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[std::abs(++planetTexIndex % 20)]);
|
|
|
|
|
if (key == GLFW_KEY_Y && action == GLFW_PRESS && planetTexIndex > 0)
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[std::abs(--planetTexIndex % 20)]);
|
|
|
|
|
if (key == GLFW_KEY_T && action == GLFW_PRESS) {
|
|
|
|
|
++planetTexIndex;
|
|
|
|
|
|
|
|
|
|
if (planetTexIndex > sizeof(planetTexPaths) / sizeof(planetTexPaths[0]) - 1)
|
|
|
|
|
planetTexIndex = 0;
|
|
|
|
|
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[planetTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
if (key == GLFW_KEY_Y && action == GLFW_PRESS) {
|
|
|
|
|
--planetTexIndex;
|
|
|
|
|
|
|
|
|
|
if (planetTexIndex < 0)
|
|
|
|
|
planetTexIndex = sizeof(planetTexPaths) / sizeof(planetTexPaths[0]) - 1;
|
|
|
|
|
|
|
|
|
|
planetTex = Core::LoadTexture(planetTexPaths[planetTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//tekstura słońca
|
|
|
|
|
if (key == GLFW_KEY_U && action == GLFW_PRESS)
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[std::abs(++sunTexIndex % 5)]);
|
|
|
|
|
if (key == GLFW_KEY_I && action == GLFW_PRESS && sunTexIndex > 0)
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[std::abs(--sunTexIndex % 5)]);
|
|
|
|
|
if (key == GLFW_KEY_U && action == GLFW_PRESS) {
|
|
|
|
|
++sunTexIndex;
|
|
|
|
|
|
|
|
|
|
if (sunTexIndex > sizeof(sunTexPaths) / sizeof(sunTexPaths[0]) - 1)
|
|
|
|
|
sunTexIndex = 0;
|
|
|
|
|
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
if (key == GLFW_KEY_I && action == GLFW_PRESS) {
|
|
|
|
|
--sunTexIndex;
|
|
|
|
|
|
|
|
|
|
if (sunTexIndex < 0)
|
|
|
|
|
sunTexIndex = sizeof(sunTexPaths) / sizeof(sunTexPaths[0]) - 1;
|
|
|
|
|
|
|
|
|
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//atmosfera
|
|
|
|
|
if (key == GLFW_KEY_O && action == GLFW_PRESS)
|
|
|
|
@ -472,12 +551,20 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|
|
|
|
if (key == GLFW_KEY_P && action == GLFW_PRESS)
|
|
|
|
|
lightingCheck = !lightingCheck;
|
|
|
|
|
|
|
|
|
|
//poświata słońca
|
|
|
|
|
if (key == GLFW_KEY_E && action == GLFW_PRESS)
|
|
|
|
|
glowCheck = !glowCheck;
|
|
|
|
|
|
|
|
|
|
//skybox
|
|
|
|
|
if (key == GLFW_KEY_Q && action == GLFW_PRESS)
|
|
|
|
|
skyBoxCheck = !skyBoxCheck;
|
|
|
|
|
|
|
|
|
|
//bloom
|
|
|
|
|
if (key == GLFW_KEY_M && action == GLFW_PRESS) {
|
|
|
|
|
blur_count++;
|
|
|
|
|
if (blur_count > 5)
|
|
|
|
|
blur_count = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//obsluga wejscia
|
|
|
|
@ -513,17 +600,17 @@ void processInput(GLFWwindow* window)
|
|
|
|
|
//obrót planety
|
|
|
|
|
float rotationSpeed = 0.0025f;
|
|
|
|
|
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_RIGHT) == GLFW_PRESS && planetRot < 1.5f)
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_RIGHT) == GLFW_PRESS && planetRot < 2.0f)
|
|
|
|
|
planetRot += rotationSpeed;
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_LEFT) == GLFW_PRESS && planetRot > -1.5f)
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_LEFT) == GLFW_PRESS && planetRot > -2.0f)
|
|
|
|
|
planetRot -= rotationSpeed;
|
|
|
|
|
|
|
|
|
|
//jasność
|
|
|
|
|
float powerSpeed = 0.05f;
|
|
|
|
|
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_1) == GLFW_PRESS && lightPower < 16.f)
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_1) == GLFW_PRESS && lightPower < 20.f)
|
|
|
|
|
lightPower += powerSpeed;
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_2) == GLFW_PRESS && lightPower > 2.f)
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_2) == GLFW_PRESS && lightPower > 1.f)
|
|
|
|
|
lightPower -= powerSpeed;
|
|
|
|
|
|
|
|
|
|
lightColor = glm::vec3(lightPower, lightPower, lightPower);
|
|
|
|
@ -555,17 +642,17 @@ void processInput(GLFWwindow* window)
|
|
|
|
|
//ruch chmur
|
|
|
|
|
float motionSpeed = 0.0025f;
|
|
|
|
|
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_V) == GLFW_PRESS && cloudMotion < 1.5f)
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_V) == GLFW_PRESS && cloudMotion < 0.5f)
|
|
|
|
|
cloudMotion += motionSpeed;
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_C) == GLFW_PRESS && cloudMotion > -1.5f)
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_C) == GLFW_PRESS && cloudMotion > -0.5f)
|
|
|
|
|
cloudMotion -= motionSpeed;
|
|
|
|
|
|
|
|
|
|
//jasność chmur
|
|
|
|
|
float brightnessSpeed = 0.0005f;
|
|
|
|
|
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_N) == GLFW_PRESS && cloudBrightness < 0.16f)
|
|
|
|
|
if (glfwGetKey(window, GLFW_KEY_N) == GLFW_PRESS && cloudBrightness < 0.2f)
|
|
|
|
|
cloudBrightness += brightnessSpeed;
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_B) == GLFW_PRESS && cloudBrightness > 0.02f)
|
|
|
|
|
else if (glfwGetKey(window, GLFW_KEY_B) == GLFW_PRESS && cloudBrightness > 0.01f)
|
|
|
|
|
cloudBrightness -= brightnessSpeed;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -580,11 +667,9 @@ void init(GLFWwindow* window) {
|
|
|
|
|
ImGui::CreateContext();
|
|
|
|
|
ImGuiIO& io = ImGui::GetIO(); (void)io;
|
|
|
|
|
ImGui_ImplGlfw_InitForOpenGL(window, true);
|
|
|
|
|
ImGui_ImplOpenGL3_Init("#version 330");
|
|
|
|
|
ImGui_ImplOpenGL3_Init("#version 430");
|
|
|
|
|
ImGui::StyleColorsDark;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
glfwSetKeyCallback(window, key_callback);
|
|
|
|
|
|
|
|
|
|
programTex = shaderLoader.CreateProgram("shaders/shader_tex.vert", "shaders/shader_tex.frag");
|
|
|
|
@ -612,6 +697,8 @@ void shutdown(GLFWwindow* window) {
|
|
|
|
|
shaderLoader.DeleteProgram(programPbr);
|
|
|
|
|
shaderLoader.DeleteProgram(programSun);
|
|
|
|
|
shaderLoader.DeleteProgram(programSkyBox);
|
|
|
|
|
shaderLoader.DeleteProgram(programBlur);
|
|
|
|
|
shaderLoader.DeleteProgram(programBloomFinal);
|
|
|
|
|
ImGui_ImplOpenGL3_Shutdown();
|
|
|
|
|
ImGui_ImplGlfw_Shutdown();
|
|
|
|
|
ImGui::DestroyContext();
|
|
|
|
|