Great, thanks for the reply.  Actually, we have another feature and I
was wondering if you could tell me whether performance will drop using
a new feature.  Here is how I build the bitmap....

var thisMat : BitmapData = new BitmapData
(materialVO.basematerial.width, materialVO.basematerial.height);
thisMat.draw(DisplayItems.drawRectangle(materialVO.basematerial.width,
materialVO.basematerial.height, {color: brandColour, alpha: 0.5}));
thisMat.draw(materialVO.basematerial, null, null, null, null, true);
thisMat.draw(shadow, null, null, BlendMode.MULTIPLY);

Line 1 just creates my bitmapdate at the width and height of a
bitmapdata object in a value object.
Then, line 2 draws the coloured background in.
Line 3 apply my texture (probably a face)

Then, line 4 is my new feature which I'm wondering is going to affect
performance...  I basically have separate BitmapDatas which contain
the shading for each of these materials.  They don't have transparent
backgrounds but as you can see, I'm applying the multiply blend mode
which will remove all the white.

So basically, my layering goes...
1)  Coloured background
2)  Face texture (contains transparency)
3)  A new layer which contains the same layout as the face texture but
only features the shading for it with the multiply blend mode applied.

Performance is so-so at the moment.  I'm just wondering if performance
will change by adding this shadow layer or if Away doesn't really care
amount the amount of data inside the bitmap data and just sees it as
one image (as I expect).

My character is made up of three different colladas.  A head, a arms/
torso combination and legs.  This is because the character is
dynamically created based on user input.  The total polycount is
around 2,300 - 2,500.  Things are stuttering a little.  Does this
sound normal for this setup?  Am I pushing it a bit with this amount
of polys or is it possible my code is bad.

Thanks again for all your hard work on the engine Rob (and co!), I'm
really loving the setup!




On Nov 17, 1:21 am, Rob Bateman <[email protected]> wrote:
> Hey Dave
>
> i think your idea of creating a bitmap material, draw in a coloured block
> and then draw a bitmap on top will be a lot faster rendering than using a
> composite material, because there will be less triangle drawing operations
> when rendering to screen. i wouldn't bother using composite material at all,
> even if you need to update the material background color. unless this is
> being done every frame, flattening to a single material will always be
> faster
>
> Rob
>
>
>
>
>
> On Thu, Nov 12, 2009 at 10:20 AM, Dave <[email protected]> wrote:
> > Just an update, I think I'm going to use a CompositeMaterial as it
> > looks like we'll want to have a coloured material and then a bitmap
> > material drawn on top.  However, it doesn't look like
> > CompositeMaterial's addMaterial() method supports adding
> > ColorMaterial's.  Can anybody give me an idea of how I can go about
> > this?
>
> > I could just make a bitmap material, draw in a coloured block and then
> > draw my bitmap on top but I was hoping that making a composite
> > material of a colour material and then a bitmap material would
> > increase performance.
>
> > Thanks,
> > Dave
>
> > On Nov 11, 3:28 pm, Dave <[email protected]> wrote:
> > > Hi there,
> > > Ok I've got a character that's built up of a few different colladas
> > > based on answers given by the user.  At the end, appropriate materials
> > > are applied to each piece (head, arms/torso and legs).  I'm using a
> > > Phong shader which I know is very processor intensive but a normal
> > > bitmap material just isn't quite good quality enough.  I searched
> > > Papervision tutorials a bit and saw some more options for materials
> > > such as Gourard shaders etc but they don't seem to be included in
> > > Away.
>
> > > Is there anything inbetween Bitmap and Phong as far as quality versus
> > > speed goes that I could try out.  Any other optimization techniques
> > > would be handy too.
>
> --
> Rob Bateman
> Flash Development & Consultancy
>
> [email protected]

Reply via email to