<p dir="auto">I have created a small piece of code in <a href="http://jsfiddle.net/grr308Lx/12/" rel="nofollow">http://jsfiddle.net/grr308Lx/12/</a> which is based on post(<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="6675013" data-permission-text="Title is private" data-url="https://github.com/mrdoob/three.js/issues/2386" data-hovercard-type="issue" data-hovercard-url="/mrdoob/three.js/issues/2386/hovercard" href="https://github.com/mrdoob/three.js/issues/2386">#2386</a>)</p>
<p dir="auto">No matter how I change the renderDepth of the blue and red cube, the red one is always behind the blue one.</p>
<p dir="auto">I've spent a couple days working on this issue with no result.<br>
I tried to get a jsFiddle together but couldn't get dat.gui to integrate with it in order to demonstrate changing these values with no effect.</p>
<p dir="auto">But the simple fact is:<br>
With a WebGLRenderer and PerspectiveCamera, any attempt at altering sorting does nothing.<br>
I even tried hacking three.js at one point to introduce a custom sort, but apparently, it's overridden or ignored.</p>
<p dir="auto">The sample I used is as follows:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="var gui = new dat.GUI();
var folder = gui.addFolder(&quot;renderDepth&quot;);

var R = new THREE.Mesh( new THREE.BoxGeometry(50, 50, 50), new THREE.MeshPhongMaterial({color:0xFF0000}) );
R.position.set(-10,-10,-10);
R.renderDepth = 3;
folder.add(R,&quot;renderDepth&quot;).min(0).max(1000).step(1).name(&quot;Red&quot;).listen();
scene.add(R);

var G = new THREE.Mesh( new THREE.BoxGeometry(50, 50, 50), new THREE.MeshPhongMaterial({color:0x00FF00}) );
G.renderDepth = 2;
folder.add(G,&quot;renderDepth&quot;).min(0).max(1000).step(1).name(&quot;Green&quot;).listen();
scene.add(G);

var B = new THREE.Mesh( new THREE.BoxGeometry(50, 50, 50), new THREE.MeshPhongMaterial({color:0x0000FF}) );
B.position.set(+10,+10,+10);
B.renderDepth = 1;
folder.add(B,&quot;renderDepth&quot;).min(0).max(1000).step(1).name(&quot;Blue&quot;).listen();
scene.add(B);

folder.open();"><pre class="notranslate"><span class="pl-k">var</span> <span class="pl-s1">gui</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-s1">dat</span><span class="pl-kos">.</span><span class="pl-c1">GUI</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-k">var</span> <span class="pl-s1">folder</span> <span class="pl-c1">=</span> <span class="pl-s1">gui</span><span class="pl-kos">.</span><span class="pl-en">addFolder</span><span class="pl-kos">(</span><span class="pl-s">"renderDepth"</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">R</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">Mesh</span><span class="pl-kos">(</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">BoxGeometry</span><span class="pl-kos">(</span><span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshPhongMaterial</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">color</span>:<span class="pl-c1">0xFF0000</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">R</span><span class="pl-kos">.</span><span class="pl-c1">position</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-c1">-</span><span class="pl-c1">10</span><span class="pl-kos">,</span><span class="pl-c1">-</span><span class="pl-c1">10</span><span class="pl-kos">,</span><span class="pl-c1">-</span><span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">R</span><span class="pl-kos">.</span><span class="pl-c1">renderDepth</span> <span class="pl-c1">=</span> <span class="pl-c1">3</span><span class="pl-kos">;</span>
<span class="pl-s1">folder</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">R</span><span class="pl-kos">,</span><span class="pl-s">"renderDepth"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">min</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">max</span><span class="pl-kos">(</span><span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-s">"Red"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">scene</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">R</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">G</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">Mesh</span><span class="pl-kos">(</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">BoxGeometry</span><span class="pl-kos">(</span><span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshPhongMaterial</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">color</span>:<span class="pl-c1">0x00FF00</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">G</span><span class="pl-kos">.</span><span class="pl-c1">renderDepth</span> <span class="pl-c1">=</span> <span class="pl-c1">2</span><span class="pl-kos">;</span>
<span class="pl-s1">folder</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">G</span><span class="pl-kos">,</span><span class="pl-s">"renderDepth"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">min</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">max</span><span class="pl-kos">(</span><span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-s">"Green"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">scene</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">G</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-k">var</span> <span class="pl-v">B</span> <span class="pl-c1">=</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">Mesh</span><span class="pl-kos">(</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">BoxGeometry</span><span class="pl-kos">(</span><span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">,</span> <span class="pl-c1">50</span><span class="pl-kos">)</span><span class="pl-kos">,</span> <span class="pl-k">new</span> <span class="pl-c1">THREE</span><span class="pl-kos">.</span><span class="pl-c1">MeshPhongMaterial</span><span class="pl-kos">(</span><span class="pl-kos">{</span><span class="pl-c1">color</span>:<span class="pl-c1">0x0000FF</span><span class="pl-kos">}</span><span class="pl-kos">)</span> <span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">B</span><span class="pl-kos">.</span><span class="pl-c1">position</span><span class="pl-kos">.</span><span class="pl-en">set</span><span class="pl-kos">(</span><span class="pl-c1">+</span><span class="pl-c1">10</span><span class="pl-kos">,</span><span class="pl-c1">+</span><span class="pl-c1">10</span><span class="pl-kos">,</span><span class="pl-c1">+</span><span class="pl-c1">10</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-v">B</span><span class="pl-kos">.</span><span class="pl-c1">renderDepth</span> <span class="pl-c1">=</span> <span class="pl-c1">1</span><span class="pl-kos">;</span>
<span class="pl-s1">folder</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">B</span><span class="pl-kos">,</span><span class="pl-s">"renderDepth"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">min</span><span class="pl-kos">(</span><span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">max</span><span class="pl-kos">(</span><span class="pl-c1">1000</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">step</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">name</span><span class="pl-kos">(</span><span class="pl-s">"Blue"</span><span class="pl-kos">)</span><span class="pl-kos">.</span><span class="pl-en">listen</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-s1">scene</span><span class="pl-kos">.</span><span class="pl-en">add</span><span class="pl-kos">(</span><span class="pl-v">B</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-s1">folder</span><span class="pl-kos">.</span><span class="pl-en">open</span><span class="pl-kos">(</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">I also noticed that very few pertinent questions on StackOverflow were answered and so I'm hoping this is enough of a bug to post this here.</p>