[Papervision3D] Rasterizing in AS3 with ByteArray

jakelewis jakelewis at blueyonder.co.uk
Sun Jan 7 12:03:24 EST 2007


Are the Projection/ScreenDrawing ratios you claim based on full screen? The
projection times are dependant solely on the number of vertices / triangles,
whilst the screendrawing, I assume, is dependant mostly on the movie screen
size, (with a small overhead per triangle and per rasterline of each
triangle).

>>but the results are hindered by the screen drawing routines, which
obviously haven't changed much from Flash 8.
This suggests to me that the screen drawing routines are handled natively
(c++), as this would be unaffected by the improvements made migrating from
as2 to as3. I don't feel we'll be able to get anywhere close to the c++
performance with an AS3 implementation.
It would however improve quality as it would allow expansion to true
perspective correction, zbuffering, gourad lighting etc. Andre Michele ( see
my earlier posting) has been down this route.

I'm surprised that the line and circle drawing would not be implemented
native as well though. The fact that Didier at ByteArray.org surpassed the
Flash player benchmarks suggest that perhaps it is implemented in AS.
Perhaps porting his code to AS2 and running on Flash8 player would be
revealing - a small decrease in performance ( due to his calling code being
in AS2) would suggest that the graphics methods are native, a large decrease
would suggest that the graphics methods are in ActionScript too.




  -----Original Message-----
  From: Papervision3D-bounces at osflash.org
[mailto:Papervision3D-bounces at osflash.org]On Behalf Of Carlos Ulloa
  Sent: Sunday, January 07, 2007 6:41 AM
  To: Papervision3D at osflash.org
  Subject: Re: [Papervision3D] Rasterizing in AS3 with ByteArray


  Very interesting.

  And it actually doesn't use ByteArray :)

  For the lines, it uses good old setPixel, and for the triangles, it uses
fillRect. This shows how incredibly slow the Graphics api is. It also shows
how fast AS3 is, executing so much code per pixel and still rendering faster
than the player itself. I would like to see their examples with
quality="LOW", though.

  I've been doing some performance tests recently as there has been some
changes in the projection code (the code that converts from 3D to 2D). After
spending hours working on 10 lines of code, you always want to measure your
results.

  I'm going to publish the benchmarks shortly, but just so you know, in a
typical AS2 scene 60% of time is consumed by the 3D code. The other 40% is
taken by Flash for drawing the screen.

  In AS3, the 3D calculations take less than 10% of the time per frame. The
other 90% is hijacked by Flash for screen drawing.

  Papervision3D AS3 code is more than 15x faster than its AS2 counterpart,
but the results are hindered by the screen drawing routines, which obviously
haven't changed much from Flash 8.

  Optimization of the 3D code is less important than finding a faster way of
drawing triangles. That's why this is so interesting. I would love to have
time to do some tests with this. I would say that ByteArray is got to be
faster than doing setPixel one by one. But with Flash you never know.

  C4RL05
  // noventaynueve.com
  // papervision3d.org




  On 07/01/07, ricardo cabello ~ mr.doob <info at mrdoob.com> wrote:
    Just so you know... it's now opensource and it includes a poly raster.
    http://www.bytearray.org/?p=67

    --
    Ricardo Cabello ~ Mr.doob
    Designer + Developer

    Web: http://mrdoob.com
    RSS feed: http://mrdoob.com/rss.php
    Skype: r0802


    Carlos Ulloa wrote:
    > http://www.bytearray.org
    >
    > This guy has written a rasterizer class using ByteArray that seems to
    > be a lot faster than the native Graphics class.
    >
    > The Graphics api is our bottle neck. Any efforts in this direction
    > would significantly increase render performance.
    >
    > Excellent news.
    >
    > C4RL05
    > // noventaynueve.com <http://noventaynueve.com >
    > // papervision3d.org <http://papervision3d.org>
    > ----------------------------------------------------------------------
--
    >
    > _______________________________________________
    > Papervision3D mailing list
    > Papervision3D at osflash.org
    > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
    >

    _______________________________________________
    Papervision3D mailing list
    Papervision3D at osflash.org
    http://osflash.org/mailman/listinfo/papervision3d_osflash.org


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070107/4da9a8ac/attachment.htm


More information about the Papervision3D mailing list