On Wed, Jul 10, 2013 at 9:38 AM, Carlos Rovira <carlosrov...@apache.org>wrote:

> Hi,
>
> from time to time people comes with the desire to see Flex running on
> Stage3D. I would want to recopile all the state of the art info about this
> topic and see if is possible and how much work it would require.
>
> I know people like J.Campos did two attempts and get valious research from
> that experience. There's things to get into account like accessibility.
>
> Please could people share in this thread the things they know in order to
> recopile all info? Is there some things to take into account that could
> make Stage3D not possible for Flex? Could we overpass it and make it
> possible? If it would be possible...it will brings real benefits?
>
> If some work is done in this topic, I'd propose to make focused in this
> particular thing and unlike FlexJS, here I will not try to break
> UIComponent in small parts, or  break compatibility. Even if it could be
> possible to have a global flag like "enableStage3D" to make our apps run on
> Stage3D if is true or remain in normal display layer, it could be great.
>
> Thanks in advance for any insight regarding this topic.
>
> Best
>
> Carlos
>


Carlos,

Thanks for bringing this topic back up.  I have been wanting to work with
FlexJS and hook up the view beads with Stage3D.  I have a decent idea how
to go about it, but havent had a chance to write real code.

On the flip side, if we want to hook up the Vanilla Flex SDK with Stage3D,
I think the better option would be to make use of Starling.  Here are a few
areas of concern and some ideas on how to tackle them.

*1) DisplayList*

Since Flex is closely tied with the concept of a display list, and since
Starling provides an abstraction layer on top of Stage3D with a concept of
display list, it will be easier to do it this way.  This post by Tinic Uro
explains this problem in detail [1]

*Approaches to solve the problem:*
I think the best way to approach this would be to start with a simple class
tree (ex. FlexSprite > UIComponent > SkinnableComponent > ButtonBase >
Button) and tried to render it on the GPU.  The crucial interface that
UIComponent implements is the IChildList.as.  Figuring out how to map a
display list to Starling display list is key.  [2]

*2) Vector vs. Bitmap rendering*
Once we figure out the displaylist paradigm, the next problem to solve
would be vector vs. bitmap drawing.  Stage3D and Starling concentrates
mostly on bitmap rendering.  It makes sense, because that is what the GPU
is best at.  Whereas, most times using Flex, we want to draw vectors.
 Resizable, vector (FXG, swf, etc.) based skins are used a lot in Flex.
 So, figuring out drawing vectors using Stage3D is key for Flex.

*Approaches to solve the problem:*
Good news is that there has been some progress in this regard [3]  I have
contacted the author of this project who has promised to open source the
code.  Not sure when that is going to happen, though :-)

*3) Font rendering, TLF, etc.*
Once specific use case of drawing vectors would be rendering of fonts and
more complicated typography.  Getting something as complicated as the TLF
library working on the GPU is going to take quite a bit of work.

*Approaches to solve the problem:*
Again, there has been some work in this area: [4]  The Firetype project
attempts at rendering fonts via the GPU.   Just getting the various aspects
of font rendering seems like a fun project :-)

*4) Accessibility*
Stage3D does not support any hooks to accessibility out of the box.

*Approaches to solve the problem:*
This is something we may have to solve using a combination of AS3 code and
use Externalnterface to handover accessibility to the browser.  On mobile,
we may have to write some ANEs to deal with this.  Of course, this approach
will cause performance issues.  So, we may want to enable this via a
compiler switch.

Overall, this is a solvable problem, but it requires some disciplined
architecture and a lot of coding + coffee :-)  As you mentioned, collecting
this kind of discussion summaries into a wiki page would be a great idea.

That said, jumping on the FlexJS bandwagon and use the redesign of Flex as
an opportunity to also render things using Stage3D is a great opportunity
for us.  Afterall, if FlexJS can be rendered using HTML/Javascript, of
course we can figure out a way to render it using Flash's own Stage3D.
 Every day FlexJS is progressing without us figuring out how to render it
on Stage3D is a great opportunity lost, IMO.

Thanks,
Om

[1] http://blog.kaourantin.net/?p=138
[2]
http://doc.starling-framework.org/core/starling/display/package-detail.html
[3] http://blog.bwhiting.co.uk/?p=423
[4] https://github.com/MaxDidIt/firetype

Reply via email to