Hello,
I'm back with some questions I had wondered about for quite some time but never really bothered to ask.
Maybe a few things could be suggestions for the future of jPCT-AE as well...
It's a long list (and I'm not necessarily in a rush/hurry for answers so please take your time...) but anyway, here goes:
1. Why can a Light object only be assigned to one World? As far as I know you can only add a Light to the World using the constructor of Light.
When you look further, World does have the option to remove all lights with World.removeAll() or World.removeAllLights().
But there is no World.addLight(Light light) or World.addLights(Light[] lights) option...
In one of my projects, I remember having had 2 Worlds with diffent fogging parameters but same Lights, where I had to declare the 'same' Lights twice.
2. Is there any beneficial multi-threading capabilities jPCT-AE has or could have?
I have tried World.setDefaultThread(...) for instance but I never really understood its purpose entirely in jPCT-AE...
I tried to set it to a "new Thread()" but the application only became slower I believe...
I am not entirely sure if jPCT-AE has any other beneficial multi-threading capabilities (I haven't really found so far)...
I believe OpenGL doesn't entirely allow it anyway. But maybe some non-OpenGL things that jPCT does before rendering could still be done using multi-threading..? Pre-processing or anything like that
I figured that since devices become much better at multi-threading, maybe it would be nice to have some multi-threading options.
I found something interesting in the jPCT documentation:
https://www.jpct.net/doc/com/threed/jpct/threading/package-summary.html and
https://www.jpct.net/doc/com/threed/jpct/WorldProcessor.html but I haven't found something similar for jPCT-AE.
3. Will ReflectionHelper be ported to jPCT-AE?
I am referring to:
https://www.jpct.net/doc/com/threed/jpct/util/ReflectionHelper.htmlI believe ShadowHelper has been ported to jPCT-AE at a later stage too but I thought ReflectionHelper would be interesting too.
For mirror-like surfaces I believe it would be nice to have.
4. Will BloomGLProcessor be ported to jPCT-AE?
Here, I am referring to:
https://www.jpct.net/doc/com/threed/jpct/procs/BloomGLProcessor.htmlI am not sure if it is heavy or something but I thought it would be interesting to have.
5. Why can a VertexController only be assigned to a single mesh?
When you try to apply the same VertexController to another mesh you will get an error like:
"java.lang.RuntimeException: [ 1639357199784 ] - ERROR: This instance has already been assigned to another Mesh!"
I thought that maybe it would work too if the same VertexController was applied to multiple meshes, but I guess not...
6. Why does jPCT-AE use a static TextureManager instance?
I thought it would have made more sense to make a TextureManager per renderer or something
I believe it would be possible to have both too (so even Textures loaded from other renderers are accessible for whatever reason you have...)
With having both I mean that you have a 'TextureManager' per renderer but also still the global static one.
7. Why does jPCT-AE still attempt to draw non-visible polygons?
I believe polygons that are not visible in the scene are still sent to the GPU to 'draw' while they won't really be drawn.
Examples:
- polygons out of the FOV of the camera (or it seems jPCT still processes these unless they have been manually set to Object3D.setVisibility(false).
- polygons out of max fogging distance range.
- also this is not available in jPCT-AE:
https://www.jpct.net/doc/com/threed/jpct/Portals.html8. Is there any other plans for the future of jPCT-AE?
Further development? (implement new techniques and such; better lighting (Phong), more control for lighting (specularity))
Optimizing? (speeding up/improving existing implementations, multi-threading, etc.)
New features? (support for OpenGL3+ (compute shaders or something) or Vulkan or something)
More future-proofing? (I believe some things in jPCT-AE have been made for when Android 2.2/2.3 was more popular; so maybe they need to be reconsidered; think of memory limitations, max. texture size, max. texture stages, Phong shading, loading newer 3D models (other/newer file types), etc.)
Open-sourcing? (on GitHub or something so people can contribute)
Porting from other graphics libraries or jPCT? (some features that are present in other graphics libraries or jPCT but missing in jPCT-AE)
9. Any idea what causes these crashes..?
Most of these are native crashes but they might still point to some clue in the stacktrace (as some refer to the Java code)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.aeroshark333.artofearthify <<<
backtrace:
#00 pc 000000000001706c /vendor/lib64/libsrv_um.so
#00 pc 00000000000cc808 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002dcc4 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 0000000000031fb0 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002c4c8 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002bf24 /vendor/lib64/egl/libGLESv2_mtk.so (glDrawElements+120)
#00 pc 00000000000e7e1c /system/lib64/libandroid_runtime.so (android_glDrawElements__IIILjava_nio_Buffer_2(_JNIEnv*, _jobject*, int, int, int, _jobject*)+276)
#00 pc 00000000002d3504 /system/framework/arm64/boot-framework.oat (art_jni_trampoline+196)
#00 pc 00000000020072fc /memfd:/jit-cache (com.threed.jpct.GL20.glDrawElements+60)
#00 pc 0000000002020fc0 /memfd:/jit-cache (com.threed.jpct.CompiledInstance.render+11664)
#00 pc 000000000203cc88 /memfd:/jit-cache (com.threed.jpct.GLRenderer.drawVertexArray+2088)
#00 pc 0000000002047390 /memfd:/jit-cache (com.threed.jpct.World.draw+704)
#00 pc 000000000204a11c /memfd:/jit-cache (com.threed.jpct.World.draw+60)
#00 pc 0000000002018c28 /memfd:/jit-cache (com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame+9096)
#00 pc 0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001460ac /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
#00 pc 00000000002e3758 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
#00 pc 00000000002de7e4 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+900)
#00 pc 00000000005a8a8c /apex/com.android.runtime/lib64/libart.so (MterpInvokeVirtualQuick+596)
#00 pc 0000000000135594 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_virtual_quick+20)
#00 pc 000000000022cd84 /data/app/com.aeroshark333.artofearthify-yaNv3ycyylpEX_4FbNxKmA==/oat/arm64/base.vdex (com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame+4)
#00 pc 00000000005a4364 /apex/com.android.runtime/lib64/libart.so (MterpInvokeInterface+1740)
#00 pc 0000000000131a14 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_interface+20)
#00 pc 00000000002f475c /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.guardedRun+2068)
#00 pc 00000000005a4f00 /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+1168)
#00 pc 0000000000131914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#00 pc 00000000002f5152 /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+114)
#00 pc 00000000002b4088 /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.13310094408155829753)+240)
#00 pc 0000000000593d00 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1024)
#00 pc 0000000000140468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#00 pc 0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001460ac /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
#00 pc 00000000004b2da0 /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#00 pc 00000000004b3e50 /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416)
#00 pc 00000000004f43a8 /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176)
#00 pc 00000000000e5614 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
#00 pc 0000000000085458 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
signal 11 (SIGSEGV), code 2 (SEGV_ACCERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.aeroshark333.artofearthify <<<
backtrace:
#00 pc 000000000001706c /vendor/lib64/libsrv_um.so
#00 pc 00000000000ce0d8 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002e2cc /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000003264c /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002ca84 /vendor/lib64/egl/libGLESv2_mtk.so
#00 pc 000000000002c4dc /vendor/lib64/egl/libGLESv2_mtk.so (glDrawElements+120)
#00 pc 0000000000079d38 /vendor/lib64/egl/libGLES_meow.so
#00 pc 00000000000e6cac /system/lib64/libandroid_runtime.so (android_glDrawElements__IIILjava_nio_Buffer_2(_JNIEnv*, _jobject*, int, int, int, _jobject*)+276)
#00 pc 00000000002ca994 /system/framework/arm64/boot-framework.oat (art_jni_trampoline+196)
#00 pc 0000000000088d88 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.threed.jpct.GL20.glDrawElements+72)
#00 pc 0000000000064158 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.threed.jpct.CompiledInstance.render+12008)
#00 pc 000000000006cf88 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.threed.jpct.GLRenderer.drawVertexArray+2264)
#00 pc 000000000007f18c /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.threed.jpct.World.draw+844)
#00 pc 000000000007fc10 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.threed.jpct.World.draw+64)
#00 pc 0000000000051178 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame+9240)
#00 pc 0000000000056930 /data/app/com.aeroshark333.artofearthify-qsfIgfJfssMx7-jwHqMHFA==/oat/arm64/base.odex (com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame+64)
#00 pc 0000000002006824 /memfd:/jit-cache (android.opengl.GLSurfaceView$GLThread.guardedRun+6852)
#00 pc 0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001460ac /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
#00 pc 00000000002e3c38 /apex/com.android.runtime/lib64/libart.so (art::interpreter::ArtInterpreterToCompiledCodeBridge(art::Thread*, art::ArtMethod*, art::ShadowFrame*, unsigned short, art::JValue*)+384)
#00 pc 00000000002decc4 /apex/com.android.runtime/lib64/libart.so (bool art::interpreter::DoCall<false, false>(art::ArtMethod*, art::Thread*, art::ShadowFrame&, art::Instruction const*, unsigned short, art::JValue*)+900)
#00 pc 00000000005a4a40 /apex/com.android.runtime/lib64/libart.so (MterpInvokeDirect+400)
#00 pc 0000000000131914 /apex/com.android.runtime/lib64/libart.so (mterp_op_invoke_direct+20)
#00 pc 00000000002d79b6 /system/framework/framework.jar (android.opengl.GLSurfaceView$GLThread.run+114)
#00 pc 00000000002b4568 /apex/com.android.runtime/lib64/libart.so (art::interpreter::Execute(art::Thread*, art::CodeItemDataAccessor const&, art::ShadowFrame&, art::JValue, bool, bool) (.llvm.14186875840613789731)+240)
#00 pc 0000000000593b40 /apex/com.android.runtime/lib64/libart.so (artQuickToInterpreterBridge+1024)
#00 pc 0000000000140468 /apex/com.android.runtime/lib64/libart.so (art_quick_to_interpreter_bridge+88)
#00 pc 0000000000137334 /apex/com.android.runtime/lib64/libart.so (art_quick_invoke_stub+548)
#00 pc 00000000001460ac /apex/com.android.runtime/lib64/libart.so (art::ArtMethod::Invoke(art::Thread*, unsigned int*, unsigned int, art::JValue*, char const*)+244)
#00 pc 00000000004b2898 /apex/com.android.runtime/lib64/libart.so (art::(anonymous namespace)::InvokeWithArgArray(art::ScopedObjectAccessAlreadyRunnable const&, art::ArtMethod*, art::(anonymous namespace)::ArgArray*, art::JValue*, char const*)+104)
#00 pc 00000000004b3948 /apex/com.android.runtime/lib64/libart.so (art::InvokeVirtualOrInterfaceWithJValues(art::ScopedObjectAccessAlreadyRunnable const&, _jobject*, _jmethodID*, jvalue const*)+416)
#00 pc 00000000004f3e98 /apex/com.android.runtime/lib64/libart.so (art::Thread::CreateCallback(void*)+1176)
#00 pc 00000000000e2364 /apex/com.android.runtime/lib64/bionic/libc.so (__pthread_start(void*)+36)
#00 pc 0000000000083d98 /apex/com.android.runtime/lib64/bionic/libc.so (__start_thread+64)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.aeroshark333.artofearthify <<<
backtrace:
#00 pc 0000000000019164 /system/lib/libc.so (memcpy+96)
#00 pc 00000000000b37db /vendor/lib/libgsl.so (ioctl_kgsl_sharedmem_write+114)
#00 pc 00000000000f99b3 /vendor/lib/egl/libRBGLESv2_adreno.so (rb_vbo_cache_vertex_attrib+278)
#00 pc 000000000006a97d /vendor/lib/egl/libRBGLESv2_adreno.so (cache_vertex_array+1396)
#00 pc 000000000006b643 /vendor/lib/egl/libRBGLESv2_adreno.so (cache_vertex_elements+3162)
#00 pc 0000000000074bfd /vendor/lib/egl/libRBGLESv2_adreno.so (core_glDrawElementsInstancedXXX+984)
#00 pc 00000000000752bd /vendor/lib/egl/libRBGLESv2_adreno.so (core_glDrawElements+20)
#00 pc 0000000000052a51 /vendor/lib/egl/libRBGLESv2_adreno.so (glDrawElements+72)
#00 pc 0000000000d6352b /system/framework/arm/boot-framework.oat (offset 0x637000) (android.opengl.GLES10.glClearColorx [DEDUPED]+122)
#00 pc 0000000000012c37 /dev/ashmem/dalvik-jit-code-cache_12126_12126 (deleted)
signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.aeroshark333.artofearthify <<<
backtrace:
#00 pc 0000000000018da0 /system/lib/libc.so (memcpy+100)
#00 pc 0000000000093e03 /vendor/lib/egl/libGLESv2_mtk.so
#00 pc 000000000001c137 /vendor/lib/egl/libGLESv2_mtk.so
#00 pc 000000000001f1c7 /vendor/lib/egl/libGLESv2_mtk.so
#00 pc 000000000001af75 /vendor/lib/egl/libGLESv2_mtk.so
#00 pc 000000000001aabf /vendor/lib/egl/libGLESv2_mtk.so (glDrawElements+54)
#00 pc 000000000008441d /system/lib/libandroid_runtime.so (android_glDrawElements__IIILjava_nio_Buffer_2(_JNIEnv*, _jobject*, int, int, int, _jobject*)+116)
#00 pc 0000000000a09d75 /system/framework/arm/boot-framework.oat (offset 0x5ea000) (android.graphics.Color.nativeRGBToHSV [DEDUPED]+140)
#00 pc 00000000000102f7 /dev/ashmem/dalvik-jit-code-cache (deleted)
java.lang.RuntimeException:
at com.threed.jpct.Logger.log (Logger.java:206)
at com.threed.jpct.GL20.checkFrameBufferObject (GL20.java:2100)
at com.threed.jpct.GL20.setRenderTarget (GL20.java:2060)
at com.threed.jpct.GLRenderer.setRenderTarget (GLRenderer.java:2179)
at com.threed.jpct.FrameBuffer.setRenderTarget (FrameBuffer.java:287)
at com.threed.jpct.FrameBuffer.setRenderTarget (FrameBuffer.java:249)
at com.aeroshark333.blackhole3d.BlackHole3D.onDrawFrame (BlackHole3D.java:415)
at com.aeroshark333.blackhole3d.livewallpaper.LiveWallpaperRenderer.onDrawFrame (LiveWallpaperRenderer.java:83)
at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1591)
at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1286)
I guess this is all I have to ask for now. Looking forward to your reply!
Cheers,
Abiram