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.


Messages - zammbi

Pages: 1 ... 7 8 [9] 10 11 ... 25
121
Support / Re: Version updates!
« on: March 01, 2012, 08:38:48 am »
With a little fun I finally got it to work. Here is the code if anyone wants to do the same :)

Code: [Select]
boolean isOpenGl2 = false;
try {
Method setEGLContextClientVersion = GLSurfaceView.class.getMethod(
                   "setEGLContextClientVersion", int.class );
           /* success, this is a newer device */

setEGLContextClientVersion.invoke(mGLView, 2);
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView));
isOpenGl2 = true;
Log.d("WW", "Using OpenGL 2.0");
} catch (NoSuchMethodException e) {
Log.d("WW", "Fail to find setEGLContextClientVersion, must be an older device.");
} catch (IllegalArgumentException e) {
} catch (IllegalAccessException e) {
} catch (InvocationTargetException e) {
}
if(!isOpenGl2){
Log.d("WW", "Using OpenGL 1.1");
}

However with AA it slowed even my Galaxy Nexus to 17fps, so looks like that is off the table :( Though it looked a lot nicer!

Then it was crashing when I removed the AA line.

Quote
03-01 20:32:12.204: D/WW(28677): Using OpenGL 2.0
03-01 20:32:12.266: D/libEGL(28677): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so
03-01 20:32:12.266: D/libEGL(28677): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so
03-01 20:32:12.266: D/libEGL(28677): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so
03-01 20:32:12.384: D/OpenGLRenderer(28677): Enabling debug mode 0
03-01 20:32:12.407: W/dalvikvm(28677): threadid=11: thread exiting with uncaught exception (group=0x40a721f8)
03-01 20:32:12.407: E/AndroidRuntime(28677): FATAL EXCEPTION: GLThread 1182
03-01 20:32:12.407: E/AndroidRuntime(28677): java.lang.RuntimeException: createContext failed: EGL_BAD_CONFIG
03-01 20:32:12.407: E/AndroidRuntime(28677):    at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1164)
03-01 20:32:12.407: E/AndroidRuntime(28677):    at android.opengl.GLSurfaceView$EglHelper.throwEglException(GLSurfaceView.java:1156)
03-01 20:32:12.407: E/AndroidRuntime(28677):    at android.opengl.GLSurfaceView$EglHelper.start(GLSurfaceView.java:1003)
03-01 20:32:12.407: E/AndroidRuntime(28677):    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1348)
03-01 20:32:12.407: E/AndroidRuntime(28677):    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1202)
03-01 20:32:12.743: D/OpenGLRenderer(28677): Flushing caches (mode 0)
03-01 20:32:13.009: D/OpenGLRenderer(28677): Flushing caches (mode 1)
03-01 20:32:15.837: I/Process(28677): Sending signal. PID: 28677 SIG: 9

Why would it crash just from removing this line?
Code: [Select]
mGLView.setEGLConfigChooser(new AAConfigChooser(mGLView));

122
Support / Re: Version updates!
« on: March 01, 2012, 07:19:10 am »
Ah seems it was added in 2.2. I'm targeting 2.1 which is probably the reason.

Blah that is quite annoying then. I was hoping to use it. Maybe could try some reflection, check if the method exists and use it, not use if that would work...

123
Support / Re: Drawing an advance line
« on: March 01, 2012, 04:13:54 am »
Performance seems to be good. 400 lines on a Motorola Flipout seems smooth enough. The X1 is like 1fps but that's ok :P Usually the user will use it as a static screen and not change the camera angle.

124
Bugs / Re: Huaweu x1 renders very glitchy
« on: March 01, 2012, 03:00:07 am »
I solved my main issue.

Changed
Code: [Select]
final Object3D ground = Primitives.getPlane(1, 48);
to
Code: [Select]
final Object3D ground = Primitives.getPlane(8, 6);
Now it doesn't overlap (much). There is still some smaller glitches but its good enough for me.

Edit:

I don't even need this code anymore:

Code: [Select]
gl10.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST);

125
Support / Re: Version updates!
« on: March 01, 2012, 12:32:59 am »
I must be missing something. I've followed the wiki but this method is missing for me "mGLView.setEGLContextClientVersion(2);"

126
Support / Re: Drawing an advance line
« on: March 01, 2012, 12:19:37 am »
Quote
Please re-download. I've added a setter for the width to Polyline. Transparency should be possible as the color already has alpha, but it's currently not enabled by the drawing method. I'll look into it, but not today.
Great width works perfectly!

Thanks for your help.

127
Bugs / Re: Huaweu x1 renders very glitchy
« on: March 01, 2012, 12:14:17 am »
Quote
(in case you haven't already) try the one that i use in my examples
The code is based on your helloworld example.

Quote
You might want to see if this call
Thanks, that helps with the texture warping. Still fast enough also for our cases. But the overlapping isn't fixed. (photo attached). Is there any other code which could help with this?

We will be supporting low end phones with 2.1 or higher so I need to make sure it looks nice as possible on most of them.

If there is no way for supporting these phones is there a method in Jpct that I can easily use to figure out if its rendering using PixelFlinger?

[attachment deleted by admin]

128
Bugs / Huaweu x1 renders very glitchy
« on: February 29, 2012, 11:52:44 pm »
I'm currently testing the Huaweu x1 however it's very glitchy. Tested with both the beta and the stable version.

I have a plane with a texture on it which is under my model, but the texture is warped and the plane goes on top of the model. Clipping of the model also messes up.

Quote
03-01 12:03:22.322: I/jPCT-AE(2544): OpenGL vendor:     Android
03-01 12:03:22.342: I/jPCT-AE(2544): OpenGL renderer:   Android PixelFlinger 1.3
03-01 12:03:22.342: I/jPCT-AE(2544): OpenGL version:    OpenGL ES-CM 1.0
03-01 12:03:22.342: I/jPCT-AE(2544): OpenGL renderer initialized (using 2 texture stages)

Its Android 2.2.2.

I'll try get a screen shot...

129
Support / Re: Version updates!
« on: February 29, 2012, 11:41:25 pm »
Great in that case I'll give a try... hopefully one of our 10 devices around hasn't got opengl 2.0 so I can test the fall back. 

130
Support / Re: Drawing an advance line
« on: February 29, 2012, 11:31:46 pm »
Awesome it works and looks a lot better than what I had.

Are you able to support width and transparency with the colour? Line width is quite important for us.

Other than the new Polyline class is the code stable?

131
Support / Re: Version updates!
« on: February 29, 2012, 09:49:34 pm »
Since it's a beta I'll leave it for now. But I'll try once its known to be stable for its anti-aliasing support.

132
Feedback / Re: Object3D Editor file anywhere?
« on: February 29, 2012, 10:03:38 am »
Probably was on my old laptop but sold it a couple of months back heh.
I noticed it was hosted on geocities.com, this might help... http://archiveteam.org/index.php?title=GeoCities

133
Support / Re: Version updates!
« on: February 29, 2012, 08:55:27 am »
I haven't tested it but is there a way to test if the device supports OpenGL ES2.0 before using it?

134
Support / Re: Drawing an advance line
« on: February 29, 2012, 03:37:16 am »
Found some code before on the forum, which I believe was from Paul. I've modified it to allow what I want. It seems to work, now to test it... Hopefully this will help anyone else looking for lines :)

Code: [Select]
public static Object3D createLine (SimpleVector[] points, float width, String textureName)
{
    Object3D line = new Object3D( 8 * points.length);
    float offset = width / 2.0f;
   
    int count = 0;
    while(count+1 < points.length){
    SimpleVector pointA = points[count];
    SimpleVector pointB = points[count+1];
   
    // Quad A:
    line.addTriangle( new SimpleVector( pointA.x, pointA.y - offset, pointA.z ), 0, 0,
                     new SimpleVector( pointA.x, pointA.y + offset, pointA.z ), 0, 1,
                     new SimpleVector( pointB.x, pointB.y + offset, pointB.z ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    line.addTriangle( new SimpleVector( pointB.x, pointB.y + offset, pointB.z ), 0, 0,
                     new SimpleVector( pointB.x, pointB.y - offset, pointB.z ), 0, 1,
                     new SimpleVector( pointA.x, pointA.y - offset, pointA.z ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    // Quad A, back-face:
    line.addTriangle( new SimpleVector( pointB.x, pointB.y - offset, pointB.z ), 0, 0,
                     new SimpleVector( pointB.x, pointB.y + offset, pointB.z ), 0, 1,
                     new SimpleVector( pointA.x, pointA.y + offset, pointA.z ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    line.addTriangle( new SimpleVector( pointA.x, pointA.y + offset, pointA.z ), 0, 0,
                     new SimpleVector( pointA.x, pointA.y - offset, pointA.z ), 0, 1,
                     new SimpleVector( pointB.x, pointB.y - offset, pointB.z ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    // Quad B:
    line.addTriangle( new SimpleVector( pointA.x, pointA.y, pointA.z + offset ), 0, 0,
                     new SimpleVector( pointA.x, pointA.y, pointA.z - offset ), 0, 1,
                     new SimpleVector( pointB.x, pointB.y, pointB.z - offset ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    line.addTriangle( new SimpleVector( pointB.x, pointB.y, pointB.z - offset ), 0, 0,
                     new SimpleVector( pointB.x, pointB.y, pointB.z + offset ), 0, 1,
                     new SimpleVector( pointA.x, pointA.y, pointA.z + offset ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    // Quad B, back-face:
    line.addTriangle( new SimpleVector( pointB.x, pointB.y, pointB.z + offset ), 0, 0,
                     new SimpleVector( pointB.x, pointB.y, pointB.z - offset ), 0, 1,
                     new SimpleVector( pointA.x, pointA.y, pointA.z - offset ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    line.addTriangle( new SimpleVector( pointA.x, pointA.y, pointA.z - offset ), 0, 0,
                     new SimpleVector( pointA.x, pointA.y, pointA.z + offset ), 0, 1,
                     new SimpleVector( pointB.x, pointB.y, pointB.z + offset ), 1, 1,
                     TextureManager.getInstance().getTextureID( textureName ) );
    count++;
    }
   
    line.setLighting( Object3D.LIGHTING_NO_LIGHTS );
    line.setAdditionalColor(new RGBColor(255, 255, 255));
    line.setCulling(Object3D.CULLING_DISABLED);
//     line.setTransparency(0);
    line.forceGeometryIndices(false);
    line.build();

    return line;
}

135
Support / Re: Drawing an advance line
« on: February 28, 2012, 11:57:03 pm »
Quote
But as said, these are no real reasons...i'll see, if there's a way to add at least some basic support for them...
Cool, I can do any testing if needed.
The 2 graphics libraries we have been using for the wagon wheel for our flash stuff and iPhone both had line support. I think it would only help jpct.

Pages: 1 ... 7 8 [9] 10 11 ... 25