[Bf-blender-cvs] [850944e6cda] master: Image: Export emissive colors in 3 channel PNG images
Jeroen Bakker
noreply at git.blender.org
Mon Oct 19 11:34:16 CEST 2020
Commit: 850944e6cda763f099652bf97d52d22f1deb5daa
Author: Jeroen Bakker
Date: Mon Oct 19 11:29:47 2020 +0200
Branches: master
https://developer.blender.org/rB850944e6cda763f099652bf97d52d22f1deb5daa
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.
===================================================================
M source/blender/imbuf/intern/imageprocess.c
===================================================================
diff --git a/source/blender/imbuf/intern/imageprocess.c b/source/blender/imbuf/intern/imageprocess.c
index 6ad69e72b4f..f8029c08bad 100644
--- a/source/blender/imbuf/intern/imageprocess.c
+++ b/source/blender/imbuf/intern/imageprocess.c
@@ -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;
More information about the Bf-blender-cvs
mailing list