Dynamic Paint:
[blender.git] / source / blender / nodes / intern / SHD_nodes / SHD_geom.c
index 379f54bec57a2c729f4c3cbd58d0025c07e3ab5b..b349406932ef72068e6e56f3bd6906bc7f88a75d 100644 (file)
@@ -47,6 +47,7 @@ static bNodeSocketType sh_node_geom_out[]= {
        {       SOCK_VECTOR, 0, "UV",   0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
        {       SOCK_VECTOR, 0, "Normal",       0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f},
        {       SOCK_RGBA,   0, "Vertex Color", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
+       {       SOCK_VALUE,   0, "Vertex Alpha", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
        {       SOCK_VALUE,   0, "Front/Back", 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 1.0f},
        {       -1, 0, ""       }
 };
@@ -93,10 +94,14 @@ static void node_shader_exec_geom(void *data, bNode *node, bNodeStack **UNUSED(i
                        }
 
                        VECCOPY(out[GEOM_OUT_VCOL]->vec, scol->col);
-                       out[GEOM_OUT_VCOL]->vec[3]= 1.0f;
+                       out[GEOM_OUT_VCOL]->vec[3]= scol->col[3];
+
+                       out[GEOM_OUT_VCOL_ALPHA]->vec[0]= scol->col[3];
                }
-               else
+               else {
                        memcpy(out[GEOM_OUT_VCOL]->vec, defaultvcol, sizeof(defaultvcol));
+                       out[GEOM_OUT_VCOL_ALPHA]->vec[0]= 1.0f;
+               }
                
                if(shi->osatex) {
                        out[GEOM_OUT_GLOB]->data= shi->dxgl;