From b76ef231fcb97073285488dff0dadfdcd2ace188 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Tue, 29 Jul 2025 19:35:12 +0200 Subject: [PATCH] PS Bugfix: revert gamma correction for color, not brightness setting --- wled00/FXparticleSystem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wled00/FXparticleSystem.cpp b/wled00/FXparticleSystem.cpp index 27899b232..21061a098 100644 --- a/wled00/FXparticleSystem.cpp +++ b/wled00/FXparticleSystem.cpp @@ -601,7 +601,7 @@ void ParticleSystem2D::render() { hsv2rgb(baseHSV, baseRGB.color32); // convert back to RGB } } - if(gammaCorrectBri) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution + if(gammaCorrectCol) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution renderParticle(i, brightness, baseRGB, particlesettings.wrapX, particlesettings.wrapY); } @@ -675,7 +675,7 @@ __attribute__((optimize("O2"))) void ParticleSystem2D::renderParticle(const uint // - scale brigthness with gamma correction (done in render()) // - apply inverse gamma correction to brightness values // - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total - if(gammaCorrectBri) { + if(gammaCorrectCol) { pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma pxlbrightness[1] = gamma8inv(pxlbrightness[1]); pxlbrightness[2] = gamma8inv(pxlbrightness[2]); @@ -1458,7 +1458,7 @@ void ParticleSystem1D::render() { hsv2rgb(baseHSV, baseRGB.color32); // convert back to RGB } } - if(gammaCorrectBri) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution + if(gammaCorrectCol) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution renderParticle(i, brightness, baseRGB, particlesettings.wrap); } // apply smear-blur to rendered frame @@ -1519,7 +1519,7 @@ __attribute__((optimize("O2"))) void ParticleSystem1D::renderParticle(const uint // - scale brigthness with gamma correction (done in render()) // - apply inverse gamma correction to brightness values // - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total - if(gammaCorrectBri) { + if(gammaCorrectCol) { pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma pxlbrightness[1] = gamma8inv(pxlbrightness[1]); }