<p>Are there any inherent pros/cons of leaving sample as lamp on for every material? If there are cons, why is it enabled by default and not just when you make an emissive material? </p>
<div class="gmail_quote">On Nov 13, 2012 4:54 PM, &quot;Brecht Van Lommel&quot; &lt;<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>&gt; wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I would not call this a bug, not because it&#39;s great behavior but<br>
because it&#39;s part of an important optimization.<br>
<br>
When sample as lamp is disabled, what happens is that rays just bounce<br>
around based on the BSDF, and when they happen to hit a an emitter,<br>
then that illuminates the surface. In this case we don&#39;t know<br>
beforehand that we are going to hit an emitting surface, and so we<br>
don&#39;t know if it&#39;s a &quot;shadow ray&quot;.<br>
<br>
With samples as lamp enabled, that same type of bouncing still happen.<br>
But in addition we now pick a points on emitting surfaces and trace<br>
shadow rays directly to it, which helps finding small emitting<br>
surfaces. In this case we know it&#39;s a shadow ray, and so the ray is<br>
tagged as such.<br>
<br>
The solution would involve executing shaders twice to distinguish<br>
between these two cases, so not ideal.<br>
<br>
Brecht.<br>
<br>
On Tue, Nov 13, 2012 at 10:01 PM, Bassam Kurdali &lt;<a href="mailto:bassam@urchn.org">bassam@urchn.org</a>&gt; wrote:<br>
&gt; Hey folks, I&#39;ve constructed an artificial example here to illustrate the<br>
&gt; issue.<br>
&gt; I&#39;ve got a plane (named selective) that has transparent shader and a mix<br>
&gt; node with Light Path &#39;Is Shadow Ray&#39; as input to factor. The idea is<br>
&gt; that the shadows would be colored one color, but e.g. diffuse and glossy<br>
&gt; reflections with another.<br>
&gt;<br>
&gt; This is being lit with a mesh cube and an emission shader.<br>
&gt;<br>
&gt; If &#39;Sample as lamp&#39; is on on the Cube emission shader, the result is a<br>
&gt; yellow transparent plane, with a blue shadow.<br>
&gt;<br>
&gt; If &#39;Sample as lamp&#39; is off on the Cube emission shader, the result is a<br>
&gt; yellow transparent plane, with a yellow shadow.<br>
&gt;<br>
&gt; Is this quirk a normal result? I realize that transparent shader is<br>
&gt; somehow &#39;fake&#39; - or is it a bug?<br>
&gt;<br>
&gt; blend file <a href="http://urchn.org/misc/test.blend" target="_blank">http://urchn.org/misc/test.blend</a><br>
&gt; image1 <a href="http://urchn.org/misc/sample_aslamp.png" target="_blank">http://urchn.org/misc/sample_aslamp.png</a><br>
&gt; image2 <a href="http://urchn.org/misc/nosampleaslamp.png" target="_blank">http://urchn.org/misc/nosampleaslamp.png</a><br>
&gt;<br>
&gt; cheers<br>
&gt; Bassam<br>
&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>
</blockquote></div>