<div dir="ltr">Hi,<div><br></div><div>First of all it is to be defined what exactly &quot;shadow catcher&quot; is and how it fits into VFX workflow. Is it approach to BSDF shading or is it a render pass? Or maybe just more advanced light path/visibility control in the material? Strictly defining what exactly our goal is the best first step IMO.</div><div><br></div><div>Now, as for the approach: differential rendering is the only way to get proper shadows as far as i concerned. The only thing is you need to do it without extending render times by the factor of 2. The problem you mentioned i&#39;m not really sure. Of course material used to catch the shadow is important, you wouldn&#39;t want to use magenta material to get shadows for the light gray material (unless it&#39;s artistic decision).</div><div><br></div><div>If you&#39;re asking which heuristics are possible to achieve faster differential rendering -- you&#39;ll need to have a research on this i&#39;m afraid.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 11, 2015 at 11:59 PM, Lukas Stockner <span dir="ltr">&lt;<a href="mailto:lukas.stockner@freenet.de" target="_blank">lukas.stockner@freenet.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
I&#39;ve been trying out how to implement a shadow catcher in Cycles, but<br>
apparently there are many different approaches.<br>
<br>
My current idea is: At the point being shaded, evaluate the direct<br>
light, but also separately accumulate the contribution of lights without<br>
considering occlusion (the shadow_blocked check). Then, a shadow ratio<br>
can be calculated from &quot;L_regular / L_no_occlusion&quot;. The shadow ratio is<br>
then used in a Holdout-like setup to set alpha and terminate the ray.<br>
For non-camera rays a diffuse BSDF is generated, but that could easily<br>
solved by adding a BSDF input to the shadow catcher node which allows to<br>
set a non-camera BSDF. By using an AlphaOver in the compositor, this can<br>
be easily combined with a suitable background.<br>
There are two problems with this approach: First of all, it doesn&#39;t<br>
consider indirect lighting such as caustics or, which is more important,<br>
diffuse light. Therefore, the area around objects on the shadow catcher<br>
looks slightly darker than it should look. And secondly, the standard<br>
implementation &quot;calculate both values, divide, set alpha&quot; inside the<br>
shader doesn&#39;t work, because both values must be accumulated separately.<br>
This could be implemented as an auxiliary internal pass, though, so that<br>
the division is performed in the buffer code. Still, not as nice and<br>
clean as I had hoped for.<br>
<br>
Another approach is<br>
<a href="http://www.pauldebevec.com/Research/IBL/debevec-siggraph98.pdf" target="_blank">http://www.pauldebevec.com/Research/IBL/debevec-siggraph98.pdf</a>, which<br>
basically works with a difference. However, as far as I see, that needs<br>
a really precise and accurate scene (for example, in the page 9 example,<br>
a wrong color for the plane would instantly give weird-colored shadows).<br>
Also, it produces negative colors in the difference image, which will<br>
probably cause havoc in the compositor.<br>
<br>
So, my question would be: Are there any approaches that might work<br>
better? Am I overlooking something? If not, would one of these<br>
approaches be useful?<br>
Any input is most appreciated :)<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><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</div>