diff --git a/.vs/grk-project/v16/.suo b/.vs/grk-project/v16/.suo index cce4d18..df98408 100644 Binary files a/.vs/grk-project/v16/.suo and b/.vs/grk-project/v16/.suo differ diff --git a/Release/room.exe b/Release/room.exe index a210a9d..7fb23db 100644 Binary files a/Release/room.exe and b/Release/room.exe differ diff --git a/Release/room.pdb b/Release/room.pdb index 0089ac0..7dc1a22 100644 Binary files a/Release/room.pdb and b/Release/room.pdb differ diff --git a/cw 9/Release/grk-cw9.log b/cw 9/Release/grk-cw9.log index 0c50a0b..62b2e3e 100644 --- a/cw 9/Release/grk-cw9.log +++ b/cw 9/Release/grk-cw9.log @@ -18,24 +18,24 @@ C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(302,59): warning C4305: "argument" T=float ] C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(460,29): warning C4018: "<": niezgodność typu ze znakiem/bez znaku -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(501,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(514,108): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(503,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(516,108): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(525,59): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(527,59): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(526,37): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(559,2): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(687,21): warning C4305: "-=": obcięcie z "double" do "float" -C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(689,21): warning C4305: "+=": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(528,37): warning C4305: "argument": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(561,2): warning C4305: "argument": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(689,21): warning C4305: "-=": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(691,21): warning C4305: "+=": obcięcie z "double" do "float" Trwa generowanie kodu - 2 of 595 functions ( 0.3%) were compiled, the rest were copied from previous compilation. + 1 of 595 functions ( 0.2%) were compiled, the rest were copied from previous compilation. 0 functions were new in current compilation - 6 functions had inline decision re-evaluated but remain unchanged + 7 functions had inline decision re-evaluated but remain unchanged Zakończono generowanie kodu grk-cw9.vcxproj -> C:\Users\annas\Desktop\graf\Release\room.exe diff --git a/cw 9/Release/main.obj b/cw 9/Release/main.obj index 2f864c4..f0a0d68 100644 Binary files a/cw 9/Release/main.obj and b/cw 9/Release/main.obj differ diff --git a/cw 9/Release/room.iobj b/cw 9/Release/room.iobj index 2944688..07c8453 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 07f7ae8..c1425e5 100644 Binary files a/cw 9/Release/room.ipdb and b/cw 9/Release/room.ipdb differ diff --git a/cw 9/Release/vc142.pdb b/cw 9/Release/vc142.pdb index c69e488..3d5be2e 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 054e5ba..edd20c2 100644 --- a/cw 9/src/room.hpp +++ b/cw 9/src/room.hpp @@ -213,36 +213,36 @@ void drawObjectDepth(Core::RenderContext& context, glm::mat4 viewProjection, glm } -//void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix) { -// glDisable(GL_DEPTH_TEST); -// glUseProgram(programSkybox); -// glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix(); -// glm::mat4 transformation = viewProjectionMatrix * modelMatrix; -// glUniformMatrix4fv(glGetUniformLocation(programSkybox, "transformation"), 1, GL_FALSE, (float*)&transformation); -// glUniform1i(glGetUniformLocation(programSkybox, "skybox"), 10); -// Core::SetActiveTexture(texture::cubemapTexture, "skybox", programSkybox, 0); -// glUniform1f(glGetUniformLocation(programSkybox, "exposition"), exposition); -// Core::DrawContext(context); -// glEnable(GL_DEPTH_TEST); -//} - void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix) { glDisable(GL_DEPTH_TEST); - glUseProgram(programSkybox); - glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix(); glm::mat4 transformation = viewProjectionMatrix * modelMatrix; - glUniformMatrix4fv(glGetUniformLocation(programSkybox, "transformation"), 1, GL_FALSE, (float*)&transformation); - Core::SetActiveTexture(texture::cubemapTexture, "skybox", programSkybox, 0); + glUniform1i(glGetUniformLocation(programSkybox, "skybox"), 0); + //Core::SetActiveTexture(texture::cubemapTexture, "skybox", programSkybox, 0); glUniform1f(glGetUniformLocation(programSkybox, "exposition"), exposition); - Core::DrawContext(context); - glEnable(GL_DEPTH_TEST); } +//void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix) { +// glDisable(GL_DEPTH_TEST); +// +// glUseProgram(programSkybox); +// +// glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix(); +// glm::mat4 transformation = viewProjectionMatrix * modelMatrix; +// +// glUniformMatrix4fv(glGetUniformLocation(programSkybox, "transformation"), 1, GL_FALSE, (float*)&transformation); +// Core::SetActiveTexture(texture::cubemapTexture, "skybox", programSkybox, 0); +// glUniform1f(glGetUniformLocation(programSkybox, "exposition"), exposition); +// +// Core::DrawContext(context); +// +// glEnable(GL_DEPTH_TEST); +//} + void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec3 color, float roughness, float metallic) { glActiveTexture(GL_TEXTURE0); glUniform1i(glGetUniformLocation(program, "depthMap"), 0); @@ -495,6 +495,8 @@ void pingPongBluring() void renderScene(GLFWwindow* window) { + spotlightPos = spaceshipPos + 0.2 * spaceshipDir; + spotlightConeDir = spaceshipDir; lightShipVP = createPerspectiveMatrix(0.5) * glm::lookAt(spotlightPos, spotlightPos + spotlightConeDir, glm::vec3(0, 1, 0)); glClearColor(1.f, 1, 1, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); @@ -562,9 +564,6 @@ void renderScene(GLFWwindow* window) 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::chairContext, glm::scale(glm::vec3(0.03,0.03,0.03)) * glm::translate(glm::vec3(-100.5f,0.0f, -35.0f)), glm::vec3(0.0f, 0.0f, 0.0f), 0.0f, 0.2f); - spotlightPos = spaceshipPos + 0.2 * spaceshipDir; - spotlightConeDir = spaceshipDir; - pingPongBluring(); glBindFramebuffer(GL_FRAMEBUFFER, 0);