<div dir="ltr"><div>If this can be handled by a hybrid Emission/Diffuse shader than it can also be used for animated scenes which use baked assets for the background objects without the need for compositing.  <br><br></div><div>I think this problem is mostly the same for cg scenes that use some baked assets and scenes that mix cg with real camera footage. <br><br>A BSDF which mostly has the characteristics of an Emission shader but which can receive shadows without self-shadowing will solve both problems without introducing multi-stage compositing hassles.<br><br></div><div>With a pure white sky (1.0, 1.0, 1.0) and materials that are also set to (1.0, 1.0, 1.0), we almost have a shadow catcher without any compositing at all.  The only problem with the following image is that the background self-shadows when it should only receive them.  Otherwise it would be pure white everywhere but for the monkey&#39;s shadow.<br><br><img alt="Inline image 1" src="cid:ii_14b7f488adc2ea66" height="273" width="481"><br></div><div>(i)  The BSDF should be unaffected by the scene lighting color/intensity just as an Emission shader would be<br></div><div>(ii)  It should also exclude self-shadowing the same with an Emission shader.<br></div><div>(iii) It just has to accept shadows the way a Diffuse shader would.  This could offer a fairly substantial performance increase over standard Diffuse BSDF since at least two major factors of the lighting calculations are being excluded.<br></div><div><br></div><div><br><br></div><div>As a compositing option I think the following works but the main CG elements may have to be tagged somehow so they would not appear in one of the two required render passes.  <br></div><div><br></div><div>One pass has all the objects and the other pass has only the background which will catch the shadow(both passes are rendered pure white for everything).  The second pass has it&#39;s color inverted and is mixed with the first using &#39;Color Burn&#39;(in PS 7.0)<br><br></div><div><br><img alt="Inline image 2" src="cid:ii_14b7f4bb7960d691" height="310" width="561"><br><br></div><div><br></div><div><br><br></div><div><br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 11, 2015 at 11:01 PM, Sergey Sharybin <span dir="ltr">&lt;<a href="mailto:sergey.vfx@gmail.com" target="_blank">sergey.vfx@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"><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"><div><div class="h5"><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" target="_blank">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></div></div><span class="HOEnZb"><font color="#888888">-- <br><div><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</font></span></div>
<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></blockquote></div><br></div>