GLBasic forum

Main forum => Bug Reports => Topic started by: Dark Schneider on 2011-Aug-08

Title: POLYVECTOR with color slow on iPad
Post by: Dark Schneider on 2011-Aug-08
If use POLYVECTOR with any color, it runs very slow on the iPad, it is curious because on an iPod 1G it runs fine. But they have different GPUs.

I say this because if you are planning to use POLYVECTORS to change colors of sprites and others (like fonts) take in mind this if you want to release it on iPad.
:giveup:
Title: Re: POLYVECTOR with color slow on iPad
Post by: blackway on 2011-Aug-08
Nooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo        :'(
I'm programming a game (universal binary) (Iphone,Ipad) and I'm using polyvectors with colors!!!!!   
I have a Ipod touch 3G and runs good, but I don't have a Ipad to test it....

Gernot, Can you help us about this problem?
Thanks!!!
Title: Re: POLYVECTOR with color slow on iPad
Post by: Slydog on 2011-Aug-08
But how can you use POLYVECTORs without a colour attribute?  It isn't optional?

Code (glbasic) Select
POLYVECTOR x%, y%, tx%, ty%, col%

To keep things fast, are you using POLYNEWSTRIP for each polygon that shares the same texture?
(as opposed to using a STARTPOLY command for EVERY poly?)

Or, does GLB on iPad create a new OpenGL draw call for every colour change maybe?  (it treats it as a different material?)
Title: Re: POLYVECTOR with color slow on iPad
Post by: MrTAToad on 2011-Aug-08
May or may not be of interest : http://www.glbasic.com/forum/index.php?topic=5565.15
Title: Re: POLYVECTOR with color slow on iPad
Post by: Dark Schneider on 2011-Aug-09
Yes I know, and when I use POLYVECTORS with no color it runs fine, but if I specify a color it runs slow, I say this because it runs slow only using it 8 times (to draw the select stage buttons) and runs very very slow.
But for drawing the game I use a tile based map using lot of POLYVECTORs without color and runs very good. So the color is the deep problem, not the POLYVECTORs.
Title: Re: POLYVECTOR with color slow on iPad
Post by: monono on 2011-Aug-09
@Slydog: If you use white opengl has not to colorize the image.
Title: Re: POLYVECTOR with color slow on iPad
Post by: spicypixel on 2011-Aug-09
I'm still with SlyDog here how can you use POLYVECTOR without the colour parameter, it isn't optional. Can you show the command you use which works but doesn't use the colour attribute please.
Title: Re: POLYVECTOR with color slow on iPad
Post by: Moebius on 2011-Aug-09
It is 'optional' in that it defaults to white:
Code (glbasic) Select
// Function descr. at bottom of IDE:
POLYVECTOR x#, y#, tx# = 0, ty# = 0, color% = RGB(255,255,255)

QuoteIf you use white opengl has not to colorize the image.
Title: Re: POLYVECTOR with color slow on iPad
Post by: Kitty Hello on 2011-Aug-16
Right. I check for 0xffffff or rGB(255,255,255) as a colour. If you use that, I disable glcolorPointer stuff. which makes drawing on OpenGL|ES a lot faster usually. Also we found out that some devices (Android) don't support the colouring at all.
For coloured lines, load a different texture with the colour set or use texture coordinates for the colour.
For fonts, try using MEM2SPRITE with a memory image that you modified on the fly to match the colour you want.
Title: Re: POLYVECTOR with color slow on iPad
Post by: spacefractal on 2011-Aug-16
its would been nice if possible if a device support that feature, so we can use alternative drawing.

a slightly another bug in the same place is ALPHAMODE. if you set other number than 0, then its simply dont do any alpha at all, before you use a color sprite.....

is its the same issue for ANDROID if i use white color, but with alpha polys?

PS. Also when you use POLYVECTOR of course.
Title: Re: POLYVECTOR with color slow on iPad
Post by: Kitty Hello on 2011-Aug-17
alphamode should work on iPad. Please make an example where it doesn't.