Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Is AGK speed affected when using big images in sprites?

Author
Message
nickele upgraded
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Birthplace of Democracy
Posted: 23rd Jul 2016 18:17

I am examining the scenario of using the same set of graphics in a universal 2D game for iPads. In order to reduce the size of graphics assets, I was thinking of keeping only the hires images for the sprites (eg discard 512x512 atlases to be normally in earlier iPads and keep only the 1024x1024 ones for usage in both elder & newer devices alike).

So the important question is: Does the usage of 2D sprites with images greater than the sprite resolutions in AppGameKit, affect the performance of the GPU in older generation devices (any device, Android and iOS)?

To be more precise, does the speed of drawing some hundreds sprites of 128x128 pixels on the screen depend on whether we choose an image of 128x128, or an image of 256x256 for all our sprites?

Or does OpenGL use draw calls in a clever way and takes care of that, so that the speed remains the same regardless of the size of images?
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 24th Jul 2016 08:51 Edited at: 24th Jul 2016 08:52
This may be a good starting point...

SetIntendedDeviceSize

Description

Sets the size of the device you have designed all your artwork for, this allows AppGameKit to downsize the images to save memory on lower resolution devices. Note that commands such as SetSpriteAnimation that might assume image sizes must account for images that have been reduced. For example loading a 512x512 image and using SetSpriteAnimation(spr,128,128,16) should instead use SetSpriteAnimation(spr,GetImageWidth(img)/4,GetImageHeight(img)/4,16) in case the image is no longer 512 in size.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
nickele upgraded
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Birthplace of Democracy
Posted: 25th Jul 2016 11:21
Thank you for the idea sir BatVink!
Van B
Moderator
22
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 25th Jul 2016 17:49
One thing that does slow things down, especially on Android is alpha transparency - too many layers of alpha should be avoided.
The code is dark and full of errors
CumQuaT
AGK Master
14
Years of Service
User Offline
Joined: 28th Apr 2010
Location: Tasmania, Australia
Posted: 30th Jul 2016 15:19
Interesting... My game runs with 800 tiled sprites with alpha transparency and it runs great, even on an old cheapie android I bought from the post office lol

Login to post a reply

Server time is: 2024-11-25 03:36:25
Your offset time is: 2024-11-25 03:36:25