• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Draw small tiled images on a large bitmap. How will GPU cache it?

Guest
Aug 30, 2015 Aug 30, 2015

Copy link to clipboard

Copied

Hello,

I am working on a game for android with Adobe Air.

I would like to know if its possible to fill an existing background bitmap( that covers the screen) with bitmapData from a 64x64 movieclip so that the whole background image is covered by 64x64 tiled data as a pattern. If so how to do it since graphics.beginBitmapFill() method is available only to shapes and sprites.

If its possible will the GPU only cache the 64x64 image data or will it cache the whole background image data?

Will there be performance hit?

Thank you for your time.

TOPICS
ActionScript

Views

312

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2015 Aug 31, 2015

Copy link to clipboard

Copied

you could do that using the draw method of the bitmapdata class, and your bitmap would be stored as the whole background image.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 31, 2015 Aug 31, 2015

Copy link to clipboard

Copied

Thanks for the reply.

I can use bitmapData.draw() to draw the small image a number of times on the big bitmap, but wont that mean the bitmapData of the whole background image will be stored in memory.

Is there a way only the small 64x64 data is stored in memory and I can apply it to the background bitmap in a tiled manner?

I want to fill the background but only at the memory cost of a 64x64 image.

Would it be more memory efficient to have a number of small bitmaps(64x64). That way only the 64x64 data is stored by gpu. The tradeoff is more objects in the display list.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 31, 2015 Aug 31, 2015

Copy link to clipboard

Copied

LATEST

again, your bitmap would be stored as the whole background image.

the big trade-off is deciding whether you want to use a bitmap image which consumes memory, but is more efficient for the cpu to handle as long as the cached bitmap doesn't change, or use something that uses less memory but requires more work for the cpu.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines