<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, "Brecht Van Lommel" <<a href="mailto:brechtvanlommel@pandora.be">brechtvanlommel@pandora.be</a>> 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's great behavior but<br>
because it'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't know<br>
beforehand that we are going to hit an emitting surface, and so we<br>
don't know if it's a "shadow ray".<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'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 <<a href="mailto:bassam@urchn.org">bassam@urchn.org</a>> wrote:<br>
> Hey folks, I've constructed an artificial example here to illustrate the<br>
> issue.<br>
> I've got a plane (named selective) that has transparent shader and a mix<br>
> node with Light Path 'Is Shadow Ray' as input to factor. The idea is<br>
> that the shadows would be colored one color, but e.g. diffuse and glossy<br>
> reflections with another.<br>
><br>
> This is being lit with a mesh cube and an emission shader.<br>
><br>
> If 'Sample as lamp' is on on the Cube emission shader, the result is a<br>
> yellow transparent plane, with a blue shadow.<br>
><br>
> If 'Sample as lamp' is off on the Cube emission shader, the result is a<br>
> yellow transparent plane, with a yellow shadow.<br>
><br>
> Is this quirk a normal result? I realize that transparent shader is<br>
> somehow 'fake' - or is it a bug?<br>
><br>
> blend file <a href="http://urchn.org/misc/test.blend" target="_blank">http://urchn.org/misc/test.blend</a><br>
> image1 <a href="http://urchn.org/misc/sample_aslamp.png" target="_blank">http://urchn.org/misc/sample_aslamp.png</a><br>
> image2 <a href="http://urchn.org/misc/nosampleaslamp.png" target="_blank">http://urchn.org/misc/nosampleaslamp.png</a><br>
><br>
> cheers<br>
> Bassam<br>
><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>
_______________________________________________<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>