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

Matt Ebb matt at mke3.net
Wed Jul 9 06:59:13 CEST 2008


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/07c363cc/attachment.htm 


More information about the Bf-committers mailing list