Fix T68076: Color Correction node generates NaN
This is the same fix that the `GammaOperation` uses. Differential Revision: https://developer.blender.org/D6696 Reviewers: brecht
This commit is contained in:
parent
3caefc89ee
commit
10705807fe
Notes:
blender-bot
2023-02-14 06:00:50 +01:00
Referenced by issue #68076, Color Correction node generates NaN value
|
@ -117,9 +117,10 @@ void ColorCorrectionOperation::executePixelSampled(float output[4],
|
|||
g = 0.5f + ((g - 0.5f) * contrast);
|
||||
b = 0.5f + ((b - 0.5f) * contrast);
|
||||
|
||||
r = powf(r * gain + lift, invgamma);
|
||||
g = powf(g * gain + lift, invgamma);
|
||||
b = powf(b * gain + lift, invgamma);
|
||||
/* Check for negative values to avoid nan. */
|
||||
r = (r > 0.0f) ? powf(r * gain + lift, invgamma) : r;
|
||||
g = (g > 0.0f) ? powf(g * gain + lift, invgamma) : g;
|
||||
b = (b > 0.0f) ? powf(b * gain + lift, invgamma) : b;
|
||||
|
||||
// mix with mask
|
||||
r = mvalue * inputImageColor[0] + value * r;
|
||||
|
|
Loading…
Reference in New Issue