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.


Topics - kiffa

Pages: 1 2 [3] 4 5 6
31
Support / NullPointerException in FrameBuffer.dispose().
« on: June 22, 2013, 07:49:27 am »
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:

Code: [Select]
//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
« on: 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
Support / Some issues about Object3d.checkForCollisionSpherical()
« on: April 26, 2013, 03:11:43 pm »
My racing game, Codes:
 
Code: [Select]
    //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
Support / How to effectively use the cache of cup/gpu in java/jPCT-AE?
« on: April 26, 2013, 04:37:46 am »
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
« on: April 19, 2013, 05:38:51 am »
codes:

Code: [Select]
mObject3d.checkForCollisionSpherical(step, r);
Exception:

Code: [Select]
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:

Code: [Select]
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
Support / Could i use pre-compressed ETC1 texture file in jPCT-AE?
« on: April 17, 2013, 05:48:44 am »
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
Support / Does the fog affect the performance heavily?
« on: April 07, 2013, 03:47:29 pm »
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:

Code: [Select]
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:

Code: [Select]
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.


41
Support / Strange texture rendering.
« on: March 27, 2013, 10:33:24 am »
My game have a car and 2 scenes, i keep the car-Object3D in memory permanently, and unload the texture when scene changing, the problem is:

1, In scene 1, all are fine, then change to scene2, unload the texture.
2, In scene 2, reload the car-texture(which is the same as scene 1), reassign it to the car.
3, The car seems rendering with another texture. For example, there are other objects in my scene, road\sky\building\tree..., the car seems rendering with the texture of the road.
4, Chang to scene 1 again, unload\reload\reassign, the car seems rendering with the texture of the tree.
5, Chang to scene 2 again, the car seems rendering with the texture of the tree(of scene 2, which is different from the tree of scene 1).
6, Repeat changing scenes, at last, the car will be black and doesn't change any more.

scene 1:


scene 2:


scene 1:


at last:

42
Support / How to improve the performance of SkyBox?
« on: March 26, 2013, 08:52:34 am »
I made a skyBox, which cause a 6-9 fps dropping down。How to improve the performance? Could i use only one world and one-time rendering to make skyBox?

My codes:

Code: [Select]
World skyWorld = new world();

/ /sky is an object3D which has a center of (0,0,0);
skyWorld.add(sky). 

//set camera to the center of sky.
skyWorld.getCamera().setPosition(0,0,0);

// sceneWorld is the world of scene(the "real" world).
skyWorld.getCamera().setBack(sceneWorld.getCamera().getBack());

// don't write to zBuffer when rendering the sky, to avoid to adjust the size of sky.
sky.setRenderHook(new IRenderHook(){
 public void beforeRendering(int paramInt) {
         GLES20.glDepthMask(false);
      }

  public void afterRendering(int paramInt) {
        GLES20.glDepthMask(true);
      }

});

// onDrawFrame(), rendering sky per frame
framebuffer.clear();
skyWorld.renderScene(framebuffer);
skyWorld.draw(framebuffer);

sceneWorld.renderScene(framebuffer);
sceneWorld.draw(framebuffer);

framebuffer.display();
 

43
Support / Some issues about transparency sorting.
« on: March 25, 2013, 11:12:47 am »
I 'am making a car-racing game. I made a road with some buildings, these buildings are just planes with alpha textures(png), and all the buildings are combinded to one mesh. The problem is: i could see the far buildings through the near buildings.

。。。。。。。。。。。。。。。。。。。
。                                                   。
。(far building)        (near building)。   <----- look at
。                                                   。
。。。。。。。。。。。。。。。。。。。
               



44
Support / How to judge if a texture contains alpha?
« on: March 22, 2013, 12:40:29 pm »
I'm writing a SceneLoader which has a feature: auto setting Object3D's transparency by it's texture. Codes may like that:

Code: [Select]
Texture texture = TextureManager.getInstance().getTexture(name);
object3d.setTexture(name);

if(texture.containsAlpha()){
  object3d.setTransparency(0xff);
}

But there isn't a method like texture.containsAlpha().

45
Support / How to move a car upon the ground of the ups and downs?
« on: March 20, 2013, 01:33:42 pm »
I'm making a car-racing game, the road is undulate, how to moving the car? Some sample codes will be very helpful, thanks!

Pages: 1 2 [3] 4 5 6