[Papervision3D] updateBitmap
Nathaniel Warner
warner.nathaniel at gmail.com
Mon Aug 13 13:07:50 PDT 2007
Carlos,
Thanks for the great reply and the wonderful 3D engine. I will attempt to
incorporate your comments.
-Nate
On 8/13/07, Carlos Ulloa <c4rl054321 at gmail.com> wrote:
>
> If you notice a performance hit when using animated materials, the problem
> lies in the size and complexity of the movieclip to redraw. If you have many
> of those, things might get slow. There's nothing we can do there as the task
> of updating the bitmaps is done inside Flash with BitmapData.draw, not in
> ActionScript.
>
> To avoid the draw overhead during render time, I tend to predraw animated
> sequences into an array of bitmaps and then just change the
> material.bitmap = animation[ frame ]; To predraw the frames of a MovieClip
> you might need to use an enter frame event and do it one frame at a time.
> You can do that while loading other assets for example.
>
> Also watch out for the antialiasing settings. On one hand, the
> material.smooth property controls antialiasing on the textures as they are
> rendered. On the other, stage.quality controls antialiasing of the edges
> of the 3D objects (and the rest of the Flash objects). Both happen at screen
> draw time, i.e. after the ActionScript of the frame has been executed.
>
> But stage.quality also affects BitmapData.draw, so if a material is
> animated it will use the current stage.quality setting to draw the texture
> on each frame. , that's why it would be much faster to predraw the textures
> in the highest quality needed and then switch to quality low when rendering.
> This happens at render time, i.e. while the renderCamera method is been
> executed.
>
> This means the quality setting during the renderCamera() method will be
> used to update the animated materials, while the quality setting at the end
> of the ActionScript controls the way objects are rendered. That's why it's
> possible to update the materials on one quality setting and render at a
> different quality.
>
> If you do this, animated materials will be updated without antialias
> (fast) and render the scene at a higher quality (slow):
>
> stage.quality = StageQuality.LOW;
> scene.renderCamera( this.camera );
> stage.quality = StageQuality.BEST;
>
> If you do the opposite, animated materials will be updated with antialias
> (slow) and render the scene at low quality (fast):
>
> stage.quality = StageQuality.BEST;
> scene.renderCamera( this.camera );
> stage.quality = StageQuality.LOW;
>
> Finally, on MovieMaterials it's important to use transparent only when
> it's really needed.
>
> To get the best performance you have to try different settings until you
> find a good compromise between performance and graphic quality.
>
> Hope it helps,
>
> C4RL05
> // carlosulloa.com
> // papervision3d.org
>
>
>
> On 13/08/07, Nathaniel Warner < warner.nathaniel at gmail.com> wrote:
>
> > That got it. Thanks!
> >
> > On 8/12/07, John Grden <neoriley at gmail.com> wrote:
> > > material.animated = true;
> > >
> > > just add that after it creates the material in the createAlbum()
> > method.
> > > this will hit your processor since there's 50 albums being drawn so
> > watch
> > > out for that
> > >
> > >
> > > On 8/13/07, Nathaniel Warner < warner.nathaniel at gmail.com > wrote:
> > > >
> > > > Hmm, OK. Do you have a sample fla or maybe a few snippets of code
> > > > showing how to use an animated movie clip as a material?
> > > >
> > > > As an experiment I tried simply taking the papercloud sample and
> > > > replacing the album with my animated movie clip but it didn't work
> > > > (not without calling updateBitmap). If someone has some extra time
> > > > maybe they can modify the papercloud example to utilize an animated
> > > > movie. I know I am missing something simple but I can't figure it
> > > > out.
> > > >
> > > > On 8/12/07, Andy Zupko < azupko at zupko.info> wrote:
> > > > > If you are using a movie material that is animated, you shouldn't
> > need
> > > to
> > > > > call updateBitmap. I think that is only if you are using a bitmap
> > > material
> > > > > and want to 'animate' that. If you need to improve speed, drop
> > the
> > > number
> > > > > of polygons used in each. I have also noticed a large difference
> > based
> > > on
> > > > > the size of the bitmapdata you are using.
> > > > >
> > > > > -----Original Message-----
> > > > > From: papervision3d-bounces at osflash.org
> > > > > [mailto: papervision3d-bounces at osflash.org ] On Behalf
> > > Of Nathaniel Warner
> > > > > Sent: Sunday, August 12, 2007 6:42 PM
> > > > > To: papervision3d at osflash.org
> > > > > Subject: [Papervision3D] updateBitmap
> > > > >
> > > > > I have a movie that I am using as an animated material for 100
> > planes.
> > > > > Currently I am calling updateBitmap for my materials, once for
> > each
> > > > > frame and once for each material. Needless to say, it runs a
> > little
> > > > > slow so I was wondering if there's a more efficient way to do
> > this?
> > > > >
> > > > > I am little surprised my computer didn't explode to be
> > honest. This
> > > > > is a well designed engine you have here.
> > > > >
> > > > > Thanks, Nate
> > > > >
> > > > > _______________________________________________
> > > > > Papervision3D mailing list
> > > > > Papervision3D at osflash.org
> > > > >
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > >
> > > > >
> > > > > _______________________________________________
> > > > > Papervision3D mailing list
> > > > > Papervision3D at osflash.org
> > > > >
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > > >
> > > >
> > > > _______________________________________________
> > > > Papervision3D mailing list
> > > > Papervision3D at osflash.org
> > > >
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > > >
> > >
> > >
> > >
> > > --
> > > [ JPG ]
> > > _______________________________________________
> > > Papervision3D mailing list
> > > Papervision3D at osflash.org
> > > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> > >
> > >
> >
> > _______________________________________________
> > Papervision3D mailing list
> > Papervision3D at osflash.org
> > http://osflash.org/mailman/listinfo/papervision3d_osflash.org
> >
>
>
> _______________________________________________
> Papervision3D mailing list
> Papervision3D at osflash.org
> http://osflash.org/mailman/listinfo/papervision3d_osflash.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://osflash.org/pipermail/papervision3d_osflash.org/attachments/20070813/384b0704/attachment.html
More information about the Papervision3D
mailing list