Help iPhone & 3D

Previous topic - Next topic

Kyo

it's possible to use the multitexturing for POLYSPRITES?


it's possible to use a type of alpha for each POLYNEWSTRIP?

Kitty Hello

The alpha can be changed with the ALPHAMODE just before the POLYNEWSTRIP. I've not tested it, but that's the way I would expect it.

Multitexturing is not possible. What are you trying to do?

Kyo

Quote from: Kitty Hello on 2010-Feb-18
The alpha can be changed with the ALPHAMODE just before the POLYNEWSTRIP. I've not tested it, but that's the way I would expect it.

Multitexturing is not possible. What are you trying to do?

if i use :
Code (glbasic) Select
STARTPOLY 0,2
ALPHAMODE -0.8
LOCAL c%=RGB(255,255,255)
POLYVECTOR  0, 0, 0,0,c
POLYVECTOR  0,40, 0,0,c
POLYVECTOR 40,20, 0,0,c
POLYVECTOR 40,40, 0,0,c

POLYNEWSTRIP
ALPHAMODE 0
// same at 100,100
POLYVECTOR 100,100, 0,0,c
POLYVECTOR 100,140, 0,0,c
POLYVECTOR 140,120, 0,0,c
POLYVECTOR 140,140, 0,0,c

ENDPOLY
SHOWSCREEN
MOUSEWAIT


the polysprite use only the last call to alpha (ALPHAMODE 0) but not the first call (ALPHAMODE -0.8 )

if I use :
Code (glbasic) Select
STARTPOLY 0,2
ALPHAMODE 0
LOCAL c%=RGB(255,255,255)
POLYVECTOR  0, 0, 0,0,c
POLYVECTOR  0,40, 0,0,c
POLYVECTOR 40,20, 0,0,c
POLYVECTOR 40,40, 0,0,c

POLYNEWSTRIP
ALPHAMODE -0.8
// same at 100,100
POLYVECTOR 100,100, 0,0,c
POLYVECTOR 100,140, 0,0,c
POLYVECTOR 140,120, 0,0,c
POLYVECTOR 140,140, 0,0,c

ENDPOLY
SHOWSCREEN
MOUSEWAIT

the polysprite use only the last call to alpha (ALPHAMODE -0.8 ) but not the first call (ALPHAMODE 0)


I use The multitexture for create many polys whit more texture using a single call to  STARTPOLY and more POLYNEWSTRIP.

bigsofty

Slow answer but "media/" in your path should read "Media/"
Cheers,

Ian.

"It is practically impossible to teach good programming style to students that have had prior exposure to BASIC.  As potential programmers, they are mentally mutilated beyond hope of regeneration."
(E. W. Dijkstra)

Kyo

#19
Quote from: bigsofty on 2010-Feb-19
Slow answer but "media/" in your path should read "Media/"

Yes the path is Media  :good:

before starting to make a my  game I did test with sprites not mine.

My game use
- 2 textures (single texture: 800 x 800 px ) for the player (ready stance - walk forward - walk back - jump ecc.)

- 1 texture for the hud, the shadow under the characters ecc (300 X 300 - px)

- 1 texture for the stage only one parallax (no multiparallax) (500 X 400 - px)

I  make four calls at STARTPOLY ....  :rant: (slow code ...)

1 Type:
Code (glbasic) Select

TYPE tanim
img%
x%
y%
active%
cl%
scalex%
box_col_x% // Box X for collision - player hit
box_col_y% // Box y for collision - player hit
box_col_h% // Box h for collision - player hit
box_col_w%// Box w for collision - player hit

box_atk_x% // Box X for collision - player attack
box_atk_y% // Box y for collision - player attack
box_atk_h% // Box h for collision - player attack
box_atk_w%// Box w for collision - player attack

tx% // UV X Texture
ty% // UV Y Texture
txf%// UV W Texture
tyf%// UV H Texture
ENDTYPE
GLOBAL anim[] AS tanim
DIM anim[2][20][20] // [1] 0,1 player 1 e 2 // [20] num max of animation // [30] num max of frame for single animation


My game run at 20 FPS on iPhone ....  :'(

If I could change the texture after the call STARPOLY would be fantastic!

Example:
Code (glbasic) Select
loadsprite "Media/bla0.png",1
loadsprite "Media/bla1.png",2
loadsprite "Media/bla2.png",3

STARTPOLY 1,2 // apply  the texture 1

LOCAL c%=RGB(255,255,255)
POLYVECTOR  0, 0, 0,0,c
POLYVECTOR  0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c

POLYNEWSTRIP 2 // apply the texture 2
POLYVECTOR  0, 0, 0,0,c
POLYVECTOR  0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c

POLYNEWSTRIP 3 // apply the texture 3
POLYVECTOR  0, 0, 0,0,c
POLYVECTOR  0,40, 0,40,c
POLYVECTOR 40,20, 40,0,c
POLYVECTOR 40,40, 40,40,c
ENDPOLY


Now I'm looking for another solution.

This is a screenshot of my test game:



Kitty Hello

Changing textures costs performance. No way to implement that in the new vertex group. I would have to startpoly/endpoly anyway.

Your sprites are big. The fill rate of the iPhone is very limited. I try if I can change the internal texture format to something better, but don't expect too much speed boost.

Kyo

Quote from: Kitty Hello on 2010-Feb-20
Changing textures costs performance. No way to implement that in the new vertex group. I would have to startpoly/endpoly anyway.

Your sprites are big. The fill rate of the iPhone is very limited. I try if I can change the internal texture format to something better, but don't expect too much speed boost.


thanks for the info. I'll try to do anything....  :good: