Skip to content

Commit ee7802f

Browse files
committed
fix glow strength, fr this time
1 parent 0503ca1 commit ee7802f

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

Data/Base.rte/Shaders/PostProcess.frag

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#version 130
22

33
in vec2 textureUV;
4+
in vec4 vertexColor;
45

56
out vec4 FragColor;
67

@@ -18,5 +19,5 @@ vec4 texture2DAA(sampler2D tex, vec2 uv) {
1819
}
1920

2021
void main() {
21-
FragColor = texture2DAA(rteTexture, textureUV) * rteColor;
22+
FragColor = texture2DAA(rteTexture, textureUV) * rteColor * vertexColor;
2223
}

Data/Base.rte/Shaders/PostProcess.vert

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
in vec3 rteVertexPosition;
44
in vec2 rteVertexTexUV;
5+
in vec4 rteVertexColor;
56

67
out vec2 textureUV;
8+
out vec4 vertexColor;
79

810
uniform mat4 rteModel;
911
uniform mat4 rteProjection;
1012

1113
void main() {
1214
gl_Position = rteProjection * rteModel * vec4(rteVertexPosition, 1.0);
15+
vertexColor = rteVertexColor;
1316
textureUV = rteVertexTexUV;
1417
}

Source/Managers/PostProcessMan.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,14 +436,15 @@ void PostProcessMan::DrawPostScreenEffects() {
436436
GL_CHECK(glBindVertexArray(m_VertexArray));
437437
m_PostProcessShader->SetInt(m_PostProcessShader->GetTextureUniform(), 0);
438438
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetProjectionUniform(), *m_ProjectionMatrix);
439+
m_PostProcessShader->SetVector4f(m_PostProcessShader->GetColorUniform(), glm::vec4(1.0f));
439440

440441
for (const PostEffect& postEffect: m_PostScreenEffects) {
441442
if (postEffect.m_Bitmap) {
442443
effectBitmap = postEffect.m_Bitmap;
443444
effectStrength = postEffect.m_Strength;
444445
effectPosX = postEffect.m_Pos.m_X - postEffect.m_Bitmap->w / 2;
445446
effectPosY = postEffect.m_Pos.m_Y - postEffect.m_Bitmap->h / 2;
446-
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(postEffect.m_Bitmap), effectPosX, effectPosY, {.r=effectStrength, .g=effectStrength, .b=effectStrength, .a=effectStrength});
447+
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(postEffect.m_Bitmap), effectPosX, effectPosY, {.r=effectStrength, .g=effectStrength, .b=effectStrength, .a=255});
447448
}
448449
}
449450
}

0 commit comments

Comments
 (0)