7 Replies Latest reply on Jul 11, 2008 6:10 AM by Chunick

    Director's shortcomings?

    hwa-jun yu Level 1
      Sorry to have posted this question, it may seem exposing Director's inability in certain cases but I am just curious to know answers from senior fellow programmers.

      From my experiences, I found out that :
      1. Director can't scale sprites perfectly.
      I can't understand images become jaggy when we upscale it, but with Director, images also look jaggy when we downscale it at runtime. (change sprite's width and height directly)

      2. Director can't rotate well.
      The sprite will look awfully jaggy. (change sprite's rotation value)

      3. Director doesn't support Particle System
      Or is it I don't know the proper technique? I used copypixel to create 800 x 600 snow particles. They look good but performance dropped from normal 30 fps to poorly only 15.

      If there is some algorithm to outcome these problems, please let me know. That'll be very helpful in our upcoming projects. Again, with no intention to harshly criticize Director's creator, this is merely a question I've been wanting to ask for long.

      Thank you.
        • 1. Re: Director's shortcomings?
          UdoGre
          Hi Hwa-jun,

          You're right about points 1 and 2.

          About point 3: You don't draw your snow "on exitframe", do you? This would slow down a lot. If so, put the code in "on enterframe" instead and behold a mighty increase in speed.

          HTH,

          Udo
          • 2. Re: Director's shortcomings?
            Level 7
            When image quality is the issue, you should forget the normal sprite
            approach, and check imaging lingo.
            For resizing / rotating, you should use a virtual buffer, that is 2x or more
            the size of the output. You can e.g. perform any rotation (copypixel using
            quads) on a 2x virtual buffer, and then copy it to an image half it's size.
            As for the snow, though it could be done with sprites and object oriented
            coding, still using an image buffer should be preferable. An 8bit grayscale
            overlayed image with screen ink applied to it probably.

            "hwa-jun yu" <webforumsuser@macromedia.com> wrote in message
            news:g519h5$p5o$1@forums.macromedia.com...
            > Sorry to have posted this question, it may seem exposing Director's
            > inability
            > in certain cases but I am just curious to know answers from senior fellow
            > programmers.
            >
            > From my experiences, I found out that :
            > 1. Director can't scale sprites perfectly.
            > I can't understand images become jaggy when we upscale it, but with
            > Director,
            > images also look jaggy when we downscale it at runtime. (change sprite's
            > width
            > and height directly)
            >
            > 2. Director can't rotate well.
            > The sprite will look awfully jaggy. (change sprite's rotation value)
            >
            > 3. Director doesn't support Particle System
            > Or is it I don't know the proper technique? I used copypixel to create 800
            > x
            > 600 snow particles. They look good but performance dropped from normal 30
            > fps
            > to poorly only 15.
            >
            > If there is some algorithm to outcome these problems, please let me know.
            > That'll be very helpful in our upcoming projects. Again, with no intention
            > to
            > harshly criticize Director's creator, this is merely a question I've been
            > wanting to ask for long.
            >
            > Thank you.
            >


            • 3. Re: Director's shortcomings?
              hwa-jun yu Level 1
              Thank you for the replies, guys.
              I'll try putting my code to enterframe, udo.

              Is there any good tutorial on virtual buffer, or any other same technique that you tell me, alchemist? You know, for some people, theories are just not enough (including me). Sorry for the trouble~

              • 4. Re: Director's shortcomings?
                Level 7
                From a quick search:
                http://www.mediamacros.com/item/item-1006687612/
                The above link contains sample code for rotating an image. Haven't checked
                it, but since it's written by Luke, it should work.
                To enhance the quality, you can create a larger image (e.g.2x), copyPixels
                to the new image (magnify) rotate the big image, and copy the resulting
                image data to the original image (shrink)

                You can always google 'imaging lingo tutorial / examples'.


                "hwa-jun yu" <webforumsuser@macromedia.com> wrote in message
                news:g528i8$sb2$1@forums.macromedia.com...
                > Thank you for the replies, guys.
                > I'll try putting my code to enterframe, udo.
                >
                > Is there any good tutorial on virtual buffer, or any other same technique
                > that
                > you tell me, alchemist? You know, for some people, theories are just not
                > enough
                > (including me). Sorry for the trouble~
                >
                >
                >





                • 5. Re: Director's shortcomings?
                  hwa-jun yu Level 1
                  Thanks, alch!
                  I'll give it a try
                  • 6. Re: Director's shortcomings?
                    the real POTMO
                    the virtual buffer alchemist is referring to is probably just something like this

                    * have the original image you want to resize in a image-object. (member("org").image)
                    * the you rotate it with for example copy pixel with quad into a new image-object
                    * then you scale that image into 50% size and youll get a fairly good-looking sprite.

                    Also when working with scaled and rotated sprites its always better, even if your not going with the vertual buffer technique to have the members in at least 200% size of what you want the sprite to be. Then youll get a bit better rotations.

                    But still this is something that the community have been crying out to get for a long time. The ability to set scale- and rotation-mode to bilinear or biqubic. It cant be that hard for Adobe to fix this but i guess they have more important things to do like changing the gui slightly and making the search function a hundred times slower (in D11 compared to DMX2004)