[Bf-committers] [Bf-blender-cvs] SVN commit:/data/svn/bf-blender [14928] trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c:

Remo Pini remo.pini at avexys.com
Wed Jul 9 11:28:03 CEST 2008


It should probably also read 

 

out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[i];

 

Instead of 

 

out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[0];

 

or you'll replace all zero values with the value of in[0], which is most
likely NOT desired.

 

Cheers

 

Remo





 

From: bf-committers-bounces at blender.org
[mailto:bf-committers-bounces at blender.org] On Behalf Of Matt Ebb
Sent: Mittwoch, 9. Juli 2008 06:59
To: bf-committers at blender.org
Subject: Re: [Bf-committers] [Bf-blender-cvs] SVN
commit:/data/svn/bf-blender [14928]
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c:

 

Hi, I realise this is an old commit, but I was looking inside the gamma
node code today and saw what I think is an error - shouldn't that line
read

out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[0];

rather than

out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0];

?

Correct me if I'm wrong, but it seems like it's only checking if the red
channel is less than zero, rather than each channel independently?

cheers

Matt

On Fri, May 23, 2008 at 12:56 AM, Brecht Van Lommel
<brechtvanlommel at pandora.be> wrote:

Revision: 14928
 
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-
blender&revision=14928
Author:   blendix
Date:     2008-05-22 16:56:32 +0200 (Thu, 22 May 2008)

Log Message:
-----------

Fix for part of bug #12075: gamma node generated nan's on negative
input.

...

 

	
	 {
	       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];
	 }

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-committers/attachments/20080709/d9f3b774/attachment.htm 


More information about the Bf-committers mailing list