Added some models and tested textures,
works just fine
BIN
models/sun.jpg
Normal file
After Width: | Height: | Size: 803 KiB |
Before Width: | Height: | Size: 95 KiB After Width: | Height: | Size: 95 KiB |
67753
models2/Office_chair_obj/Office_chair.obj
Normal file
BIN
models2/Office_chair_obj/Office_chair_fabric_dif.png
Normal file
After Width: | Height: | Size: 393 KiB |
BIN
models2/Office_chair_obj/Office_chair_fabric_normal.png
Normal file
After Width: | Height: | Size: 644 KiB |
BIN
models2/Office_chair_obj/Office_chair_plastic_dif.png
Normal file
After Width: | Height: | Size: 88 KiB |
BIN
models2/Office_chair_obj/Office_chair_plastic_normal.png
Normal file
After Width: | Height: | Size: 189 KiB |
26205
models2/bed/bed.obj
Normal file
BIN
models2/bookshelf/BOOKS_TEXTURE.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
BIN
models2/bookshelf/SHELF_TEXTURE.bmp
Normal file
After Width: | Height: | Size: 3.0 MiB |
3430
models2/bookshelf/books.obj
Normal file
1535
models2/bookshelf/shelf.obj
Normal file
85077
models2/ceiling_lamp/stockholm.obj
Normal file
2203
models2/desk/Desk1_Polygon.obj
Normal file
BIN
models2/door/source/SM_Door_low.fbx
Normal file
BIN
models2/door/textures/Door_AO.jpg
Normal file
After Width: | Height: | Size: 213 KiB |
BIN
models2/door/textures/Door_albedo.jpg
Normal file
After Width: | Height: | Size: 720 KiB |
BIN
models2/door/textures/Door_metallic.jpg
Normal file
After Width: | Height: | Size: 84 KiB |
BIN
models2/door/textures/Door_normal.png
Normal file
After Width: | Height: | Size: 3.3 MiB |
BIN
models2/door/textures/Door_roughness.jpg
Normal file
After Width: | Height: | Size: 1.1 MiB |
BIN
models2/indoor-pot-plant-3/textures/Pot textures_col.jpeg
Normal file
After Width: | Height: | Size: 89 KiB |
BIN
models2/indoor-pot-plant-3/textures/Pot textures_nor.png
Normal file
After Width: | Height: | Size: 1.6 MiB |
BIN
models2/indoor-pot-plant-3/textures/bpng.jpeg
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
models2/indoor-pot-plant-3/textures/bpng.png
Normal file
After Width: | Height: | Size: 264 KiB |
BIN
models2/indoor-pot-plant-3/textures/bpng_NRM Kopie.jpeg
Normal file
After Width: | Height: | Size: 10 KiB |
37989
models2/lamp/Lamp_LOVMANAD_OBJ.obj
Normal file
BIN
models2/lamp/_Base_color.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
BIN
models2/lamp/_Height.png
Normal file
After Width: | Height: | Size: 1.8 MiB |
BIN
models2/lamp/_Metallic.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
models2/lamp/_Normal.png
Normal file
After Width: | Height: | Size: 14 MiB |
BIN
models2/lamp/_Opacity.png
Normal file
After Width: | Height: | Size: 22 KiB |
BIN
models2/lamp/_Roughness.png
Normal file
After Width: | Height: | Size: 1.3 MiB |
20
models2/potplant/Pot.mtl
Normal 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
BIN
models2/potplant/b3.jpg
Normal file
After Width: | Height: | Size: 846 KiB |
8392
models2/window/WindowUK.obj
Normal 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)
|
||||
|