diff --git a/.vs/grk-project/v16/.suo b/.vs/grk-project/v16/.suo index 5fa9afc..c7e2dbc 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 e7a6375..2fe5431 100644 Binary files a/.vs/grk-project/v16/Browse.VC.db and b/.vs/grk-project/v16/Browse.VC.db differ diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite index 301c17f..6396e9e 100644 Binary files a/.vs/slnx.sqlite and b/.vs/slnx.sqlite differ diff --git a/Debug/room.exe b/Debug/room.exe index 39b07db..e583eff 100644 Binary files a/Debug/room.exe and b/Debug/room.exe differ diff --git a/Debug/room.pdb b/Debug/room.pdb index dc63725..c15c930 100644 Binary files a/Debug/room.pdb and b/Debug/room.pdb differ diff --git a/Release/room.exe b/Release/room.exe index 3c86649..a7dd760 100644 Binary files a/Release/room.exe and b/Release/room.exe differ diff --git a/Release/room.pdb b/Release/room.pdb index b281d92..667d72e 100644 Binary files a/Release/room.pdb and b/Release/room.pdb differ diff --git a/cw 9/Debug/Box.obj b/cw 9/Debug/Box.obj index 57864b3..9e87526 100644 Binary files a/cw 9/Debug/Box.obj and b/cw 9/Debug/Box.obj differ diff --git a/cw 9/Debug/Camera.obj b/cw 9/Debug/Camera.obj index caf2858..328937f 100644 Binary files a/cw 9/Debug/Camera.obj and b/cw 9/Debug/Camera.obj differ diff --git a/cw 9/Debug/Render_Utils.obj b/cw 9/Debug/Render_Utils.obj index 210b458..da00406 100644 Binary files a/cw 9/Debug/Render_Utils.obj and b/cw 9/Debug/Render_Utils.obj differ diff --git a/cw 9/Debug/SOIL.obj b/cw 9/Debug/SOIL.obj index bba0e01..aa9d825 100644 Binary files a/cw 9/Debug/SOIL.obj and b/cw 9/Debug/SOIL.obj differ diff --git a/cw 9/Debug/Shader_Loader.obj b/cw 9/Debug/Shader_Loader.obj index 17805fa..1963716 100644 Binary files a/cw 9/Debug/Shader_Loader.obj and b/cw 9/Debug/Shader_Loader.obj differ diff --git a/cw 9/Debug/Texture.obj b/cw 9/Debug/Texture.obj index a0e1a37..6f998a9 100644 Binary files a/cw 9/Debug/Texture.obj and b/cw 9/Debug/Texture.obj differ diff --git a/cw 9/Debug/grk-cw9.log b/cw 9/Debug/grk-cw9.log index 797b50b..0ebdc9a 100644 --- a/cw 9/Debug/grk-cw9.log +++ b/cw 9/Debug/grk-cw9.log @@ -1,44 +1,39 @@ -C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(513,5): warning MSB8028: Katalog pośredni (Debug\) zawiera pliki udostępnione z innego projektu (grk-cw9.vcxproj). Może to spowodować niepoprawne zachowanie podczas oczyszczania i ponownej kompilacji. +C:\software\vs19\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild.targets(513,5): warning MSB8028: The intermediate directory (Debug\) contains files shared from another project (grk-cw9.vcxproj). This can lead to incorrect clean and rebuild behavior. 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 -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(111,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(130,38): warning C4305: "=": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(153,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(172,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(190,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(276,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(287,96): warning C4305: "argument": obcięcie z "double" do "T" +C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\shared\minwindef.h(130,1): warning C4005: 'APIENTRY': macro redefinition +C:\Users\s464961\Source\Repos\GRK_Room\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : see previous definition of 'APIENTRY' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(107,30): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(122,38): warning C4305: '=': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(145,16): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(166,16): warning C4305: 'initializing': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(185,15): warning C4101: 'textureID': unreferenced local variable +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(268,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(279,96): warning C4305: 'argument': truncation from 'double' to 'T' with [ T=float ] -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(291,59): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(283,59): warning C4305: 'argument': truncation from 'double' to 'T' with [ T=float ] -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(388,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(412,109): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(440,29): warning C4018: '<': signed/unsigned mismatch +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(480,13): warning C4244: 'initializing': conversion from 'double' to 'float', possible loss of data +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(493,108): warning C4305: 'argument': truncation from 'double' to 'T' with [ T=float ] -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(421,87): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(504,59): warning C4305: 'argument': truncation from 'double' to 'T' with [ T=float ] -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(421,223): warning C4305: "argument": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(424,59): warning C4305: "argument": obcięcie z "double" do "T" - with - [ - T=float - ] -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(425,37): warning C4305: "argument": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(462,2): warning C4305: "argument": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(594,21): warning C4305: "-=": obcięcie z "double" do "float" -D:\UAM\Grafika komputerowa\projekt\GRK_Room\cw 9\src\room.hpp(596,21): warning C4305: "+=": obcięcie z "double" do "float" -Box.obj : warning LNK4075: zignorowano opcję „/EDITANDCONTINUE” z powodu określenia opcji „/INCREMENTAL:NO” -LINK : warning LNK4098: domyślna biblioteka „MSVCRT” powoduje konflikt z innymi bibliotekami; użyj opcji /NODEFAULTLIB:biblioteka - grk-cw9.vcxproj -> D:\UAM\Grafika komputerowa\projekt\GRK_Room\Debug\room.exe +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(505,37): warning C4305: 'argument': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(538,2): warning C4305: 'argument': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(662,21): warning C4305: '-=': truncation from 'double' to 'float' +C:\Users\s464961\source\repos\GRK_Room\cw 9\src\room.hpp(664,21): warning C4305: '+=': truncation from 'double' to 'float' +Box.obj : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/INCREMENTAL:NO' specification +LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library + grk-cw9.vcxproj -> C:\Users\s464961\Source\Repos\GRK_Room\Debug\room.exe diff --git a/cw 9/Debug/image_DXT.obj b/cw 9/Debug/image_DXT.obj index ab2b705..a4946fe 100644 Binary files a/cw 9/Debug/image_DXT.obj and b/cw 9/Debug/image_DXT.obj differ diff --git a/cw 9/Debug/image_helper.obj b/cw 9/Debug/image_helper.obj index e28aa99..27775a6 100644 Binary files a/cw 9/Debug/image_helper.obj and b/cw 9/Debug/image_helper.obj differ diff --git a/cw 9/Debug/main.obj b/cw 9/Debug/main.obj index 7e81c73..066c1e2 100644 Binary files a/cw 9/Debug/main.obj and b/cw 9/Debug/main.obj differ diff --git a/cw 9/Debug/room.exe.recipe b/cw 9/Debug/room.exe.recipe index 072862f..19f1cab 100644 --- a/cw 9/Debug/room.exe.recipe +++ b/cw 9/Debug/room.exe.recipe @@ -2,7 +2,7 @@ - D:\UAM\Grafika komputerowa\projekt\GRK_Room\Debug\room.exe + C:\Users\Genos\Source\Repos\GRK_Room22\Debug\room.exe diff --git a/cw 9/Debug/room.tlog/CL.command.1.tlog b/cw 9/Debug/room.tlog/CL.command.1.tlog index ca2b77b..5d46b65 100644 Binary files a/cw 9/Debug/room.tlog/CL.command.1.tlog and b/cw 9/Debug/room.tlog/CL.command.1.tlog differ diff --git a/cw 9/Debug/room.tlog/CL.read.1.tlog b/cw 9/Debug/room.tlog/CL.read.1.tlog index 56f184f..eba3c47 100644 Binary files a/cw 9/Debug/room.tlog/CL.read.1.tlog and b/cw 9/Debug/room.tlog/CL.read.1.tlog differ diff --git a/cw 9/Debug/room.tlog/CL.write.1.tlog b/cw 9/Debug/room.tlog/CL.write.1.tlog index 36d8edd..861d7d7 100644 Binary files a/cw 9/Debug/room.tlog/CL.write.1.tlog and b/cw 9/Debug/room.tlog/CL.write.1.tlog differ diff --git a/cw 9/Debug/room.tlog/link.command.1.tlog b/cw 9/Debug/room.tlog/link.command.1.tlog index e91d4c6..517646e 100644 Binary files a/cw 9/Debug/room.tlog/link.command.1.tlog and b/cw 9/Debug/room.tlog/link.command.1.tlog differ diff --git a/cw 9/Debug/room.tlog/link.read.1.tlog b/cw 9/Debug/room.tlog/link.read.1.tlog index 0c2c7c4..e223d75 100644 Binary files a/cw 9/Debug/room.tlog/link.read.1.tlog and b/cw 9/Debug/room.tlog/link.read.1.tlog differ diff --git a/cw 9/Debug/room.tlog/link.write.1.tlog b/cw 9/Debug/room.tlog/link.write.1.tlog index b684a59..9250058 100644 Binary files a/cw 9/Debug/room.tlog/link.write.1.tlog and b/cw 9/Debug/room.tlog/link.write.1.tlog differ diff --git a/cw 9/Debug/room.tlog/room.lastbuildstate b/cw 9/Debug/room.tlog/room.lastbuildstate index 60b436a..80c57e1 100644 --- a/cw 9/Debug/room.tlog/room.lastbuildstate +++ b/cw 9/Debug/room.tlog/room.lastbuildstate @@ -1,2 +1,2 @@ PlatformToolSet=v142:VCToolArchitecture=Native32Bit:VCToolsVersion=14.29.30133:TargetPlatformVersion=10.0.19041.0: -Debug|Win32|D:\UAM\Grafika komputerowa\projekt\GRK_Room\| +Debug|Win32|C:\Users\Genos\Source\Repos\GRK_Room22\| diff --git a/cw 9/Debug/stb_image_aug.obj b/cw 9/Debug/stb_image_aug.obj index af13158..8693d16 100644 Binary files a/cw 9/Debug/stb_image_aug.obj and b/cw 9/Debug/stb_image_aug.obj differ diff --git a/cw 9/Debug/vc142.idb b/cw 9/Debug/vc142.idb index ff42e93..cf623c6 100644 Binary files a/cw 9/Debug/vc142.idb and b/cw 9/Debug/vc142.idb differ diff --git a/cw 9/Debug/vc142.pdb b/cw 9/Debug/vc142.pdb index 322ea69..72de494 100644 Binary files a/cw 9/Debug/vc142.pdb and b/cw 9/Debug/vc142.pdb differ diff --git a/cw 9/Release/Box.obj b/cw 9/Release/Box.obj index 90a08df..19e40bd 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 b5b637e..82124a9 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 8fdd0c2..d95fb17 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 29c6cf5..d59eedb 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 ab38bdd..b1a4f1d 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 529bb2b..e1a0075 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 4b2c6aa..3b6eaca 100644 --- a/cw 9/Release/grk-cw9.log +++ b/cw 9/Release/grk-cw9.log @@ -1,46 +1,35 @@  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_Room\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(94,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(109,38): warning C4305: "=": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(132,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(153,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(172,15): warning C4101: "textureID": lokalna zmienna, do której nie istnieje odwołanie -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(252,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(263,96): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\annas\Desktop\graf\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(119,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(137,38): warning C4305: "=": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(160,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(181,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(200,15): warning C4101: "textureID": lokalna zmienna, do której nie istnieje odwołanie +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(293,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(304,96): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(267,59): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(308,59): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(343,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(353,108): warning C4305: "argument": obcięcie z "double" do "T" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(472,29): warning C4018: "<": niezgodność typu ze znakiem/bez znaku +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(497,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(514,109): warning C4305: "argument": obcięcie z "double" do "T" with [ T=float ] -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(361,87): warning C4305: "argument": obcięcie z "double" do "T" - with - [ - T=float - ] -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(361,223): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(364,59): warning C4305: "argument": obcięcie z "double" do "T" - with - [ - T=float - ] -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(365,37): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(393,2): warning C4305: "argument": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(501,21): warning C4305: "-=": obcięcie z "double" do "float" -C:\Users\Genos\source\repos\GRK_Room\cw 9\src\room.hpp(503,21): warning C4305: "+=": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(570,2): warning C4305: "argument": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(709,21): warning C4305: "-=": obcięcie z "double" do "float" +C:\Users\annas\Desktop\graf\cw 9\src\room.hpp(711,21): warning C4305: "+=": obcięcie z "double" do "float" Trwa generowanie kodu - 35 of 586 functions ( 6.0%) were compiled, the rest were copied from previous compilation. + 2 of 608 functions ( 0.3%) were compiled, the rest were copied from previous compilation. 0 functions were new in current compilation - 15 functions had inline decision re-evaluated but remain unchanged + 6 functions had inline decision re-evaluated but remain unchanged Zakończono generowanie kodu - grk-cw9.vcxproj -> C:\Users\Genos\source\repos\GRK_Room\Release\room.exe + grk-cw9.vcxproj -> C:\Users\annas\Desktop\graf\Release\room.exe diff --git a/cw 9/Release/image_DXT.obj b/cw 9/Release/image_DXT.obj index f494786..b45e6bd 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 d28c710..b18245d 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 436a9ec..16e0a50 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 9f9c666..7e3233f 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_Room\Release\room.exe + C:\Users\annas\Desktop\graf\Release\room.exe diff --git a/cw 9/Release/room.iobj b/cw 9/Release/room.iobj index e127328..6960712 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 b6eb01e..8830fac 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 46e41cc..fa2e57e 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 7161280..84afaf3 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 477c34d..557ca7c 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.command.1.tlog b/cw 9/Release/room.tlog/link.command.1.tlog index 4cfa9ec..3d87186 100644 Binary files a/cw 9/Release/room.tlog/link.command.1.tlog and b/cw 9/Release/room.tlog/link.command.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 d4b9406..c1fa650 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 c4240e1..42b372f 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 c94b67f..ba43894 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_Room\| +Release|Win32|C:\Users\annas\Desktop\graf\| diff --git a/cw 9/Release/stb_image_aug.obj b/cw 9/Release/stb_image_aug.obj index fc65a5e..cdca64e 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 1673833..9a4af7d 100644 Binary files a/cw 9/Release/vc142.pdb and b/cw 9/Release/vc142.pdb differ diff --git a/cw 9/grk-cw9.vcxproj b/cw 9/grk-cw9.vcxproj index 04488ff..7520a32 100644 --- a/cw 9/grk-cw9.vcxproj +++ b/cw 9/grk-cw9.vcxproj @@ -41,6 +41,8 @@ + + diff --git a/cw 9/grk-cw9.vcxproj.filters b/cw 9/grk-cw9.vcxproj.filters index 02d13f3..a20ee76 100644 --- a/cw 9/grk-cw9.vcxproj.filters +++ b/cw 9/grk-cw9.vcxproj.filters @@ -121,5 +121,11 @@ Shader Files + + Shader Files + + + Shader Files + \ No newline at end of file diff --git a/cw 9/shaders/shader_8_sun.frag b/cw 9/shaders/shader_8_sun.frag index c4c8a93..ec5cca1 100644 --- a/cw 9/shaders/shader_8_sun.frag +++ b/cw 9/shaders/shader_8_sun.frag @@ -1,11 +1,20 @@ #version 430 core +layout (location = 0) out vec4 FragColor; +layout (location = 1) out vec4 BloomColor; uniform vec3 color; uniform float exposition; - out vec4 outColor; void main() { outColor = vec4(vec3(1.0) - exp(-color*exposition),1); + //outColor = vec4(color, 1.0); + float brightness = dot(FragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); + if(brightness > 1.0) + BloomColor = vec4(FragColor.rgb, 1.0); + else + BloomColor = vec4(0.0, 0.0, 0.0, 1.0); + + BloomColor = vec4(color, 1.0); } diff --git a/cw 9/shaders/shader_8_sun.vert b/cw 9/shaders/shader_8_sun.vert index 0699a2e..5c2d818 100644 --- a/cw 9/shaders/shader_8_sun.vert +++ b/cw 9/shaders/shader_8_sun.vert @@ -4,10 +4,12 @@ layout(location = 0) in vec3 vertexPosition; layout(location = 1) in vec3 vertexNormal; layout(location = 2) in vec2 vertexTexCoord; + uniform mat4 transformation; void main() { gl_Position = transformation * vec4(vertexPosition, 1.0); //gl_Position = vec4(vertexPosition, 1.0); + } diff --git a/cw 9/shaders/shader_9_1.frag b/cw 9/shaders/shader_9_1.frag index 7eb79d4..7cfc3a0 100644 --- a/cw 9/shaders/shader_9_1.frag +++ b/cw 9/shaders/shader_9_1.frag @@ -1,5 +1,8 @@ #version 430 core +layout (location = 0) out vec4 FragColor; +layout (location = 1) out vec4 BloomColor; + float AMBIENT = 0.03; float PI = 3.14; @@ -148,11 +151,21 @@ void main() attenuatedlightColor = angle_atenuation*spotlightColor/pow(length(spotlightPos-worldPos),2)*calculateShadow(normal, spotlightDir, shipPos, depthMapShip); ilumination=ilumination+PBRLight(spotlightDir,attenuatedlightColor,normal,viewDir); + //sun ilumination=ilumination+PBRLight(sunDir,sunColor*calculateShadow(normal, spotlightDir, sunSpacePos, depthMap),normal,viewDir); + - outColor = vec4(vec3(1.0) - exp(-ilumination*exposition),1); + outColor = vec4(vec3(1.01) - exp(-ilumination*exposition),1); + + FragColor = outColor; + // check whether fragment output is higher than threshold, if so output as brightness color + float brightness = dot(FragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); + if(brightness > 1.0) + BloomColor = vec4(FragColor.rgb, 1.0); + else + BloomColor = vec4(0.0, 0.0, 0.0, 1.0); //outColor = vec4(roughness,metallic,0,1); //outColor = vec4(test; } diff --git a/cw 9/shaders/shader_skybox.frag b/cw 9/shaders/shader_skybox.frag index 7052ca9..dd54407 100644 --- a/cw 9/shaders/shader_skybox.frag +++ b/cw 9/shaders/shader_skybox.frag @@ -1,12 +1,21 @@ #version 430 core uniform samplerCube skybox; - +uniform float exposition; in vec3 texCoord; +out vec4 outColor; +layout (location = 0) out vec4 FragColor; +layout (location = 1) out vec4 BloomColor; -out vec4 out_color; void main() { - out_color = texture(skybox,texCoord); + outColor = vec4(vec3(1.0) - exp(-texture(skybox,texCoord).rgb*exposition),1); + + FragColor = outColor; + float brightness = dot(FragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); + if(brightness > 1.0) + BloomColor = vec4(FragColor.rgb, 1.0); + else + BloomColor = vec4(0.0, 0.0, 0.0, 1.0); } \ No newline at end of file diff --git a/cw 9/shaders/test.frag b/cw 9/shaders/test.frag index a6a6dc6..bcc1899 100644 --- a/cw 9/shaders/test.frag +++ b/cw 9/shaders/test.frag @@ -3,17 +3,46 @@ out vec4 FragColor; in vec2 tc; -uniform sampler2D depthMap; +uniform sampler2D color; +uniform sampler2D highlight; float rescale_z(float z){ float n = 0.05; float f = 20.; return (2*n*f/(z*(n-f)+n+f))/f; } +float weight[5] = float[] (0.227027, 0.1945946, 0.1216216, 0.054054, 0.016216); + +vec4 blur() +{ + vec2 tex_offset = 1.0 / textureSize(color, 0); // gets size of single texel + vec3 result = texture(highlight, tc).rgb * weight[0]; // current fragment's contribution + bool horizontal = true; + if(horizontal) + { + for(int i = 1; i < 5; ++i) + { + result += texture(highlight, tc + vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; + result += texture(highlight, tc - vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; + } + } + else + { + for(int i = 1; i < 5; ++i) + { + result += texture(highlight, tc + vec2(0.0, tex_offset.y * i)).rgb * weight[i]; + result += texture(highlight, tc - vec2(0.0, tex_offset.y * i)).rgb * weight[i]; + } + } + return vec4(result, 1.0); +} void main() { - float depthValue = texture(depthMap, tc).r; + //float depthValue = texture(depthMap, tc).r; //FragColor = vec4(vec3(rescale_z(depthValue)+0.5), 1.0); - FragColor = vec4(vec3((depthValue)+0.5), 1.0); + //FragColor = vec4(vec3((depthValue)+0.5), 1.0); + + FragColor = vec4(texture(highlight, tc).rgb+texture(color, tc).rgb,1); + //FragColor = vec4( (texture(color, tc)-0.98)*50); } \ No newline at end of file diff --git a/cw 9/shaders/test.vert b/cw 9/shaders/test.vert index f1a6f7e..f17f83e 100644 --- a/cw 9/shaders/test.vert +++ b/cw 9/shaders/test.vert @@ -10,5 +10,5 @@ out vec2 tc; void main() { tc = vertexTexCoord; - gl_Position = vec4(vertexPosition*0.5, 1.0); + gl_Position = vec4(vertexPosition, 1.0); } diff --git a/cw 9/src/main.cpp b/cw 9/src/main.cpp index a94ab40..046c28f 100644 --- a/cw 9/src/main.cpp +++ b/cw 9/src/main.cpp @@ -23,7 +23,7 @@ int main(int argc, char** argv) #endif // tworzenie okna za pomoca glfw - GLFWwindow* window = glfwCreateWindow(500, 500, "The Best Room", NULL, NULL); + GLFWwindow* window = glfwCreateWindow(800, 800, "The Best Room", NULL, NULL); if (window == NULL) { std::cout << "Failed to create GLFW window" << std::endl; @@ -34,7 +34,7 @@ int main(int argc, char** argv) // ladowanie OpenGL za pomoca glew glewInit(); - glViewport(0, 0, 500, 500); + glViewport(0, 0, 800, 800); init(window); diff --git a/cw 9/src/room.hpp b/cw 9/src/room.hpp index beb3979..e139f32 100644 --- a/cw 9/src/room.hpp +++ b/cw 9/src/room.hpp @@ -15,13 +15,13 @@ #include #include #include - +#include #include "SOIL/SOIL.h" #include "SOIL/stb_image_aug.h" const unsigned int SHADOW_WIDTH = 1024, SHADOW_HEIGHT = 1024; -int WIDTH = 500, HEIGHT = 500; +int WIDTH = 800, HEIGHT = 800; namespace models { Core::RenderContext couchContext; @@ -48,7 +48,6 @@ namespace models { Core::RenderContext lightSwitchContext; Core::RenderContext easelContext; Core::RenderContext carContext; - Core::RenderContext flowerContext; Core::RenderContext vaseContext; } @@ -66,7 +65,7 @@ std::vector faces = "textures/skybox/left2.jpg", "textures/skybox/top2.jpg", "textures/skybox/bottom2.jpg", - "textures/skybox/front2.jpg", + "textures/skybox/front2.jpg", "textures/skybox/back2.jpg", }; @@ -76,12 +75,15 @@ GLuint depthMap; GLuint depthMapShipFBO; GLuint depthMapShip; +GLuint bloomTextureFBO; + GLuint program; GLuint programSun; GLuint programTest; GLuint programTex; GLuint programDepth; GLuint programSkybox; +GLuint programBlur; Core::Shader_Loader shaderLoader; @@ -97,20 +99,25 @@ glm::vec3 cameraDir = glm::vec3(-0.354510f, 0.000000f, 0.935054f); glm::vec3 spaceshipPos = glm::vec3(0.065808f, 1.250000f, -2.189549f); glm::vec3 spaceshipDir = glm::vec3(-0.490263f, 0.000000f, 0.871578f); + +unsigned int colorBuffers[2]; +unsigned int pingpongFBO[2]; +unsigned int pingpongBuffer[2]; + GLuint VAO,VBO; float aspectRatio = 1.f; float exposition = 1.f; 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); //cienie z latarki glm::vec3 spotlightPos = glm::vec3(0, 0, 0); glm::vec3 spotlightConeDir = glm::vec3(0, 0, 0); glm::vec3 spotlightColor = glm::vec3(1.0, 1.0, 1.0)*10; float spotlightPhi = 3.14 / 4; -glm::mat4 lightVP = glm::ortho(-4.f, 3.f, -2.5f, 5.f, -10.0f, 20.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0)); +glm::mat4 lightVP = glm::ortho(-4.f, 3.f, -2.5f, 5.f, -10.0f, 20.0f) * glm::lookAt(sunPos, sunPos - sunDir, glm::vec3(0, 1, 0)); // glm::mat4 lightShipVP; float lastTime = -1.f; @@ -119,7 +126,6 @@ float deltaTime = 0.f; bool lightOn = true; glm::vec3 carPosTranform = glm::vec3(0, 0, 0); - void updateDeltaTime(float time) { if (lastTime < 0) { lastTime = time; @@ -138,7 +144,7 @@ glm::mat4 createCameraMatrix() glm::mat4 cameraRotrationMatrix = glm::mat4({ cameraSide.x,cameraSide.y,cameraSide.z,0, cameraUp.x,cameraUp.y,cameraUp.z ,0, - -cameraDir.x,-cameraDir.y,-cameraDir.z,0, + -cameraDir.x,-cameraDir.y,-cameraDir.z,0, 0.,0.,0.,1., }); cameraRotrationMatrix = glm::transpose(cameraRotrationMatrix); @@ -147,7 +153,7 @@ glm::mat4 createCameraMatrix() return cameraMatrix; } -glm::mat4 createPerspectiveMatrix() +glm::mat4 createPerspectiveMatrix() //do shaderow { glm::mat4 perspectiveMatrix; float n = 0.05; @@ -224,10 +230,17 @@ void drawSkyBox(Core::RenderContext& context, glm::mat4 modelMatrix) { glm::mat4 transformation = viewProjectionMatrix * modelMatrix; glUniformMatrix4fv(glGetUniformLocation(programSkybox, "transformation"), 1, GL_FALSE, (float*)&transformation); glUniform1i(glGetUniformLocation(programSkybox, "skybox"), 0); + glUniform1f(glGetUniformLocation(programSkybox, "exposition"), exposition); + if (lightOn) + glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z); + else + glUniform3f(glGetUniformLocation(program, "lightPos"), 1000.f, 1000.f, 1000.f); 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); @@ -258,16 +271,17 @@ void drawObjectPBR(Core::RenderContext& context, glm::mat4 modelMatrix, glm::vec if (lightOn) glUniform3f(glGetUniformLocation(program, "lightPos"), pointlightPos.x, pointlightPos.y, pointlightPos.z); - else + else glUniform3f(glGetUniformLocation(program, "lightPos"), 1000.f, 1000.f, 1000.f); - glUniform3f(glGetUniformLocation(program, "lightColor"), pointlightColor.x, pointlightColor.y, pointlightColor.z); + glUniform3f(glGetUniformLocation(program, "spotlightConeDir"), spotlightConeDir.x, spotlightConeDir.y, spotlightConeDir.z); glUniform3f(glGetUniformLocation(program, "spotlightPos"), spotlightPos.x, spotlightPos.y, spotlightPos.z); glUniform3f(glGetUniformLocation(program, "spotlightColor"), spotlightColor.x, spotlightColor.y, spotlightColor.z); glUniform1f(glGetUniformLocation(program, "spotlightPhi"), spotlightPhi); + Core::DrawContext(context); } void renderShadowapSun(GLuint depthFBO, glm::mat4 light) { @@ -284,12 +298,32 @@ void renderShadowapSun(GLuint depthFBO, glm::mat4 light) { 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))); drawObjectDepth(models::couchContext, light, glm::scale(glm::vec3(0.5f)) * glm::translate(glm::vec3(8.4f, 0, -0.4f)) * glm::eulerAngleY(3.15f)); + + drawObjectDepth(models::coffeeTableContext, light, glm::translate(glm::vec3(2.8f, 0, 0.5f))); + + drawObjectDepth(models::doorContext, light, glm::mat4()); + + drawObjectDepth(models::planeContext, light, glm::mat4()); + + drawObjectDepth(models::roomContext, light, glm::mat4()); - drawObjectDepth(models::deskContext, light,glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.9f))); + + + // draw windows + drawObjectDepth(models::windowContext, light, glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.2f))); + + + drawObjectDepth(models::windowContext, light, glm::eulerAngleY(3.14f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.3f))); + + + drawObjectDepth(models::windowContext, light, glm::eulerAngleY(1.57f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.45f)) * glm::translate(glm::vec3(-0.6f, 0, -0.25f))); + + drawObjectDepth(models::deskContext, light, glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.9f))); drawObjectDepth(models::displayScreenContext, light, glm::scale(glm::vec3(0.1, 0.1, 0.1)) * glm::translate(glm::vec3(-28.5f, 9.0f, -20.0f))); + drawObjectDepth(models::chairContext, light, glm::scale(glm::vec3(1.0f, 1.2f, 1.0f)) * glm::eulerAngleY(3.14f) * glm::translate(glm::vec3(2.8f, 0.0f, 1.5f))); drawObjectDepth(models::ps5Context, light, glm::mat4()); drawObjectDepth(models::tvStandContext, light, glm::mat4()); @@ -300,13 +334,8 @@ void renderShadowapSun(GLuint depthFBO, glm::mat4 light) { drawObjectDepth(models::bookshelfContext, light, glm::mat4()); drawObjectDepth(models::easelContext, light, glm::mat4()); drawObjectDepth(models::carContext, light, glm::translate(carPosTranform)); - drawObjectDepth(models::flowerContext, light, glm::mat4()); drawObjectDepth(models::vaseContext, light, glm::translate(glm::vec3(1.1f, 1.41f, -2.2f))); - drawObjectDepth(models::windowContext, light, glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.2f))); - drawObjectDepth(models::windowContext, light, glm::eulerAngleY(3.14f) * glm::scale(glm::vec3(1.0f, 1.0f, 2.3f)) * glm::translate(glm::vec3(-2.9f, 0, -0.3f))); - drawObjectDepth(models::windowContext, light, 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 spaceshipSide = glm::normalize(glm::cross(spaceshipDir, glm::vec3(0.f, 1.f, 0.f))); glm::vec3 spaceshipUp = glm::normalize(glm::cross(spaceshipSide, spaceshipDir)); glm::mat4 specshipCameraRotrationMatrix = glm::mat4({ @@ -316,6 +345,8 @@ void renderShadowapSun(GLuint depthFBO, glm::mat4 light) { 0.,0.,0.,1., }); + + //drawObjectDepth(shipContext, drawObjectDepth(models::spaceshipContext, light, glm::translate(spaceshipPos) * specshipCameraRotrationMatrix * glm::eulerAngleY(glm::pi()) * glm::scale(glm::vec3(0.03f)) @@ -363,31 +394,110 @@ void initDepthMapShip() glBindFramebuffer(GL_FRAMEBUFFER, 0); } +void initBloom() +{ + // set up floating point framebuffer to render scene to + glGenFramebuffers(1, &bloomTextureFBO); + glBindFramebuffer(GL_FRAMEBUFFER, bloomTextureFBO); + + glGenTextures(2, colorBuffers); + for (unsigned int i = 0; i < 2; i++) + { + glBindTexture(GL_TEXTURE_2D, colorBuffers[i]); + glTexImage2D( + GL_TEXTURE_2D, 0, GL_RGBA16F, WIDTH, HEIGHT, 0, GL_RGBA, GL_FLOAT, NULL + ); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + // attach texture to framebuffer + glFramebufferTexture2D( + GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + i, GL_TEXTURE_2D, colorBuffers[i], 0 + ); + unsigned int rboDepth; + + glGenRenderbuffers(1, &rboDepth); + glBindRenderbuffer(GL_RENDERBUFFER, rboDepth); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, WIDTH, HEIGHT); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rboDepth); + + unsigned int attachments[2] = { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 }; + glDrawBuffers(2, attachments); + if (glCheckFramebufferStatus(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) + std::cout << "Framebuffer not complete!" << std::endl; + } +} + +void initPingPong() +{ + + glGenFramebuffers(2, pingpongFBO); + glGenTextures(2, pingpongBuffer); + for (unsigned int i = 0; i < 2; i++) + { + glBindFramebuffer(GL_FRAMEBUFFER, pingpongFBO[i]); + glBindTexture(GL_TEXTURE_2D, pingpongBuffer[i]); + glTexImage2D( + GL_TEXTURE_2D, 0, GL_RGBA16F, WIDTH, HEIGHT, 0, GL_RGBA, GL_FLOAT, NULL + ); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + glFramebufferTexture2D( + GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pingpongBuffer[i], 0 + ); + glBindTexture(GL_TEXTURE_2D, 0); + } +} + +void pingPongBluring() +{ + + bool horizontal = true, first_iteration = true; + int amount = 50; + glUseProgram(programBlur); + + for (unsigned int i = 0; i < amount; i++) + { + glBindFramebuffer(GL_FRAMEBUFFER, pingpongFBO[horizontal]); + glUniform1i(glGetUniformLocation(programBlur, "horizontal"), horizontal); + glBindTexture( + GL_TEXTURE_2D, first_iteration ? colorBuffers[1] : pingpongBuffer[!horizontal] + ); + Core::SetActiveTexture(first_iteration ? colorBuffers[1] : pingpongBuffer[!horizontal], "image",programBlur, 0); + Core::DrawContext(models::testContext); + horizontal = !horizontal; + if (first_iteration) + first_iteration = false; + } + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + +} + 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(0.4f, 0.4f, 0.8f, 1.0f); + glClearColor(1.f, 1, 1, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); float time = glfwGetTime(); updateDeltaTime(time); - - 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)); - glm::mat4 specshipCameraRotrationMatrix = glm::mat4({ - spaceshipSide.x,spaceshipSide.y,spaceshipSide.z,0, - spaceshipUp.x,spaceshipUp.y,spaceshipUp.z ,0, - -spaceshipDir.x,-spaceshipDir.y,-spaceshipDir.z,0, - 0.,0.,0.,1., - }); - - spotlightPos = spaceshipPos + 0.4 * spaceshipDir; - spotlightConeDir = spaceshipDir; + renderShadowapSun(depthMapFBO, lightVP); renderShadowapSun(depthMapShipFBO, lightShipVP); + glBindFramebuffer(GL_FRAMEBUFFER, bloomTextureFBO); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glViewport(0,0,WIDTH, HEIGHT); drawSkyBox(cubeContext, glm::translate(cameraPos)); + + if (lightOn) { glUseProgram(programSun); glm::mat4 viewProjectionMatrix = createPerspectiveMatrix() * createCameraMatrix(); @@ -398,21 +508,20 @@ void renderScene(GLFWwindow* window) Core::DrawContext(sphereContext); } + //pingPongBluring(time); glUseProgram(program); - 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)), glm::vec3(0.2, 0.7, 0.3), 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)), - glm::vec3(0.5, 0.5, 0.5), 0.7, 0.0); 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::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); @@ -425,19 +534,43 @@ void renderScene(GLFWwindow* window) 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::flowerContext, glm::mat4(), glm::vec3(1.0f, 1.0f, 1.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::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); + + 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)); + glm::mat4 specshipCameraRotrationMatrix = glm::mat4({ + spaceshipSide.x,spaceshipSide.y,spaceshipSide.z,0, + spaceshipUp.x,spaceshipUp.y,spaceshipUp.z ,0, + -spaceshipDir.x,-spaceshipDir.y,-spaceshipDir.z,0, + 0.,0.,0.,1., + }); + + + + //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 ); + + pingPongBluring(); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + //test depth buffer + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + glUseProgram(programTest); + Core::SetActiveTexture(colorBuffers[0], "color", programTest, 0); + Core::SetActiveTexture(pingpongBuffer[1], "highlight", programTest, 1); + //Core::SetActiveTexture(colorBuffers[0],prog) + Core::DrawContext(models::testContext); + glUseProgram(0); glfwSwapBuffers(window); } @@ -447,6 +580,9 @@ void framebuffer_size_callback(GLFWwindow* window, int width, int height) glViewport(0, 0, width, height); WIDTH = width; HEIGHT = height; + initBloom(); + initPingPong(); + } void loadModelToContext(std::string path, Core::RenderContext& context) @@ -475,6 +611,7 @@ void init(GLFWwindow* window) programDepth = shaderLoader.CreateProgram("shaders/shader_shadowmapsun.vert", "shaders/shader_shadowmapsun.frag"); programSkybox = shaderLoader.CreateProgram("shaders/shader_skybox.vert", "shaders/shader_skybox.frag"); + programBlur = shaderLoader.CreateProgram("shaders/shader_blur.vert", "shaders/shader_blur.frag"); loadCubemap(faces); initDepthMap(); @@ -489,6 +626,7 @@ 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); @@ -508,11 +646,14 @@ void init(GLFWwindow* window) loadModelToContext("./models/light_switch/light_switch.obj", models::lightSwitchContext); loadModelToContext("./models/easel/easel3.obj", models::easelContext); loadModelToContext("./models/car/car.obj", models::carContext); - loadModelToContext("./models/flower/flower.obj", models::flowerContext); + loadModelToContext("./models/ceramic_vase_02_4k.obj", models::vaseContext); initDepthMap(); initDepthMapShip(); + initBloom(); + initPingPong(); + } void shutdown(GLFWwindow* window) @@ -563,10 +704,10 @@ void processInput(GLFWwindow* window) printf("spaceshipPos = glm::vec3(%ff, %ff, %ff);\n", spaceshipPos.x, spaceshipPos.y, spaceshipPos.z); printf("spaceshipDir = glm::vec3(%ff, %ff, %ff);\n", spaceshipDir.x, spaceshipDir.y, spaceshipDir.z); } - if (glfwGetKey(window, GLFW_KEY_L) == GLFW_PRESS) lightOn = !lightOn; + // if (glfwGetKey(window, GLFW_KEY_LEFT) == GLFW_PRESS) if (glfwGetKey(window, GLFW_KEY_UP) == GLFW_PRESS) carPosTranform += carUp * moveSpeed; if (glfwGetKey(window, GLFW_KEY_DOWN) == GLFW_PRESS) @@ -575,14 +716,18 @@ void processInput(GLFWwindow* window) carPosTranform -= carSide * moveSpeed; if (glfwGetKey(window, GLFW_KEY_RIGHT) == GLFW_PRESS) carPosTranform += carSide * moveSpeed; + //cameraDir = glm::normalize(-cameraPos); + } + +// funkcja jest glowna petla void renderLoop(GLFWwindow* window) { while (!glfwWindowShouldClose(window)) - { + { processInput(window); - renderScene(window); + //glfwSwapBuffers(window); glfwPollEvents(); } } \ No newline at end of file