1 Reply Latest reply on May 28, 2009 2:36 AM by SharsnikMcFly

    Rendering - need for speed

    SharsnikMcFly

      I was wondering what the best practices for rendering are. I need to be able to use a shader to render objects, but after that they can be static (for the most part). From what I know, the best technique depends on the amount the object is moving around, so.. let me give some examples.

       

      No rotation, lots of translation - bitmap.

      Rotation, low translation - Shape/Sprite? (Are these different?)

      High rotation/translation - Shape/Sprite (though this is painful regardless)

       

      However, using the shader as a shape's filter is completely out of the question. Not only does it not account for rotation, but it completely kills FPS (30+ rotating objects brings it to a hault). One other thing I can think of off the top of my head is using a single shader to render the entire background by passing in multiple bitmaps with translations. However, without the use of loops in Hydra, this seems a bit over the top.

       

      Also, are vector graphics different than Shape/Sprites? I can take a image in flash and turn it into a Shape, so I assume that's all bitmap oriented stuff... are pure vector graphics an improvement?

       

      Finally, if I use a bitmapFill on a Shape, or even a vector object, does the resulting image behavior lieka  bitmap, or a Shape?

        • 1. Re: Rendering - need for speed
          SharsnikMcFly Level 1

          I did some tests and got the following results.

           

          I measured the number of 100x100 Sprites/Bitmap on screen at the point the app hit 50 FPS... not incredibly accurate, but you get the point.

           

          50FPS at:

           

          sprite / translation - 534

          sprite / rotation - 590

          bitmap / translation - 550

          bitmap / rotation - 40

           

          With shader applied (Writes to bitmap, uses filter for sprite)

          sprite / translation - 510

          sprite / rotation -  <10

          bitmap / translation - 520

          bitmap / rotation - 40

           

          Using a single movie clip as a parent, and moving only that clip, not the indivual graphics

          bitmap / translation - 790

          bitmap / rotation - 90

          sprite / translation - 650

          sprite / rotation - <10

           

          Do these number seem about right?

          I've seen flash movies with several thousand sprites, which might be doable by say copying the original data to single bitmap, or soemthing.

           

          Again, if anyone has advice/wisdom, I'd like to hear it.