Hi there!

I’m currently using the standard unity SSAO effect in my project. And of course I’m using particles as well. But in combination with SSAO this leads to really ugly artifacts!
Somehow the SSAO shines THROUGH the particles. Here two screenshots to show that:

With SSAO enabled:

alt text

But that should look more like this (WITHOUT SSAO):
alt text

Does anyone know how this problem can be solved?
I have already tried all provided material shader for particles, but it’s the same with any of them.

I think you need to render your particles through a different camera. The reason you’re getting artifacts is because SSAO is a post-process screen shader that take depth values into account. This means the AO shading is added at a later stage, after geometries (and your particles) are painted.

You should add another camera that have a larger depth than your main camera. This camera shouldnt have to clear anything and should only render a layer that you set your particles to use. You should also clear the particle layer from the main camera.

This way the scene (without particles) with SSAO is rendered first. Next, the scene will be rendered with only the particles added on top of your first pass. Think of it like layers in photo shop.

Since the suggested approach did not work entirely (I did not manage to get the proper depth-testing for the second camera), I now found a working solution. This works due to the new feature supported in 3.5: There you can tell via an attribute, that a certain PostscreenEffect has to be applied to opaque geometry only, which solves everything.

In my case I just opened the SSAO script and added the attribute above the OnRenderImage method, like this:

[ImageEffectOpaque]
void OnRenderImage (RenderTexture source, RenderTexture destination)