Search code examples
actionscript-3away3d

Away3D with Starling


I have an Away3D 4.0 application with UI made in old flash display API, which can be only partly hardware accelerated.

On PC works fine, but the frame rate of UI on mobile devices is too low, hence I am porting it to Starling.

So I tried using both Away3D and Starling, but they don't work together (it compiles but there are run-time errors). What do I have to change? Specifically or generally for maybe another 2D library such as ND2D. Are there libraries that support this out of the box?

Edit: First I add an Away3D content and there are no errors. When initialising Starling, the error is in Starling.as (a library class) on line 249. I also tried this as someone suggested, but didn't make any difference (also information is 3 months old and libraries are being updated).

Edit 2: The error was caused by having a different enableDepthAndStencil value as is in Away3D, which is hardcoded in Sparling as false, because it doesn't really need it. Well, after "fixing" this there are no runtime errors: Away 3D content displays, but then I add Starling and the canvas becomes black. I guess I will have to dive into the Away3D source.


Solution

  • I got it working by following instructions in this comment and the one afterwards (additionally only had to change enableDepthAndStencil to true in Starling.as in updateViewPort()).