Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - kiffa

#21
For example, many trees which share the same mesh and the same texture, but have different translations and rotations and need be checked collision dividually(which means I can collide with only one of these trees and don't affect others).

Now I'm doing this like:

Object3D tree;
for(int i = 0; i < treeNum; ++i){
  trees[i] = tree.cloneObject();
  trees[i].translate(xxx);
  world.addObject(trees[i]);
}


But when the treeNum going large, the performance will drop down heavily. Each tree has about 20 tris, there are about 10 - 80 trees on screen.

1, Generally, is this(rendering 10 - 80 objects of 20-tiris ) a problem(with other objects of the scene)?

2, Could I render these trees once(like merging them to one large object3D)but check collision dividually?
#22
In my car-racing game, I need calc the distance between "rear\front" and road. But the result seems incorrect.

The car and road:

-------
|       |
--------------------
|                        |
--------------------
rear               front
----------------------------------------  road

code:
    mCar.Translate(0, 50, 0); // move up
    SimpleVector d = new SimpleVector(0, -1, 0);
    float frontHeight = mRoad.calcMinDistance(front, d, 4 * 30);
    float rearHeight = mRoad.calcMinDistance(rear, d, 4 * 30);
    WLog.d("front: " + front);
    WLog.d("rear: " + rear);
    WLog.d("frontHeight: " + frontHeight);
    WLog.d("rearHeight: " + rearHeight);


log:


09-15 16:30:56.680: D/Woo3d(4707): frontHeight: 50.03162
09-15 16:30:56.680: D/Woo3d(4707): rearHeight: 1.0E12
09-15 16:30:56.690: D/Woo3d(4707): front: (-2172.8433,50.031296,-1480.5132)
09-15 16:30:56.690: D/Woo3d(4707): rear: (-2172.3599,50.031296,-1543.8423)
09-15 16:30:56.690: D/Woo3d(4707): frontHeight: 50.03162
09-15 16:30:56.690: D/Woo3d(4707): rearHeight: 1.0E12
09-15 16:30:56.710: D/Woo3d(4707): front: (-2172.8623,50.031296,-1477.4586)
09-15 16:30:56.710: D/Woo3d(4707): rear: (-2172.379,50.031296,-1540.7877)
09-15 16:30:56.710: D/Woo3d(4707): frontHeight: 50.03162
09-15 16:30:56.710: D/Woo3d(4707): rearHeight: 50.03162



But there shouldn't be the result of COLLISION_NONE(1.0E12).  What's the possible reason?
#23
Support / Some question about the order of drawing.
September 10, 2013, 09:43:12 AM
How does jPCT-AE implement the order of drawing(rendering)?   

Dose jPCT-AE use any Occlusion culling?

I need these info to help my  art  partner to design the game scene. For example, one-large-combined-mesh VS small meshes, small textures VS one-large-texture, and so on.

by depth (necessity for accurate draw order / painter's algorithm)
-by program (context changes may be costly!)
--by texture in program (that texture context changes may be costly...)
---by mesh that uses that texture
----by discrete entity transform (every entity using this mesh)

#24
The same code to blit a full screen transparency texture:
frameBuffer.blit(mSpeedUpTexture, 0, 0, 0, 0, 128, 64, Constant.screenWidthPx, Constant.screenHeightPx, 0xff, false);

but cause the different performance on different devices:

1,  On Tegra2, when bliting, the FPS droped from 59 to 49. Screen: 800*480

2, On Adreno305, when bliting, the FPS(62-63) nearly doesn't drop. Screen: 960*540

What's the possible reason? Is this a fill rate issue? If I FrameBuffer.resize(400*240), the fps(59-60) won't drop when bliting on Tegra2.

And how to resolve this?
#25
In my game, I called Object3D.checkForCollisionEllipsoid() per frame, and I found there are some creating of new objects per call(Seems they are CollisionInfo and SimpleVector).

Is there any way to avoid this? I use the Allocation Tracker tool of Android to do the profiling, and there is the report:

#26
Support / Black texture when enable mipmapping.
August 14, 2013, 10:22:38 AM
Some textures(Seems 2^n * 2^m, not 2^n * 2^n) will be black if i enable mipmapping, and be fine if i disable mipmapping. Codes:

OK:
Config.glTransparencyMul = 1 / 255f;
    Config.glTransparencyOffset = 0;
    Config.farPlane = 7000;
    Config.unloadImmediately = true;
    Texture.defaultToKeepPixels(false);
    Texture.defaultTo4bpp(true);

    Texture.defaultToMipmapping(false);


Black:
Config.glTransparencyMul = 1 / 255f;
    Config.glTransparencyOffset = 0;
    Config.farPlane = 7000;
    Config.unloadImmediately = true;
    Texture.defaultToKeepPixels(false);
    Texture.defaultTo4bpp(true);

    Texture.defaultToMipmapping(true);


Env:

OS: Android 2.3.3\Android 4.2\Android 2.3\Android 4.0
Devices: Tegra2\Mali 400 MP\SGX 531\Adreno 203


And if i enable ETC1 and mipmapping, app will crash on Tegra2. If i enable ETC 1, disable mipmapping, app runs fine. The crash will not happen on Mali 400\SGX 531\Adreno 203.

The crash log:

08-14 16:07:30.850: I/jPCT-AE(8233): Subobject of object 32/object34 compiled to indexed fixed point data using 30/20 vertices in 17ms!
08-14 16:07:30.850: I/jPCT-AE(8233): Object 32/object34 compiled to 1 subobjects in 18ms!
08-14 16:07:30.850: I/jPCT-AE(8233): [ 1376467650865 ] - WARNING: Texture's size is 256/128, but textures should be square for OpenGL ES2.0! This may result in a black texture!
08-14 16:07:30.860: I/jPCT-AE(8233): Creating buffers...
08-14 16:07:30.860: I/jPCT-AE(8233): [ 1376467650874 ] - ERROR: before: glError 1282
08-14 16:07:30.870: W/dalvikvm(8233): threadid=13: thread exiting with uncaught exception (group=0x401c0560)
08-14 16:07:30.870: W/System.err(8233): java.lang.RuntimeException: [ 1376467650874 ] - ERROR: before: glError 1282
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.Logger.log(Logger.java:193)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.GL20.checkError(GL20.java:147)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.GL20.glGenBuffers(GL20.java:1354)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.CompiledInstance.compileToVBO(CompiledInstance.java:1455)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.CompiledInstance.render(CompiledInstance.java:593)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.GLRenderer.drawVertexArray(GLRenderer.java:2211)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.World.draw(World.java:1351)
08-14 16:07:30.870: W/System.err(8233):    at com.threed.jpct.World.draw(World.java:1091)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.woo3d.util.SkyBox.render(SkyBox.java:107)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.car.scene.Sky.update(Sky.java:90)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.car.scene.SceneRoad.beforeRender(SceneRoad.java:71)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.woo3d.defaultimpl.DefaultSceneManager.beforeRender(DefaultSceneManager.java:512)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.woo3d.components.GameRenderer.handleGameRender(GameRenderer.java:456)
08-14 16:07:30.870: W/System.err(8233):    at com.zwenyu.woo3d.components.GameRenderer.onDrawFrame(GameRenderer.java:140)
08-14 16:07:30.870: W/System.err(8233):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
08-14 16:07:30.870: W/System.err(8233):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)




#27
Support / How to do the profiling in jPCT-AE?
August 12, 2013, 10:13:27 AM
My purpose is to do some performance profiling, and there are another questions:

1, Is there a method to print the exact numbers of draw calls per frame?

2, How to print the total numbers of triangles(vertices) in world?

3, How to print the total  numbers of triangles(vertices) which was exactly  rendering in world?(means which was not culled/in display list/in visible list ...).

4, How to print the consuming time of gpu and cpu per frame?
#28
Many 3D games of PC have the settings of changing screen-resolution.

Could I do this in android with jPCT-AE?

E.g: My device is 480*800, i want to simulate a 320*533 screen(full screen).

If I coding like "new FrameBuffer(320, 533)", I will get a game screen of 320*533, but it's not full screen.

#29
GUI means menu\button\dash board\HP-bar and so on,  they are 2D images in most case.

I have tried 2 methods:
  1, Use Android GUI mechanism: This is simple, but will be slow when the view(s) need to update frequently(send msg to UI-Thread, then measure\layout\draw the View-hierarchy.)

2, Use FrameBuffer.blit(): Need to code yourself for some special effects, and seems to be not very fast(Maybe I used it in a wrong way).

My question:
  1, Could you explain the implementation of FrameBuffer.blit()? And how fast should it be?

  2, Is there a third way? The performance is the most important factor  to me.
#30
Support / Does jni make sense?
July 31, 2013, 04:41:44 AM
For jPCT-AE, does jni make sense?
#31
When exiting my game, sometimes the app will crash. I doubt the problem was caused by multi threads,  but after checking many times, i didn't found the reason, could you give me some guides?

codes:

//in onDrawFrame():  -- GLThread
  destroyDirect();

  private void destroyDirect() {
    WLog.d("--------------------------------------------");
    WLog.d("gamerender destroy!!!!");

    getGameContext().getSceneManager().destroyCurrentScene();
    getGameContext().getWorld().dispose();

    if (mFrameBuffer != null) {
      WLog.d("--------------------------------------------");
      WLog.d("dispose world!");
      getGameContext().getWorld().dispose();
      WLog.d("--------------------------------------------");
      WLog.d("dispose framebuffer!");
      mFrameBuffer.dispose();
      WLog.d("--------------------------------------------");
    }
}



logs:


06-22 13:23:55.204: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.204: D/Woo3d(12923): gamerender destroy!!!!
06-22 13:23:55.204: D/Woo3d(12923): destroy current scene
06-22 13:23:55.204: D/Woo3d(12923): clear camera controller
06-22 13:23:55.204: D/Woo3d(12923): free texture: bar_1
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bar_1
06-22 13:23:55.204: D/Woo3d(12923): free texture: bar_2
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bar_2
06-22 13:23:55.204: D/Woo3d(12923): free texture: bridge
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture bridge
06-22 13:23:55.204: D/Woo3d(12923): free texture: light
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture light
06-22 13:23:55.204: D/Woo3d(12923): free texture: road
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture road
06-22 13:23:55.204: D/Woo3d(12923): free texture: sea
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture sea
06-22 13:23:55.204: D/Woo3d(12923): free texture: flag
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture flag
06-22 13:23:55.204: D/Woo3d(12923): free texture: start
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture start
06-22 13:23:55.204: D/Woo3d(12923): free texture: accTrigger_1
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture accTrigger_1
06-22 13:23:55.204: D/Woo3d(12923): free texture: accTrigger_2
06-22 13:23:55.204: D/texture(12923): removeAndUnload texture accTrigger_2
06-22 13:23:55.274: D/dalvikvm(12923): GC_EXPLICIT freed 2076K, 66% free 6588K/19335K, external 8736K/10356K, paused 71ms
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object483'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object482'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object481'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object480'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object479'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object478'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object477'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object476'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object475'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object474'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object473'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object472'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object471'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object470'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object469'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object468'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object467'
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bar_1
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object466'
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bar_2
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_bridge
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_light
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_road
06-22 13:23:55.284: D/Woo3d(12923): unload object3d: 4_sea
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object465'
06-22 13:23:55.284: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.284: D/Woo3d(12923): dispose world!
06-22 13:23:55.284: D/Woo3d(12923): --------------------------------------------
06-22 13:23:55.284: D/Woo3d(12923): dispose framebuffer!
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object464'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object463'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object462'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object461'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object460'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object459'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object458'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object457'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object456'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object455'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object454'
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object453'
06-22 13:23:55.284: I/jPCT-AE(12923): All texture data unloaded from gpu!
06-22 13:23:55.284: I/jPCT-AE(12923): VBO disposed for object 'object452'
06-22 13:23:55.284: I/jPCT-AE(12923): Disposing VBOs!
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object451'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object450'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object449'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object448'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object447'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object446'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object445'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object444'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object443'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object442'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object441'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object440'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object439'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object438'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object437'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object436'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object435'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object434'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object433'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object432'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object431'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object430'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object429'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object428'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object427'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object426'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object425'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object424'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object423'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object422'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object406'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object405'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object404'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object403'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object402'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object401'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object400'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object399'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object398'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object397'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object396'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object395'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object394'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object393'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object392'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object391'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object390'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object389'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object388'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object387'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object386'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object385'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object384'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object383'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object382'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object381'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object380'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object379'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object378'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object377'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object376'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object375'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object374'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object373'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object372'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object371'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object370'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object369'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object368'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object367'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object366'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object365'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object364'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object363'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object362'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object361'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object360'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object359'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object358'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object357'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object356'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object355'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object354'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object353'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object351'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object350'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object349'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object348'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object347'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object346'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object345'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object341'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object325'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object340'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object336'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object342'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object337'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object180'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object339'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object322'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object338'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object251'
06-22 13:23:55.304: I/jPCT-AE(12923): VBO disposed for object 'object109'
06-22 13:23:55.304: W/dalvikvm(12923): threadid=18: thread exiting with uncaught exception (group=0x4018b560)
06-22 13:23:55.314: E/AndroidRuntime(12923): FATAL EXCEPTION: GLThread 35
06-22 13:23:55.314: E/AndroidRuntime(12923): java.lang.NullPointerException
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.threed.jpct.GLRenderer.dispose(GLRenderer.java:478)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.threed.jpct.FrameBuffer.dispose(FrameBuffer.java:378)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.zwenyu.woo3d.components.GameRenderer.destroyDirect(GameRenderer.java:446)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at com.zwenyu.woo3d.components.GameRenderer.onDrawFrame(GameRenderer.java:131)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1363)
06-22 13:23:55.314: E/AndroidRuntime(12923):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)
#32
Support / Texture was dim with Mali 400
May 15, 2013, 01:57:43 PM
The same texture (and models) was rendering well with Tegra2 but dim with Mali 400(seems there are some water print upon the texture). See the road:



Log:

05-15 20:09:53.251: D/Woo3d(17573): egl vendor: Android
05-15 20:09:53.251: D/Woo3d(17573): egl version: 1.4 Android META-EGL
05-15 20:09:53.251: D/Woo3d(17573): egl extension: EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_gl_renderbuffer_image EGL_KHR_fence_sync EGL_ANDROID_image_native_buffer
05-15 20:09:53.251: D/Woo3d(17573): support opengl-es 2.0
05-15 20:09:53.251: D/Woo3d(17573): choose EGLConfig: MSAA enabled with 2 samples!
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_RED_SIZE: 5
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_GREEN_SIZE: 5
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_BLUE_SIZE: 5
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_ALPHA_SIZE: 1
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_DEPTH_SIZE: 24
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_RENDERABL_TYPE: 5
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_SAMPLE_BUFFERS: 1
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_SAMPLES: 4
05-15 20:09:53.251: D/Woo3d(17573): eglconfig: EGL_STENCIL_SIZE: 8
05-15 20:09:53.271: D/Woo3d(17573): 3d Renderer Surface Created
05-15 20:09:53.271: D/Woo3d(17573): 3d Renderer Surface Changed: 1280, 800
05-15 20:09:53.271: D/Woo3d(17573): initFrameBuffer: width: 1280, height: 800
05-15 20:09:53.761: D/Woo3d(17573): GL vendor:ARM
05-15 20:09:53.761: D/Woo3d(17573): GL version:OpenGL ES 2.0
05-15 20:09:53.761: D/Woo3d(17573): GL renderer:Mali-400 MP
05-15 20:09:53.761: D/Woo3d(17573): GLSL version:OpenGL ES GLSL ES 1.00
05-15 20:09:53.761: D/Woo3d(17573): GL extensions:GL_EXT_debug_marker GL_OES_texture_npot GL_OES_compressed_ETC1_RGB8_texture GL_OES_standard_derivatives GL_OES_EGL_image GL_OES_depth24 GL_ARM_rgba8 GL_ARM_mali_shader_binary GL_OES_depth_texture GL_OES_packed_depth_stencil GL_EXT_texture_format_BGRA8888 GL_EXT_blend_minmax GL_OES_EGL_image_external GL_OES_EGL_sync GL_OES_rgb8_rgba8 GL_EXT_multisampled_render_to_texture GL_EXT_discard_framebuffer
05-15 20:09:53.761: D/Woo3d(17573): GL_BLEND is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_CULL_FACE is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_DEPTH_TEST is: true
05-15 20:09:53.761: D/Woo3d(17573): GL_DITHER is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_POLYGON_OFFSET_FILL is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_SAMPLE_ALPHA_TO_COVERAGE is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_SAMPLE_COVERAGE is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_SCISSOR_TEST is: false
05-15 20:09:53.761: D/Woo3d(17573): GL_STENCIL_TEST is: false


#33
The problem happens rare.

And the color of stripes maybe white or black(depending on devices), the size of stripes is about 1/10 of the screen. The persistent  time of the strips is very short, may be 1-5 frames(a rough estimate).

Any hints?
#34
My racing game, Codes:
 
    //onDrawFrame, move car.
    mStep = calcStepBySpeed();
    SimpleVector fixedStep = null;
    if (!(fixedStep = mModel.checkForCollisionSpherical(mStep, r)).equals(mStep)) {
      fixedStep.y = mStep.y;
      mStep = fixedStep;
    }
    mModel.translate(mStep);


Problem: Sometimes, the car can run through the bar(collider). See the pic below, the white ball is the boundingSphere of the car.

1, The correct collision status:





2, The incorrect status, the car may run through the bar(not often):




#35
In C, i know some tricks to improve the cache hitting. But i'm not very clear how JVM/DVM work, so i don't know how to improve this in java. And i know little about GPU(and it's cache)。

Any suggestions or best practices? And could jPCT-AE benefit from mulit-cores cpu?
#36
Support / NullPointerException in collision checking
April 19, 2013, 05:38:51 AM
codes:

mObject3d.checkForCollisionSpherical(step, r);

Exception:

04-19 01:31:19.280: E/AndroidRuntime(3243):       java.lang.NullPointerException
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.threed.jpct.Object3D.collideSpherical(Object3D.java:4284)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.threed.jpct.World.checkSomeCollisionSpherical(World.java:1650)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.threed.jpct.World.checkObjCollisionSpherical(World.java:1275)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.threed.jpct.Object3D.checkForCollisionSpherical(Object3D.java:2865)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.entity.ComMove.checkCollision(ComMove.java:130)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.entity.ComAI.tryMove2(ComAI.java:54)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.entity.ComAI.update(ComAI.java:173)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.entity.GameEntity.update(GameEntity.java:144)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.entity.GameEntityManager.updateAllEntities(GameEntityManager.java:60)
04-19 01:31:19.280: E/AndroidRuntime(3243): at com.zwenyu.woo3d.scene.Scene3D.onLoop(Scene3D.java:209)



Others: 
Hard to reappear the exception. I use octree for collision.
#37
In my racing game, i used Object.checkForCollisionEllipsoid() to check collision.

The collision will happen between these objs: player's car(1 object3d)、npc-cars(1 - 6, 6 object3ds)、road-bar(one large object3d):



My codes:

bar.setCollisionMode(Object3D.COLLISION_CHECK_OTHERS);

playerCar.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
npcCar1.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
npcCar2.setCollisionMode(Object3D.COLLISION_CHECK_SELF);
...
npcCar6.setCollisionMode(Object3D.COLLISION_CHECK_SELF);


OcTree oc = new OcTree(bar, 10, 3, OcTree.MODE_OPTIMIZED);
oc.setRenderingUse(false);
oc.setCollisionUse(true);
bar.setOcTree(oc);

//onDrawFrame
playerCar.checkForCollisionEllipsoid(step, mEllipsoid, 3);
npcCar1.checkForCollisionEllipsoid(step, mEllipsoid, 3);
...
npcCar6.checkForCollisionEllipsoid(step, mEllipsoid, 3);


My question:
1, The bar has 8800 triangles, how to create the octree will give the best performance?

2, Any other suggestions to improve the collision performance? The bar is just plane.

#38
I used Texture.setTextureCompression(true) ;

But i'm not clear how it works, create normal-texture from image file -> compress it to ect1-texture -> upload to gpu, right?

Could i use pre-compressed etc1-texture file which is created by the etc1 tool of android(or another etc1 tools)?  My purpose is to decrease the size of APK and the memory usage (in order to use larger texture to improve the details).

Does texture compression always improve the performance? I know it will decrease the bandwidth usage of texture, but i am not clear if it will consume more time to access the texels(seek/uncompress/read etc...);
#39
In my racing game, if i disable fogging, FPS = 50 - 54,  if i enable, FPS = 38 - 44. I don't know if i use it in a wrong way. Codes:

world.setFogging(World.FOGGING_ENABLED);
world.setFogParameters(3000, 3500, 155, 155, 155);
#40
removeAndUnload() the texture, then reload the texture, the obj seems still rendering with the dummy texture:


car.setTexture("car");

TextureManager.getInstance().removeAndUnload("car", getFrameBuffer());

Texture t = new Texture(in, false);
TextureManager.getInstance().addTexture("car", t);
TextureManager.getInstance().prewarm(getFrameBuffer());
car.setTexture("car");



And if i don't remveAndUnload, just replace it, the result is correct.