From 01f29b6d4e34749a36574812ba2daced73e0de2c Mon Sep 17 00:00:00 2001 From: Tleety Date: Tue, 8 Mar 2016 11:14:09 +0100 Subject: [PATCH] Blur behind buttons/sprites should now be working as intended. --- include/Engine/Rendering/BlurHUD.h | 1 + include/Engine/Rendering/RenderQueue.h | 1 + include/Engine/Rendering/Renderer.h | 2 - .../Schema/Entities/QualityAssurance.xml | 394 +- .../Schema/Entities/aaaatestremoveme.xml | 5787 ++++++++++++++++- resources/Shaders/CombineTexture.frag.glsl | 16 +- resources/Shaders/Gaussian_horiz.frag.glsl | 12 +- resources/Shaders/Gaussian_vert.frag.glsl | 12 +- resources/Shaders/Sprite.frag.glsl | 3 +- src/Engine/Rendering/BlurHUD.cpp | 54 +- src/Engine/Rendering/DrawFinalPass.cpp | 19 +- src/Engine/Rendering/RenderSystem.cpp | 1 + src/Engine/Rendering/Renderer.cpp | 1 - 13 files changed, 6053 insertions(+), 250 deletions(-) diff --git a/include/Engine/Rendering/BlurHUD.h b/include/Engine/Rendering/BlurHUD.h index 2d01673e..ca3b7270 100644 --- a/include/Engine/Rendering/BlurHUD.h +++ b/include/Engine/Rendering/BlurHUD.h @@ -48,6 +48,7 @@ private: //const LightCullingPass* m_LightCullingPass int m_Iterations = 3; int m_Quality = 0; + float m_BlurQuality = 2.f; GLuint m_GaussianTexture_horiz = 0; GLuint m_GaussianTexture_vert = 0; diff --git a/include/Engine/Rendering/RenderQueue.h b/include/Engine/Rendering/RenderQueue.h index e3c46e85..f183b021 100644 --- a/include/Engine/Rendering/RenderQueue.h +++ b/include/Engine/Rendering/RenderQueue.h @@ -33,6 +33,7 @@ struct RenderScene Rectangle Viewport; bool ClearDepth = false; + bool ShouldBlur = false; glm::vec4 AmbientColor; void Clear() diff --git a/include/Engine/Rendering/Renderer.h b/include/Engine/Rendering/Renderer.h index 37385875..9983bae9 100644 --- a/include/Engine/Rendering/Renderer.h +++ b/include/Engine/Rendering/Renderer.h @@ -57,8 +57,6 @@ private: Texture* m_ErrorTexture; Texture* m_WhiteTexture; - GLuint m_CombinedTexture; - Model* m_ScreenQuad; Model* m_UnitQuad; Model* m_UnitSphere; diff --git a/resources/Schema/Entities/QualityAssurance.xml b/resources/Schema/Entities/QualityAssurance.xml index 04cc288a..7a8f657f 100644 --- a/resources/Schema/Entities/QualityAssurance.xml +++ b/resources/Schema/Entities/QualityAssurance.xml @@ -3,7 +3,7 @@ - 4.7473226580121377 + 0.8333591884066891 @@ -11,6 +11,104 @@ + + + + + + + + + + + + + + + Models/Characters/Assault/AssaultAnimated.mesh + + + + + + + + + + + + + + Models/Characters/Assault/AssaultAnimated.mesh + + + + + + + + + Animation test + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + + + + + + + + + + + + + + + + + + + 0.5 + + + + + + + + + + + + + + Models/Characters/Assault/AssaultAnimated.mesh + + + + + + + + + + + + + @@ -43,7 +141,7 @@ - + @@ -96,115 +194,11 @@ - + - - - - - - - - - - - - - - - - - Models/Characters/Assault/AssaultAnimated.mesh - - - - - - - - - - - - - - - - Models/Characters/Assault/AssaultAnimated.mesh - - - - - - - - - Animation test - Fonts/DroidSans.ttf,64 - - - - - - - - - - - - Models/Core/UnitCylinder.mesh - - - - - - - - - - - - - - - - - - - - 0.5 - - - - - - - - - - - - - - - - Models/Characters/Assault/AssaultAnimated.mesh - - - - - - - - - - - - - @@ -228,7 +222,7 @@ - + @@ -292,7 +286,7 @@ - + @@ -324,7 +318,7 @@ - + @@ -395,15 +389,15 @@ - - - Schema/Entities/Player.xml - + + + Schema/Entities/Player.xml + @@ -465,15 +459,15 @@ - - - Schema/Entities/Player.xml - + + + Schema/Entities/Player.xml + @@ -619,8 +613,8 @@ - + @@ -674,7 +668,7 @@ - + @@ -721,7 +715,7 @@ - + @@ -781,7 +775,7 @@ - + @@ -828,7 +822,7 @@ - + @@ -874,7 +868,7 @@ - + @@ -921,7 +915,7 @@ - + @@ -968,7 +962,7 @@ - + @@ -1023,22 +1017,22 @@ + 15 - 15 + + + + + Models/Core/UnitCube.mesh true - - - - - @@ -1054,8 +1048,8 @@ - + @@ -1078,13 +1072,13 @@ 1 + Models/Core/UnitCube.mesh true - @@ -1100,8 +1094,8 @@ - + @@ -1122,13 +1116,13 @@ 2 + Models/Core/UnitCube.mesh true - @@ -1144,8 +1138,8 @@ - + @@ -1168,13 +1162,13 @@ 3 + Models/Core/UnitCube.mesh true - @@ -1190,8 +1184,8 @@ - + @@ -1212,23 +1206,23 @@ + -15 - -15 4 + + + + + Models/Core/UnitCube.mesh true - - - - - @@ -1244,8 +1238,8 @@ - + @@ -1285,8 +1279,8 @@ - + @@ -1382,7 +1376,7 @@ - + @@ -1391,7 +1385,7 @@ true - 2.5396116058983438 + 0.66694876855613217 3.7999999523162842 true @@ -1438,7 +1432,7 @@ - + @@ -1447,7 +1441,7 @@ - 1.5396208215609732 + 2.0168132214141465 Models/Characters/Assault/AssaultTPose.mesh @@ -1490,22 +1484,20 @@ - + - - - + true - 1.5396208215609732 + 2.0168132214141465 true @@ -1550,7 +1542,7 @@ - + @@ -1560,7 +1552,7 @@ true - 4.4522528839264339 + 6.6002622626005092 10 3 @@ -1608,7 +1600,7 @@ - + @@ -1618,7 +1610,7 @@ true - 3.2362842141074992 + 0.1169253453956216 true 5 true @@ -1655,8 +1647,8 @@ - + @@ -1701,6 +1693,11 @@ + + + + + @@ -1711,11 +1708,6 @@ 5 - - - - - @@ -1738,8 +1730,8 @@ - + @@ -1777,8 +1769,8 @@ - + @@ -1790,8 +1782,8 @@ - + @@ -1801,7 +1793,7 @@ true - 2.5396116058983438 + 0.66694876855613217 3.7999999523162842 true @@ -1845,9 +1837,7 @@ - - - + @@ -1915,8 +1905,8 @@ - + @@ -1991,20 +1981,20 @@ - - 2 - + + 2 + Textures/Core/UnitHexagon_Rotated.png - + @@ -2025,20 +2015,20 @@ - - 3 - + + 3 + Textures/Core/UnitHexagon_Rotated.png - + @@ -2059,21 +2049,21 @@ - - 4 - 1 + + 4 + Textures/Core/UnitHexagon_Rotated.png - + @@ -2094,20 +2084,20 @@ - - 1 - + + 1 + Textures/Core/UnitHexagon_Rotated.png - + @@ -2128,19 +2118,19 @@ - 1 + Textures/Core/UnitHexagon_Rotated.png - + @@ -2173,7 +2163,7 @@ - + @@ -2374,7 +2364,9 @@ Textures/Core/ErrorTexture.png + true + @@ -2387,6 +2379,7 @@ Textures/Core/White.png + false @@ -2400,6 +2393,7 @@ 1920x1080 Fonts/DroidSans.ttf,64 + false @@ -2416,6 +2410,7 @@ Textures/Core/White.png + false @@ -2429,6 +2424,7 @@ 1280x720 Fonts/DroidSans.ttf,64 + false @@ -2540,20 +2536,20 @@ + + + + + 2 Models/Weapons/Blue/AssaultWeaponBlue.mesh - - - - - + - diff --git a/resources/Schema/Entities/aaaatestremoveme.xml b/resources/Schema/Entities/aaaatestremoveme.xml index 8da40b58..d44e4883 100644 --- a/resources/Schema/Entities/aaaatestremoveme.xml +++ b/resources/Schema/Entities/aaaatestremoveme.xml @@ -2,37 +2,5794 @@ + + 8.2999489298303502 + 15 + - + - - Models/Core/Unithexagon.mesh - - - + + + + + + Models/Props/Ground.mesh + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + + + Models/Props/Highground3.mesh + + + + + + + + + + Models/Props/Highground4.mesh + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + Models/Props/Highground2.mesh + + + + + + + + + + Models/Props/Highground1.mesh + + + + + + + + + + + + Models/Props/Highground5.mesh + + + + + + + + + + + Models/Props/Highground6.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallTop.mesh + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall1.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall2.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallBig.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallMedium.mesh + + + + + + + + + + + + Models/Props/Walls/SciFiWallSmall3.mesh + + + + + + + + + + Models/Props/Walls/SciFiWallSmall4.mesh + + + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar1Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar3Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + Models/Props/Pillars/StonePillar.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiPillar2Red.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallBlue.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/BigWallRed.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall2.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SmallWall3.mesh + + + + + + + + + + + + Models/Props/Walls/SmallWall4.mesh + + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/SpecialWall1.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + + + Models/Props/Stones/BigStone.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + Models/Props/Stones/SmallStone2.mesh + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + Models/Props/Stones/SmallStone1.mesh + + + + + + + + + + + + + + + + Models/Props/Stones/MediumStone2.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + Models/Props/Bridges/SciFiBridgeDefense.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Blue.mesh + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/SciFiBridge1Red.mesh + + + + + + + + + + + + + Models/Props/Bridges/WoodenBridge.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall2.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall3.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + Models/Props/Walls/MediumWall1.mesh + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + Models/Core/UnitPlane.mesh + + true + + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + Models/Core/UnitCube.mesh + + + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + Models/Props/Pillars/SciFiBridgePillar1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/TreeLog.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/AliveBush.mesh + true + + + + + + + + + + + + + + Models/Props/Flora/SpecialRoot.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + Models/Props/PickUps/PickUpHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + Models/Props/Stones/AssaultHolder.mesh + + + + + + + + + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + Models/Props/SciFiHolder1.mesh + + + + + + + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalBlue.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + + + Models/Props/Stones/ShinyStoneCrystalRed.mesh + + + + + + + + + + + + - + - + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/AmmoPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + 0.10000000149011612 + + + + Models/Props/PickUps/HealthPickUp.mesh + + + + + + + + + + + + + + + + + + + + + Schema/Entities/Player.xml + - + - + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + - + - - 2.2000000476837158 - - + + + + + 10 + + + + + + + + + + 10 + + + + + + + + + + + + + 1 + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 10 + + + + + + + + + + + 1 + + + + + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 2 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointRed.mesh + + + + + + + + + + + + + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 3 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointNeutral.mesh + + + + + + + + + + 1.5498908015879351 + 1 + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + Models/Props/CapturePoint/CapturePointBlue.mesh + + + + + + + + + + + + + 4 + + + + + + + + + Models/Core/UnitCylinder.mesh + + true + + + + + + + + + + + + + + + + + + + + + + Schema/Entities/PlayerRed.xml + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + Models/Characters/Assault/AssaultTPose.mesh + false + + + + + + + + + + + + + 0.049999997019767761 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 4 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 3 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + 2 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + + + + + + + + + 0.10332605343919568 + + + + 1 + + + Textures/Core/UnitHexagon_Rotated.png + + + + + + + + + + + + + + + + + + 7 + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Play + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Option + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Credits + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/White.png + true + + + + + + + + + + + + + Quit + Fonts/DroidSans.ttf,64 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Textures/Core/UnitRaptor.png + + + + PickClass + 1 + + + + + + + + + + + + + Textures/Core/UnitHexagon.png + + + + PickClass + 2 + + + + + + + + + + + + + Textures/Test/aM4ME4GR.png + + + + PickClass + 3 + + + + + + + + + + + + + + + diff --git a/resources/Shaders/CombineTexture.frag.glsl b/resources/Shaders/CombineTexture.frag.glsl index 9d6a71c2..fd4acaac 100644 --- a/resources/Shaders/CombineTexture.frag.glsl +++ b/resources/Shaders/CombineTexture.frag.glsl @@ -1,14 +1,15 @@ #version 430 -uniform sampler2D Texture0; -uniform sampler2D Texture1; +layout (binding = 0) uniform sampler2D Texture0; +layout (binding = 1)uniform sampler2D Texture1; in VertexData{ vec2 TextureCoordinate; }Input; -out vec4 fragmentColor; +out vec4 sceneColor; +out vec4 bloomColor; void main() { @@ -17,9 +18,14 @@ void main() float texel1_total = (texel1.r + texel1.g + texel1.b) * texel1.a; texel1_total = ceil(clamp(texel1_total, 0, 1)); - vec4 final = texel0 * texel1_total + texel1 * (1 - texel1_total); + vec4 result0 = texel0 * (1.0 - texel1_total); + vec4 result1 = texel1 * texel1_total; + + //vec4 final = texel1 * texel1_total + texel0 * (1.0 - texel1_total); + //float res = 1.0 - texel1_total; //vec4 final = vec4(texel1_total, texel1_total, texel1_total, 1.0); - fragmentColor = final; + sceneColor = result1; + bloomColor = vec4(0.0, 0.0, 0.0, 0.0); } diff --git a/resources/Shaders/Gaussian_horiz.frag.glsl b/resources/Shaders/Gaussian_horiz.frag.glsl index 6a9572c2..8a306ec2 100644 --- a/resources/Shaders/Gaussian_horiz.frag.glsl +++ b/resources/Shaders/Gaussian_horiz.frag.glsl @@ -14,11 +14,15 @@ uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.01 void main() { vec2 tex_offset = 1.0 / textureSize2D(Texture, 0); - vec3 result = texture(Texture, Input.TextureCoordinate).rgb * weight[0]; - + vec3 center = texture(Texture, Input.TextureCoordinate).rgb; + vec3 result = center * weight[0]; for(int i = 1; i < 5; ++i) { - result += texture(Texture, Input.TextureCoordinate + vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; - result += texture(Texture, Input.TextureCoordinate - vec2(tex_offset.x * i, 0.0)).rgb * weight[i]; + vec4 eastFragments = texture(Texture, Input.TextureCoordinate + vec2(tex_offset.x * i, 0.0)); + vec4 westFragments = texture(Texture, Input.TextureCoordinate - vec2(tex_offset.x * i, 0.0)); + result += eastFragments.rgb * weight[i] * eastFragments.a; + result += westFragments.rgb * weight[i] * westFragments.a; + result += center * weight[i] * (1.0 - westFragments.a); + result += center * weight[i] * (1.0 - eastFragments.a); } fragmentColor = vec4(result, 1.0); } \ No newline at end of file diff --git a/resources/Shaders/Gaussian_vert.frag.glsl b/resources/Shaders/Gaussian_vert.frag.glsl index 8b0e861a..921ba55a 100644 --- a/resources/Shaders/Gaussian_vert.frag.glsl +++ b/resources/Shaders/Gaussian_vert.frag.glsl @@ -14,11 +14,15 @@ uniform float weight[5] = float[](0.227027, 0.1945946, 0.1216216, 0.054054, 0.01 void main() { vec2 tex_offset = 1.0 / textureSize2D(Texture, 0); - vec3 result = texture(Texture, Input.TextureCoordinate).rgb * weight[0]; - + vec3 center = texture(Texture, Input.TextureCoordinate).rgb; + vec3 result = center * weight[0]; for(int i = 1; i < 5; ++i) { - result += texture(Texture, Input.TextureCoordinate + vec2(0.0, tex_offset.y * i)).rgb * weight[i]; - result += texture(Texture, Input.TextureCoordinate - vec2(0.0, tex_offset.y * i)).rgb * weight[i]; + vec4 northFragments = texture(Texture, Input.TextureCoordinate + vec2(0.0, tex_offset.y * i)); + vec4 southFragments = texture(Texture, Input.TextureCoordinate - vec2(0.0, tex_offset.y * i)); + result += northFragments.rgb * weight[i] * northFragments.a; + result += southFragments.rgb * weight[i] * southFragments.a; + result += center * weight[i] * (1.0 - northFragments.a); + result += center * weight[i] * (1.0 - southFragments.a); } fragmentColor = vec4(result, 1.0); } \ No newline at end of file diff --git a/resources/Shaders/Sprite.frag.glsl b/resources/Shaders/Sprite.frag.glsl index 754be6ac..266398da 100644 --- a/resources/Shaders/Sprite.frag.glsl +++ b/resources/Shaders/Sprite.frag.glsl @@ -35,7 +35,8 @@ void main() sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1)); //bloomColor = vec4(clamp((glowTexel.xyz*3) - 1.0, 0, 100), 1.0); - bloomColor = vec4(1.0, 1.0, 1.0, 0.0); + bloomColor = vec4(max(color_result.xyz - 1.0, 0.0), clamp(color_result.a, 0, 1)); + //bloomColor = vec4(1.0, 1.0, 1.0, 0.0); } diff --git a/src/Engine/Rendering/BlurHUD.cpp b/src/Engine/Rendering/BlurHUD.cpp index bd9ef901..4787510b 100644 --- a/src/Engine/Rendering/BlurHUD.cpp +++ b/src/Engine/Rendering/BlurHUD.cpp @@ -44,7 +44,8 @@ void BlurHUD::InitializeShaderPrograms() m_CombineTexturesProgram->AddShader(std::shared_ptr(new VertexShader("Shaders/CombineTexture.vert.glsl"))); m_CombineTexturesProgram->AddShader(std::shared_ptr(new FragmentShader("Shaders/CombineTexture.frag.glsl"))); m_CombineTexturesProgram->Compile(); - m_CombineTexturesProgram->BindFragDataLocation(0, "fragmentColor"); + m_CombineTexturesProgram->BindFragDataLocation(0, "sceneColor"); + m_CombineTexturesProgram->BindFragDataLocation(1, "bloomColor"); m_CombineTexturesProgram->Link(); } GLERROR("Creating DepthFill program"); @@ -53,11 +54,13 @@ void BlurHUD::InitializeShaderPrograms() void BlurHUD::InitializeBuffers() { glm::vec2 res = glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); + glm::vec2 res2 = glm::vec2(m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); + CommonFunctions::GenerateTexture(&m_DepthStencil_horiz, GL_CLAMP_TO_BORDER, GL_NEAREST, - res, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8); - CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, - res, GL_RGB16F, GL_RGB, GL_FLOAT); + res2, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8); + CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_NEAREST, + res2, GL_RGBA16F, GL_RGBA, GL_FLOAT); if (m_GaussianFrameBuffer_horiz.GetHandle() == 0) { m_GaussianFrameBuffer_horiz.AddResource(std::shared_ptr(new Texture2D(&m_DepthStencil_horiz, GL_DEPTH_STENCIL_ATTACHMENT))); @@ -66,9 +69,9 @@ void BlurHUD::InitializeBuffers() m_GaussianFrameBuffer_horiz.Generate(); CommonFunctions::GenerateTexture(&m_DepthStencil_vert, GL_CLAMP_TO_BORDER, GL_NEAREST, - res, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8); - CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, - res, GL_RGB16F, GL_RGB, GL_FLOAT); + res2, GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8); + CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_NEAREST, + res2, GL_RGBA16F, GL_RGBA, GL_FLOAT); if (m_GaussianFrameBuffer_vert.GetHandle() == 0) { m_GaussianFrameBuffer_vert.AddResource(std::shared_ptr(new Texture2D(&m_DepthStencil_vert, GL_DEPTH_STENCIL_ATTACHMENT))); @@ -92,11 +95,15 @@ void BlurHUD::ClearBuffer() m_GaussianFrameBuffer_horiz.Bind(); glClearColor(0.f, 0.f, 0.f, 0.f); glClearStencil(0x00); + glStencilMask(~0); + glDisable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); m_GaussianFrameBuffer_horiz.Unbind(); m_GaussianFrameBuffer_vert.Bind(); glClearColor(0.f, 0.f, 0.f, 0.f); glClearStencil(0x00); + glStencilMask(~0); + glDisable(GL_SCISSOR_TEST); glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); m_GaussianFrameBuffer_vert.Unbind(); @@ -114,7 +121,10 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) FillStencil(scene); - DrawBloomPassState state; + RenderState state; + state.Disable(GL_BLEND); + state.Disable(GL_DEPTH_TEST); + state.Disable(GL_CULL_FACE); GLuint shaderHandle_horiz = m_GaussianProgram_horiz->GetHandle(); GLuint shaderHandle_vert = m_GaussianProgram_vert->GetHandle(); @@ -128,6 +138,10 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) state.StencilFunc(GL_EQUAL, 1, 0xFF); state.StencilMask(0x00); state.DepthMask(GL_FALSE); + state.Enable(GL_SCISSOR_TEST); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); + glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); + m_GaussianProgram_horiz->Bind(); glActiveTexture(GL_TEXTURE0); glBindTexture(GL_TEXTURE_2D, texture); @@ -144,6 +158,8 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) state.StencilFunc(GL_EQUAL, 1, 0xFF); state.StencilMask(0x00); state.DepthMask(GL_FALSE); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); + glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_vert->Bind(); glActiveTexture(GL_TEXTURE0); @@ -162,6 +178,8 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) state.StencilFunc(GL_EQUAL, 1, 0xFF); state.StencilMask(0x00); state.DepthMask(GL_FALSE); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); + glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_horiz->Bind(); glActiveTexture(GL_TEXTURE0); @@ -182,6 +200,8 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) state.StencilFunc(GL_EQUAL, 1, 0xFF); state.StencilMask(0x00); state.DepthMask(GL_FALSE); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); + glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); m_GaussianProgram_vert->Bind(); glActiveTexture(GL_TEXTURE0); @@ -192,6 +212,9 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) , GL_UNSIGNED_INT, 0, m_ScreenQuad->MaterialGroups()[0].material->StartIndex); GLERROR("DrawBloomPass::Draw: END"); + glViewport(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); + glScissor(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); + return m_GaussianTexture_vert; } @@ -199,9 +222,9 @@ GLuint BlurHUD::Draw(GLuint texture, RenderScene& scene) void BlurHUD::OnWindowResize() { - CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT); + CommonFunctions::GenerateTexture(&m_GaussianTexture_vert, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality), GL_RGB16F, GL_RGB, GL_FLOAT); m_GaussianFrameBuffer_vert.Generate(); - CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height), GL_RGB16F, GL_RGB, GL_FLOAT); + CommonFunctions::GenerateTexture(&m_GaussianTexture_horiz, GL_CLAMP_TO_EDGE, GL_LINEAR, glm::vec2(m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality), GL_RGB16F, GL_RGB, GL_FLOAT); m_GaussianFrameBuffer_horiz.Generate(); } @@ -216,6 +239,7 @@ void BlurHUD::FillStencil(RenderScene& scene) state.StencilFunc(GL_ALWAYS, 1, 0xFF); state.StencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); state.StencilMask(0xFF); + glViewport(0, 0, m_Renderer->GetViewportSize().Width/m_BlurQuality, m_Renderer->GetViewportSize().Height/m_BlurQuality); m_FillDepthStencilProgram->Bind(); @@ -254,16 +278,16 @@ void BlurHUD::FillStencil(RenderScene& scene) glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, spriteJob->Model->ElementBuffer); glDrawElements(GL_TRIANGLES, spriteJob->EndIndex - spriteJob->StartIndex + 1, GL_UNSIGNED_INT, (void*)(spriteJob->StartIndex*sizeof(unsigned int))); } - + glViewport(0, 0, m_Renderer->GetViewportSize().Width, m_Renderer->GetViewportSize().Height); } //Texture 1 will be used if texture 2 is black at that texel, else texture 2 is used. GLuint BlurHUD::CombineTextures(GLuint texture1, GLuint texture2) { - RenderState state; - state.BindFramebuffer(m_CombinedTextureBuffer.GetHandle()); - state.Disable(GL_DEPTH_TEST); - state.Disable(GL_STENCIL_TEST); + //RenderState state; + //state.BindFramebuffer(m_CombinedTextureBuffer.GetHandle()); + //state.Disable(GL_DEPTH_TEST); + //state.Disable(GL_STENCIL_TEST); m_CombineTexturesProgram->Bind(); diff --git a/src/Engine/Rendering/DrawFinalPass.cpp b/src/Engine/Rendering/DrawFinalPass.cpp index ea6bce1d..edde3ef5 100644 --- a/src/Engine/Rendering/DrawFinalPass.cpp +++ b/src/Engine/Rendering/DrawFinalPass.cpp @@ -281,20 +281,31 @@ void DrawFinalPass::Draw(RenderScene& scene, BlurHUD* blurHUDPass) GLERROR("Shielded Transparent objects"); //Generate blur texture. - m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene); - //Combine nonblur and blur texture + delete state; + if (scene.ShouldBlur) { + //This needs to be drawn only when the full scene is being renderd, and then let be, otherwise sprite and other shit will show on it. + m_FullBlurredTexture = blurHUDPass->Draw(m_SceneTexture, scene); + } + DrawFinalPassState* stateSprite = new DrawFinalPassState(m_FinalPassFrameBuffer.GetHandle()); + if(scene.ShouldBlur) { + //Combine nonblur and blur texture + stateSprite->Disable(GL_DEPTH_TEST); + stateSprite->Disable(GL_STENCIL_TEST); + m_CombinedTexture = blurHUDPass->CombineTextures(m_SceneTexture, m_FullBlurredTexture); + + } //Draw Transparen objects //state->BlendFunc(GL_ONE, GL_ONE); //state->StencilFunc(GL_EQUAL, 1, 0xFF); //DrawModelRenderQueues(scene.Jobs.TransparentObjects, scene); GLERROR("TransparentObjects"); //state->BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + stateSprite->Enable(GL_DEPTH_TEST); DrawSprites(scene.Jobs.SpriteJob, scene); - GLERROR("SpriteJobs"); - delete state; + delete stateSprite; GLERROR("END"); } diff --git a/src/Engine/Rendering/RenderSystem.cpp b/src/Engine/Rendering/RenderSystem.cpp index a1f00c88..114f432b 100644 --- a/src/Engine/Rendering/RenderSystem.cpp +++ b/src/Engine/Rendering/RenderSystem.cpp @@ -435,6 +435,7 @@ void RenderSystem::Update(double dt) } RenderScene scene; + scene.ShouldBlur = true; scene.Camera = m_Camera; scene.Viewport = Rectangle(1280, 720); diff --git a/src/Engine/Rendering/Renderer.cpp b/src/Engine/Rendering/Renderer.cpp index 63a89e9e..f58e6208 100644 --- a/src/Engine/Rendering/Renderer.cpp +++ b/src/Engine/Rendering/Renderer.cpp @@ -162,7 +162,6 @@ void Renderer::Draw(RenderFrame& frame) m_DrawFinalPass->Draw(*scene, m_BlurHUDPass); GLERROR("Draw Geometry+Light"); //m_DrawScenePass->Draw(*scene); - m_CombinedTexture = m_BlurHUDPass->CombineTextures(m_DrawFinalPass->SceneTexture(), m_DrawFinalPass->FullBlurredTexture()); PerformanceTimer::StartTimerAndStopPrevious("Renderer-Draw Text"); m_TextPass->Draw(*scene, *m_DrawFinalPass->FinalPassFrameBuffer());