|
-
President
Which one is faster?
Right now I'm making a game where I have a scenario that is a bit big, at least more than 2800 pixels that is the limit for filters as far as I know. I have a movieclip with a filter applied and because of the size it's not displayed. I have realized about 2 options here. The first is to divide the mc by areas, having each area into a frame of the movieclip, and depending which part of the mc has to be shown on screen it goes to a certain frame. This way the width of the mc keeps below the 2800. I have done this placing some invisible mc's that check if they hit the main player to go to the respective frame.
The second option is easier but I don't know if it's faster (I guess it's not). It's just making smaller mc's into the main one with filters applied to each. A bit simple. Now my question is which way is faster when running the game?
Thanks in advance to any advice!
 This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
Yes we can
Just to go sure i got right what you mean:
With the second solution you suggest it would be that you have two mcs, apply a filter on each of them and then put em into a container mc and scale that one up?
If so,then that wouldn´t work cause for flash it doesn´t matter i you try to apply a filter on a object that is bigger than the max dimensons it runs a filter at or if the object is scaled smaller but then in a container that scaled it up and then again it has to apply the filter on a bigger area than the max dimensions limit.
So regarding that only option 1 would work.
If you meant something different for option 2 please elaborate.
Option1 probably wouldn´t be performing excellent either since you´re still applying a filter to a pretty large region and the max dimension limit filters for which filters are applied are there because the flash player of course gets slower the bigger the area is the filter is applied on.
If you want to apply filters on objects that are bigger than stage dimensions it would make more sense that you draw those into a stage size bitmapdata and then apply the filter on that one.
-
President
Thanks for the reply! I've never used bitmapdata but if it gets too slow I'll try your way.
Maybe I didn't explain very well. Let's suppose I have an mc called "forest", and its width is 3000. Forest has trees inside, let's say it has 10 trees. So instead of applying a filter to the whole "forest" mc, I put 5 trees into one mc, and 5 trees into another; that would make 2 clips of 1500 each, that are inside the "forest" mc. Then I apply a filter to each clip (inside the main clip) individually. Please tell me if its clear
 This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
Yes we can
Ok, i see what you mean now, yeah, that would work. That said the less often you apply a filter per frame refresh, the better regarding performance.
If you go the bitmapdata route you could either apply the filter to your stage bitmapdata if you want it to look as if it affects the whole scene, or if you only want it to be applied to some objects that could be made in even more performance savey way (like apply the filter on one tree image, copy/draw that into a bitmapdata and then copy/draw that filter applied tree image to anywhere you want, all that maybe even before the level starts if its for static use).
I know, working with art in non codeside manner in the ide is nice in many cases but as long as flash has no propper gpu acceleration the bitmapdata way is often the only solution that runs at nice performance for many things.
If you don´t go the bitmapdata way,then yeah, you have to try which runs faster, hard to tell since many things affect that, like amount of objects you apply filters on,their dimensions,how often you update the filter etc, with some filters even what elements are in front and behind the objects you apply filters on (in case of alpha transparency being in play with effects objects in layers above/below the filter applied object affect performance some).
-
President
Thanks so much Tom! very useful response The mc I'm using is static, I think I might better take some chances with bitmapdata then. I think I'll try what you said about copying/drawing the filter applied image. Haven't thought about that. Thank you!
 This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
-
Senior Member
I have to ask, what filter is so important you need to use it on such a large graphic?
-
President
I am using a shadow filter to create an outline in the graphics inside the clip, and a bisel filter to add bump. I could make them images and import them but I don't want the size of the swf go too high.
 This is MC. His _parents sent him to stop() by the super market to buy some _root beer if he wanted to gotoAndPlay() with his friends at the park later.
This is my Blog!... The gaming Process
Please check out my site: Giddel Creations
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|