diff --git a/cw_8/README.md b/cw_8/README.md new file mode 100644 index 0000000..7c284dd --- /dev/null +++ b/cw_8/README.md @@ -0,0 +1,36 @@ +## Projekt GRK 2023Z +Szymon Szczubkowski, Agnieszka Wyrosławska + +## Zaimplementowane technologie + +### Physically based rendering +W projekcie zaimplementowane jest oświetlenie PBR. Wspiera ono albedo, roughness, metallic, ambient occlusion oraz **normal** mapy. + +### Normal mapping +Razem z PBR zaimplementowane zostało wsparcie dla normal maps. + + +![picture](https://i.imgur.com/VJP72bY.png) + +### Skybox cubemap +W tle widoczny jest skybox kosmosu. + +![picture](https://i.imgur.com/1X3LDC5.png) + + +### Billboarding +Na potrzeby wyświetlania cząsteczek ognia zaimplementowany został billboarding. + +![picture](https://i.gyazo.com/d00aba38d49f6179861f68ec464b4753.gif) + +### Gamepad mapping +Jeśli wykryty zostanie gamepad, sterowanie zostanie na niego przełączone. +Sprawdzany jest stopień popchnięcia gałki oraz wciśnięcia spustu, prędkość statku skaluje się z nimi. +Sterowanie wygląda następująco: + +FUNKCJA | PRZYCISK +--- | --- +LOT W PRZÓD | PRAWY TRIGGER +LOT W TYŁ | LEWY TRIGGER +OBRÓT LEWO-PRAWO | LEWA GAŁKA +NACHYLENIE GÓRA-DÓŁ | PRAWA GAŁKA \ No newline at end of file diff --git a/cw_8/src/Particle.cpp b/cw_8/src/Particle.cpp index 0ba22f0..3f5e3ec 100644 --- a/cw_8/src/Particle.cpp +++ b/cw_8/src/Particle.cpp @@ -40,13 +40,13 @@ void ParticleGenerator::Draw(glm::mat4 modelMatrix, GLuint programParticle, GLui void ParticleGenerator::init() { unsigned int VBO; float particle_quad[] = { - 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, + 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, + -0.5f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, - 1.0f, 1.0f, 0.0f, 1.0f, 1.0f, - 1.0f, 0.0f, 0.0f, 1.0f, 0.0f + -0.5f, 1.0f, 0.0f, 0.0f, 1.0f, + 0.5f, 1.0f, 0.0f, 1.0f, 1.0f, + 0.5f, 0.0f, 0.0f, 1.0f, 0.0f }; glGenVertexArrays(1, &this->VAO); glGenBuffers(1, &VBO); diff --git a/cw_8/src/projekt.hpp b/cw_8/src/projekt.hpp index 8634bbe..c2e3c6f 100644 --- a/cw_8/src/projekt.hpp +++ b/cw_8/src/projekt.hpp @@ -407,7 +407,8 @@ void renderScene(GLFWwindow* window) { drawObjectPBR(planetContext, glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(0, 0, -3.f)) * glm::eulerAngleY(-1.5f * time) * glm::scale(glm::vec3(0.1f)), texture::earth_albedo, texture::earth_normal, texture::earth_ao, texture::earth_roughness, texture::earth_metallic); drawObjectPBR(planetContext, glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(0, 0, -3.f)) * glm::eulerAngleY( 2.f * time) * glm::translate(glm::vec3(0.4f, 0, 0.4f)) * glm::eulerAngleY(-0.5f * time) * glm::scale(glm::vec3(0.04f)), texture::moon_albedo, texture::moon_normal, texture::moon_ao, texture::moon_roughness, texture::moon_metallic); - mainEngine->Draw(createPerspectiveMatrix() * createCameraMatrix() * glm::translate(glm::vec3(0.f, -0.22f, -0.05f)) * glm::translate(cameraPos + 0.2 * cameraDir + glm::vec3(0, 1, 0) * 0.05f), programParticle, texture::particle_fire, cameraDir); + mainEngine->Draw(createPerspectiveMatrix() * createCameraMatrix() * glm::translate(glm::vec3(0.f, -0.22f, 0.0f)) * glm::translate(cameraPos + 0.2 * cameraDir + glm::vec3(0, 1, 0) * 0.05f), programParticle, texture::particle_fire, cameraDir); + std::cout << glm::to_string(spaceshipPos) << std::endl; //desired objects end here glUseProgram(0); glfwSwapBuffers(window);