WARNING : This site is outdated and the PopcornFX team will no longer answer your questions here.
For all support questions please go to our Discord server
0 like 0 dislike
Hello Persistant

I'm creating some UI elements using your plugin in Unity. The problem I encountered is that some elements sometimes render behind game elements/geometry.

Is there a way to force particles to render over everything (not write depth?)

by zaknafein (1.2k points)

1 Answer

0 like 0 dislike
Hi zaknafein,

It really depends on your materials in Unity and where the native rendering is inserted (http://wiki.popcornfx.com/index.php/Menus#Insert_Native_Rendering).

That global setting will determine whether particles are drawn behind or in front of transparent materials.
by Raphael (10.6k points)
It seems to have worked >almost< every time, so we're getting somewhere!
The problem we have is on some machines in our studio upon changing the Native Rendering option popcorn rendering seems to be disabled completely.
I made an empty scene, removed the sky (to clear color) and upon flicking this option back and forth particles either display or not.
There doesn't seem to be anything out of ordinary in PopcornFx log, but I'm more than happy to send it if you wish.
Have you ever had any problems like that ?
That sounds like a bug with Unity's command buffers. On certain platforms, with some graphics API, the native calls are discarded when there's no skybox.  
This was supposedly fixed on Unity's side, but maybe you encountered another corner case not covered by the fix.
I have the same issue when skybox is present in a "vanilla" empty scene.
I have popcornFx camera (created using your right click menu) and a VFX using the right click menu too (any VFX I made before).
All the settings are default except native rendering.
What graphics API are you in? I can't seem to reproduce the issue in DX11.
Ok, so there's a lot of issues across the board. PCs with Oculus Rift camera are rendering particles in a different order than the ones without. Additive meshes are rendering always "on top" on an Android device, but are rendered correctly on a PC (with and without oculus camera)...
API we're working in are Android and android package on a device.
As a side note :
A while back with had a problem with HasPostFx tickbox on the camera, which behaves differently on PC machines with Android setting, depending on whether the user was using oculus rift to look around the scene or not.

What platforms are you actually supporting with the plugin and how new would Unity has to be to be stable and render reliably?

I'm using 5.4.0p2 - GVR6 version of Unity
Android SDK - 6.x (N) - API Level 24
OK, so there must be several factors at play, here.

First about the render order discrepancy on PC with or without Oculus, this shouldn't happen as far as I'm aware. We'd really appreciate if you could send us a minimalist repro project showcasing the issue.  

Now about the "always on top additive meshes" issue on Android. This may be a bug in our GLES implementation, we'll investigate. If you could provide us with screenshots of the result and the expected result, that would help greatly.  

The "HasPostFx" checkbox is actually a workaround for DirectX' texture mapping's origin being top-left instead of OpenGL's bottom-left (as documented here : http://wiki.popcornfx.com/index.php/PKFxRenderingPlugin_component#HasPostFx), so it has no effect on Android.

We actually support the platforms/graphics API combinations described in the table I linked earlier.  
VR-specific bugs encountered with Unity's native VR support are most likely on Unity's part and come from discrepancies in their implementations of said native VR support and the the aforementioned command buffers' native plugin interface.  

Edit : Oh, and the plugin should be full-featured full-support from Unity 5.2 on. unfortunately we're not exempt from regressions due to Unity's changes and it might be worthwhile reporting those to them.
Thanks for your reply. I have just emailed popcorn support with a repro package. I'll provide you with the repro of oculus/PC camera transparency issue asap.