<p dir="auto">Hi!</p>
<p dir="auto">I've run into issue when trying to use shadows in my scene that is rendered into two separate viewports (separate scenes, based on <a href="http://mrdoob.github.io/three.js/examples/webgl_multiple_views.html" rel="nofollow">http://mrdoob.github.io/three.js/examples/webgl_multiple_views.html</a>). The moment I enable shadowing, shadow map (used only in one scene, one viewport) is corrupted. Please see the image attached. There is only one shadow receiver in the screenshot and no object casting shadows, yet, parts of the ground are suggested as in shadow. When I remove renderer.enableScissorTest(true), shadows are ok (but I lose my other viewport rendering of course).</p>
<p dir="auto">Can this be done with some workaround?</p>
<p dir="auto">three.js r58, win7, latest google chrome, latest firefox</p>
<p dir="auto">Great library btw! Keep up the good work and thanks for any advice!<br>
Regards,<br>
Boris Zapotocky</p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/7320380df741b280a6333b8d6d8fde93ca132d1d68a18d947631e2c4c01b8057/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333634373835342f3539303834352f61643762613530302d633966312d313165322d386265302d6136393562623361393662372e706e67"><img src="https://camo.githubusercontent.com/7320380df741b280a6333b8d6d8fde93ca132d1d68a18d947631e2c4c01b8057/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333634373835342f3539303834352f61643762613530302d633966312d313165322d386265302d6136393562623361393662372e706e67" alt="bug_shadow" data-canonical-src="https://f.cloud.github.com/assets/3647854/590845/ad7ba500-c9f1-11e2-8be0-a695bb3a96b7.png" style="max-width: 100%;"></a></p>
<p dir="auto"><a target="_blank" rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/0389d22f5792aba1141069f6c5a46161655e720f75a045f34261e81e44a46197/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333634373835342f3539303834342f61643731643932362d633966312d313165322d393730392d6535323063333831353132612e706e67"><img src="https://camo.githubusercontent.com/0389d22f5792aba1141069f6c5a46161655e720f75a045f34261e81e44a46197/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f333634373835342f3539303834342f61643731643932362d633966312d313165322d393730392d6535323063333831353132612e706e67" alt="bug_shadow_noscissor" data-canonical-src="https://f.cloud.github.com/assets/3647854/590844/ad71d926-c9f1-11e2-9709-e520c381512a.png" style="max-width: 100%;"></a></p>
<p dir="auto">Hi,<br>
first of all I love the three.js framework and so I have play arround with it and found something strange and want to know if this is "by design" or if this shouldn't be the case.</p>
<p dir="auto">You can use te same scene object in multiple CanvasRenderer instances, but not in multiple WebGLRenderer instance.<br>
So for WebGLRenderer you need a dedicated scene for each WebGLRenderer instance.</p>
<p dir="auto">Example render which is NOT working with WebGLRenderer:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function render() {
    mesh1.rotation.x += 0.01;
    mesh1.rotation.y += 0.02;
    renderer1.render(scene1, camera1);
    renderer2.render(scene1, camera1);
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">mesh1</span><span class="pl-kos">.</span><span class="pl-c1">rotation</span><span class="pl-kos">.</span><span class="pl-c1">x</span> <span class="pl-c1">+=</span> <span class="pl-c1">0.01</span><span class="pl-kos">;</span>
    <span class="pl-s1">mesh1</span><span class="pl-kos">.</span><span class="pl-c1">rotation</span><span class="pl-kos">.</span><span class="pl-c1">y</span> <span class="pl-c1">+=</span> <span class="pl-c1">0.02</span><span class="pl-kos">;</span>
    <span class="pl-s1">renderer1</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">scene1</span><span class="pl-kos">,</span> <span class="pl-s1">camera1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">renderer2</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">scene1</span><span class="pl-kos">,</span> <span class="pl-s1">camera1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">Example render which is working with WebGLRenderer:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="function render() {
    mesh1.rotation.x += 0.01;
    mesh1.rotation.y += 0.02;
    renderer1.render(scene1, camera1);
    renderer2.render(scene2, camera1);
}"><pre class="notranslate"><span class="pl-k">function</span> <span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-kos">)</span> <span class="pl-kos">{</span>
    <span class="pl-s1">mesh1</span><span class="pl-kos">.</span><span class="pl-c1">rotation</span><span class="pl-kos">.</span><span class="pl-c1">x</span> <span class="pl-c1">+=</span> <span class="pl-c1">0.01</span><span class="pl-kos">;</span>
    <span class="pl-s1">mesh1</span><span class="pl-kos">.</span><span class="pl-c1">rotation</span><span class="pl-kos">.</span><span class="pl-c1">y</span> <span class="pl-c1">+=</span> <span class="pl-c1">0.02</span><span class="pl-kos">;</span>
    <span class="pl-s1">renderer1</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">scene1</span><span class="pl-kos">,</span> <span class="pl-s1">camera1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
    <span class="pl-s1">renderer2</span><span class="pl-kos">.</span><span class="pl-en">render</span><span class="pl-kos">(</span><span class="pl-s1">scene2</span><span class="pl-kos">,</span> <span class="pl-s1">camera1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>
<p dir="auto">As I mention both examples are working fine with the CanvasRenderer, it also doesn't matter if I use the same camera or different ones.</p>
<p dir="auto">Thanks for confirmation and Greetings,</p>
<ul dir="auto">
<li>Markus B.</li>
</ul>