Apple Device Max Texture Size

Hi,

Why does not Corona Simulator show corrent value  real texture memory for iOS device

Real Texture Memory limist are below:

http://www.iosres.com/

What is the deference?  

I can’t get that to show up, but the simulator should return the texture memory limit for the Mac, not the device.  You would have to look at the return call data on an actual device to see what it is.  I did a quick test on my Mac and it shows 16,384 for my Mac.

Rob

Hi Rob,

Thansk for quick reply. 

I have some test on my lab environment, i sent test application to my devices (iPad 2 and iPhone 5). Test application return maxTextureSize, but two devices return 4,906 Kb, this is not correct…

My Code 

main.lua:

display.setStatusBar( display.HiddenStatusBar ) local \_W = display.viewableContentWidth local \_H = display.viewableContentHeight local storyboard = require("storyboard") local GGColour = require( "GGColour" ) local colourChart = GGColour:new() colourChart:loadColours( "otherRGB.json" ) local background = display.newRect(0,0, \_W, \_H) background:setFillColor( 255,255,255 ) background.x = \_W \* 0.5 background.y = \_H \* 0.5 local renk = "SteelBlue" topBar = display.newRect( display.contentCenterX,0, \_W, 100) topBar:setFillColor( colourChart:fromName( renk ) ) bottomBar = display.newRect( display.contentCenterX,\_H, \_W,  100) bottomBar:setFillColor( colourChart:fromName( renk ) ) storyboard.gotoScene( "menu" ) 

menu.lua

local \_W = display.viewableContentWidth local \_H = display.viewableContentHeight local storyboard = require( "storyboard") local GGColour = require( "GGColour" ) local GGColour = require( "GGColour" ) local colourChart = GGColour:new() colourChart:loadColours( "otherRGB.json" ) local scene = storyboard.newScene() function scene:createScene( e )         local picFrame = display.newRoundedRect( display.contentCenterX, display.contentCenterY+15 , \_W-20, \_H-150 ,2)     picFrame.strokeWidth = 3     picFrame:setFillColor(255,255,255)     picFrame:setStrokeColor(0,0,0)     local resim = display.newImageRect("images/2.jpg",picFrame.width -5,picFrame.height -5)     resim.x = \_W \* 0.5     resim.y = \_H \* 0.5 + 15     end local function onMemoryWarning( event )     print( "Yetersiz Memory" ) end function scene:enterScene( e )     local myTextMemoryT = display.newText( "", 0, 0, native.systemFontBold, 12 )     myTextMemoryT:setFillColor( 0,0,0 )     myTextMemoryT.text = "Texture MEMORY = "..system.getInfo( "maxTextureSize" ).." KB"     myTextMemoryT.x = \_W \* 0.5     myTextMemoryT.y = topBar.y + 60  end function scene:exitScene( e )      end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) Runtime:addEventListener( "memoryWarning", onMemoryWarning ) return scene

Result for iPhone5s: 4,906

Result for iPad2 : 4,906

if iPad2 Texture Memory is 4096x4096 then 4096*4096*4 = 67,108,864. Why shown my devices is 4,096 kb

Am I doing something wrong? I understand texture memory usage and i will decide image inventory.

Thanks your support.

I see. You are misundersanding what maxTextureSize is.  It’s the size of one of the sides of the maxTexture.

In other words, if you look at your equation:  4096 x 4096 * 4 = 64Mb then the maxTextureSize is 4096.  It’s returning the 4096, not the 4096 * 4096  * 4.

Toes that make sense?

On older devices it should return 1024.  On more modern devices, 2048 and on the retina/hd displays it may return 4096 or larger.  So to get the number of megabytes the largest texture can support would would do:

biggestImage = system.getInfo(“maxTextureSize”) * system.getInfo(“maxTextureSize”) * 4

Rob

Hi Rob,

I’m sorry misunderstanding the maxTextureSize, i understand issue :slight_smile: everything is clear now :slight_smile:

Thanks again Rob.

Regards.

I can’t get that to show up, but the simulator should return the texture memory limit for the Mac, not the device.  You would have to look at the return call data on an actual device to see what it is.  I did a quick test on my Mac and it shows 16,384 for my Mac.

Rob

Hi Rob,

Thansk for quick reply. 

I have some test on my lab environment, i sent test application to my devices (iPad 2 and iPhone 5). Test application return maxTextureSize, but two devices return 4,906 Kb, this is not correct…

My Code 

main.lua:

display.setStatusBar( display.HiddenStatusBar ) local \_W = display.viewableContentWidth local \_H = display.viewableContentHeight local storyboard = require("storyboard") local GGColour = require( "GGColour" ) local colourChart = GGColour:new() colourChart:loadColours( "otherRGB.json" ) local background = display.newRect(0,0, \_W, \_H) background:setFillColor( 255,255,255 ) background.x = \_W \* 0.5 background.y = \_H \* 0.5 local renk = "SteelBlue" topBar = display.newRect( display.contentCenterX,0, \_W, 100) topBar:setFillColor( colourChart:fromName( renk ) ) bottomBar = display.newRect( display.contentCenterX,\_H, \_W,  100) bottomBar:setFillColor( colourChart:fromName( renk ) ) storyboard.gotoScene( "menu" ) 

menu.lua

local \_W = display.viewableContentWidth local \_H = display.viewableContentHeight local storyboard = require( "storyboard") local GGColour = require( "GGColour" ) local GGColour = require( "GGColour" ) local colourChart = GGColour:new() colourChart:loadColours( "otherRGB.json" ) local scene = storyboard.newScene() function scene:createScene( e )         local picFrame = display.newRoundedRect( display.contentCenterX, display.contentCenterY+15 , \_W-20, \_H-150 ,2)     picFrame.strokeWidth = 3     picFrame:setFillColor(255,255,255)     picFrame:setStrokeColor(0,0,0)     local resim = display.newImageRect("images/2.jpg",picFrame.width -5,picFrame.height -5)     resim.x = \_W \* 0.5     resim.y = \_H \* 0.5 + 15     end local function onMemoryWarning( event )     print( "Yetersiz Memory" ) end function scene:enterScene( e )     local myTextMemoryT = display.newText( "", 0, 0, native.systemFontBold, 12 )     myTextMemoryT:setFillColor( 0,0,0 )     myTextMemoryT.text = "Texture MEMORY = "..system.getInfo( "maxTextureSize" ).." KB"     myTextMemoryT.x = \_W \* 0.5     myTextMemoryT.y = topBar.y + 60  end function scene:exitScene( e )      end scene:addEventListener( "createScene", scene ) scene:addEventListener( "enterScene", scene ) scene:addEventListener( "exitScene", scene ) Runtime:addEventListener( "memoryWarning", onMemoryWarning ) return scene

Result for iPhone5s: 4,906

Result for iPad2 : 4,906

if iPad2 Texture Memory is 4096x4096 then 4096*4096*4 = 67,108,864. Why shown my devices is 4,096 kb

Am I doing something wrong? I understand texture memory usage and i will decide image inventory.

Thanks your support.

I see. You are misundersanding what maxTextureSize is.  It’s the size of one of the sides of the maxTexture.

In other words, if you look at your equation:  4096 x 4096 * 4 = 64Mb then the maxTextureSize is 4096.  It’s returning the 4096, not the 4096 * 4096  * 4.

Toes that make sense?

On older devices it should return 1024.  On more modern devices, 2048 and on the retina/hd displays it may return 4096 or larger.  So to get the number of megabytes the largest texture can support would would do:

biggestImage = system.getInfo(“maxTextureSize”) * system.getInfo(“maxTextureSize”) * 4

Rob

Hi Rob,

I’m sorry misunderstanding the maxTextureSize, i understand issue :slight_smile: everything is clear now :slight_smile:

Thanks again Rob.

Regards.