More changes
This commit is contained in:
parent
321861e387
commit
83da99812f
12
models2/room/smallerWall.mtl
Normal file
12
models2/room/smallerWall.mtl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Blender 3.4.1 MTL File: 'untitled.blend'
|
||||||
|
# www.blender.org
|
||||||
|
|
||||||
|
newmtl Material.002
|
||||||
|
Ns 250.000000
|
||||||
|
Ka 1.000000 1.000000 1.000000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ke 0.000000 0.000000 0.000000
|
||||||
|
Ni 1.450000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd smallerWall.png
|
16
models2/room/smallerWall.obj
Normal file
16
models2/room/smallerWall.obj
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# Blender 3.4.1
|
||||||
|
# www.blender.org
|
||||||
|
mtllib smallerWall.mtl
|
||||||
|
o Plane
|
||||||
|
v -2.000000 0.000000 -0.000000
|
||||||
|
v 2.000000 0.000000 -0.000000
|
||||||
|
v -2.000000 2.600000 0.000000
|
||||||
|
v 2.000000 2.600000 0.000000
|
||||||
|
vn -0.0000 -0.0000 1.0000
|
||||||
|
vt 0.000000 0.000000
|
||||||
|
vt 1.000000 0.000000
|
||||||
|
vt 0.000000 1.000000
|
||||||
|
vt 1.000000 1.000000
|
||||||
|
s 0
|
||||||
|
usemtl Material.002
|
||||||
|
f 1/1/1 2/2/1 4/4/1 3/3/1
|
BIN
models2/room/smallerWall.png
Normal file
BIN
models2/room/smallerWall.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
12
models2/room/smallerWall_ww.mtl
Normal file
12
models2/room/smallerWall_ww.mtl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
# Blender 3.4.1 MTL File: 'untitled.blend'
|
||||||
|
# www.blender.org
|
||||||
|
|
||||||
|
newmtl Material.002
|
||||||
|
Ns 250.000000
|
||||||
|
Ka 1.000000 1.000000 1.000000
|
||||||
|
Ks 0.500000 0.500000 0.500000
|
||||||
|
Ke 0.000000 0.000000 0.000000
|
||||||
|
Ni 1.450000
|
||||||
|
d 1.000000
|
||||||
|
illum 2
|
||||||
|
map_Kd smallerWall.png
|
47
models2/room/smallerWall_ww.obj
Normal file
47
models2/room/smallerWall_ww.obj
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
# Blender 3.4.1
|
||||||
|
# www.blender.org
|
||||||
|
mtllib smallerWall_ww.mtl
|
||||||
|
o Plane
|
||||||
|
v -2.000000 0.000000 -0.000000
|
||||||
|
v 2.000000 0.000000 -0.000000
|
||||||
|
v -2.000000 2.600000 0.000000
|
||||||
|
v 2.000000 2.600000 0.000000
|
||||||
|
v -0.292093 2.600000 0.000000
|
||||||
|
v 1.727409 2.600000 0.000000
|
||||||
|
v -0.292093 0.000000 -0.000000
|
||||||
|
v 1.727409 0.000000 -0.000000
|
||||||
|
v -2.000000 2.284286 0.000000
|
||||||
|
v 2.000000 2.284286 0.000000
|
||||||
|
v -0.292093 2.284286 0.000000
|
||||||
|
v 1.727409 2.284286 0.000000
|
||||||
|
v -2.000000 1.054286 -0.000000
|
||||||
|
v 2.000000 1.054286 -0.000000
|
||||||
|
v -0.292093 1.054286 -0.000000
|
||||||
|
v 1.727409 1.054286 -0.000000
|
||||||
|
vn -0.0000 -0.0000 1.0000
|
||||||
|
vt 0.000000 0.000000
|
||||||
|
vt 1.000000 0.000000
|
||||||
|
vt 0.000000 1.000000
|
||||||
|
vt 1.000000 1.000000
|
||||||
|
vt 0.512748 1.000000
|
||||||
|
vt 0.846081 1.000000
|
||||||
|
vt 0.512748 0.000000
|
||||||
|
vt 0.846081 0.000000
|
||||||
|
vt 0.000000 0.878571
|
||||||
|
vt 1.000000 0.878571
|
||||||
|
vt 0.512748 0.878571
|
||||||
|
vt 0.846081 0.878571
|
||||||
|
vt 0.000000 0.405494
|
||||||
|
vt 1.000000 0.405495
|
||||||
|
vt 0.512748 0.405495
|
||||||
|
vt 0.846081 0.405495
|
||||||
|
s 0
|
||||||
|
usemtl Material.002
|
||||||
|
f 12/12/1 10/10/1 4/4/1 6/6/1
|
||||||
|
f 9/9/1 11/11/1 5/5/1 3/3/1
|
||||||
|
f 11/11/1 12/12/1 6/6/1 5/5/1
|
||||||
|
f 13/13/1 15/15/1 11/11/1 9/9/1
|
||||||
|
f 16/16/1 14/14/1 10/10/1 12/12/1
|
||||||
|
f 8/8/1 2/2/1 14/14/1 16/16/1
|
||||||
|
f 1/1/1 7/7/1 15/15/1 13/13/1
|
||||||
|
f 7/7/1 8/8/1 16/16/1 15/15/1
|
Binary file not shown.
Binary file not shown.
@ -39,6 +39,8 @@ namespace models {
|
|||||||
Core::RenderContext carpet;
|
Core::RenderContext carpet;
|
||||||
Core::RenderContext roof;
|
Core::RenderContext roof;
|
||||||
Core::RenderContext longerWall;
|
Core::RenderContext longerWall;
|
||||||
|
Core::RenderContext smallerWall;
|
||||||
|
Core::RenderContext smallerWall_ww;
|
||||||
}
|
}
|
||||||
namespace textures {
|
namespace textures {
|
||||||
GLuint floorTexture;
|
GLuint floorTexture;
|
||||||
@ -56,6 +58,7 @@ namespace textures {
|
|||||||
GLuint carpetTexture;
|
GLuint carpetTexture;
|
||||||
GLuint roofTexture;
|
GLuint roofTexture;
|
||||||
GLuint longerWallTexture;
|
GLuint longerWallTexture;
|
||||||
|
GLuint smallerWallTexture;
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint depthMapFBO;
|
GLuint depthMapFBO;
|
||||||
@ -91,7 +94,8 @@ Core::RenderContext sphereContext;
|
|||||||
|
|
||||||
glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, 0.369280f);
|
glm::vec3 sunPos = glm::vec3(-4.740971f, 2.149999f, 0.369280f);
|
||||||
glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f);
|
glm::vec3 sunDir = glm::vec3(-0.93633f, 0.351106, 0.003226f);
|
||||||
glm::vec3 sunColor = glm::vec3(0.9f, 0.9f, 0.7f)*5;
|
glm::vec3 sunColor = glm::vec3(0.9f, 0.9f, 0.7f);
|
||||||
|
|
||||||
|
|
||||||
glm::vec3 cameraPos = glm::vec3(0.479490f, 1.250000f, -2.124680f);
|
glm::vec3 cameraPos = glm::vec3(0.479490f, 1.250000f, -2.124680f);
|
||||||
glm::vec3 cameraDir = glm::vec3(-0.354510f, 0.000000f, 0.935054f);
|
glm::vec3 cameraDir = glm::vec3(-0.354510f, 0.000000f, 0.935054f);
|
||||||
@ -103,7 +107,7 @@ GLuint VAO,VBO;
|
|||||||
|
|
||||||
float aspectRatio = 1.f;
|
float aspectRatio = 1.f;
|
||||||
|
|
||||||
float exposition = 1.f;
|
float exposition = 4.f;
|
||||||
|
|
||||||
glm::vec3 pointlightPos = glm::vec3(0, 2, 0);
|
glm::vec3 pointlightPos = glm::vec3(0, 2, 0);
|
||||||
glm::vec3 pointlightColor = glm::vec3(0.9, 0.6, 0.6);
|
glm::vec3 pointlightColor = glm::vec3(0.9, 0.6, 0.6);
|
||||||
@ -274,14 +278,14 @@ void renderScene(GLFWwindow* window)
|
|||||||
updateDeltaTime(time);
|
updateDeltaTime(time);
|
||||||
renderShadowapSun();
|
renderShadowapSun();
|
||||||
|
|
||||||
//space lamp
|
/*space lamp*/
|
||||||
//glUseProgram(programSun);
|
glUseProgram(programSun);
|
||||||
//glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
|
glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix();
|
||||||
//glm::mat4 transformation = viewProjectionMatrix * glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1));
|
glm::mat4 transformation = viewProjectionMatrix * glm::translate(pointlightPos) * glm::scale(glm::vec3(0.1));
|
||||||
//glUniformMatrix4fv(glGetUniformLocation(programSun, "transformation"), 1, GL_FALSE, (float*)&transformation);
|
glUniformMatrix4fv(glGetUniformLocation(programSun, "transformation"), 1, GL_FALSE, (float*)&transformation);
|
||||||
//glUniform3f(glGetUniformLocation(programSun, "color"), sunColor.x / 2, sunColor.y / 2, sunColor.z / 2);
|
glUniform3f(glGetUniformLocation(programSun, "color"), sunColor.x, sunColor.y, sunColor.z);
|
||||||
//glUniform1f(glGetUniformLocation(programSun, "exposition"), exposition);
|
glUniform1f(glGetUniformLocation(programSun, "exposition"), exposition);
|
||||||
//Core::DrawContext(sphereContext);
|
Core::DrawContext(sphereContext);
|
||||||
|
|
||||||
glUseProgram(program);
|
glUseProgram(program);
|
||||||
|
|
||||||
@ -302,17 +306,32 @@ void renderScene(GLFWwindow* window)
|
|||||||
textures::longerWallTexture,
|
textures::longerWallTexture,
|
||||||
0,
|
0,
|
||||||
0);
|
0);
|
||||||
//drawObjectPBR(models::carpet, glm::mat4() * glm::scale(glm::vec3(3)),
|
glm::mat4 model = glm::mat4() * glm::translate(glm::vec3(2.5, 0, 0));
|
||||||
// textures::carpetTexture,
|
model = glm::rotate(model, glm::radians(90.0f), glm::vec3(0, 1, 0));
|
||||||
// 0,
|
drawObjectPBR(models::smallerWall, model,
|
||||||
// 0
|
textures::longerWallTexture,
|
||||||
//);
|
0,
|
||||||
|
0
|
||||||
//drawObjectPBR(models::window, glm::mat4(),
|
);
|
||||||
// textures::windowFrameTexture,
|
model = glm::mat4() * glm::translate(glm::vec3(-2.5, 0, 0));
|
||||||
// 0.2,
|
model = glm::rotate(model, glm::radians(90.0f), glm::vec3(0, 1, 0));
|
||||||
// 0.1
|
drawObjectPBR(models::smallerWall_ww, model,
|
||||||
//);
|
textures::longerWallTexture,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
drawObjectPBR(models::carpet, glm::mat4() * glm::translate(glm::vec3(0.0 ,0.01 ,0.9)),
|
||||||
|
textures::carpetTexture,
|
||||||
|
0,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
model = glm::mat4() * glm::translate(glm::vec3(-2.5, 1.5, -0.5)) * glm::scale(glm::vec3(0.4));
|
||||||
|
model = glm::rotate(model, glm::radians(90.0f), glm::vec3(0, 1, 0));
|
||||||
|
drawObjectPBR(models::window, model,
|
||||||
|
textures::windowFrameTexture,
|
||||||
|
0.2,
|
||||||
|
0.1
|
||||||
|
);
|
||||||
//drawObjectPBR(models::potPlant, glm::mat4() * glm::scale(glm::vec3(0.2f)) * glm::translate(glm::vec3(-5.0f, 55.0f, -6.0f)),
|
//drawObjectPBR(models::potPlant, glm::mat4() * glm::scale(glm::vec3(0.2f)) * glm::translate(glm::vec3(-5.0f, 55.0f, -6.0f)),
|
||||||
// textures::potPlantTexture,
|
// textures::potPlantTexture,
|
||||||
// 1.0f,
|
// 1.0f,
|
||||||
@ -455,6 +474,9 @@ void init(GLFWwindow* window)
|
|||||||
loadModelToContext("./models2/room/floor.obj", models::floor);
|
loadModelToContext("./models2/room/floor.obj", models::floor);
|
||||||
loadModelToContext("./models2/room/floor.obj", models::roof);
|
loadModelToContext("./models2/room/floor.obj", models::roof);
|
||||||
loadModelToContext("./models2/room/longerWall.obj", models::longerWall);
|
loadModelToContext("./models2/room/longerWall.obj", models::longerWall);
|
||||||
|
loadModelToContext("./models2/room/smallerWall.obj", models::smallerWall);
|
||||||
|
loadModelToContext("./models2/room/smallerWall_ww.obj", models::smallerWall_ww);
|
||||||
|
|
||||||
|
|
||||||
textures::floorTexture = Core::LoadTexture("./models2/room/wood.png");
|
textures::floorTexture = Core::LoadTexture("./models2/room/wood.png");
|
||||||
textures::flashlightTexture = Core::LoadTexture("./models/FlashlightTexture.png");
|
textures::flashlightTexture = Core::LoadTexture("./models/FlashlightTexture.png");
|
||||||
@ -472,6 +494,7 @@ void init(GLFWwindow* window)
|
|||||||
textures::carpetTexture = Core::LoadTexture("./models2/carpet/1251.jpg");
|
textures::carpetTexture = Core::LoadTexture("./models2/carpet/1251.jpg");
|
||||||
textures::roofTexture = Core::LoadTexture("./models2/room/roof.png");
|
textures::roofTexture = Core::LoadTexture("./models2/room/roof.png");
|
||||||
textures::longerWallTexture = Core::LoadTexture("./models2/room/longerWall.png");
|
textures::longerWallTexture = Core::LoadTexture("./models2/room/longerWall.png");
|
||||||
|
textures::longerWallTexture = Core::LoadTexture("./models2/room/smallerWall.png");
|
||||||
}
|
}
|
||||||
|
|
||||||
void shutdown(GLFWwindow* window)
|
void shutdown(GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user