Image: Export emissive colors in 3 channel PNG images
Related to T81199. When saving a rendered image with transparency (RGBA) to a 3 channel PNG image the emissive colors were not exported. This change adds the emissive colors to the written file. NOTE: this does not fix the limitation of writing emissive colors to a 4 channel PNG file as the file format does not support this.
This commit is contained in:
parent
f52f51aef2
commit
850944e6cd
|
@ -458,17 +458,8 @@ void IMB_alpha_under_color_float(float *rect_float, int x, int y, float backcol[
|
|||
float *fp = rect_float;
|
||||
|
||||
while (a--) {
|
||||
if (fp[3] == 0.0f) {
|
||||
copy_v3_v3(fp, backcol);
|
||||
}
|
||||
else {
|
||||
float mul = 1.0f - fp[3];
|
||||
|
||||
fp[0] += mul * backcol[0];
|
||||
fp[1] += mul * backcol[1];
|
||||
fp[2] += mul * backcol[2];
|
||||
}
|
||||
|
||||
const float mul = 1.0f - fp[3];
|
||||
madd_v3_v3fl(fp, backcol, mul);
|
||||
fp[3] = 1.0f;
|
||||
|
||||
fp += 4;
|
||||
|
|
Loading…
Reference in New Issue