improve particle position, add readme.md

This commit is contained in:
Szymon Szczubkowski 2024-02-08 08:09:55 +01:00
parent ba05c16fea
commit c020151e3a
3 changed files with 44 additions and 7 deletions

36
cw_8/README.md Normal file
View File

@ -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

View File

@ -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);

View File

@ -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);