From 5463828bd2f62b10640e91637942b8784a7eee5c Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 22 May 2008 14:56:32 +0000 Subject: Fix for part of bug #12075: gamma node generated nan's on negative input. --- source/blender/nodes/intern/CMP_nodes/CMP_gamma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c index 6cd1c5981a6..ff9e2b716ce 100644 --- a/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c +++ b/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c @@ -46,7 +46,8 @@ static void do_gamma(bNode *node, float *out, float *in, float *fac) { int i=0; for(i=0; i<3; i++) { - out[i] = pow(in[i],fac[0]); + /* check for negative to avoid nan's */ + out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0]; } out[3] = in[3]; } -- cgit v1.2.3