diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json index 84bba22..2fc551a 100644 --- a/.vs/VSWorkspaceState.json +++ b/.vs/VSWorkspaceState.json @@ -5,6 +5,6 @@ "\\cw 9\\shaders", "\\cw 9\\src" ], - "SelectedNode": "\\cw 9\\src\\main.cpp", + "SelectedNode": "\\cw 9\\src", "PreviewInSolutionExplorer": false } \ No newline at end of file diff --git a/.vs/grk-project/v16/.suo b/.vs/grk-project/v16/.suo index bf92943..51449f1 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 70aa18c..8cd8e4c 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 3147629..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 9dde2c3..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 ef7a578..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..06ad7e8 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..ab6502b 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 da996d8..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 dbf0e51..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 fadbc53..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 a4b3f54..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 688be5f..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 770fa35..6f998a9 100644 Binary files a/cw 9/Debug/Texture.obj and b/cw 9/Debug/Texture.obj differ diff --git a/cw 9/Debug/image_DXT.obj b/cw 9/Debug/image_DXT.obj index 05dcc75..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 84604f2..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 5527c3f..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 292352f..19f1cab 100644 --- a/cw 9/Debug/room.exe.recipe +++ b/cw 9/Debug/room.exe.recipe @@ -2,7 +2,7 @@ - C:\Users\s464961\Source\Repos\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 961f027..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 b7c5d5d..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 66178a0..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 1ca51d0..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 e646aa4..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 59e192b..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 b518fca..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|C:\Users\s464961\Source\Repos\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 f88e1f7..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 b0e6ae0..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 f73c387..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..07c3397 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..1e70af3 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..631c002 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..5259303 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..3736096 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..0ebe80e 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..a9de21b 100644 --- a/cw 9/Release/grk-cw9.log +++ b/cw 9/Release/grk-cw9.log @@ -1,46 +1,41 @@  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\Genos\Source\Repos\GRK_Room22\dependencies\glfw-3.3.8.bin.WIN32\include\GLFW\glfw3.h(123): message : zobacz poprzednią definicję „APIENTRY” +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(107,30): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(122,38): warning C4305: "=": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(145,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(166,16): warning C4305: "inicjowanie": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(185,15): warning C4101: "textureID": lokalna zmienna, do której nie istnieje odwołanie +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(268,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(279,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\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(283,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\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(441,29): warning C4018: "<": niezgodność typu ze znakiem/bez znaku +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(482,13): warning C4244: "inicjowanie": konwersja z "double" do "float", możliwa utrata danych +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(495,108): 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" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(506,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(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\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(507,37): warning C4305: "argument": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(540,2): warning C4305: "argument": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(664,21): warning C4305: "-=": obcięcie z "double" do "float" +C:\Users\Genos\source\repos\GRK_Room22\cw 9\src\room.hpp(666,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. + 1 of 595 functions ( 0.2%) 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 + 10 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\Genos\Source\Repos\GRK_Room22\Release\room.exe diff --git a/cw 9/Release/image_DXT.obj b/cw 9/Release/image_DXT.obj index f494786..b782bfe 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..0832bd1 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..69693b2 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..b3d470d 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\Genos\Source\Repos\GRK_Room22\Release\room.exe diff --git a/cw 9/Release/room.iobj b/cw 9/Release/room.iobj index e127328..b797a99 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..e5906b3 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..17e1310 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..34bf6c4 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..4b46bac 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..ed41cbd 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..906fa6f 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..0ccb955 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..18dff22 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\Genos\Source\Repos\GRK_Room22\| diff --git a/cw 9/Release/stb_image_aug.obj b/cw 9/Release/stb_image_aug.obj index fc65a5e..b0d1ab2 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..33c8be1 100644 Binary files a/cw 9/Release/vc142.pdb and b/cw 9/Release/vc142.pdb differ diff --git a/cw 9/shaders/shader_8_sun.frag b/cw 9/shaders/shader_8_sun.frag index 27008ba..ec5cca1 100644 --- a/cw 9/shaders/shader_8_sun.frag +++ b/cw 9/shaders/shader_8_sun.frag @@ -5,10 +5,16 @@ 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); + 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_blur.vert b/cw 9/shaders/shader_blur.vert index ca3c4af..93b0300 100644 --- a/cw 9/shaders/shader_blur.vert +++ b/cw 9/shaders/shader_blur.vert @@ -9,6 +9,6 @@ out vec2 TexCoords; void main() { - //gl_Position = vec4(vertexPosition*0.5, 1.0); + gl_Position = vec4(vertexPosition, 1.0); TexCoords = vertexTexCoord; } diff --git a/cw 9/shaders/shader_skybox.frag b/cw 9/shaders/shader_skybox.frag index 7052ca9..575b0fa 100644 --- a/cw 9/shaders/shader_skybox.frag +++ b/cw 9/shaders/shader_skybox.frag @@ -4,9 +4,16 @@ uniform samplerCube skybox; in vec3 texCoord; -out vec4 out_color; +layout (location = 0) out vec4 FragColor; +layout (location = 1) out vec4 BloomColor; + void main() { - out_color = texture(skybox,texCoord); + FragColor = texture(skybox,texCoord); + 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 12c2fd6..bcc1899 100644 --- a/cw 9/shaders/test.frag +++ b/cw 9/shaders/test.frag @@ -16,22 +16,22 @@ 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(color, tc).rgb * weight[0]; // current fragment's contribution + 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(color, tc + vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; - result += texture(color, 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]; + result += texture(highlight, tc - vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; } } else { for(int i = 1; i < 5; ++i) { - result += texture(color, tc + vec2(0.0, tex_offset.y * i)).rgb * weight[i]; - result += texture(color, 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]; + result += texture(highlight, tc - vec2(0.0, tex_offset.y * i)).rgb * weight[i]; } } return vec4(result, 1.0); @@ -43,6 +43,6 @@ void main() //FragColor = vec4(vec3(rescale_z(depthValue)+0.5), 1.0); //FragColor = vec4(vec3((depthValue)+0.5), 1.0); - FragColor = vec4( blur()); + 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/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 9ef50c9..2d7d74a 100644 --- a/cw 9/src/room.hpp +++ b/cw 9/src/room.hpp @@ -20,7 +20,7 @@ const unsigned int SHADOW_WIDTH = 1024, SHADOW_HEIGHT = 1024; -int WIDTH = 500, HEIGHT = 500; +int WIDTH = 800, HEIGHT = 800; namespace models { Core::RenderContext couchContext; @@ -427,14 +427,15 @@ void initPingPong() glFramebufferTexture2D( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, pingpongBuffer[i], 0 ); + glBindTexture(GL_TEXTURE_2D, 0); } } -void pingPongBluring(float time) +void pingPongBluring() { bool horizontal = true, first_iteration = true; - int amount = 10; + int amount = 50; glUseProgram(programBlur); for (unsigned int i = 0; i < amount; i++) @@ -444,7 +445,8 @@ void pingPongBluring(float time) glBindTexture( GL_TEXTURE_2D, first_iteration ? colorBuffers[1] : pingpongBuffer[!horizontal] ); - Core::DrawContext(models::couchContext); + Core::SetActiveTexture(first_iteration ? colorBuffers[1] : pingpongBuffer[!horizontal], "image",programBlur, 0); + Core::DrawContext(models::testContext); horizontal = !horizontal; if (first_iteration) first_iteration = false; @@ -544,16 +546,16 @@ void renderScene(GLFWwindow* window) spotlightPos = spaceshipPos + 0.2 * spaceshipDir; spotlightConeDir = spaceshipDir; - + 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(colorBuffers[1], "highlight", programTest, 1); + Core::SetActiveTexture(pingpongBuffer[1], "highlight", programTest, 1); //Core::SetActiveTexture(colorBuffers[0],prog) - Core::DrawContext(models::testContext); + //Core::DrawContext(models::testContext); glUseProgram(0); glfwSwapBuffers(window);