0 like 0 dislike


We're having some difficulty combining Popcornfx effects with Image Effects affecting our scene.

Preview Image: https://drive.google.com/open?id=0B8mdG_h56p1GSjh0LV9FSjZ0NlE

There's 3 main things on the scene: character meshes, UI and popcornfx effects.

We have 2 seperate cameras, one that renders UI, and the other one that renders everything else and has popcornfx renderer and some image effects such as AO, dof and bloom.

Popcornfx Preferences are set to "Before Image Effect Opaque". 

The problem is that the image effects( like AO in the preview image) are coming through the popcornfx (orange shield mesh that is supposed to be solid). Same thing happens with billboard rendered particles.

Turning on soft particles for billboards didn't help.

We also tried setting Popcornfx preferences to "Before Image Effect". This fixes the image effects coming through, but creates another problem. and that is that all popcornfx effects appear in front of all meshes, like they are a sticker on a screen, so when I look at the shield that's in front of another mesh, I can still see the shield through him.

So far, none of these options are working for us, so we need another solution.

Tested on Linux, Windows 8, Windows 10. All 64 bit. Unity 5.3.4. Popcornfx

by Zheljka (720 points)

1 Answer

2 like 0 dislike
Best answer

Hello Zheljka,

So the cause of your problem is that the image effect "breaks" the depth buffer and it is then impossible to use it to cull the particles that are behind your meshes if you choose to render the particles in the "Before Image Effect" pass.

The way you can fix that is by setting all your materials in your particle effects to "Soft". The rendering "Before Image Effect" should then work properly because it will copy the depth buffer before it gets corrupted by your image effect. The problem with this technique is that all your particles will be soft, but you can always tweak the "softness distance" to get the rendering you like.

We are currently thinking about having a system to be able to render non-soft particles using the copied depth buffer, but this feature is not high in our priority list.

As a reference, here is the Unity rendering pipeline for the PopcornFx plugin:


Hope this helps!

EDIT: To apply post-effects with DX11, you can now follow this wiki page

by Paul (8k points)
So you are saying that you can still see the AO on top of the billboards when you switch to "Before Image Effect" with soft particles? But in your first Question, you said that the AO was not rendered on top when setting the native rendering to this... I am a little bit confused, maybe there is something that I don't understand.

Normally, to make it work:
  - Switch the native rendering to "Before Image Effect"
  - Change your billboard effects to "Soft" materials
  - Activate the soft particles on the camera
  - If you don't want particles too soft, change the softness distance to match the rendering you need

The main issue with this solution is that you mesh particles will still be rendered on top of your geometry.
Out native rendering was set to Before Image Effect Opaque.
Setting it to Before Image Effect now helps for billboard particles. Thank you.
I hope we can have the same for meshes too soon.
We'll see what we can do to make it work in a more robust way for all kind of particles, I will keep you informed.
You can also switch to DirectX 9, tha AO does not break the depth buffer when using the DX9 graphic API.
Also, I just noticed... The SoftnessDistance works on billboard particles, but not on ribbon.