GLBasic forum

Main forum => GLBasic - en => Topic started by: Kyo on 2010-Apr-21

Title: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
first I tested on iphone :

1000X1000 texture - Work
1024x1024 texture - Don't Work (stretch texture)
2000x2000 texture - Don't Work (stretch texture)
1000x2000 texture - Don't Work (stretch texture)

After:
I tested a loop of single sprite (first with polyvector an after with drawsprite) over 150 sprite (128x128 px)  load the iPhone crash ..... :S

This is the limit of GLBasic???????   :blink:

the limit of allocated memory is 600 kB????

I have 45MB memory free on iphone ......  :'(
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: matchy on 2010-Apr-21
Realistically, isn't a 512x512 sprite or texture map overly sufficient for the device screen size?  :blink:
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Qube on 2010-Apr-21
I use 1024x1024 sprite sheets (what ever you want to call them) all the time with no problems on the iPhone. 1024x1024 is (as far as I'm aware) the maximum texture size on the iPhone.

Quote
the limit of allocated memory is 600 kB?

Not sure where you get that size from, sorry. As a very bare minimum I have two 1024x1024 images loaded at any one time in my games. One for the backgrounds and the other for sprites, etc and have not had any issues at all.

Could you post some example code and image files which demonstrate this issue? :)
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kitty Hello on 2010-Apr-21
I think the iPhone texture limit is 1024x1024. It's strange that a 1024x1024 texture does not work, though.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
everything is correct what you say
but now I have a question ...

if the limit on iphone is two texture size 1024x1024 (about 640KB of memory), as they have made this game?

Is a 2d game with large sprites and many animations...

their engine is optimized?

they do not have the memory limits of the iPhone?

http://www.youtube.com/watch?v=J5qrwzzM3Kk (http://www.youtube.com/watch?v=J5qrwzzM3Kk)
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Moru on 2010-Apr-21
How many bits per pixel are we talking about here? A bitmap with 24 bit color usually takes 3 bytes per pixel which adds up to about 3 MB per 1024x1024 sheet unless there is some fancy realtime compression of textures on the iphone?
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
I use png 8bit compression.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: matchy on 2010-Apr-21


Quote from: Ocean on 2010-Apr-21
Quote from: matchy on 2010-Apr-21
Realistically, isn't a 512x512 sprite or texture map overly sufficient for the device screen size?  :blink:
depends on the application and on the minimum level of quality you're ready to settle for.

If it were the iPad or PC then it would matter.

It just seems more efficient, and most likely quicker, for the iPhone with 320x480 to use 512x512 for 3D textures or for large stitched scrolling backgrounds that are greater than 512.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: bigsofty on 2010-Apr-21
As Qube said, 1024x1024 should work fine on the iPhone?
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
1024x1024 works!
There is a system to unload/load fastly the sprites???

for realtime switch animation....
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kitty Hello on 2010-Apr-21
Oh dear. For a street fighter, you might want to load the animation to show next (sequence) as one tile set.
The real street fighter will probably create compressed textures and directly load these packed data into the graphics card.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
Quote

just load an empty sprite into the previous sprite handle - this IS documented...

Ocean


tell me where to find it in documentation ? ... thanks  :good:
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
I tried this system:

Load Tile Animation (Deafult) Ready Stance (5 Frame)

|1|2|3|4|5|  <-  (Tiled Ready Stance Animation )

When i Touch the screen on IPhone

I load  the animation Walk (5 Frame) and play it

When i dont touch the screen return to first animation (Ready Stance)

On PC work fine, but on iPhone stops until another image is loaded (1 ~ 2 sec  - depend on the size of image)

Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-21
there is no solution to my problem?  :help:
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kitty Hello on 2010-Apr-22
try loading BMP instead of PNG, which *might* be slightly faster. I fear it's not going to be realtime, though.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-22
I have not tested the speed loading  of LOADBMP, but LOADBMP not have a unique ID number.

it works with an image and i have 2 players ....  :whistle:
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kitty Hello on 2010-Apr-23
not LOADBMP that would be the background.
Try LOADSPRITE with a ".bmp" instead of a ".png".
If you got it working, please tell us what you did.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Scott_AW on 2010-Apr-23
When playing around loading graphics, I noticed that I had problems using images that greatly exceeded the height of the screen but not the width.  I was able to use a 1760x608 wide image, but not a 1024x800(image got squished), although I believe I also had squishing issues when using a 1024x600 vs a 1024x576(which I'm using now)

This probably just confusing things, but  the working images were divisable by 16 (600 vs 576), but both are powers of 8.  In relation, if I used a texture smaller than 16x16 in a 3d model the texture would not correctly fill the model face.
Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Kyo on 2010-Apr-23
Quote from: Kitty Hello on 2010-Apr-23
not LOADBMP that would be the background.
Try LOADSPRITE with a ".bmp" instead of a ".png".
If you got it working, please tell us what you did.



I use:
- BMP - 8 Bit, Exact Palette 64 color (Frame size: 20 Kb)
- PNG - 8 Bit, Exact Palette 64 color (Frame size: 6 Kb)

I tested it in different ways:

Loop: Load single frame (PNG or BMP) -> Showscreen - >  Load new frame
- Result: on the screen the FPS change between 40 to 100, but I see that goes to 20~25 FPS

Loop: Load Tile (PNG or BMP) -> Execute Tile -> Showscreen - >  Load new Tile
- Result: Very Very Slow - stops for 1 second when loading Tile

I was hoping to find a way to get more memory ....  :(

I also tested the difference of polyvector and drawsprite.

Polyvector is faster only if you use the function POLYNEWSTRIP , only if you use the same image (good for tile level or to clone an entity)

Title: Re: Polyvector - texture 1000x1000 pixel limit???
Post by: Scott_AW on 2010-Apr-23
Use 24bit images, png files will be smaller and loading will be faster since the program won't have to decode the palette.  Load up all your graphics before you do anything, or have loading stages between operation.