www.jpct.net

jPCT-AE - a 3d engine for Android => Support => Topic started by: fir3d on May 14, 2010, 06:20:39 pm

Title: some questions
Post by: fir3d on May 14, 2010, 06:20:39 pm
1.) I searched on google and I couldnt find it anywhere. What does it mean to serialize a mesh? ???

2.) in the source of the simple demo there is no thread made to draw the graphics (game loop), is the ondrawframe automatically run in a different thread?


3.) I keep on getting out of memory when trying to load the 3ds object. What should be a good number of polygons for a model to use in an android game?
Title: Re: some questions
Post by: EgonOlsen on May 15, 2010, 09:48:17 am
On this page: http://www.jpct.net/jpct-ae/ (http://www.jpct.net/jpct-ae/) you'll find an alpha version of jPCT 1.21 (the desktop version, not the Android one). That one contains a new class called DeSerializer. You can use this class to load a model on your workstation and serialize it to a file for the android version. You can then use the Loader-class of AE to load it. This serves three purposes:


Some more information can be found here: http://www.jpct.net/forum2/index.php/topic,1578.0.html (http://www.jpct.net/forum2/index.php/topic,1578.0.html)

If you are having problems with that alpha version of 1.21, here's a more recent jar: http://www.jpct.net/download/beta/jpct.jar (http://www.jpct.net/download/beta/jpct.jar)

The OOM-Exception from the 3ds loader comes from the fact that the loader has to do some parsing, which consumes additional memory. Loading a serialized object doesn't require this, so models loaded that way can be larger.
Title: Re: some questions
Post by: EgonOlsen on May 15, 2010, 10:31:50 pm
Forgot about the thread question: yes.
Title: Re: some questions
Post by: fir3d on May 16, 2010, 03:40:26 pm
thanks for the help!

whats the best way to add shadows in android, or is it not possible yet?
Title: Re: some questions
Post by: EgonOlsen on May 16, 2010, 11:10:07 pm
Either bake it into the texture if possible (i.e. for static meshes) or use some planar shapes below the objects (i.e. "blob shadows"). There's no support for shadow mapping in hardware and even if it were, it would be much to slow on current hardware anyway.
Title: Re: some questions
Post by: AGP on August 31, 2011, 12:08:14 am
What is controlling (and starting) the repainting?
Title: Re: some questions
Post by: EgonOlsen on August 31, 2011, 06:51:55 am
What is controlling (and starting) the repainting?
I'm not sure what you mean with that question? Who controls the call to onDrawFrame()? Android. You can switch to some manual mode if you want to, but by default, it calls it every *whatever* ms. Was that your question?
Title: Re: some questions
Post by: AGP on August 31, 2011, 05:10:44 pm
Yeah, that was it. So to make a game loop for your Hello World, one would have to call something like (or exactly like)
Code: [Select]
renderer.setRenderMode(RENDERMODE_WHEN_DIRTY);
right? And to repaint:
Code: [Select]
renderer.requestRender();
Is that the way you would do it, or would you just recommend that the game loop be called by renderer.onDrawFrame(GL10)?
Title: Re: some questions
Post by: EgonOlsen on September 01, 2011, 01:04:45 pm
I use to put my calls to the game logic into the onDrawFrame() method and let Android manage the repaints. I never bothered with RENDERMODE_WHEN_DIRTY.