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<br><br>out[i] = (in[i] > 0.0f)? pow(in[i],fac[0]): in[0];<br><br>rather than<br>
<br>out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0];<br><br>?<br><br>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?<br>
<br>cheers<br><br>Matt<br><br><div class="gmail_quote">On Fri, May 23, 2008 at 12:56 AM, Brecht Van Lommel <<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Revision: 14928<br>
<a href="http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14928" target="_blank">http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14928</a><br>
Author: blendix<br>
Date: 2008-05-22 16:56:32 +0200 (Thu, 22 May 2008)<br>
<br>
Log Message:<br>
-----------<br>
<br>
Fix for part of bug #12075: gamma node generated nan's on negative input.<br>
<br>
...</blockquote><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
{<br>
int i=0;<br>
for(i=0; i<3; i++) {<br>
- out[i] = pow(in[i],fac[0]);<br>
+ /* check for negative to avoid nan's */<br>
+ out[i] = (in[0] > 0.0f)? pow(in[i],fac[0]): in[0];<br>
}<br>
out[3] = in[3];<br>
}</blockquote></div><br>