połączenie "nowy-skybox" z "master"
@ -3,14 +3,14 @@ Pos=60,60
|
|||||||
Size=400,400
|
Size=400,400
|
||||||
|
|
||||||
[Window][Planet]
|
[Window][Planet]
|
||||||
Pos=1,217
|
Pos=1,257
|
||||||
Size=327,227
|
Size=327,229
|
||||||
|
|
||||||
[Window][Sun]
|
[Window][Sun]
|
||||||
Pos=1,445
|
Pos=1,487
|
||||||
Size=327,118
|
Size=327,120
|
||||||
|
|
||||||
[Window][General]
|
[Window][General]
|
||||||
Pos=1,0
|
Pos=1,0
|
||||||
Size=327,216
|
Size=327,256
|
||||||
|
|
||||||
|
@ -75,8 +75,16 @@ bool lightingCheck = false;
|
|||||||
bool skyBoxCheck = false;
|
bool skyBoxCheck = false;
|
||||||
bool toneMappingCheck = false;
|
bool toneMappingCheck = false;
|
||||||
|
|
||||||
const char* skyBoxPaths[] = { "./textures/skybox/space_rt.png", "./textures/skybox/space_lf.png", "./textures/skybox/space_up.png", "./textures/skybox/space_dn.png",
|
const char* skyBoxPaths0[] = { "./textures/skybox/bkg1_left.png", "./textures/skybox/bkg1_right.png", "./textures/skybox/bkg1_top.png", "./textures/skybox/bkg1_bot.png",
|
||||||
|
"./textures/skybox/bkg1_back.png", "./textures/skybox/bkg1_front.png" };
|
||||||
|
const char* skyBoxPaths1[] = { "./textures/skybox/left.png", "./textures/skybox/right.png", "./textures/skybox/top.png", "./textures/skybox/bot.png",
|
||||||
|
"./textures/skybox/back.png", "./textures/skybox/front.png" };
|
||||||
|
const char* skyBoxPaths2[] = { "./textures/skybox/bkg2_left2.png", "./textures/skybox/bkg2_right1.png", "./textures/skybox/bkg2_top3.png", "./textures/skybox/bkg2_bottom4.png",
|
||||||
|
"./textures/skybox/bkg2_back6.png", "./textures/skybox/bkg2_front5.png" };
|
||||||
|
const char* skyBoxPaths3[] = { "./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" };
|
"./textures/skybox/space_bk.png", "./textures/skybox/space_ft.png" };
|
||||||
|
const char** skyBoxArrays[] = { skyBoxPaths0, skyBoxPaths1, skyBoxPaths2, skyBoxPaths3 };
|
||||||
|
int skyBoxIndex = 0;
|
||||||
GLuint skyBoxTex;
|
GLuint skyBoxTex;
|
||||||
|
|
||||||
glm::vec3 skyBoxPos = glm::vec3(0.f, 0.f, 0.f);
|
glm::vec3 skyBoxPos = glm::vec3(0.f, 0.f, 0.f);
|
||||||
@ -189,8 +197,28 @@ void showGUI() {
|
|||||||
{
|
{
|
||||||
ImGui::Checkbox("Sky Box", &skyBoxCheck);
|
ImGui::Checkbox("Sky Box", &skyBoxCheck);
|
||||||
|
|
||||||
if (skyBoxCheck)
|
if (skyBoxCheck) {
|
||||||
|
ImGui::Text("Texture");
|
||||||
|
if (ImGui::Button("Prev", ImVec2(60, 20))) {
|
||||||
|
--skyBoxIndex;
|
||||||
|
|
||||||
|
if (skyBoxIndex < 0)
|
||||||
|
skyBoxIndex = sizeof(skyBoxArrays) / sizeof(skyBoxArrays[0]) - 1;
|
||||||
|
|
||||||
|
skyBoxTex = Core::LoadSkyBox(skyBoxArrays[skyBoxIndex]);
|
||||||
|
}
|
||||||
|
ImGui::SameLine();
|
||||||
|
if (ImGui::Button("Next", ImVec2(60, 20))) {
|
||||||
|
++skyBoxIndex;
|
||||||
|
|
||||||
|
if (skyBoxIndex > sizeof(skyBoxArrays) / sizeof(skyBoxArrays[0]) - 1)
|
||||||
|
skyBoxIndex = 0;
|
||||||
|
|
||||||
|
skyBoxTex = Core::LoadSkyBox(skyBoxArrays[skyBoxIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::SliderFloat("Rotation", &skyBoxRot, 0.0f, 360.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
ImGui::SliderFloat("Rotation", &skyBoxRot, 0.0f, 360.0f, "%.3f", ImGuiSliderFlags_AlwaysClamp);
|
||||||
|
}
|
||||||
|
|
||||||
ImGui::Checkbox("Tone Mapping", &toneMappingCheck);
|
ImGui::Checkbox("Tone Mapping", &toneMappingCheck);
|
||||||
ImGui::SliderInt("Bloom Level", &blur_count, 1, 5, "%d", ImGuiSliderFlags_AlwaysClamp);
|
ImGui::SliderInt("Bloom Level", &blur_count, 1, 5, "%d", ImGuiSliderFlags_AlwaysClamp);
|
||||||
@ -483,8 +511,6 @@ void renderScene(GLFWwindow* window) {
|
|||||||
else
|
else
|
||||||
drawPlanetTex(sphereContext, planetTranslate * planetRotate * planetScale, planetTex, normalTex);
|
drawPlanetTex(sphereContext, planetTranslate * planetRotate * planetScale, planetTex, normalTex);
|
||||||
|
|
||||||
//drawPlanetTex(sphereContext, planetTranslate * planetRotate * planetScale, planetRock, rockNormal);
|
|
||||||
|
|
||||||
//rysowanie słońca
|
//rysowanie słońca
|
||||||
glm::mat4 sunScale = glm::scale(glm::vec3(sunSize));
|
glm::mat4 sunScale = glm::scale(glm::vec3(sunSize));
|
||||||
glm::mat4 sunRotate = glm::rotate(PI, glm::vec3(0, 1, 0));
|
glm::mat4 sunRotate = glm::rotate(PI, glm::vec3(0, 1, 0));
|
||||||
@ -571,6 +597,24 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
|||||||
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//tekstura skyboxa
|
||||||
|
if (key == GLFW_KEY_G && action == GLFW_PRESS) {
|
||||||
|
++skyBoxIndex;
|
||||||
|
|
||||||
|
if (skyBoxIndex > sizeof(skyBoxArrays) / sizeof(skyBoxArrays[0]) - 1)
|
||||||
|
skyBoxIndex = 0;
|
||||||
|
|
||||||
|
skyBoxTex = Core::LoadSkyBox(skyBoxArrays[skyBoxIndex]);
|
||||||
|
}
|
||||||
|
else if (key == GLFW_KEY_H && action == GLFW_PRESS) {
|
||||||
|
--skyBoxIndex;
|
||||||
|
|
||||||
|
if (skyBoxIndex < 0)
|
||||||
|
skyBoxIndex = sizeof(skyBoxArrays) / sizeof(skyBoxArrays[0]) - 1;
|
||||||
|
|
||||||
|
skyBoxTex = Core::LoadSkyBox(skyBoxArrays[skyBoxIndex]);
|
||||||
|
}
|
||||||
|
|
||||||
//atmosfera
|
//atmosfera
|
||||||
if (key == GLFW_KEY_O && action == GLFW_PRESS)
|
if (key == GLFW_KEY_O && action == GLFW_PRESS)
|
||||||
atmosphereCheck = !atmosphereCheck;
|
atmosphereCheck = !atmosphereCheck;
|
||||||
@ -732,7 +776,7 @@ void init(GLFWwindow* window) {
|
|||||||
normalTex = Core::LoadTexture(normalTexPaths[planetTexIndex]);
|
normalTex = Core::LoadTexture(normalTexPaths[planetTexIndex]);
|
||||||
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
sunTex = Core::LoadTexture(sunTexPaths[sunTexIndex]);
|
||||||
|
|
||||||
skyBoxTex = Core::LoadSkyBox(skyBoxPaths);
|
skyBoxTex = Core::LoadSkyBox(skyBoxArrays[skyBoxIndex]);
|
||||||
|
|
||||||
blurPingPong(window);
|
blurPingPong(window);
|
||||||
|
|
||||||
|
BIN
grk/cw 6/textures/skybox/back.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_back.png
Normal file
After Width: | Height: | Size: 2.2 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_bot.png
Normal file
After Width: | Height: | Size: 3.9 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_front.png
Normal file
After Width: | Height: | Size: 1.9 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_left.png
Normal file
After Width: | Height: | Size: 3.5 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_right.png
Normal file
After Width: | Height: | Size: 2.3 MiB |
BIN
grk/cw 6/textures/skybox/bkg1_top.png
Normal file
After Width: | Height: | Size: 3.6 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_back6.png
Normal file
After Width: | Height: | Size: 7.2 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_bottom4.png
Normal file
After Width: | Height: | Size: 7.2 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_front5.png
Normal file
After Width: | Height: | Size: 7.9 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_left2.png
Normal file
After Width: | Height: | Size: 7.6 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_right1.png
Normal file
After Width: | Height: | Size: 6.5 MiB |
BIN
grk/cw 6/textures/skybox/bkg2_top3.png
Normal file
After Width: | Height: | Size: 8.0 MiB |
BIN
grk/cw 6/textures/skybox/bot.png
Normal file
After Width: | Height: | Size: 3.8 MiB |
BIN
grk/cw 6/textures/skybox/front.png
Normal file
After Width: | Height: | Size: 4.0 MiB |
BIN
grk/cw 6/textures/skybox/left.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
BIN
grk/cw 6/textures/skybox/right.png
Normal file
After Width: | Height: | Size: 4.1 MiB |
BIN
grk/cw 6/textures/skybox/top.png
Normal file
After Width: | Height: | Size: 4.0 MiB |