Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]

Trim causes intense Flickering with my Sprite
Started by Q-tro May 12 2015 06:51 AM

1 reply to this topic
texture packer sprite sheet flickering trim trimming image sheet texture memory
This topic has been archived. This means that you cannot reply to this topic.
[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Observer

  • 16 posts
  • Corona SDK

Hi fellow Corona dev's,


today I have a question about our favourite packing tool, Texture Packer.


Here's the situation:


I have a character with a lot of animations made with sprite sheets. Given Texture Memory limit on some low-end devices, what I want to do is to make sure that all the animations (which translates in a series of TP sprite sheets), are a maximum of 1024x1024 in pixel size, so that Texture Memory usage is limited.


My character has 9 animations which are loded all together when in the init phase of my app, and having 9 images with 2024x2024 in size can be really demanding for some devices right now.


So i just tought to use the trim mode for all my spritesheet: that really reduces the overall size of the resulting spritesheet, but when I play my Corona sprite inside a scene, the result is flickering terribly!


I've tried to play with Extrude and paddings but, other than my sprite sheet getting bigger in pixel size, those really doesn't help with the flickering.


The only solution I have found to avoid flickering is to NOT trim at all, which maintains the transparent canvas of my frames, but also demands a lot more of pixel size, reaching 2024x2024!


A single 2024x2024 sheet takes up to 16 MB of texture memory, so it goes without saying that having a character that stores 9 of those big sheets really is unacceptable if you value good perfomances!


I've been really into finding a solution that removes the flickering entirely and also does not create a giant image file to play with... but I had no luck up until know!


Hope someone here have some answers to this upsetting problem...



[TOPIC: post.html]


[GLOBAL: userInfoPane.html]
  • Contributor

  • 352 posts
  • Corona SDK

Hi there,


Is the problem that the sprite images are actually flickering, or could it be that the sprite position is moving erratically, which creates the appearance of flickering?  I think if you use the trim mode on Texture Packer, if you don't set the sprite anchors to the centre X/Y position (0.5,0.5), then the sprite can look like like it's flickering / jumping all over the place.