Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/nodes/intern/CMP_nodes')
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_blur.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c1
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c16
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_glare.c1
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_image.c7
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_math.c7
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_rgb.c2
-rw-r--r--source/blender/nodes/intern/CMP_nodes/CMP_rotate.c1
8 files changed, 29 insertions, 8 deletions
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
index 2b33126b3a7..718578a921b 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_blur.c
@@ -387,7 +387,7 @@ static void bokeh_single_image(bNode *node, CompBuf *new, CompBuf *img, float fa
float dist= sqrt(fj*fj + fi*fi);
//*dgauss= hexagon_filter(fi, fj);
- *dgauss= RE_filter_value(nbd->filtertype, 2.0f*dist - 1.0f);
+ *dgauss= RE_filter_value(nbd->filtertype, dist);
val+= *dgauss;
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
index b32c531d8f9..e395716f36d 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_channelMatte.c
@@ -97,6 +97,7 @@ static void do_channel_matte(bNode *node, float *out, float *in)
default:
break;
}
+ break;
}
default:
break;
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
index 151850105b7..55d77a902b9 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_colorMatte.c
@@ -49,16 +49,24 @@ static bNodeSocketType cmp_node_color_out[]={
static void do_color_key(bNode *node, float *out, float *in)
{
+ float h_wrap;
NodeChroma *c;
c=node->storage;
VECCOPY(out, in);
- if(fabs(in[0]-c->key[0]) < c->t1 &&
- fabs(in[1]-c->key[1]) < c->t2 &&
- fabs(in[2]-c->key[2]) < c->t3)
- {
+ if(
+ /* do hue last because it needs to wrap, and does some more checks */
+
+ /* sat */ (fabs(in[1]-c->key[1]) < c->t2) &&
+ /* val */ (fabs(in[2]-c->key[2]) < c->t3) &&
+
+ /* multiply by 2 because it wraps on both sides of the hue,
+ * otherwise 0.5 would key all hue's */
+
+ /* hue */ ((h_wrap= 2.0f * fabs(in[0]-c->key[0])) < c->t1 || (2.0f - h_wrap) < c->t1)
+ ) {
out[3]=0.0; /*make transparent*/
}
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c
index 1a339b45a05..2e0822a4511 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_glare.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_glare.c
@@ -467,6 +467,7 @@ static void node_composit_exec_glare(void *UNUSED(data), bNode *node, bNodeStack
case 2:
default:
streaks(ndg, new, src);
+ break;
}
free_compbuf(src);
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_image.c b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
index 3caaad26bae..a5f256054cd 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_image.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_image.c
@@ -53,6 +53,7 @@ static bNodeSocketType cmp_node_rlayers_out[]= {
{ SOCK_RGBA, 0, "Refract", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_RGBA, 0, "Indirect", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 0, "IndexOB", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_VALUE, 0, "IndexMA", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_VALUE, 0, "Mist", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_RGBA, 0, "Emit", 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ SOCK_RGBA, 0, "Environment",0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
@@ -211,6 +212,8 @@ static void outputs_multilayer_get(RenderData *rd, RenderLayer *rl, bNodeStack *
out[RRES_OUT_INDIRECT]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDIRECT);
if(out[RRES_OUT_INDEXOB]->hasoutput)
out[RRES_OUT_INDEXOB]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXOB);
+ if(out[RRES_OUT_INDEXMA]->hasoutput)
+ out[RRES_OUT_INDEXMA]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_INDEXMA);
if(out[RRES_OUT_MIST]->hasoutput)
out[RRES_OUT_MIST]->data= compbuf_multilayer_get(rd, rl, ima, iuser, SCE_PASS_MIST);
if(out[RRES_OUT_EMIT]->hasoutput)
@@ -326,7 +329,7 @@ static CompBuf *compbuf_from_pass(RenderData *rd, RenderLayer *rl, int rectx, in
CompBuf *buf;
int buftype= CB_VEC3;
- if(ELEM3(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST))
+ if(ELEM4(passcode, SCE_PASS_Z, SCE_PASS_INDEXOB, SCE_PASS_MIST, SCE_PASS_INDEXMA))
buftype= CB_VAL;
else if(passcode==SCE_PASS_VECTOR)
buftype= CB_VEC4;
@@ -373,6 +376,8 @@ static void node_composit_rlayers_out(RenderData *rd, RenderLayer *rl, bNodeStac
out[RRES_OUT_INDIRECT]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDIRECT);
if(out[RRES_OUT_INDEXOB]->hasoutput)
out[RRES_OUT_INDEXOB]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXOB);
+ if(out[RRES_OUT_INDEXMA]->hasoutput)
+ out[RRES_OUT_INDEXMA]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_INDEXMA);
if(out[RRES_OUT_MIST]->hasoutput)
out[RRES_OUT_MIST]->data= compbuf_from_pass(rd, rl, rectx, recty, SCE_PASS_MIST);
if(out[RRES_OUT_EMIT]->hasoutput)
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_math.c b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
index 4348fd18759..b7a67f3563b 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_math.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_math.c
@@ -140,7 +140,12 @@ static void do_math(bNode *node, float *out, float *in, float *in2)
break;
case 14: /* Round */
{
- out[0]= (out[0]<0)?(int)(in[0] - 0.5f):(int)(in[0] + 0.5f);
+ /* round by the second value */
+ if( in2[0] != 0.0f )
+ out[0]= floorf(in[0] / in2[0] + 0.5f) * in2[0];
+ else
+ out[0]= floorf(in[0] + 0.5f);
+
}
break;
case 15: /* Less Than */
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c
index a6ce77b64f0..36b7988c4e0 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_rgb.c
@@ -45,7 +45,7 @@ static void node_composit_exec_rgb(void *UNUSED(data), bNode *node, bNodeStack *
{
bNodeSocket *sock= node->outputs.first;
- VECCOPY(out[0]->vec, sock->ns.vec);
+ QUATCOPY(out[0]->vec, sock->ns.vec);
}
void register_node_type_cmp_rgb(ListBase *lb)
diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
index b6b1764ff0f..eccac4f0e6d 100644
--- a/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
+++ b/source/blender/nodes/intern/CMP_nodes/CMP_rotate.c
@@ -97,6 +97,7 @@ static void node_composit_exec_rotate(void *UNUSED(data), bNode *node, bNodeStac
break;
case 2:
bicubic_interpolation(ibuf, obuf, u, v, xo, yo);
+ break;
}
}