połączenie "master" z "przyciski"

This commit is contained in:
K4RP4T 2024-01-20 19:40:40 +01:00
commit 54689b0edf
46 changed files with 73 additions and 26 deletions

View File

@ -15,14 +15,45 @@
#include <string>
namespace texture {
namespace texturePlanets {
GLuint earth;
GLuint clouds;
GLuint moon;
GLuint planet;
GLuint mercury;
GLuint venus;
GLuint mars;
GLuint sun;
GLuint alpine;
GLuint ceres;
GLuint eris;
GLuint haumea;
GLuint icy;
GLuint jupiter;
GLuint makemake;
GLuint martian;
GLuint neptune;
GLuint saturn;
GLuint savannah;
GLuint swamp;
GLuint tropical;
GLuint uranus;
GLuint venusian;
GLuint volcanic;
}
namespace textureSuns {
GLuint sun1;
GLuint sun2;
GLuint sun3;
GLuint sun4;
}
namespace textureMoons {
GLuint moon1;
GLuint moon2;
GLuint moon3;
}
namespace textureMaterials {
GLuint clouds;
}
GLuint program;
@ -58,8 +89,7 @@ int HDR_HEIGHT = 1024;
glm::vec3 lightColor = glm::vec3(50, 50, 50);
glm::mat4 createCameraMatrix()
{
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));
@ -77,9 +107,7 @@ glm::mat4 createCameraMatrix()
return cameraMatrix;
}
glm::mat4 createPerspectiveMatrix()
{
glm::mat4 createPerspectiveMatrix() {
glm::mat4 perspectiveMatrix;
float n = 0.05f;
float f = 20.f;
@ -94,7 +122,6 @@ glm::mat4 createPerspectiveMatrix()
0.,0.,-1.,0.,
});
perspectiveMatrix = glm::transpose(perspectiveMatrix);
return perspectiveMatrix;
@ -196,8 +223,7 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
}
*/
void renderScene(GLFWwindow* window)
{
void renderScene(GLFWwindow* window) {
glClearColor(0.0f, 0.0f, 0.15f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
float time = glfwGetTime();
@ -205,25 +231,23 @@ void renderScene(GLFWwindow* window)
glm::mat4 sunScale = glm::scale(glm::vec3(sunSize));
glm::mat4 sunTranslate = glm::translate(sunPos);
drawSun(sphereContext, sunTranslate * sunScale, texture::sun);
drawSun(sphereContext, sunTranslate * sunScale, textureSuns::sun1);
glm::mat4 planetScale = glm::scale(glm::vec3(planetSize));
glm::mat4 planetRotate = glm::rotate(time * planetRot, glm::vec3(0, 1, 0));
glm::mat4 planetTranslate = glm::translate(planetPos);
drawObjectTexture(sphereContext, planetTranslate * planetRotate * planetScale, texture::earth);
drawObjectTexture(sphereContext, planetTranslate * planetRotate * planetScale, texturePlanets::earth);
glfwSwapBuffers(window);
}
void framebuffer_size_callback(GLFWwindow* window, int width, int height)
{
void framebuffer_size_callback(GLFWwindow* window, int width, int height) {
aspectRatio = float(width) / float(height);
glViewport(0, 0, width, height);
}
void loadModelToContext(std::string path, Core::RenderContext& context)
{
void loadModelToContext(std::string path, Core::RenderContext& context) {
Assimp::Importer import;
const aiScene* scene = import.ReadFile(path, aiProcess_Triangulate | aiProcess_CalcTangentSpace);
@ -235,8 +259,7 @@ void loadModelToContext(std::string path, Core::RenderContext& context)
context.initFromAssimpMesh(scene->mMeshes[0]);
}
void init(GLFWwindow* window)
{
void init(GLFWwindow* window) {
glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);
glEnable(GL_DEPTH_TEST);
@ -250,13 +273,37 @@ void init(GLFWwindow* window)
loadModelToContext("./models/sphere.obj", sphereContext);
texture::earth = Core::LoadTexture("./textures/earth2.png");
texture::clouds = Core::LoadTexture("./textures/clouds.jpg");
texture::sun = Core::LoadTexture("./textures/sun.jpg");
texturePlanets::earth = Core::LoadTexture("./textures/planets/earth2.png");
/*texturePlanets::planet = Core::LoadTexture("./textures/planets/planet.png");
texturePlanets::mercury = Core::LoadTexture("./textures/planets/mercury1.jpg");
texturePlanets::venus = Core::LoadTexture("./textures/planets/earth2.png");
texturePlanets::mars = Core::LoadTexture("./textures/planets/mars.jpg");
texturePlanets::alpine = Core::LoadTexture("./textures/planets/Alpine.png");
texturePlanets::ceres = Core::LoadTexture("./textures/planets/ceres_fictional.jpg");
texturePlanets::eris = Core::LoadTexture("./textures/planets/eris_fictional.jpg");
texturePlanets::haumea = Core::LoadTexture("./textures/planets/haumea_fictional.jpg");
texturePlanets::icy = Core::LoadTexture("./textures/planets/Icy.png");
texturePlanets::jupiter = Core::LoadTexture("./textures/planets/jupiter.jpg");
texturePlanets::makemake = Core::LoadTexture("./textures/planets/makemake_fictional.jpg");
texturePlanets::martian = Core::LoadTexture("./textures/planets/Martian.png");
texturePlanets::neptune = Core::LoadTexture("./textures/planets/neptune.jpg");
texturePlanets::saturn = Core::LoadTexture("./textures/planets/saturn.jpg");
texturePlanets::savannah = Core::LoadTexture("./textures/planets/Savannah.png");
texturePlanets::swamp = Core::LoadTexture("./textures/planets/Swamp.png");
texturePlanets::tropical = Core::LoadTexture("./textures/planets/Tropical.png");
texturePlanets::uranus = Core::LoadTexture("./textures/planets/uranus.jpg");
texturePlanets::venusian = Core::LoadTexture("./textures/planets/Venusian.png");
texturePlanets::volcanic = Core::LoadTexture("./textures/planets/Volcanic.png");*/
textureSuns::sun1 = Core::LoadTexture("./textures/suns/sun1.jpg");
/*textureSuns::sun2 = Core::LoadTexture("./textures/suns/sun2.jpg");
textureSuns::sun3 = Core::LoadTexture("./textures/suns/sun3.jpg");
textureSuns::sun4 = Core::LoadTexture("./textures/suns/sun4.jpg");*/
textureMaterials::clouds = Core::LoadTexture("./textures/planets/clouds.jpg");
}
void shutdown(GLFWwindow* window)
{
void shutdown(GLFWwindow* window) {
shaderLoader.DeleteProgram(programDepth);
shaderLoader.DeleteProgram(programTex);
shaderLoader.DeleteProgram(programSun);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 MiB

View File

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

Before

Width:  |  Height:  |  Size: 3.3 MiB

After

Width:  |  Height:  |  Size: 3.3 MiB

View File

Before

Width:  |  Height:  |  Size: 6.5 MiB

After

Width:  |  Height:  |  Size: 6.5 MiB

View File

Before

Width:  |  Height:  |  Size: 1.5 MiB

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

Before

Width:  |  Height:  |  Size: 1.1 MiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

View File

Before

Width:  |  Height:  |  Size: 598 KiB

After

Width:  |  Height:  |  Size: 598 KiB

View File

Before

Width:  |  Height:  |  Size: 424 KiB

After

Width:  |  Height:  |  Size: 424 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

View File

Before

Width:  |  Height:  |  Size: 9.2 MiB

After

Width:  |  Height:  |  Size: 9.2 MiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

Before

Width:  |  Height:  |  Size: 4.4 MiB

After

Width:  |  Height:  |  Size: 4.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 879 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 733 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 KiB

View File

Before

Width:  |  Height:  |  Size: 279 KiB

After

Width:  |  Height:  |  Size: 279 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

Before

Width:  |  Height:  |  Size: 3.0 MiB

After

Width:  |  Height:  |  Size: 3.0 MiB

View File

Before

Width:  |  Height:  |  Size: 163 KiB

After

Width:  |  Height:  |  Size: 163 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 KiB

View File

Before

Width:  |  Height:  |  Size: 803 KiB

After

Width:  |  Height:  |  Size: 803 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

View File

@ -3,7 +3,7 @@ na 22.01.2024
https://andkok.faculty.wmi.amu.edu.pl/grk/
Oliwia:
- znaleźć tekstury
- znaleźć tekstury (done)
- perlin noise - poczytać i spróbować coś zrobić
Kacper: