Added some models and tested textures,

works just fine
This commit is contained in:
Aleksander Burkowski 2023-01-25 14:20:55 +01:00
parent 26c9cfdab5
commit ca6464a20b
38 changed files with 390461 additions and 17 deletions

BIN
models/sun.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 803 KiB

View File

Before

Width:  |  Height:  |  Size: 95 KiB

After

Width:  |  Height:  |  Size: 95 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 644 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 KiB

26205
models2/bed/bed.obj Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 MiB

3430
models2/bookshelf/books.obj Normal file

File diff suppressed because it is too large Load Diff

1535
models2/bookshelf/shelf.obj Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
models2/lamp/_Height.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 MiB

BIN
models2/lamp/_Metallic.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

BIN
models2/lamp/_Normal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

BIN
models2/lamp/_Opacity.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
models2/lamp/_Roughness.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

20
models2/potplant/Pot.mtl Normal file
View File

@ -0,0 +1,20 @@
# Exported from Wings 3D 1.4.1
newmtl b3
Ns 100.0
d 1.0
illum 2
Kd 1.0 1.0 1.0
Ka 1.0 1.0 1.0
Ks 0.0 0.0 0.0
Ke 0.0 0.0 0.0
map_Kd b3.jpg
newmtl default
Ns 100.0
d 1.0
illum 2
Kd 0.7898538076923077 0.8133333333333334 0.6940444444444445
Ka 0.7898538076923077 0.8133333333333334 0.6940444444444445
Ks 1.0 1.0 1.0
Ke 0.0 0.0 0.0

157834
models2/potplant/Pot.obj Normal file

File diff suppressed because it is too large Load Diff

BIN
models2/potplant/b3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 KiB

8392
models2/window/WindowUK.obj Normal file

File diff suppressed because it is too large Load Diff

View File

@ -35,10 +35,14 @@ namespace models {
Core::RenderContext sphereContext;
Core::RenderContext windowContext;
Core::RenderContext testContext;
Core::RenderContext testFrame;
Core::RenderContext windowFrame;
Core::RenderContext bookShelf;
}
namespace textures {
GLuint test;
GLuint sunTexture;
GLuint windowFrameTexture;
GLuint bookShelfTexture;
}
GLuint depthMapFBO;
@ -131,7 +135,7 @@ glm::mat4 createPerspectiveMatrix()
return perspectiveMatrix;
}
void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, float roughness, float metallic) {
void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint texture, float roughness, float metallic) {
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
glm::mat4 transformation = viewProjectionMatrix * modelMatrix;
@ -162,7 +166,7 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, float ro
glm::mat4 lightVP = glm::ortho(-3.f, 2.3f, -1.3f, 3.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
Core::SetActiveTexture(textures::test, "colorTexture", program, 0);
Core::SetActiveTexture(texture, "colorTexture", program, 0);
Core::DrawContext(context);
@ -252,17 +256,14 @@ void renderScene(GLFWwindow* window)
glUseProgram(program);
//drawObjectPBR(models::testFrame, glm::mat4(), glm::vec3(0.03f, 0.03f, 0.03f), 0.2f, 0.0f);
drawObjectPBR(sphereContext,
glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::scale(glm::vec3(0.3f)),
0.3,
0.0);
drawObjectPBR(sphereContext,
glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1)) * glm::eulerAngleY(time / 3) * glm::translate(glm::vec3(4.f, 0, 0)) * glm::eulerAngleY(time) * glm::translate(glm::vec3(1.f, 0, 0)) * glm::scale(glm::vec3(0.1f)),
0.7,
0.0);
drawObjectPBR(models::windowFrame, glm::mat4(),
textures::windowFrameTexture,
0.2f,
0.0f);
drawObjectPBR(models::bookShelf, glm::mat4() * glm::scale(glm::vec3(0.01)),
textures::bookShelfTexture,
0.4f,
0.1f);
//drawObjectPBR(models::bedContext, glm::mat4(), 0.2f, 0.0f);
//drawObjectPBR(models::chairContext, glm::mat4(), 0.4f, 0.0f);
@ -292,6 +293,7 @@ void renderScene(GLFWwindow* window)
// );
drawObjectPBR(shipContext,
glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi<float>()) * glm::scale(glm::vec3(0.03f)),
textures::sunTexture,
0.2,
1.0
);
@ -368,9 +370,13 @@ void init(GLFWwindow* window)
loadModelToContext("./models/spaceship.obj", models::spaceshipContext);
loadModelToContext("./models/sphere.obj", models::sphereContext);
loadModelToContext("./models/window.obj", models::windowContext);
loadModelToContext("./models2/Frame/Frame.obj", models::testFrame);
textures::test = Core::LoadTexture("./textures/WindowFrame_Color.png");
loadModelToContext("./models2/Frame/Frame.obj", models::windowFrame);
loadModelToContext("./models2/bookshelf/shelf.obj", models::bookShelf);
textures::sunTexture = Core::LoadTexture("./models/sun.jpeg");
textures::windowFrameTexture = Core::LoadTexture("./models2/Frame/frame.png");
textures::bookShelfTexture = Core::LoadTexture("./models2/bookshelf/SHELF_TEXTURE.bmp");
}
void shutdown(GLFWwindow* window)