Skip to content

Commit b76ef23

Browse files
committed
PS Bugfix: revert gamma correction for color, not brightness setting
1 parent 591dbe3 commit b76ef23

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

wled00/FXparticleSystem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ void ParticleSystem2D::render() {
601601
hsv2rgb(baseHSV, baseRGB.color32); // convert back to RGB
602602
}
603603
}
604-
if(gammaCorrectBri) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution
604+
if(gammaCorrectCol) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution
605605
renderParticle(i, brightness, baseRGB, particlesettings.wrapX, particlesettings.wrapY);
606606
}
607607

@@ -675,7 +675,7 @@ __attribute__((optimize("O2"))) void ParticleSystem2D::renderParticle(const uint
675675
// - scale brigthness with gamma correction (done in render())
676676
// - apply inverse gamma correction to brightness values
677677
// - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total
678-
if(gammaCorrectBri) {
678+
if(gammaCorrectCol) {
679679
pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma
680680
pxlbrightness[1] = gamma8inv(pxlbrightness[1]);
681681
pxlbrightness[2] = gamma8inv(pxlbrightness[2]);
@@ -1458,7 +1458,7 @@ void ParticleSystem1D::render() {
14581458
hsv2rgb(baseHSV, baseRGB.color32); // convert back to RGB
14591459
}
14601460
}
1461-
if(gammaCorrectBri) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution
1461+
if(gammaCorrectCol) brightness = gamma8(brightness); // apply gamma correction, used for gamma-inverted brightness distribution
14621462
renderParticle(i, brightness, baseRGB, particlesettings.wrap);
14631463
}
14641464
// apply smear-blur to rendered frame
@@ -1519,7 +1519,7 @@ __attribute__((optimize("O2"))) void ParticleSystem1D::renderParticle(const uint
15191519
// - scale brigthness with gamma correction (done in render())
15201520
// - apply inverse gamma correction to brightness values
15211521
// - gamma is applied again in show() -> the resulting brightness distribution is linear but gamma corrected in total
1522-
if(gammaCorrectBri) {
1522+
if(gammaCorrectCol) {
15231523
pxlbrightness[0] = gamma8inv(pxlbrightness[0]); // use look-up-table for invers gamma
15241524
pxlbrightness[1] = gamma8inv(pxlbrightness[1]);
15251525
}

0 commit comments

Comments
 (0)