diff --git a/include/Engine/Rendering/DrawColorCorrectionPass.h b/include/Engine/Rendering/DrawColorCorrectionPass.h
index e9a7e281..f507b53c 100644
--- a/include/Engine/Rendering/DrawColorCorrectionPass.h
+++ b/include/Engine/Rendering/DrawColorCorrectionPass.h
@@ -7,6 +7,7 @@
#include "ShaderProgram.h"
//#include "Util/UnorderedMapVec2.h"
#include "Texture.h"
+#include "imgui/imgui.h"
class DrawColorCorrectionPass
{
@@ -23,7 +24,8 @@ private:
ShaderProgram* m_ColorCorrectionProgram;
Model* m_ScreenQuad;
- GLfloat m_Exposure;
+ GLfloat m_Exposure = 1;
+ GLfloat m_Gamma = 2.2;
};
#endif
\ No newline at end of file
diff --git a/resources/Schema/Entities/EditorTestWorld.xml b/resources/Schema/Entities/EditorTestWorld.xml
index 9565e2d4..b7baea28 100755
--- a/resources/Schema/Entities/EditorTestWorld.xml
+++ b/resources/Schema/Entities/EditorTestWorld.xml
@@ -43,7 +43,7 @@
-
+
@@ -85,7 +85,7 @@
Run
-
+
1
@@ -101,7 +101,7 @@
Walk
-
+
1
@@ -147,70 +147,6 @@
-
-
-
- Models/NormalMapSphere.mesh
-
-
-
-
-
-
-
-
-
-
- Models/SpecularMapSphere.mesh
-
-
-
-
-
-
-
-
-
- 1
-
-
-
-
-
-
-
-
-
-
- Models/Core/UnitSphere.mesh
-
-
-
- 3
- 1.1399998664855957
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Models/IncandescenceMapSphere.mesh
-
-
-
-
-
-
-
@@ -227,7 +163,7 @@
-
+
@@ -284,6 +220,83 @@
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ Models/NormalMapSphere.mesh
+
+
+
+
+
+
+
+
+
+
+ Models/SpecularMapSphere.mesh
+
+
+
+
+
+
+
+
+
+ 1
+
+
+
+
+
+
+
+
+
+
+ Models/Core/UnitSphere.mesh
+
+
+
+ 3
+ 1.1399998664855957
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Models/IncandescenceMapSphere.mesh
+
+
+
+
+
+
+
+
+
diff --git a/resources/Shaders/DrawColorCorrection.frag.glsl b/resources/Shaders/DrawColorCorrection.frag.glsl
index 8d13992a..91ace0c7 100644
--- a/resources/Shaders/DrawColorCorrection.frag.glsl
+++ b/resources/Shaders/DrawColorCorrection.frag.glsl
@@ -3,6 +3,7 @@
layout (binding = 0) uniform sampler2D SceneTexture;
layout (binding = 1) uniform sampler2D BloomTexture;
uniform float Exposure;
+uniform float Gamma;
in VertexData{
vec2 TextureCoordinate;
@@ -12,7 +13,6 @@ out vec4 fragmentColor;
void main()
{
- const float gamma = 2.2;
vec4 hdrColor = texture(SceneTexture, Input.TextureCoordinate);
vec4 bloomColor = texture(BloomTexture, Input.TextureCoordinate);
hdrColor += bloomColor;
@@ -21,7 +21,7 @@ void main()
vec3 result = vec3(1.0) - exp(-hdrColor.rgb * Exposure);
//gamme correction
- result = pow(result, vec3(1.0 / gamma));
+ result = pow(result, vec3(1.0 / Gamma));
fragmentColor = vec4(result, 1.0);
//fragmentColor = hdrColor;
diff --git a/resources/Shaders/ForwardPlus.frag.glsl b/resources/Shaders/ForwardPlus.frag.glsl
index de672dd1..16dca034 100644
--- a/resources/Shaders/ForwardPlus.frag.glsl
+++ b/resources/Shaders/ForwardPlus.frag.glsl
@@ -160,7 +160,7 @@ void main()
color_result += FillColor;
}
sceneColor = vec4(color_result.xyz, clamp(color_result.a, 0, 1));
- color_result += glowTexel;
+ color_result += glowTexel*3;
bloomColor = vec4(clamp(color_result.xyz - 1.0, 0, 100), 1.0);
diff --git a/src/Engine/Rendering/DrawColorCorrectionPass.cpp b/src/Engine/Rendering/DrawColorCorrectionPass.cpp
index ba9efe3e..0e3d3db5 100644
--- a/src/Engine/Rendering/DrawColorCorrectionPass.cpp
+++ b/src/Engine/Rendering/DrawColorCorrectionPass.cpp
@@ -5,7 +5,8 @@ DrawColorCorrectionPass::DrawColorCorrectionPass(IRenderer* renderer)
m_Renderer = renderer;
m_ScreenQuad = ResourceManager::Load("Models/Core/ScreenQuad.mesh");
- m_Exposure = 0.4; //TODO: Renderer: Fixa så att denna går att ändra på genom komponent eller setting.
+
+ //m_Exposure = 0.4; //TODO: Renderer: Fixa så att denna går att ändra på genom komponent eller setting.
InitializeShaderPrograms();
}
@@ -21,6 +22,8 @@ void DrawColorCorrectionPass::InitializeShaderPrograms()
void DrawColorCorrectionPass::Draw(GLuint sceneTexture, GLuint bloomTexture)
{
+ ImGui::DragFloat("Exposure", &m_Exposure, 0.01f, 0.f, 10.f, "%.2f", 1.f);
+ ImGui::DragFloat("Gamma", &m_Gamma, 0.01f, 0.f, 50.f, "%.2f", 1.f);
//glBindFramebuffer(GL_FRAMEBUFFER, 0);
GLERROR("DrawScreenQuadPass::Draw: Pre");
@@ -28,6 +31,7 @@ void DrawColorCorrectionPass::Draw(GLuint sceneTexture, GLuint bloomTexture)
m_ColorCorrectionProgram->Bind();
glClear(GL_COLOR_BUFFER_BIT);
glUniform1f(glGetUniformLocation(m_ColorCorrectionProgram->GetHandle(), "Exposure"), m_Exposure);
+ glUniform1f(glGetUniformLocation(m_ColorCorrectionProgram->GetHandle(), "Gamma"), m_Gamma);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, sceneTexture);