Announcements
The Scaleform forum is now read-only. Please head to the Gamedev site for product support.
Scaleform Forum (Read Only)
Scaleform enables developers to leverage the power of the Adobe® Flash® tool set to create powerful user interface environments for video games.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Scaleform vs Unity's transparant FX on mobile

4 REPLIES 4
Reply
Message 1 of 5
LightStriker
459 Views, 4 Replies

Scaleform vs Unity's transparant FX on mobile

We got a very weird bug with Scaleform on Unity on Android/iOS; transparant/additive FX that are very near the camera loses their transparancy.

 

It took us a while to pinpoint the issue... For some reason, Scaleform's shader is pushed to the rendering pipeline before the FX are done rendering and overwrite the FX's shader, and only on mobile.

 

It took us a while to find a workaround; we draw a single GUI character (GUI.Label) under our Scaleform HUD. From what we found, it's enough - the extra draw call after the 3D scene - to properly separate Scaleform from the scene's rendering.

 

It was a rather very annoying issue. Maybe one day it could be fixed directly in Scaleform?

4 REPLIES 4
Message 2 of 5
adam.petrone
in reply to: LightStriker

Hello LightStriker,

 

Are you seeing this behavior with the latest March release? We have done some work to mitigate this issue over previous builds. However, fixing the real issues are slated for a future update.

 

Thanks,

Adam

Message 3 of 5
LightStriker
in reply to: adam.petrone

We are currently using the latest (March) build, and while we did notice a reduction of the affected particles, it did not eliminated all of them. Particles nearest to the camera are still affected... sometimes. Right now, we think it's maybe related to the number of particules and their distance to the camera vs the rest of the scene.

We also got feedback from the QA today that our old "fix" of using GUI isn't fully working anymore on March build - was working properly on August build. With the GUI fix on March build, we have less than 1% of our particules losing their transparency.

Message 4 of 5
adam.petrone
in reply to: LightStriker

Do you have "24-bit Depth Buffer" enabled in Unity's player settings? If not, that could cause precision related issues on larger scenes.

 

I just tried this out in a very simple test scene. Particle System placed right in front of the camera and a SWF with transparent MovieClip.

It could be additional FX applied to the particles themselves, or stencil related FX in the scene. Perhaps something tripping up the render targets. When it loses the transparency, does it render to a black square?

 

Thanks for taking the time to investigate -- any additional information is welcome and appreciated. 

Message 5 of 5
LightStriker
in reply to: adam.petrone

It's a "black square" only because our particule's texture background is black. The part of the texture that is white (or other color) is still the same.

 

We debugged using XCode and got a snapshot of a problematic rendering frame and simply found that for some reason an opaque shader from Scaleform is pushed on the rendering queue before the scene is fully done rendering. The last one or last few draw calls ends up using the wrong shader. Usually, shaders are only pushed to the GPU when it's different from the one being currently used. So Unity wouldn't push a shader for each draw calls. It would have no way to know it sent draw calls while the GPU doesn't have the proper shader on its stack.

 

Maybe Unity flag the scene has being done rendering the moment it makes its last draw call, and not when the GPU claims it is done drawing. If so, Scaleform would start pushing its data too early.

 

The GUI "trick" was to postpone Scaleform's rendering just enough that the scene would properly finish doing its job. We could add more GUI element to postpone it even more, but frankly adding more draw call just to make a buffer between the scene and Scaleform is rather "dirty".

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report