Some replaces
This commit is contained in:
parent
acb0e7bb2a
commit
d7e11c39e2
File diff suppressed because it is too large
Load Diff
26918
cw 9/models/Shelf.obj
26918
cw 9/models/Shelf.obj
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,12 @@
|
||||
# Blender 3.4.1 MTL File: 'Akwarium_room.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl Material_Wool.jpg.001
|
||||
Ns 0.000000
|
||||
newmtl Material_Wool.jpg
|
||||
Ns 96.078453
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 1
|
||||
illum 2
|
||||
map_Kd F:/Blander/g4jmqcp3hjwg-Sofa/Wool.jpg
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,22 +1,12 @@
|
||||
# Blender 3.4.1 MTL File: 'Akwarium_room.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl Material.012
|
||||
Ns 0.000000
|
||||
newmtl Material.001
|
||||
Ns 96.078453
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Kd 0.640000 0.640000 0.640000
|
||||
Ks 0.500000 0.500000 0.500000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
Ni 1.000000
|
||||
d 1.000000
|
||||
illum 1
|
||||
|
||||
newmtl Material_Wool.jpg.001
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
||||
illum 2
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -2,14 +2,14 @@
|
||||
# www.blender.org
|
||||
mtllib aquarium.mtl
|
||||
o Cube
|
||||
v -6.815081 0.820323 1.347755
|
||||
v -6.815081 1.562090 1.347755
|
||||
v -6.815081 0.820323 0.896444
|
||||
v -6.815081 1.562090 0.896444
|
||||
v -6.363512 0.820323 1.347755
|
||||
v -6.363512 1.562090 1.347755
|
||||
v -6.363512 0.820323 0.896444
|
||||
v -6.363512 1.562090 0.896444
|
||||
v -6.822576 0.808011 0.901260
|
||||
v -6.822576 1.597539 0.901260
|
||||
v -6.822576 0.808011 0.341888
|
||||
v -6.822576 1.597539 0.341888
|
||||
v -6.356017 0.808011 0.901260
|
||||
v -6.356017 1.597539 0.901260
|
||||
v -6.356017 0.808011 0.341888
|
||||
v -6.356017 1.597539 0.341888
|
||||
vn -1.0000 -0.0000 -0.0000
|
||||
vn -0.0000 -0.0000 -1.0000
|
||||
vn 1.0000 -0.0000 -0.0000
|
||||
|
12
cw 9/models/plant1.mtl
Normal file
12
cw 9/models/plant1.mtl
Normal file
@ -0,0 +1,12 @@
|
||||
# Blender 3.4.1 MTL File: 'Akwarium_room.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl PlantMaterial
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
125696
cw 9/models/plant1.obj
Normal file
125696
cw 9/models/plant1.obj
Normal file
File diff suppressed because it is too large
Load Diff
22
cw 9/models/plant1dirt.mtl
Normal file
22
cw 9/models/plant1dirt.mtl
Normal file
@ -0,0 +1,22 @@
|
||||
# Blender 3.4.1 MTL File: 'Akwarium_room.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl DirtParticle
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
||||
|
||||
newmtl GroundDirtMaterial
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
247353
cw 9/models/plant1dirt.obj
Normal file
247353
cw 9/models/plant1dirt.obj
Normal file
File diff suppressed because it is too large
Load Diff
12
cw 9/models/plant1pot.mtl
Normal file
12
cw 9/models/plant1pot.mtl
Normal file
@ -0,0 +1,12 @@
|
||||
# Blender 3.4.1 MTL File: 'Akwarium_room.blend'
|
||||
# www.blender.org
|
||||
|
||||
newmtl PotMaterial
|
||||
Ns 0.000000
|
||||
Ka 1.000000 1.000000 1.000000
|
||||
Kd 0.800000 0.800000 0.800000
|
||||
Ks 0.000000 0.000000 0.000000
|
||||
Ke 0.000000 0.000000 0.000000
|
||||
Ni 1.450000
|
||||
d 1.000000
|
||||
illum 1
|
156994
cw 9/models/plant1pot.obj
Normal file
156994
cw 9/models/plant1pot.obj
Normal file
File diff suppressed because it is too large
Load Diff
@ -61,6 +61,10 @@ void main()
|
||||
vecTex = vertexTexCoord * vec2(15,15);
|
||||
vecTex.y = 1.0 - vecTex.y;
|
||||
}
|
||||
else if(size == 7){
|
||||
vecTex = vertexTexCoord * vec2(20,40);
|
||||
vecTex.y = 1.0 - vecTex.y;
|
||||
}
|
||||
else if(size == 10){
|
||||
vecTex = vertexTexCoord * vec2(150,150);
|
||||
vecTex.y = 1.0 - vecTex.y;
|
||||
|
@ -57,6 +57,10 @@ namespace models {
|
||||
|
||||
Core::RenderContext aquariumContext;
|
||||
|
||||
Core::RenderContext plant1Context;
|
||||
Core::RenderContext plant1DirtContext;
|
||||
Core::RenderContext plant1PotContext;
|
||||
|
||||
}
|
||||
|
||||
namespace texture {
|
||||
@ -68,9 +72,11 @@ namespace texture {
|
||||
GLuint fishGreenTexture;
|
||||
GLuint sofaTexture;
|
||||
GLuint sofaBaseTexture;
|
||||
|
||||
GLuint door1Texture;
|
||||
GLuint door2Texture;
|
||||
GLuint door3Texture;
|
||||
|
||||
GLuint doorhandleTexture;
|
||||
GLuint glassWallTexture;
|
||||
GLuint landTexture;
|
||||
@ -79,6 +85,11 @@ namespace texture {
|
||||
GLuint door_next_to_doorhandleTexture;
|
||||
GLuint aquariumTexture;
|
||||
GLuint spaceshipTexture;
|
||||
|
||||
GLuint plant1Texture;
|
||||
GLuint plant1DirtTexture;
|
||||
GLuint plant1PotTexture;
|
||||
|
||||
}
|
||||
|
||||
GLuint depthMapFBO;
|
||||
@ -275,7 +286,7 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec
|
||||
glUniform1f(glGetUniformLocation(program, "spotlightPhi"), spotlightPhi);
|
||||
|
||||
//For shadows
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, 1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
glUniformMatrix4fv(glGetUniformLocation(program, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
|
||||
glUniform1i(glGetUniformLocation(program, "depthMap"), 2);
|
||||
glActiveTexture(GL_TEXTURE0 + 2);
|
||||
@ -324,7 +335,7 @@ void drawObjectPBRWithTexture(Core::RenderContext& context, glm::mat4 modelMatri
|
||||
glUniform1f(glGetUniformLocation(programTex, "spotlightPhi"), spotlightPhi);
|
||||
|
||||
//For shadows
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, 1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
glUniformMatrix4fv(glGetUniformLocation(programTex, "LightVP"), 1, GL_FALSE, (float*)&lightVP);
|
||||
glUniform1i(glGetUniformLocation(programTex, "depthMap"), 2);
|
||||
glActiveTexture(GL_TEXTURE0 + 2);
|
||||
@ -435,7 +446,7 @@ void renderScene(GLFWwindow* window)
|
||||
glDepthMask(GL_TRUE);
|
||||
//
|
||||
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, -1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
glm::mat4 lightVP = glm::ortho(-10.f, 10.f, -10.f, 10.f, 1.0f, 40.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0));
|
||||
|
||||
renderShadowapSun(depthMapFBO, lightVP);
|
||||
|
||||
@ -534,7 +545,7 @@ void renderScene(GLFWwindow* window)
|
||||
|
||||
if (animal_in_box) {
|
||||
drawObjectPBRWithTexture(models::fish2Context,
|
||||
glm::translate(glm::vec3(-6.55f, 1.22f, 1.11f))
|
||||
glm::translate(glm::vec3(-6.55f, 1.22f, 0.61f))
|
||||
* glm::rotate(glm::radians(sin(time) * 15.0f), glm::vec3(0.0f, 1.0f, 0.0f)) * glm::rotate(glm::radians(sin(-time) * 5.0f), glm::vec3(1.0f, 0.0f, 0.0f))
|
||||
* glm::translate(glm::vec3(0.0f, 0.05f * sin(1.0f * time), 0.0f)) * glm::scale(glm::vec3(0.5f)),
|
||||
texture::fishRedTexture,
|
||||
@ -554,7 +565,7 @@ void renderScene(GLFWwindow* window)
|
||||
);
|
||||
|
||||
drawObjectPBRWithTexture(models::floorContext, glm::mat4(), texture::floorTexture, 0.8f, 0.0f,5);
|
||||
drawObjectPBRWithTexture(models::roomContext, glm::mat4(), texture::roomTexture, 0.8f, 0.0f, 5);
|
||||
drawObjectPBRWithTexture(models::roomContext, glm::mat4(), texture::roomTexture, 0.8f, 0.0f, 7);
|
||||
drawObjectPBRWithTexture(models::fishContext, glm::mat4(), texture::fishTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::landContext, glm::mat4(), texture::landTexture, 0.5f, 0.0f, 10);
|
||||
drawObjectPBRWithTexture(models::sofaBaseContext, glm::mat4(), texture::sofaBaseTexture, 0.5f, 0.0f, 0);
|
||||
@ -569,6 +580,9 @@ void renderScene(GLFWwindow* window)
|
||||
drawObjectPBRWithTexture(models::door_next_toContext, glm::mat4(), texture::door_next_toTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::door_next_to_doorhandleContext, glm::mat4(), texture::door_next_to_doorhandleTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::spaceshipContext, glm::mat4(), texture::spaceshipTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::plant1DirtContext, glm::mat4(), texture::plant1DirtTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::plant1PotContext, glm::mat4(), texture::plant1PotTexture, 0.5f, 0.0f, 0);
|
||||
drawObjectPBRWithTexture(models::plant1Context, glm::mat4(), texture::plant1Texture, 0.5f, 0.0f, 0);
|
||||
|
||||
|
||||
//objects with textures that contain transparency should be drawn here (last)
|
||||
@ -651,6 +665,10 @@ void init(GLFWwindow* window)
|
||||
|
||||
loadModelToContext("./models/aquarium.obj", models::aquariumContext);
|
||||
|
||||
loadModelToContext("./models/plant1.obj", models::plant1Context);
|
||||
loadModelToContext("./models/plant1dirt.obj", models::plant1DirtContext);
|
||||
loadModelToContext("./models/plant1pot.obj", models::plant1PotContext);
|
||||
|
||||
//loading textures
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
@ -664,7 +682,7 @@ void init(GLFWwindow* window)
|
||||
texture::fishRedTexture = Core::LoadTexture("textures/fish_red.png");
|
||||
texture::fishBlueTexture = Core::LoadTexture("textures/fish_blue.png");
|
||||
texture::fishGreenTexture = Core::LoadTexture("textures/fish_green.png");
|
||||
texture::roomTexture = Core::LoadTexture("textures/roof.jpg");
|
||||
texture::roomTexture = Core::LoadTexture("textures/wall.jpg");
|
||||
texture::sofaBaseTexture = Core::LoadTexture("textures/sofaa.jpg");
|
||||
texture::sofaTexture = Core::LoadTexture("textures/sofaa.jpg");
|
||||
texture::landTexture = Core::LoadTexture("textures/grass.jpg");
|
||||
@ -677,6 +695,9 @@ void init(GLFWwindow* window)
|
||||
texture::door_next_toTexture = Core::LoadTexture("textures/Door.jpg");
|
||||
texture::door_next_to_doorhandleTexture = Core::LoadTexture("textures/Door.jpg");
|
||||
texture::spaceshipTexture = Core::LoadTexture("textures/spaceship.png");
|
||||
texture::plant1Texture = Core::LoadTexture("textures/plant1.jpg");
|
||||
texture::plant1DirtTexture = Core::LoadTexture("textures/plant1dirt.jpg");
|
||||
texture::plant1PotTexture = Core::LoadTexture("textures/plant1pot.jpg");
|
||||
//
|
||||
|
||||
//prepering skybox
|
||||
@ -730,7 +751,7 @@ void key_callback(GLFWwindow* window, int key, int scancode, int action, int mod
|
||||
{
|
||||
if (spaceshipPos.x >= -6.57f && spaceshipPos.x <= -5.67f &&
|
||||
spaceshipPos.y >= 0.65f && spaceshipPos.y <= 1.75f &&
|
||||
spaceshipPos.z >= 0.27f && spaceshipPos.z <= 1.67f) {
|
||||
spaceshipPos.z >= -0.3f && spaceshipPos.z <= 1.f) {
|
||||
if (animal_in_box) {
|
||||
printf("animal in hand\n");
|
||||
animal_in_box = false;
|
||||
@ -831,9 +852,9 @@ void processInput(GLFWwindow* window)
|
||||
cameraDir = spaceshipDir;
|
||||
|
||||
if (glfwGetKey(window, GLFW_KEY_1) == GLFW_PRESS)
|
||||
exposition -= 0.05;
|
||||
exposition -= 0.001;
|
||||
if (glfwGetKey(window, GLFW_KEY_2) == GLFW_PRESS)
|
||||
exposition += 0.05;
|
||||
exposition += 0.001;
|
||||
|
||||
glfwSetKeyCallback(window, key_callback);
|
||||
|
||||
|
BIN
cw 9/textures/plant1.jpg
Normal file
BIN
cw 9/textures/plant1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 260 KiB |
BIN
cw 9/textures/plant1dirt.jpg
Normal file
BIN
cw 9/textures/plant1dirt.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 MiB |
BIN
cw 9/textures/plant1pot.jpg
Normal file
BIN
cw 9/textures/plant1pot.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.8 MiB |
Binary file not shown.
Before Width: | Height: | Size: 718 KiB After Width: | Height: | Size: 3.8 MiB |
BIN
cw 9/textures/wall1.jpg
Normal file
BIN
cw 9/textures/wall1.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 810 KiB |
Loading…
Reference in New Issue
Block a user