[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54374] trunk/blender/source/blender: Fix #34156: Spec.

Sergey Sharybin sergey.vfx at gmail.com
Thu Feb 7 16:37:00 CET 2013


Revision: 54374
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54374
Author:   nazgul
Date:     2013-02-07 15:36:59 +0000 (Thu, 07 Feb 2013)
Log Message:
-----------
Fix #34156: Spec. and Alpha Intensity OpenGL issue

Issue was caused by alpha pipeline cleanup: apparently depending on
use_alpha flag different channels for spec/alpha would be used.

Made it so talpha is computed from Image->ignore_alpha instead of
always considering to be TRUTH.

This is not so much trivial to understand what's going on here, but
it's not new issue. Anyway, if someone have got ideas how to improve
feedback here -- ideas are welcome! For now only regression is fixed.

Modified Paths:
--------------
    trunk/blender/source/blender/gpu/intern/gpu_material.c
    trunk/blender/source/blender/render/intern/source/imagetexture.c

Modified: trunk/blender/source/blender/gpu/intern/gpu_material.c
===================================================================
--- trunk/blender/source/blender/gpu/intern/gpu_material.c	2013-02-07 14:41:08 UTC (rev 54373)
+++ trunk/blender/source/blender/gpu/intern/gpu_material.c	2013-02-07 15:36:59 UTC (rev 54374)
@@ -1035,7 +1035,7 @@
 				GPU_link(mat, "mtex_image", texco, GPU_image(tex->ima, &tex->iuser, FALSE), &tin, &trgb);
 				rgbnor= TEX_RGB;
 
-				talpha= 1;
+				talpha = (tex->ima->flag & IMA_IGNORE_ALPHA) == 0;
 			}
 			else {
 				continue;

Modified: trunk/blender/source/blender/render/intern/source/imagetexture.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/imagetexture.c	2013-02-07 14:41:08 UTC (rev 54373)
+++ trunk/blender/source/blender/render/intern/source/imagetexture.c	2013-02-07 15:36:59 UTC (rev 54374)
@@ -224,8 +224,10 @@
 	}
 
 	/* keep this before interpolation [#29761] */
-	if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-		texres->talpha = TRUE;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+			texres->talpha = TRUE;
+		}
 	}
 
 	/* interpolate */
@@ -1092,8 +1094,10 @@
 	/* mipmap test */
 	image_mipmap_test(tex, ibuf);
 	
-	if ((tex->imaflag & TEX_CALCALPHA) == 0)
-		texres->talpha = 1;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0)
+			texres->talpha = 1;
+	}
 	texr.talpha = texres->talpha;
 
 	if (tex->imaflag & TEX_IMAROT) {
@@ -1506,8 +1510,10 @@
 	/* mipmap test */
 	image_mipmap_test(tex, ibuf);
 
-	if ((tex->imaflag & TEX_CALCALPHA) == 0) {
-		texres->talpha = TRUE;
+	if (tex->ima && (tex->ima->flag & IMA_IGNORE_ALPHA) == 0) {
+		if ((tex->imaflag & TEX_CALCALPHA) == 0) {
+			texres->talpha = TRUE;
+		}
 	}
 	
 	texr.talpha= texres->talpha;




More information about the Bf-blender-cvs mailing list