title: Unity3D: Drawing particles after AA resolve for performance
body: <p>I'm trying to gauge the effect of MSAA on scenes with lots of particles in Unity.</p>
  
  <p>To do that, I'd need to: </p>
  
  <ol>
  <li><p>Draw all non-particle objects in the scene with 8x MSAA</p></li>
  <li><p>Use the resolved depth buffer from the previous pass to render all
  the non-occluded particle systems onto a smaller render target.</p></li>
  <li><p>Alpha Blend the color buffer of (2) with (1) </p></li>
  </ol>
  
  <p>I'm looking at the post-processing effects to get a sense of what i might need to do, but none of them use the depth buffer from a previous pass to affect the depth test of other objects in the scene (in this case, the particles). 
  They instead post-process the depth buffer as a whole and modulate the existing color buffer.</p>
  
  <p>Is is possible to do what I'm trying in Unity? I'm reading up on Replacement Shaders, but I'm wondering how I can pass one cameras' depth buffer to another camera (that renders the non-occluded particles to a non-msaa RT).</p>
  
  <p>(This was originally posted on the <a href="http://forum.unity3d.com/threads/236419-Draw-particles-after-AA-resolve" rel="nofollow">Unity forums</a>, but I didn't get any reply. Hopefully, SO will help!)</p>
  
  <p>I did checkout the <a href="http://technology.blurst.com/off-screen-particle-optimization/" rel="nofollow">"high speed off screen particles in unity"</a> articles (on the same topic - some of the important links in it don't work anymore x(</p>