Skip to content
This repository has been archived by the owner on Jan 5, 2024. It is now read-only.

Commit

Permalink
Merge pull request #544 from cortex-command-community/postprocess-fix…
Browse files Browse the repository at this point in the history
…-srt

Fix postprocess matrix transform order
  • Loading branch information
Causeless authored Oct 25, 2023
2 parents e9c2c28 + 13fa248 commit 399719f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Managers/PostProcessMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,12 +534,12 @@ namespace RTE {
effectStrength = postEffect.m_Strength / 255.f;
effectPosX = postEffect.m_Pos.m_X;
effectPosY = postEffect.m_Pos.m_Y;
m_PostProcessShader->SetVector4f(m_PostProcessShader->GetColorUniform(), glm::vec4(effectStrength));
m_PostProcessShader->SetVector4f(m_PostProcessShader->GetColorUniform(), glm::vec4(effectStrength, effectStrength, effectStrength, 1.0f));

glm::mat4 transformMatrix(1);
transformMatrix = glm::translate(transformMatrix, glm::vec3(effectPosX, effectPosY, 0));
transformMatrix = glm::scale(transformMatrix, glm::vec3(effectBitmap->w * 0.5f, effectBitmap->h * 0.5f, 1.0));
transformMatrix = glm::rotate(transformMatrix, -postEffect.m_Angle, glm::vec3(0, 0, 1));
transformMatrix = glm::scale(transformMatrix, glm::vec3(effectBitmap->w * 0.5f, effectBitmap->h * 0.5f, 1.0));

glBindTexture(GL_TEXTURE_2D, reinterpret_cast<GLBitmapInfo*>(postEffect.m_Bitmap->extra)->m_Texture);
m_PostProcessShader->SetMatrix4f(m_PostProcessShader->GetTransformUniform(), transformMatrix);
Expand Down

0 comments on commit 399719f

Please sign in to comment.