Author Topic: skybox in jpct-ae  (Read 4682 times)

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
skybox in jpct-ae
« on: February 24, 2011, 01:37:07 pm »
Hi,

First of all, I only starting using jpct-ae about 3 weeks ago but I want to thank you Egon for developing this library - it is absolutely awesome!

Now, I am trying to write a simple game for android at the moment but I noticed that the framerate for my prototype to date was running at around 30fps on a 1ghz phone so I spent some time trying to optimize it. I have it running at 50fps now after some work but I find that if i remove my skybox from the world (or fog it out) then the fps jumps to 60. So it seems that the skybox is really hurting my framerate.

My approach to the skybox is :
1) Modeled a cube in blender and flipped the normals on the faces of the cube so that the textures will render on the inside
2) Exported the cube as 3ds file - i did not texture the cube in blender.
3) load the 3ds into the world (same world as the rest of the game, not a seperate world like in one of the demos) and used setTexture method to put the same jpg on each of the faces.

This renders well and does what i would like but its the framerate that bothers me.

Is this being caused by the fact that I have a massive cube and the textures are being stretched across the faces of the cube?

What would be a better approach?

I have one or two other questions but I will post them separately so that any answers will be easier to find for others who encounter the same issues.

Thanks in advance.

Any help would be appreciated. Thanks.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: skybox in jpct-ae
« Reply #1 on: February 24, 2011, 01:48:25 pm »
It's most likely caused by fillrate limitations of your hardware. There's nothing you can do about it except not rendering the box. You may give jPCT's own SkyBox-implementation in the util-package a try to make sure that it's not a problem with your model/code somehow, but i don't think so.
You might also try to use smaller textures to increase texture cache hit rate of the GPU.

BTW: I'll move this thread to the support section in the jPCT-AE subforum...

Offline dectar

  • byte
  • *
  • Posts: 21
    • View Profile
Re: skybox in jpct-ae
« Reply #2 on: February 24, 2011, 01:58:39 pm »
Thanks Egon. I somehow did not notice that there was an android specific support forum. This should keep me busy for a while :)

I do need some sort of skybox because my game is based on a floating platform of sorts and to have a single colour background would not look very aesthetic. I will keep digging around with a few other ideas.