My team and I really like the power of PopcornFX, and are hoping to use for our up coming game, but so far we've encountered a conflict with it rendering in front of geometry when we add the image effect SE Screen-Space Ambient Occlusion (SESSAO). We are also using deferred rendering in case that might be a factor.
From my initial debugging, I seem to have narrowed it down to two lines being called by the SESSAO script.
attachedCamera = this.GetComponent<Camera>();
attachedCamera.depthTextureMode |= DepthTextureMode.Depth;
attachedCamera.depthTextureMode |= DepthTextureMode.DepthNormals;
By changing the "depthTextureMode" to either Depth or DepthNormals, it seems to clear something being used by the PopcornFX Rendering Plugin and causes it to draw effects over top of the scene despite any three dimensional occlusion that would normally occur.
Is there by any chance something within the plugin that can be set to remedy this?
The following attempts have not yielded any results:
- Turned on the "Has Post FX" setting on the Rendering Plugin.
- Tried re-ordering script execution of the image effects within Unity.
Thank you for any help you can provide.
After a bit more research, it seems as though the problem occurs when SSAO is combined with specific shaders that change the renderQueue. In some shaders that set their "Queue = Geometery+501", some transparent PopcornFX ribbons are rendered in front of geometry. Below details my current setup, and how to replicate the issue.
Unity Version: 5.1.1f1
PopcornFX Rendering Plugin for windows: Build 22.214.171.124815 (current one available on the asset store)
Popcorn Editor: v126.96.36.199908
Here is how you can replicate the issue in a new project.
- Create new project.
- Import "PopcornFX Particle Effect Plugin (Windows Mac Linux) 2.5p1"
- Import "SSAO pro"
- Open scene "Sample_Teleporter".
- Add SSAO pro to the camera, and set the camera to “deferred”
- Add a default cube between the camera and the teleporter, and scale it so that it covers half the screen.
- Add another default cube and position it in the center of the screen between the camera and the previous cube. Then create/add a “standard” material to it and set its rendering mode to “Transparent” or “Fade”
- press play and move the "Transparent cube" in and out of the camera view to see the particles appear/disappear.
If required, I can also provide a test project I made that displays this issue.