diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-02-12 05:52:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-02-12 05:52:55 +0400 |
commit | 631f49d1280c4f87a93ff0da67f62d691a6abc64 (patch) | |
tree | 89442417d6eead4301002c8c002ac115600dab6c /source | |
parent | 5eec86c6b28539182da03bcdb65a2c96266c241c (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_meshdata_types.h | 11 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_ocean.c | 3 |
2 files changed, 10 insertions, 4 deletions
diff --git a/source/blender/makesdna/DNA_meshdata_types.h b/source/blender/makesdna/DNA_meshdata_types.h index ffa5e420fca..a189219b211 100644 --- a/source/blender/makesdna/DNA_meshdata_types.h +++ b/source/blender/makesdna/DNA_meshdata_types.h @@ -118,9 +118,14 @@ typedef struct MLoopUV { #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; diff --git a/source/blender/modifiers/intern/MOD_ocean.c b/source/blender/modifiers/intern/MOD_ocean.c index c0e529f1eae..6c5bac49188 100644 --- a/source/blender/modifiers/intern/MOD_ocean.c +++ b/source/blender/modifiers/intern/MOD_ocean.c @@ -486,7 +486,8 @@ static DerivedMesh *doOcean(ModifierData *md, Object *ob, 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--); } } |