Pocket PC 3D - slower

Previous topic - Next topic

mikiex

btw I tested the latest version, I see no 3d at all now :(

Kuron

Quotemaybe microsoft will release a handheld console...
Pocket BSOD?

Kitty Hello

mikiex: what example did you try?

Kitty Hello

You are right. I found the bug. Worked on emulator but not on real device. Get a new update.

kanati

I can get a few of the 3d samples working now...  still nothing in 640x480 correctly though...

mikiex

I get a few flickers of polys, but it crashes out on pocket pc :(

Kitty Hello

What example? PocketPC is quite limited in memory, so I'd not go for something big.
JumpFrog compiled as 3D works on my machine.

mikiex

just something simple like this :
Code (glbasic) Select
X_AUTONORMALS 1
Cube(0)

X_AUTONORMALS 2
Cube(1)
FILLRECT 0,0,320,240,RGB(0,0,200)
WHILE TRUE

X_MAKE3D 1, 2000, 45
X_CULLMODE 0
X_CAMERA 0,2,4, 0,0,0
phi=phi+GETTIMER()/5
X_MOVEMENT -1, 0, 0
X_ROTATION phi, 0,1,0
X_DRAWOBJ 0, 0
X_MOVEMENT 1, 0, 0
X_ROTATION phi, 0,1,0
X_DRAWOBJ 1, 0
SHOWSCREEN
  X_MAKE2D
   FILLRECT 0,0,320,240,RGB(0,0,200)


WEND



// ------------------------------------------------------------- //
// -=#  CREATECUBE  #=-
// ------------------------------------------------------------- //
FUNCTION Cube: num
LOCAL col
col=RGB(254, 254, 254) // white
colr=RGB(254, 0, 0) // white
X_OBJSTART num
// Front Face
X_OBJADDVERTEX  .5, -.5,  .5, 1, 0, col
X_OBJADDVERTEX -.5, -.5,  .5, 0, 0, col
X_OBJADDVERTEX  .5,  .5,  .5, 1, 1, col
X_OBJADDVERTEX -.5,  .5,  .5, 0, 1, col
X_OBJNEWGROUP
// Back Face
X_OBJADDVERTEX -.5,  .5, -.5, 1, 1, colr
X_OBJADDVERTEX -.5, -.5, -.5, 1, 0, colr
X_OBJADDVERTEX  .5,  .5, -.5, 0, 1, colr
X_OBJADDVERTEX  .5, -.5, -.5, 0, 0, colr
X_OBJNEWGROUP
// Top Face
X_OBJADDVERTEX -.5,  .5,  .5, 0, 0, col
X_OBJADDVERTEX -.5,  .5, -.5, 0, 1, col
X_OBJADDVERTEX  .5,  .5,  .5, 1, 0, col
X_OBJADDVERTEX  .5,  .5, -.5, 1, 1, col
X_OBJNEWGROUP
// Bottom Face
X_OBJADDVERTEX  .5, -.5, -.5, 0, 1, col
X_OBJADDVERTEX -.5, -.5, -.5, 1, 1, col
X_OBJADDVERTEX  .5, -.5,  .5, 0, 0, col
X_OBJADDVERTEX -.5, -.5,  .5, 1, 0, col
X_OBJNEWGROUP
// Right face
X_OBJADDVERTEX  .5,  .5, -.5, 1, 1, col
X_OBJADDVERTEX  .5, -.5, -.5, 1, 0, col
X_OBJADDVERTEX  .5,  .5,  .5, 0, 1, col
X_OBJADDVERTEX  .5, -.5,  .5, 0, 0, col
X_OBJNEWGROUP
// Left Face
X_OBJADDVERTEX -.5, -.5,  .5, 1, 0, col
X_OBJADDVERTEX -.5, -.5, -.5, 0, 0, col
X_OBJADDVERTEX -.5,  .5,  .5, 1, 1, col
X_OBJADDVERTEX -.5,  .5, -.5, 0, 1, col
X_OBJNEWGROUP
X_OBJEND
ENDFUNCTION

Hemlos

I might be able to help a little with this one..

Try creating a new xmake3d and camera for each obeject you want to render.
You are redunantly moving and rotating 2 times with one camera frame.

Also..
Showscreen automatically blacks out the screen buffer after it is rendered to the screen.
Thus eliminating the last fillrect after the showscreen, in your example will free up some memory loss:
Code (glbasic) Select
Remove:
      X_MAKE2D
   FILLRECT 0,0,320,240,RGB(0,0,200)
Note: If you want to render 2d on top of the 3d, it may help if you call x_make2d only once, before showscreen. Hence, even on a normal pc the differences in performance can be drastic, if there is too much redundant and/or unused lines of code.
Bing ChatGpt is pretty smart :O

Kitty Hello

Instead of
X_MAKE3D 1, 2000, 45
try:
X_MAKE3D 1, 20, 45

Making the z-buffer less wide. Try on PC first. I'm very busy atm, so I can't test.

mikiex

Tried that, it doesn't help, also this program used to work fine on pocket pc (it still works fine on pc)