Unity3D: Drawing particles after AA resolve for performance

↘锁芯ラ 提交于 2019-12-06 07:49:12

问题


I'm trying to gauge the effect of MSAA on scenes with lots of particles in Unity.

To do that, I'd need to:

  1. Draw all non-particle objects in the scene with 8x MSAA

  2. Use the resolved depth buffer from the previous pass to render all the non-occluded particle systems onto a smaller render target.

  3. Alpha Blend the color buffer of (2) with (1)

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.

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).

(This was originally posted on the Unity forums, but I didn't get any reply. Hopefully, SO will help!)

I did checkout the "high speed off screen particles in unity" articles (on the same topic - some of the important links in it don't work anymore x(

来源:https://stackoverflow.com/questions/22653093/unity3d-drawing-particles-after-aa-resolve-for-performance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!