I meet a problem with my Away3D scene...
I have a gallery with 3D Thumbs, which have a bitmapFileMaterial (low
jpg). For the moment, i have only 2 different JPG, a green one fore
directories, and a red/pink for images.
When i click one, the camera zoom on it and I change the material into
a MovieMaterial...
For the moment, my MovieClip is simple : an animated ring, and has
background, i put my low image, darked by a black transparent shape...
When i click in the exterior of my zoomed thumbs, the camera return
back, and I re-apply my low material...
My problem ? When I click on a thumbs, return back, re-click, return
back etc..., there is a decreasing of performance... I don't
understand what is wrong...
Do this test in my third level of my gallery (click the 1st thumbs in
first level, and the fourth in the 2nd level)
=> http://urfman.free.fr/fhw/ilotAbais/test_23fev2010.html
My simplified code of my thumbs3D Class ( extends Plane ) :
______________________________________________________________
public class thumbs3D extends Plane
{
private var mapLow:BitmapFileMaterial;
private var mapInteractive:MovieMaterial;
private var interactiveMC:vignetteSprite;
public function thumbs3D(_lowUrl:String, init:Object = null)
{
super(init);
mapLow = new BitmapFileMaterial(_lowUrl);
this.material = mapLow;
}
public function activeHdMap():void
{
interactiveMC = new vignetteSprite();
interactiveMC.buildMap(mapLow.bitmap,null,null);
mapInteractive = new MovieMaterial(interactiveMC);
mapInteractive.interactive = true;
this.material = mapInteractive;
}
public function desactiveHdMap():void
{
this.material = mapLow;
interactiveMC = null;
mapInteractive = null;
}
}
______________________________________________________________
Does the " = null" is not enough ?
Any Idea ?
Thank you.
Alexandre.
I forget to ask to do not re-click in the same thumbs all time, but in
its neighbors too...
All my friends who try it has confirmed the FPS decreasing...
On my computer, when i focus a thumbs of my 3rd level, I have 20-22
FPS...
After 10-15 crazy click, i fall to 10 FPS (it's regular)
I don't solve this, but i found an other way to do what i wan't...
Now, I make only one instance of my movieClip, so it's the same which
is applied on all thumbs when they are targeted...
I add function on this movieclip to change itself...
==> It is a success, my CPU thanks me :)
Maybe i was stupid to believe that " = null" was enough to relieve
CPU.. ?
Tanks for your answer
Alexandre.
I will search for that, it will be very usefull (if I know how to use
it !)
Thank you again ;)
Away3D also slows down once it reaches "critical mass" in terms of objects. If you always have the same number of objects, you should probably be fine, but at a certain point you'll have too many objects for it to render in real-time and then it will begin slowing down quickly. Make sure your objects are being destroyed, or remove code that relies on removeChild and addChild and replace it with .visible or something else. The cause of slow performance usually isn't having too many objects in memory, but rendering too many objects at once.
Finally, depending on your project, you can toggle between rendering modes or push objects into their own View object so that you can render them separately from the rest of the scene. There's a number of things you can do to play with maximizing performance.
On Wed, 24 Feb 2010 03:29:38 -0800, Michael Iv <explo...@gmail.com> wrote:
> I really don't know if there is a Profiler in FlashDevelop but I would
> highly recommend you to develop 3d stuff in IDE that has it .
> Flash Builder or FDT .
> In this field of programming optimization issues are critical and rapid .
> And profiler , it is like a gift from the God for that matter.
>
> On Wed, Feb 24, 2010 at 1:23 PM, Alexandre Bais <bais.al...@gmail.com>wrote:
>
>> I code with FlashDevelop (+FlexSDK)...
>> Maybe they are a monitor, but if they are, I don't know where :\
>>
>> I will search for that, it will be very usefull (if I know how to use
>> it !)
>>
>> Thank you again ;)
>>
>
>
>
--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/