diff --git a/include/Engine/Rendering/ExplosionEffectJob.h b/include/Engine/Rendering/ExplosionEffectJob.h index 8f339526..453f392c 100644 --- a/include/Engine/Rendering/ExplosionEffectJob.h +++ b/include/Engine/Rendering/ExplosionEffectJob.h @@ -27,6 +27,7 @@ struct ExplosionEffectJob : ModelJob Velocity = (glm::vec2)explosionEffectComponent["Velocity"]; ColorByDistance = (bool)explosionEffectComponent["ColorByDistance"]; ExponentialAccelaration = (bool)explosionEffectComponent["ExponentialAccelaration"]; + Reverse = (bool)explosionEffectComponent["Reverse"]; }; glm::vec3 ExplosionOrigin; @@ -44,6 +45,7 @@ struct ExplosionEffectJob : ModelJob //bool ReverseAnimation = false; //bool Wireframe = false; bool ExponentialAccelaration = false; + bool Reverse = false; std::array RandomNumbers = { 0.3257552917701f, diff --git a/resources/Shaders/ExplosionEffect.geom.glsl b/resources/Shaders/ExplosionEffect.geom.glsl index 44ae568b..b202184a 100644 --- a/resources/Shaders/ExplosionEffect.geom.glsl +++ b/resources/Shaders/ExplosionEffect.geom.glsl @@ -169,7 +169,7 @@ void main() // account for velocity // account for color - ExplodedPosition = Input[i].Position + (triangleCenter2ExplosionRadius * maxDistance * (ExplosionDuration - TimeSinceDeath)); + ExplodedPosition = Input[i].Position + (triangleCenter2ExplosionRadius * maxDistance /** (ExplosionDuration - TimeSinceDeath)*/); } // pass through vertex data diff --git a/src/Engine/Rendering/DrawFinalPass.cpp b/src/Engine/Rendering/DrawFinalPass.cpp index d084b919..2544b8a4 100644 --- a/src/Engine/Rendering/DrawFinalPass.cpp +++ b/src/Engine/Rendering/DrawFinalPass.cpp @@ -786,6 +786,8 @@ void DrawFinalPass::BindExplosionUniforms(GLuint shaderHandle, std::shared_ptrExponentialAccelaration); GLERROR("Bind 15 uniform"); + glUniform1i(glGetUniformLocation(shaderHandle, "Reverse"), job->Reverse); + GLERROR("Bind 15-2 uniform"); glUniform4fv(glGetUniformLocation(shaderHandle, "Color"), 1, glm::value_ptr(job->Color)); GLERROR("Bind 16 uniform");