Congratulations on the baby Mike!<div><br></div><div><br></div><div><br></div><div><br></div><div>[Sorry if I am breaking this mailing list&#39;s etiquette]</div><div>-Sid<br><br><div class="gmail_quote">On Tue, Jan 24, 2012 at 4:14 PM, Mike Farnsworth <span dir="ltr">&lt;<a href="mailto:mike.farnsworth@gmail.com">mike.farnsworth@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Thanks, Brecht!  I saw that this went in and the shadow bug got fixed,<br>
but I apologize for not saying anything when that was all happening.<br>
I have a good excuse, though, my wife was having a baby on Friday<br>
morning. =)  (Mom and baby are home and in great shape.)<br>
<br>
So, related to this patch was the whole HDR-range texture issue...I<br>
think I&#39;m going to take a crack at that and see if I can come up with<br>
a way to allow full-float textures for certain ones.  It really only<br>
makes sense for emission (reflectances should always be zero to one),<br>
so I don&#39;t want to add overhead to all texture sampling.  I&#39;m sure<br>
there&#39;s a way to do it.<br>
<br>
-Mike<br>
<br>
On Sun, Jan 22, 2012 at 5:28 AM, Brecht Van Lommel<br>
<div class="HOEnZb"><div class="h5">&lt;<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>&gt; wrote:<br>
&gt; Problem should be fixed now, made a mistake in tweaking the patch. The<br>
&gt; memory errors I think will also be fixed, was a separate issue with<br>
&gt; nodes for which a fix was also committed.<br>
&gt;<br>
&gt; Brecht.<br>
&gt;<br>
&gt; On Sat, Jan 21, 2012 at 11:06 AM, Constantin Rahn &lt;<a href="mailto:conz@vrchannel.de">conz@vrchannel.de</a>&gt; wrote:<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; i have tested the importance sampling with one of my current scenes (Blender<br>
&gt;&gt; 2.61.43676, Win 7 64). But I have the problem, that there is no shadow with<br>
&gt;&gt; activated imp. sampling.<br>
&gt;&gt;<br>
&gt;&gt; Rendering without importance sampling (250spp, CPU):<br>
&gt;&gt; <a href="http://www.vrchannel.de/blender/Test_is_off.jpg" target="_blank">http://www.vrchannel.de/blender/Test_is_off.jpg</a><br>
&gt;&gt;<br>
&gt;&gt; Rendering with importance sampling (~50spp, CPU), only activated the &quot;sample<br>
&gt;&gt; as lamp&quot; (512) for the BG:<br>
&gt;&gt; <a href="http://www.vrchannel.de/blender/Test_is_on.jpg" target="_blank">http://www.vrchannel.de/blender/Test_is_on.jpg</a><br>
&gt;&gt;<br>
&gt;&gt; Maybe it has to do with my node setup. I am using two different BG images,<br>
&gt;&gt; one JPG as visible background and one HDRI for the lighting with different<br>
&gt;&gt; power.<br>
&gt;&gt; The node setup:<br>
&gt;&gt; <a href="http://www.vrchannel.de/blender/Test_is_nodes.png" target="_blank">http://www.vrchannel.de/blender/Test_is_nodes.png</a><br>
&gt;&gt;<br>
&gt;&gt; I get no specific &quot;importance sampling&quot; massage in the console. But there<br>
&gt;&gt; are some &quot;Memoryblock free: attempt to free NULL pointer&quot;.<br>
&gt;&gt; I can&#39;t send my scene, will try to reduce the problem to a simpler scene.<br>
&gt;&gt;<br>
&gt;&gt; Greetings and happy blending<br>
&gt;&gt; Conz<br>
&gt;&gt;<br>
&gt;&gt; Am 20.01.2012 06:00, schrieb Mike Farnsworth:<br>
&gt;&gt;<br>
&gt;&gt; Okay, one more update.  This version hopefully fixes an issue where<br>
&gt;&gt; any changes to nearly any setting were causing a re-render, because I<br>
&gt;&gt; wasn&#39;t checking for opportunities to skip the background light sync.<br>
&gt;&gt; This version seems to trigger fewer progressive render updates, but<br>
&gt;&gt; still updates at the right times.<br>
&gt;&gt;<br>
&gt;&gt; Brecht, let me know when you think this might make it into trunk.<br>
&gt;&gt;<br>
&gt;&gt; Thanks,<br>
&gt;&gt; Farny<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jan 17, 2012 at 10:59 PM, Mike Farnsworth<br>
&gt;&gt; &lt;<a href="mailto:mike.farnsworth@gmail.com">mike.farnsworth@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; I&#39;ve updated the patch to include the task split (max of 16384 shader<br>
&gt;&gt; evaluations per task), as well as turn off the background<br>
&gt;&gt; sample_as_light switch by default to not adversely impact performance<br>
&gt;&gt; for those who haven&#39;t set a custom environment.  I don&#39;t know of any<br>
&gt;&gt; other outstanding issues.<br>
&gt;&gt;<br>
&gt;&gt; -Farny<br>
&gt;&gt;<br>
&gt;&gt; On Tue, Jan 17, 2012 at 6:18 AM, Brecht Van Lommel<br>
&gt;&gt; &lt;<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Great work! I&#39;ll do a proper review of it later.<br>
&gt;&gt;<br>
&gt;&gt; Regarding the task size, there&#39;s a function to split up tasks in the<br>
&gt;&gt; device code. It&#39;s used in device_opencl.cpp, task_add, if there&#39;s a<br>
&gt;&gt; CUDA issue with maximum size being exceeded a similar thing could be<br>
&gt;&gt; done there.<br>
&gt;&gt;<br>
&gt;&gt; Brecht.<br>
&gt;&gt;<br>
&gt;&gt; On Mon, Jan 16, 2012 at 6:16 PM, Mike Farnsworth<br>
&gt;&gt; &lt;<a href="mailto:mike.farnsworth@gmail.com">mike.farnsworth@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Someone tried the patch and had a crash when using an importance<br>
&gt;&gt; resolution greater than 1023.  (It&#39;s really just eating it with a<br>
&gt;&gt; cuda_assert(cuLaunchGrid(cuDisplace, xblocks, 1)) when launching the<br>
&gt;&gt; shader task.)  I had the same issue with my GTX 260, and I thought it<br>
&gt;&gt; was just because that was an old(er) graphics card.  On my GTX 460 it<br>
&gt;&gt; doesn&#39;t seem to have any issues with the importance resolution.  If<br>
&gt;&gt; the GTX 560 Ti is crashing too, though, then I should probably to do<br>
&gt;&gt; something about it.<br>
&gt;&gt;<br>
&gt;&gt; The issue is that when running a cuda task, you can&#39;t have 65536<br>
&gt;&gt; blocks in any dimension.  We use a block size of 16, and with a<br>
&gt;&gt; resolution of 1024x1024, that results in 65536 blocks in the X<br>
&gt;&gt; direction.  The near-term workaround is to keep the resolution under<br>
&gt;&gt; 1024, perhaps limited in the UI.<br>
&gt;&gt;<br>
&gt;&gt; The long-term solution is that I need to break up the background<br>
&gt;&gt; evaluation task into, say, chunks of 128x128 and go through them one<br>
&gt;&gt; at a time in order to cover the whole background.<br>
&gt;&gt;<br>
&gt;&gt; -Farny<br>
&gt;&gt;<br>
&gt;&gt; On Sun, Jan 15, 2012 at 11:35 PM, Mike Farnsworth<br>
&gt;&gt; &lt;<a href="mailto:mike.farnsworth@gmail.com">mike.farnsworth@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; This patch includes a full implementation of importance sampling for<br>
&gt;&gt; environments, including the MIS solution we talked about.  It adds two<br>
&gt;&gt; items for the user to control: on/off switch for whether to treat the<br>
&gt;&gt; environment as a light (off is old behavior), and a resolution control<br>
&gt;&gt; for the importance map.  Here are a few notes about the patch:<br>
&gt;&gt;<br>
&gt;&gt; * For environments that are a solid color (or very slowly changing),<br>
&gt;&gt; turning on the env light machinery is overkill, and will actually<br>
&gt;&gt; result in reduced performance.  For anything complex (textures, sky,<br>
&gt;&gt; noise, etc) it produces noticeably less noise for the same number of<br>
&gt;&gt; passes, so it should be a solid advantage.<br>
&gt;&gt;<br>
&gt;&gt; * Any HDR environment textures are chopped down to SDR range by the<br>
&gt;&gt; texture upload to device right now (nothing to do with my patch, of<br>
&gt;&gt; course); this reduces the effectiveness of this new environment<br>
&gt;&gt; sampling.  If we can fix that, the env light sampling will have an<br>
&gt;&gt; even greater effect, not to mention potentially improved visuals in<br>
&gt;&gt; general.  Just sayin&#39;...<br>
&gt;&gt;<br>
&gt;&gt; * The patch includes a change where the displacement device function<br>
&gt;&gt; now outputs to a float4 buffer, not a float3 buffer, because on my<br>
&gt;&gt; older GPU that was causing completely screwed up sampling of the<br>
&gt;&gt; background when building the importance map.  So, displacement and<br>
&gt;&gt; shader tasks now have a slightly larger output buffer, but it now<br>
&gt;&gt; works on both my older GPU (GTX 260, sm_13) and my newer GPU (GTX 460,<br>
&gt;&gt; sm_21).<br>
&gt;&gt;<br>
&gt;&gt; * There is a commented #define that allows dumping the sampled<br>
&gt;&gt; background and both parts of the importance map to /tmp for debugging<br>
&gt;&gt; purposes.  Those sections of code can be removed, but they could come<br>
&gt;&gt; in handy in the future.<br>
&gt;&gt;<br>
&gt;&gt; I&#39;m going to post some before/after images to <a href="http://morecycles.blogspot.com" target="_blank">morecycles.blogspot.com</a><br>
&gt;&gt; tonight, so you can see the difference in quality.  I apologize for<br>
&gt;&gt; this taking longer than I had anticipated.  I had left in a<br>
&gt;&gt; __int_as_float(f) where I should have just had an (int)f instead, and<br>
&gt;&gt; it manifested itself with a zero PDF for the environment light, just<br>
&gt;&gt; causing noise.  It took a while to dig through it and find it.<br>
&gt;&gt; Brecht, let me know if you have any issues with the code, and I&#39;ll try<br>
&gt;&gt; to turn around any suggestions you make ASAP so this can be included<br>
&gt;&gt; in 2.62.  I understand the deadline is the 22nd?<br>
&gt;&gt;<br>
&gt;&gt; -Farny<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bf-cycles mailing list<br>
&gt;&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bf-cycles mailing list<br>
&gt;&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bf-cycles mailing list<br>
&gt;&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Bf-cycles mailing list<br>
&gt;&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt;&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; Bf-cycles mailing list<br>
&gt; <a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</div></div></blockquote></div><br></div>