[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [54481] trunk/blender/source/blender: fix for own regression [#34096] ocean sim vertex color bug

Campbell Barton ideasman42 at gmail.com
Tue Feb 12 02:52:56 CET 2013


Revision: 54481
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=54481
Author:   campbellbarton
Date:     2013-02-12 01:52:55 +0000 (Tue, 12 Feb 2013)
Log Message:
-----------
fix for own regression [#34096] ocean sim vertex color bug
Caused by my assumption that alpha wasn't used for vertex colors.

Infact it is used by blender-internal rendering, but typically only for blending strand particles.
Updated comments to note this.

Modified Paths:
--------------
    trunk/blender/source/blender/makesdna/DNA_meshdata_types.h
    trunk/blender/source/blender/modifiers/intern/MOD_ocean.c

Modified: trunk/blender/source/blender/makesdna/DNA_meshdata_types.h
===================================================================
--- trunk/blender/source/blender/makesdna/DNA_meshdata_types.h	2013-02-12 01:20:14 UTC (rev 54480)
+++ trunk/blender/source/blender/makesdna/DNA_meshdata_types.h	2013-02-12 01:52:55 UTC (rev 54481)
@@ -118,9 +118,14 @@
 #define MLOOPUV_VERTSEL	2
 #define MLOOPUV_PINNED	4
 
-/* at the moment alpha is abused for vertex painting
- * and not used for transparency,
- * note that red and blue are _not_ swapped, as they are with #MCol */
+/**
+ * at the moment alpha is abused for vertex painting,
+ * otherwise it should _always_ be initialized to 255
+ * Mostly its not used for transparency...
+ * (except for blender-internal rendering, see [#34096]).
+ *
+ * \note red and blue are _not_ swapped, as they are with #MCol
+ */
 typedef struct MLoopCol {
 	char r, g, b, a;
 } MLoopCol;

Modified: trunk/blender/source/blender/modifiers/intern/MOD_ocean.c
===================================================================
--- trunk/blender/source/blender/modifiers/intern/MOD_ocean.c	2013-02-12 01:20:14 UTC (rev 54480)
+++ trunk/blender/source/blender/modifiers/intern/MOD_ocean.c	2013-02-12 01:52:55 UTC (rev 54481)
@@ -486,7 +486,8 @@
 
 						mlcol = &mloopcols[mp->loopstart + j];
 						mlcol->r = mlcol->g = mlcol->b = (char)(foam * 255);
-						/* mc->a = 255; */ /* no need to set */
+						/* This needs to be set (render engine uses) */
+						mlcol->a = 255;
 					} while (j--);
 				}
 			}




More information about the Bf-blender-cvs mailing list