<div dir="ltr">Hey,<br><br>the easiest approach is: store the number of samples per pixel in an image, divide the final image by the samples image.<br>I would avoid discarding samples as you will waste compute power, just find a way to reduce samples from the start (it needs a redesign to change how the kernel works), Lukas Stockner may have more idea about this as he tried to do an adaptive sampler before I guess.<br><br>cheers,<br>Mohamed Sakr</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 1:51 PM, Escot Lucas <span dir="ltr">&lt;<a href="mailto:lucas.escot@ens-lyon.fr" target="_blank">lucas.escot@ens-lyon.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="font-size:10pt;font-family:Verdana,Geneva,sans-serif">
<p>Hello everyone,</p>
<p>I originally asked the following question on the #blendercoders IRC but was advised to send it here.</p>
<p><em>Context</em>: I am currently working on a modified version of Cycles, in which the user have control over how light paths behave: they are able to transport/move rays hitting a specific surface to another one.</p>
<p>Such a modification implies that during the path tracing process, <strong>some paths/samples must be discarded</strong> (to do that I simply don&#39;t add their contribution to the final image, in kernel_path.h/kernel_path_<wbr>trace()).</p>
<p>It means some pixels are downsampled since some of their samples might be discarded, however Cycles still divides for each pixel the total contribution by <em>the total number of samples</em> which is assumed to be constant over the entire image.</p>
<p>Hence my question: is there a simple way to make this last operation (averaging pixel samples) rely on a local number of samples, for each pixel, rather than a constant amount of samples for the entire image?</p>
<p>I hope this is the right place to ask such a question, and that some of you will have an answer.</p>
<p>Regards.</p><span class="HOEnZb"><font color="#888888">
<div>-- <br>
<p id="m_-7509738023783480948signature" style="font-size:smaller;color:595959"><span style="font-weight:bold">Lucas Escot</span><br>L3 Informatique Fondamentale<br><span style="font-weight:bold">ENS de Lyon</span><br><span>Telephone: 06 88 62 63 86</span></p>
</div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="https://lists.blender.org/mailman/listinfo/bf-cycles" rel="noreferrer" target="_blank">https://lists.blender.org/<wbr>mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br></div>