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 - Redman

Pages: [1]
Support / glError 1281 exception
« on: July 15, 2016, 06:14:53 pm »
I'm getting this really strange crash exception from jPCT-AE.  I'm manually creating a bunch of Object3D's...  and it all renders fine, unless I translate the Object3D z position <= -16.0f, in which case I get this exception:

07-15 12:09:49.709 423-454/com.xxxxxxxxxx I/jPCT-AE: Creating buffers...
07-15 12:09:49.710 423-454/com.xxxxxxxxxx E/jPCT-AE: [ 1468598989710 ] - ERROR: before: glError 1281
07-15 12:09:49.740 423-454/com.xxxxxxxxxx E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f8a22e180
07-15 12:09:49.752 423-454/com.xxxxxxxxxx E/AndroidRuntime: FATAL EXCEPTION: GLThread 10571
                                                                          Process: com.redman.xxxxxxxxxx, PID: 423
                                                                          java.lang.RuntimeException: [ 1468598989710 ] - ERROR: before: glError 1281
                                                                              at com.threed.jpct.Logger.log(
                                                                              at com.threed.jpct.GL20.checkError(
                                                                              at com.threed.jpct.GL20.glGenBuffers(
                                                                              at com.threed.jpct.CompiledInstance.compileToVBO(
                                                                              at com.threed.jpct.CompiledInstance.render(
                                                                              at com.threed.jpct.GLRenderer.drawVertexArray(
                                                                              at com.threed.jpct.World.draw(
                                                                              at com.threed.jpct.World.draw(
                                                                              at com.xxxxxxxxxx.GameActivity$MyRenderer.onDrawFrame(
                                                                              at android.opengl.GLSurfaceView$GLThread.guardedRun(
                                                                              at android.opengl.GLSurfaceView$

Any idea?  I've tried the current jPCT AE JAR and the beta.  Both crash on this...

I'm currently working on an RTS project for Android using jPCT-AE.  There could possibly be up to 300+ objects on screen at one time, and I found I needed to lighten the CPU processing and memory load.  I am working on something I'm dubbing "Instance-Batch-Rendering" and I wanted to get thoughts and suggestions.

This method is for speeding up the process of rendering an Object3D multiple times on screen.

How it works:
  • Instead of cloning an Object3D, reusing the Mesh data, and sharing compiled data, this method only creates and adds 1 Object3D to the world for each unique mesh.  The Object3D must always be visible by the camera for this method to work, but it doesn't matter where its positioned.  It just matters that jPCT adds it to the visList for rendering.
  • I have created a lighter weight Instance3D object, whose main functionality is maintaining the world transform matrix (rotations, translations, scales) as well as integer ID of which model instance it represents.  It's basically an Object3D, but has no mesh data and doesn't take up much memory at all.  On each UI render frame, I manually create my own visList of Instance3D's based off the camera.  Because my project is an RTS with a top down camera, its extremely easy to calculate which objects are roughly on screen just by their x-y(z) coordinates as it's a grid.  The visLists for each type (different Meshes) of Instance get stored and calculated on every frame.  If there are no visible Instances for an Object3D, it sets the Object3D visibility to false so it doesn't get picked up in the jPCT render pipeline.
  • This Object3D has an IRenderHook attached to it.  On render, the IRenderHook.beforeRendering gets called in which it read fetches the first item in the visList.  Uniforms are passed into a Shader for the camera back matrix, the camera position, as well as a uniform for the the instance's world transform matrix.  The IRenderHook.repeatRendering gets called, increments the render index for the instance, and fetches the next instance if there are more.  It sets the transform matrix uniform of the instance and returns true.  If there are no more, it returns false.
  • A custom shader is added to the Object3D which uses the passed in Uniforms to calculate the instance's ModelViewMatrix and ModelViewProjectionMatrix on the GPU-side (offloading matrix calculations to the GPU).

So far, I have seen pretty good performance improvements using this method.  I have not tested everything out, and this is certainly not for everybody.  I have a bit more work to do on this methodology, but I wanted to gather opinions on it.  If anybody is interested, I will publish the work in this Thread, but it will be a use at your own risk as it will not support everything that jPCT-AE does and you will definitely need to build your own logic to fit your project.

I will be adding support for my hybrid-GPU-bones-animated objects for this methodology so it can support animations as well as static objects.

This is only for GLES 2.0+ as it uses Shaders at its core.

Bones / Has anybody implemented GPU/vertex shader bones yet?
« on: June 17, 2016, 11:38:33 pm »
I am curious to see if anybody has implemented GPU bones Shader yet and if they would be willing to share.  I see it mentioned in past topics, but no solution.  In the meantime, I will try to write one and share it if I'm successful.

I can't continue my project without it as my frame rates drop dramatically if I call animateSkin(...);


Bones / Skeleton deformations
« on: January 03, 2016, 03:00:14 pm »
I'm having an issue hopefully somebody else has faced.  I'm exporting from 3dsmax using OgreMax.  The binary loads properly with animations in the Ogre3D viewer, but the when converting the exported XML to *.bones format and loading the file into my jPCT-ae app, there's an issue where the skeleton bones don't appear to transforming the animation properly in the hierarchy.  Please see the attached screenshot.  Any help you may provide is greatly appreciated!

Pages: [1]