diff --git a/.vs/grk-project/v16/.suo b/.vs/grk-project/v16/.suo index f6a7f80..7f9ccf5 100644 Binary files a/.vs/grk-project/v16/.suo and b/.vs/grk-project/v16/.suo differ diff --git a/.vs/grk-project/v16/Browse.VC.db b/.vs/grk-project/v16/Browse.VC.db index e57426c..eccc4f3 100644 Binary files a/.vs/grk-project/v16/Browse.VC.db and b/.vs/grk-project/v16/Browse.VC.db differ diff --git a/Release/room.exe b/Release/room.exe index 2498f9f..49ac31e 100644 Binary files a/Release/room.exe and b/Release/room.exe differ diff --git a/Release/room.pdb b/Release/room.pdb index 938e56f..93583bb 100644 Binary files a/Release/room.pdb and b/Release/room.pdb differ diff --git a/cw 9/Release/Box.obj b/cw 9/Release/Box.obj index 9b9e9d5..6158331 100644 Binary files a/cw 9/Release/Box.obj and b/cw 9/Release/Box.obj differ diff --git a/cw 9/Release/Camera.obj b/cw 9/Release/Camera.obj index 2ea1589..080cf17 100644 Binary files a/cw 9/Release/Camera.obj and b/cw 9/Release/Camera.obj differ diff --git a/cw 9/Release/Render_Utils.obj b/cw 9/Release/Render_Utils.obj index 0a62613..a3fdddb 100644 Binary files a/cw 9/Release/Render_Utils.obj and b/cw 9/Release/Render_Utils.obj differ diff --git a/cw 9/Release/SOIL.obj b/cw 9/Release/SOIL.obj index 437fafb..250d19d 100644 Binary files a/cw 9/Release/SOIL.obj and b/cw 9/Release/SOIL.obj differ diff --git a/cw 9/Release/Shader_Loader.obj b/cw 9/Release/Shader_Loader.obj index 374deca..f3e534d 100644 Binary files a/cw 9/Release/Shader_Loader.obj and b/cw 9/Release/Shader_Loader.obj differ diff --git a/cw 9/Release/Texture.obj b/cw 9/Release/Texture.obj index 661d861..b6c0529 100644 Binary files a/cw 9/Release/Texture.obj and b/cw 9/Release/Texture.obj differ diff --git a/cw 9/Release/grk-cw9.log b/cw 9/Release/grk-cw9.log index 6b42f27..ac0adca 100644 --- a/cw 9/Release/grk-cw9.log +++ b/cw 9/Release/grk-cw9.log @@ -1,35 +1,34 @@  main.cpp C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: "APIENTRY": ponowna definicja makra -C:\Users\Genos\source\repos\GRK_Roomfinal\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(124,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(142,38): warning C4305: "=": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(165,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(184,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(202,15): warning C4101: "textureID": lokalna zmienna, do której nie istnieje odwołanie -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(344,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(350,96): warning C4305: "argument": obcięcie z "double" do "T" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(142,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(160,38): warning C4305: "=": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(183,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(202,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(220,15): warning C4101: "textureID": lokalna zmienna, do której nie istnieje odwołanie +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(310,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(316,96): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(353,59): warning C4305: "argument": obcięcie z "double" do "T" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(319,59): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(501,29): warning C4018: "<": niezgodność typu ze znakiem/bez znaku -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(526,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(540,109): warning C4305: "argument": obcięcie z "double" do "T" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(467,29): warning C4018: "<": niezgodność typu ze znakiem/bez znaku +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(492,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(506,109): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(593,2): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(737,21): warning C4305: "-=": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Roomfinal\cw 9\src\room.hpp(739,21): warning C4305: "+=": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(714,21): warning C4305: "-=": obcięcie z "double" do "float" +D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(716,21): warning C4305: "+=": obcięcie z "double" do "float" Trwa generowanie kodu - 5 of 607 functions ( 0.8%) were compiled, the rest were copied from previous compilation. + 50 of 607 functions ( 8.2%) were compiled, the rest were copied from previous compilation. 0 functions were new in current compilation - 7 functions had inline decision re-evaluated but remain unchanged + 9 functions had inline decision re-evaluated but remain unchanged Zakończono generowanie kodu - grk-cw9.vcxproj -> C:\Users\Genos\source\repos\GRK_Roomfinal\Release\room.exe + grk-cw9.vcxproj -> D:\UAM\Grafika komputerowa\projekt\GRK_Room\Release\room.exe diff --git a/cw 9/Release/image_DXT.obj b/cw 9/Release/image_DXT.obj index b78dac2..6ba9f87 100644 Binary files a/cw 9/Release/image_DXT.obj and b/cw 9/Release/image_DXT.obj differ diff --git a/cw 9/Release/image_helper.obj b/cw 9/Release/image_helper.obj index 632277c..3d7ccc4 100644 Binary files a/cw 9/Release/image_helper.obj and b/cw 9/Release/image_helper.obj differ diff --git a/cw 9/Release/main.obj b/cw 9/Release/main.obj index 6b967e1..ad79bc8 100644 Binary files a/cw 9/Release/main.obj and b/cw 9/Release/main.obj differ diff --git a/cw 9/Release/room.exe.recipe b/cw 9/Release/room.exe.recipe index c97f901..7cabe4c 100644 --- a/cw 9/Release/room.exe.recipe +++ b/cw 9/Release/room.exe.recipe @@ -2,7 +2,7 @@ - C:\Users\Genos\source\repos\GRK_Roomfinal\Release\room.exe + D:\UAM\Grafika komputerowa\projekt\GRK_Room\Release\room.exe diff --git a/cw 9/Release/room.iobj b/cw 9/Release/room.iobj index 1c66290..98a1170 100644 Binary files a/cw 9/Release/room.iobj and b/cw 9/Release/room.iobj differ diff --git a/cw 9/Release/room.ipdb b/cw 9/Release/room.ipdb index 2283b8c..6e35cb0 100644 Binary files a/cw 9/Release/room.ipdb and b/cw 9/Release/room.ipdb differ diff --git a/cw 9/Release/room.tlog/CL.command.1.tlog b/cw 9/Release/room.tlog/CL.command.1.tlog index bd14e89..2cbac6d 100644 Binary files a/cw 9/Release/room.tlog/CL.command.1.tlog and b/cw 9/Release/room.tlog/CL.command.1.tlog differ diff --git a/cw 9/Release/room.tlog/CL.read.1.tlog b/cw 9/Release/room.tlog/CL.read.1.tlog index 1bf2a32..08651ca 100644 Binary files a/cw 9/Release/room.tlog/CL.read.1.tlog and b/cw 9/Release/room.tlog/CL.read.1.tlog differ diff --git a/cw 9/Release/room.tlog/CL.write.1.tlog b/cw 9/Release/room.tlog/CL.write.1.tlog index 709010b..6b10f18 100644 Binary files a/cw 9/Release/room.tlog/CL.write.1.tlog and b/cw 9/Release/room.tlog/CL.write.1.tlog differ diff --git a/cw 9/Release/room.tlog/link.read.1.tlog b/cw 9/Release/room.tlog/link.read.1.tlog index c6463b2..88a9cff 100644 Binary files a/cw 9/Release/room.tlog/link.read.1.tlog and b/cw 9/Release/room.tlog/link.read.1.tlog differ diff --git a/cw 9/Release/room.tlog/link.write.1.tlog b/cw 9/Release/room.tlog/link.write.1.tlog index 639443e..24237fa 100644 Binary files a/cw 9/Release/room.tlog/link.write.1.tlog and b/cw 9/Release/room.tlog/link.write.1.tlog differ diff --git a/cw 9/Release/room.tlog/room.lastbuildstate b/cw 9/Release/room.tlog/room.lastbuildstate index d14f87f..e062306 100644 --- a/cw 9/Release/room.tlog/room.lastbuildstate +++ b/cw 9/Release/room.tlog/room.lastbuildstate @@ -1,2 +1,2 @@ PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: -Release|Win32|C:\Users\Genos\source\repos\GRK_Roomfinal\| +Release|Win32|D:\UAM\Grafika komputerowa\projekt\GRK_Room\| diff --git a/cw 9/Release/stb_image_aug.obj b/cw 9/Release/stb_image_aug.obj index 2215ae5..61d1686 100644 Binary files a/cw 9/Release/stb_image_aug.obj and b/cw 9/Release/stb_image_aug.obj differ diff --git a/cw 9/Release/vc142.pdb b/cw 9/Release/vc142.pdb index 9c631a2..fd85e6f 100644 Binary files a/cw 9/Release/vc142.pdb and b/cw 9/Release/vc142.pdb differ diff --git a/cw 9/src/room.hpp b/cw 9/src/room.hpp index 56a0c26..82773f8 100644 --- a/cw 9/src/room.hpp +++ b/cw 9/src/room.hpp @@ -57,11 +57,29 @@ namespace texture { GLuint earth; GLuint earthNormal; + GLuint spaceship; + GLuint spaceshipNormal; + GLuint spaceshipARM; + GLuint brick; GLuint brickNormal; GLuint brickARM; GLuint floor; + GLuint floorNormal; + GLuint floorARM; + + GLuint wall; + GLuint wallNormal; + GLuint wallARM; + + GLuint wood; + GLuint woodNormal; + GLuint woodARM; + + GLuint black; + GLuint blackNormal; + GLuint blackARM; } Core::RenderContext cubeContext; @@ -247,7 +265,7 @@ void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix) { -void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3 color, float roughness, float metallic) { +void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint textureID, GLuint textureNormalID, GLuint textureARMID) { glActiveTexture(GL_TEXTURE0); glUniform1i(glGetUniformLocation(program, "depthMap"), 0); glBindTexture(GL_TEXTURE_2D, depthMap); @@ -265,11 +283,6 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec glUniform1f(glGetUniformLocation(program, "exposition"), exposition); - //glUniform1f(glGetUniformLocation(program, "roughness"), roughness); - //glUniform1f(glGetUniformLocation(program, "metallic"), metallic); - - //glUniform3f(glGetUniformLocation(program, "color"), color.x, color.y, color.z); - glUniform3f(glGetUniformLocation(program, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z); glUniform3f(glGetUniformLocation(program, "sunDir"), sunDir.x, sunDir.y, sunDir.z); @@ -287,59 +300,12 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec glUniform3f(glGetUniformLocation(program, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z); glUniform1f(glGetUniformLocation(program, "spotlightPhi"), spotlightPhi); - Core::SetActiveTexture(texture::brick, "colorTexture", program, 2); - Core::SetActiveTexture(texture::brickNormal, "normalSampler", program, 3); - Core::SetActiveTexture(texture::brickARM, "armSampler", program, 4); + Core::SetActiveTexture(textureID, "colorTexture", program, 2); + Core::SetActiveTexture(textureNormalID, "normalSampler", program, 3); + Core::SetActiveTexture(textureARMID, "armSampler", program, 4); Core::DrawContext(context); } -void drawObjectTexture(Core::RenderContext& context, glm::mat4 modelMatrix, GLuint textureID, glm::vec3 color, float roughness, float metallic) { - glUseProgram(programTex); - - glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix(); - glm::mat4 transformation = viewProjectionMatrix * modelMatrix; - - glUniformMatrix4fv(glGetUniformLocation(programTex, "transformation"), 1, GL_FALSE, (float*)&transformation); - glUniformMatrix4fv(glGetUniformLocation(programTex, "modelMatrix"), 1, GL_FALSE, (float*)&modelMatrix); - - glUniform1f(glGetUniformLocation(programTex, "exposition"), exposition); - - glUniform1f(glGetUniformLocation(programTex, "roughness"), roughness); - glUniform1f(glGetUniformLocation(programTex, "metallic"), metallic); - glUniform3f(glGetUniformLocation(programTex, "color"), color.x, color.y, color.z); - - glUniform3f(glGetUniformLocation(programTex, "cameraPos"), cameraPos.x, cameraPos.y, cameraPos.z); - - glUniform3f(glGetUniformLocation(programTex, "sunDir"), sunDir.x, sunDir.y, sunDir.z); - glUniform3f(glGetUniformLocation(programTex, "sunColor"), sunColor.x, sunColor.y, sunColor.z); - - if (lightOn > 0.0f) - glUniform3f(glGetUniformLocation(programTex, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z); - else - glUniform3f(glGetUniformLocation(programTex, "lightPos"), 1000.f, 1000.f, 1000.f); - glUniform3f(glGetUniformLocation(programTex, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z); - - - glUniform3f(glGetUniformLocation(programTex, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z); - glUniform3f(glGetUniformLocation(programTex, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z); - glUniform3f(glGetUniformLocation(programTex, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z); - glUniform1f(glGetUniformLocation(program, "spotlightPhi"), spotlightPhi); - - glActiveTexture(GL_TEXTURE0); - glUniform1i(glGetUniformLocation(programTex, "depthMapSun"), 0); - glBindTexture(GL_TEXTURE_2D, depthMap); - glUniformMatrix4fv(glGetUniformLocation(programTex, "LightVPSun"), 1, GL_FALSE, (float*)&lightVP); - - glActiveTexture(GL_TEXTURE1); - glUniform1i(glGetUniformLocation(programTex, "depthMapShip"), 1); - glBindTexture(GL_TEXTURE_2D, depthMapShip); - glUniformMatrix4fv(glGetUniformLocation(programTex, "lightShipVP"), 1, GL_FALSE, (float*)&lightShipVP); - - Core::SetActiveTexture(textureID, "colorTexture", programTex, 0); - Core::DrawContext(context); - glUseProgram(0); -} - void renderShadowapSun(GLuint depthFBO, glm::mat4 light) { float time = glfwGetTime(); glViewport(0, 0, SHADOW_WIDTH, SHADOW_HEIGHT); @@ -546,34 +512,32 @@ void renderScene(GLFWwindow* window) glUseProgram(program); - drawObjectPBR(models::couchContext, glm::scale(glm::vec3(0.5f)) * glm::translate(glm::vec3(8.4f, 0, -0.4f)) * glm::eulerAngleY(3.15f), glm::vec3(0.03f, 0.03f, 0.03f), 0.2f, 0.0f); - drawObjectPBR(models::coffeeTableContext, glm::translate(glm::vec3(2.8f, 0, 0.5f)), glm::vec3(1.f, 1.f, 1.f), 0.4f, 0.0f); - drawObjectPBR(models::doorContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - drawObjectPBR(models::planeContext, glm::mat4(), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - drawObjectPBR(models::roomContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.8f, 0.0f); - drawObjectPBR(models::deskContext, glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.9f)), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.0f); - drawObjectPBR(models::displayScreenContext, glm::scale(glm::vec3(0.1, 0.1, 0.1)) * glm::translate(glm::vec3(-28.5f, 9.0f, -20.0f)), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.3f); + //drawObjectPBR(models::couchContext, glm::scale(glm::vec3(0.5f)) * glm::translate(glm::vec3(8.4f, 0, -0.4f)) * glm::eulerAngleY(3.15f), glm::vec3(0.03f, 0.03f, 0.03f), 0.2f, 0.0f); + drawObjectPBR(models::coffeeTableContext, glm::translate(glm::vec3(2.8f, 0, 0.5f)), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::doorContext, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::planeContext, glm::mat4(), texture::floor, texture::floorNormal, texture::floorARM); + drawObjectPBR(models::roomContext, glm::mat4(), texture::wall, texture::wallNormal, texture::wallARM); + drawObjectPBR(models::deskContext, glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.9f)), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::displayScreenContext, glm::scale(glm::vec3(0.1, 0.1, 0.1)) * glm::translate(glm::vec3(-28.5f, 9.0f, -20.0f)), texture::black, texture::blackNormal, texture::blackARM); - drawObjectPBR(models::chairContext, glm::scale(glm::vec3(1.0f, 1.2f, 1.0f)) * glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.5f)), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.0f, 0.2f); - drawObjectPBR(models::tvContext, glm::mat4(), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.2f); - drawObjectPBR(models::ps5Context, glm::mat4(), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.2f); - drawObjectPBR(models::tvStandContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::carpetContext, glm::mat4(), glm::vec3(0.6745098039215686f, 0.6352941176470588f, 0.6235294117647059f), 0.0f, 0.2f); - drawObjectPBR(models::cabinet1Context, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::cabinet2Context, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::lampContext, glm::translate(glm::vec3(0.022f, 0.15f, 0.04f)), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::bookshelfContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::lightSwitchContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); - drawObjectPBR(models::easelContext, glm::mat4(), glm::vec3(0.6745098039215686f, 0.6352941176470588f, 0.6235294117647059f), 0.0f, 0.2f); - drawObjectPBR(models::carContext, glm::translate(carPosTranform), glm::vec3(1.0f, 0.0f, 0.0f), 0.0f, 0.2f); - drawObjectPBR(models::vaseContext, glm::translate(glm::vec3(1.1f, 1.41f, -2.2f)), glm::vec3(244.0f / 255.0f, 245.0f / 255.0f, 220.0f / 255.0f), 0.0f, 0.2f); + drawObjectPBR(models::chairContext, glm::scale(glm::vec3(1.0f, 1.2f, 1.0f)) * glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.5f)), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::tvContext, glm::mat4(), texture::black, texture::blackNormal, texture::blackARM); + drawObjectPBR(models::ps5Context, glm::mat4(), texture::black, texture::blackNormal, texture::blackARM); + drawObjectPBR(models::tvStandContext, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + //drawObjectPBR(models::carpetContext, glm::mat4(), glm::vec3(0.6745098039215686f, 0.6352941176470588f, 0.6235294117647059f), 0.0f, 0.2f); + drawObjectPBR(models::cabinet1Context, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::cabinet2Context, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::lampContext, glm::translate(glm::vec3(0.022f, 0.15f, 0.04f)), texture::black, texture::blackNormal, texture::blackARM); + drawObjectPBR(models::bookshelfContext, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + //drawObjectPBR(models::lightSwitchContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.0f), 0.0f, 0.2f); + drawObjectPBR(models::easelContext, glm::mat4(), texture::wood, texture::woodNormal, texture::woodARM); + //drawObjectPBR(models::carContext, glm::translate(carPosTranform), glm::vec3(1.0f, 0.0f, 0.0f), 0.0f, 0.2f); + //drawObjectPBR(models::vaseContext, glm::translate(glm::vec3(1.1f, 1.41f, -2.2f)), glm::vec3(244.0f / 255.0f, 245.0f / 255.0f, 220.0f / 255.0f), 0.0f, 0.2f); // draw windows - drawObjectPBR(models::windowContext, glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.2f)), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - drawObjectPBR(models::windowContext, glm::eulerAngleY(3.14f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.3f)), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - drawObjectPBR(models::windowContext, glm::eulerAngleY(1.57f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.45f)) * glm::translate(glm::vec3(-0.6f, 0, -0.25f)), glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); - - //drawObjectTexture(models::planeContext, glm::mat4(), texture::floor, glm::vec3(0.402978f, 0.120509f, 0.057729f), 0.2f, 0.0f); + drawObjectPBR(models::windowContext, glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.2f)), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::windowContext, glm::eulerAngleY(3.14f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.3f)), texture::wood, texture::woodNormal, texture::woodARM); + drawObjectPBR(models::windowContext, glm::eulerAngleY(1.57f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.45f)) * glm::translate(glm::vec3(-0.6f, 0, -0.25f)), texture::wood, texture::woodNormal, texture::woodARM); glm::vec3 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f))); glm::vec3 spaceshipUp = glm::normalize(glm::cross(spaceshipSide, spaceshipDir)); @@ -588,8 +552,7 @@ void renderScene(GLFWwindow* window) //drawObjectPBR(shipContext, drawObjectPBR(models::spaceshipContext, glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi()) * glm::scale(glm::vec3(0.03f)), - glm::vec3(0.3, 0.3, 0.5), - 0.2,1.0 + texture::spaceship, texture::spaceshipNormal, texture::spaceshipARM ); @@ -648,15 +611,30 @@ void init(GLFWwindow* window) loadCubemap(faces); initDepthMap(); - programTex = shaderLoader.CreateProgram("shaders/shader_tex.vert", "shaders/shader_tex.frag"); - texture::earth = Core::LoadTexture("textures/room/earth.png"); - texture::earthNormal = Core::LoadTexture("textures/room/earth_normalmap.png"); - texture::floor = Core::LoadTexture("textures/floor/floor_wood.jpg"); - texture::brick = Core::LoadTexture("textures/room/brick.jpg"); texture::brickNormal = Core::LoadTexture("textures/room/brick_normal.jpg"); texture::brickARM = Core::LoadTexture("textures/room/brick_arm.jpg"); + texture::spaceship = Core::LoadTexture("textures/spaceship/spaceship_albedo.png"); + texture::spaceshipNormal = Core::LoadTexture("textures/spaceship/spaceship_normal.png"); + texture::spaceshipARM = Core::LoadTexture("textures/spaceship/spaceship_amr.png"); + + texture::floor = Core::LoadTexture("textures/floor/floor.jpg"); + texture::floorNormal = Core::LoadTexture("textures/floor/floor_normal.png"); + texture::floorARM = Core::LoadTexture("textures/floor/floor_arm.png"); + + texture::wall = Core::LoadTexture("textures/wall/wall.png"); + texture::wallNormal = Core::LoadTexture("textures/wall/wall_normal.png"); + texture::wallARM = Core::LoadTexture("textures/wall/wall_arm.png"); + + texture::wood = Core::LoadTexture("textures/wood/wood.jpg"); + texture::woodNormal = Core::LoadTexture("textures/wood/wood_normal.png"); + texture::woodARM = Core::LoadTexture("textures/wood/wood_arm.png"); + + texture::black = Core::LoadTexture("textures/black/black.jpg"); + texture::blackNormal = Core::LoadTexture("textures/black/black_normal.png"); + texture::blackARM = Core::LoadTexture("textures/black/black_arm.png"); + loadModelToContext("./models/sphere.obj", sphereContext); loadModelToContext("./models/cube.obj", cubeContext); loadModelToContext("./models/couch.obj", models::couchContext); @@ -665,7 +643,6 @@ void init(GLFWwindow* window) loadModelToContext("./models/door.obj", models::doorContext); loadModelToContext("./models/drawer.obj", models::drawerContext); loadModelToContext("./models/plane.obj", models::planeContext); - //loadModelToContext("./models/room_2.obj", models::roomContext); loadModelToContext("./models/room/room3.obj", models::roomContext); loadModelToContext("./models/spaceship.obj", models::spaceshipContext); loadModelToContext("./models/sphere.obj", models::sphereContext); diff --git a/cw 9/textures/black/black.jpg b/cw 9/textures/black/black.jpg new file mode 100644 index 0000000..ce2cb33 Binary files /dev/null and b/cw 9/textures/black/black.jpg differ diff --git a/cw 9/textures/black/black_arm.png b/cw 9/textures/black/black_arm.png new file mode 100644 index 0000000..c9516a9 Binary files /dev/null and b/cw 9/textures/black/black_arm.png differ diff --git a/cw 9/textures/black/black_normal.png b/cw 9/textures/black/black_normal.png new file mode 100644 index 0000000..1a745c4 Binary files /dev/null and b/cw 9/textures/black/black_normal.png differ diff --git a/cw 9/textures/floor/floor.jpg b/cw 9/textures/floor/floor.jpg new file mode 100644 index 0000000..abf1d42 Binary files /dev/null and b/cw 9/textures/floor/floor.jpg differ diff --git a/cw 9/textures/floor/floor_arm.png b/cw 9/textures/floor/floor_arm.png new file mode 100644 index 0000000..22b9fae Binary files /dev/null and b/cw 9/textures/floor/floor_arm.png differ diff --git a/cw 9/textures/floor/floor_normal.png b/cw 9/textures/floor/floor_normal.png new file mode 100644 index 0000000..1a41482 Binary files /dev/null and b/cw 9/textures/floor/floor_normal.png differ diff --git a/cw 9/textures/spaceship/spaceship_albedo.png b/cw 9/textures/spaceship/spaceship_albedo.png new file mode 100644 index 0000000..2917e54 Binary files /dev/null and b/cw 9/textures/spaceship/spaceship_albedo.png differ diff --git a/cw 9/textures/spaceship/spaceship_amr.png b/cw 9/textures/spaceship/spaceship_amr.png new file mode 100644 index 0000000..8061049 Binary files /dev/null and b/cw 9/textures/spaceship/spaceship_amr.png differ diff --git a/cw 9/textures/spaceship/spaceship_normal.png b/cw 9/textures/spaceship/spaceship_normal.png new file mode 100644 index 0000000..7479916 Binary files /dev/null and b/cw 9/textures/spaceship/spaceship_normal.png differ diff --git a/cw 9/textures/wall/wall.png b/cw 9/textures/wall/wall.png new file mode 100644 index 0000000..f3cbef7 Binary files /dev/null and b/cw 9/textures/wall/wall.png differ diff --git a/cw 9/textures/wall/wall_arm.png b/cw 9/textures/wall/wall_arm.png new file mode 100644 index 0000000..5261c7a Binary files /dev/null and b/cw 9/textures/wall/wall_arm.png differ diff --git a/cw 9/textures/wall/wall_normal.png b/cw 9/textures/wall/wall_normal.png new file mode 100644 index 0000000..d02cd08 Binary files /dev/null and b/cw 9/textures/wall/wall_normal.png differ diff --git a/cw 9/textures/wood/wood.jpg b/cw 9/textures/wood/wood.jpg new file mode 100644 index 0000000..5805dae Binary files /dev/null and b/cw 9/textures/wood/wood.jpg differ diff --git a/cw 9/textures/wood/wood_arm.png b/cw 9/textures/wood/wood_arm.png new file mode 100644 index 0000000..b259b77 Binary files /dev/null and b/cw 9/textures/wood/wood_arm.png differ diff --git a/cw 9/textures/wood/wood_normal.png b/cw 9/textures/wood/wood_normal.png new file mode 100644 index 0000000..2806756 Binary files /dev/null and b/cw 9/textures/wood/wood_normal.png differ