HOW to minimise Texture Memory on 36 x image sequence..

We have captured 36 images of an object as it is being pivoted and rotated around 360 degrees.

With a bit of code you can swipe left or right to turn the image in either direction. This works to turn off visibility on all other images except one.

All works fine but as each image of the 36 averages around 900x 500 pixels, this is a lot to load into texture memory at once.

Other than loading images and removing them all the time so that only 3-6 remain in texture memory, is there any other way this could be achieved? My guess is that they should all fit on around 10 sprite sheets which will reduce texture memory for a start, but is there something more dramatic that can be done?

Here is the code for alternating each image btw if this helps:

 ObjImg[1].isVisible = true ------------------ -- SWIPE Obj IMAGES ------------------ local currentObj = 1 local lock = false local function toggleObj (direction) if not lock then ObjImg[currentObj].isVisible = false if direction == "left" then if currentObj==36 then currentObj = 1; end ObjImg[currentObj+1].isVisible = true currentObj = currentObj + 1 else if currentObj==1 then currentObj = 36; end ObjImg[currentObj-1].isVisible = true currentObj = currentObj - 1 end -- set Lock lock = true composer.timerStash.lock = timer.performWithDelay( 50, function () lock=false; end, 1 ) end end image.swipeLayer.isHitTestable = true local prevX = 0 local function startDrag( event ) if event.phase == "began" then prevX = event.x end if event.x \> prevX then print 'swipe right' toggleObj("right") elseif event.x \< prevX then print 'swipe left' toggleObj("left") end prevX = event.x end image.swipeLayer:addEventListener("touch", startDrag)

Try this:

When an object is ‘not visible’, set the fill to a small texture, then when it is visible set the fill to the original texture.

I used a similar technique in this demo:

https://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2014/10

Hey roaminggamer, many thanks for the tip.

Unfortunately I don’t have access to the fill api. Can texture memory handling like this be achieved without this pro feature in some way do you know?

The only other way I know of is to delete the objects, but that can present various design challenges.  Sorry I couldn’t help.

Try this:

When an object is ‘not visible’, set the fill to a small texture, then when it is visible set the fill to the original texture.

I used a similar technique in this demo:

https://github.com/roaminggamer/RG_FreeStuff/tree/master/AskEd/2014/10

Hey roaminggamer, many thanks for the tip.

Unfortunately I don’t have access to the fill api. Can texture memory handling like this be achieved without this pro feature in some way do you know?

The only other way I know of is to delete the objects, but that can present various design challenges.  Sorry I couldn’t help.