What happened?
The Twinklefox and Twinklecat effects are visibly dimmer in v16.0.0 compared to v0.15.x. This is because the v16.0.0 gamma correction architecture change (commit ee9ac94) moved gamma correction from input colors to the final output stage, but the Twinklefox twinkle colors were not compensated with gamma32inv().
Root cause
In v0.15.x, gamma correction was applied to palette and segment colors when they were loaded (_colors_t[i] = gamma32(seg.currentColor(i))). Effects operated on pre-gamma'd values, and no gamma was applied at output.
In v16.0.0, effects operate on linear (non-gamma'd) colors, and gamma32() is applied at the output stage (FX_fcn.cpp:1685). Effects that do their own internal brightness scaling (like Twinklefox's bright parameter to ColorFromPalette) get their brightness curve gamma-compressed at output, resulting in dimmer mid-brightness twinkles.
A partial fix was already applied to the Twinklefox background color:
bg = gamma32inv(bg); // need to invert gamma as the FX was written without any gamma correction
And the same pattern is used in the Pride2015 effect:
newcolor.color32 = gamma32inv(newcolor.color32);
But the twinkle colors themselves were not given the same treatment.
Fix
Apply gamma32inv() to the twinkle color output, matching the existing pattern:
CRGBW c = twinklefox_one_twinkle(myclock30, myunique8, cat);
+ c = gamma32inv(c); // invert gamma as the FX was written without gamma correction
unsigned cbright = c.getAverageLight();
This is a one-line change in FX.cpp within twinklefox_base().
Environment
- WLED v16.0.0
- LED type: WS2812B
- Gamma correction: enabled
- Effect: Twinklefox with black background
To Reproduce Bug
Observe Twinklefox difference between 0.15.4 and 16.0 install
Expected Behavior
Same or similar brightness
Install Method
Binary from WLED.me
What version of WLED?
16.0
Which microcontroller/board are you seeing the problem on?
ESP8266, ESP32
Relevant log/trace output
Anything else?
No response
Code of Conduct
What happened?
The Twinklefox and Twinklecat effects are visibly dimmer in v16.0.0 compared to v0.15.x. This is because the v16.0.0 gamma correction architecture change (commit ee9ac94) moved gamma correction from input colors to the final output stage, but the Twinklefox twinkle colors were not compensated with
gamma32inv().Root cause
In v0.15.x, gamma correction was applied to palette and segment colors when they were loaded (
_colors_t[i] = gamma32(seg.currentColor(i))). Effects operated on pre-gamma'd values, and no gamma was applied at output.In v16.0.0, effects operate on linear (non-gamma'd) colors, and
gamma32()is applied at the output stage (FX_fcn.cpp:1685). Effects that do their own internal brightness scaling (like Twinklefox'sbrightparameter toColorFromPalette) get their brightness curve gamma-compressed at output, resulting in dimmer mid-brightness twinkles.A partial fix was already applied to the Twinklefox background color:
bg = gamma32inv(bg); // need to invert gamma as the FX was written without any gamma correctionAnd the same pattern is used in the Pride2015 effect:
But the twinkle colors themselves were not given the same treatment.
Fix
Apply
gamma32inv()to the twinkle color output, matching the existing pattern:CRGBW c = twinklefox_one_twinkle(myclock30, myunique8, cat); + c = gamma32inv(c); // invert gamma as the FX was written without gamma correction unsigned cbright = c.getAverageLight();This is a one-line change in
FX.cppwithintwinklefox_base().Environment
To Reproduce Bug
Observe Twinklefox difference between 0.15.4 and 16.0 install
Expected Behavior
Same or similar brightness
Install Method
Binary from WLED.me
What version of WLED?
16.0
Which microcontroller/board are you seeing the problem on?
ESP8266, ESP32
Relevant log/trace output
Anything else?
No response
Code of Conduct