1

I'm looking to optimise the performance of my program.

Off the bat I've set stage quality to medium (if I set it to Low half my movieclips don't render). This helped, but I want more!!!

A hint I've read in the P3D Essentials book is to turn of animated materials when not needed. Fantastic idea, but doesn't explain how.

When I create a material I can set material.animated = false and that works, but in another function I cannot access the material of my primitives. Something as simple as plane.material.animated = false returns a null exception. So how do I turn on/off animated materials dynamically on my primitives?

Richard Parnaby-King
  • 14,703
  • 11
  • 69
  • 129
  • The PV3D project is dead. Use Away3D. –  Apr 18 '11 at 20:49
  • Some proof: http://unitzeroone.com/blog/2009/09/28/goodbye-papervision/. –  Apr 18 '11 at 20:59
  • Hardly proof. One of the core team left. However the [blog](http://blog.papervision3d.org/) has not been updated since July 2010, and the [dev site](http://dev.papervision3d.org/) sine June 2009. [Code Google](http://code.google.com/p/papervision3d/) was updated March 2011, though... I think I'll take a look at Away3D for my next project as this one is 95% done. – Richard Parnaby-King Apr 19 '11 at 09:04
  • It's proof because he was the core developer. Sure, things have been updated here and there and they did start on a new branch, but there is maybe 2 guys committing code etc there are over 22 active, daily developers including an astrophysicist on the away3d team. Also some more proof, Papervision was pretty much the ONLY flash engine that was not invited to participate in the molehill private alpha/beta. Why? Cause adobe knows it's essentially a dead project also. :) –  Apr 19 '11 at 11:18

1 Answers1

0

Looking through the API this appears to be impossible. What I can do to improve performance, though, is remove the objects that are not visible, e.g. if a plane is completely hidden behind another plane, then don't show (render) it. This is what I was attempting to achieve with my original question...

I have all my planes held in an array.

//make all the planes invisible. Don't want to render them
for(var i = 0; i< planes.length(); i++)
{
  planes[i].visible = false;
}
//show the first plane so we have **something** to see
planes[0].visible = true;

This works for me because I know that only one plane will be visible at a time (until it transitions to the next plane, in which case I make that plane visible, and when the current plane has finished transitioning, I hide that).

Richard Parnaby-King
  • 14,703
  • 11
  • 69
  • 129