Lighting on an Android device
in
Android Processing
•
6 months ago
I have been trying to get the
perspective demo working on my Android device (Huawei Ascend G300 U8815) but it won't work when lights() are enabled. I think this is the same/similar unresolved problem posted under
Android with light.
I changed the size(640, 360, P3D) call to instead fill the screen:
If i comment out the lights() call in the draw() method, it works fine (though no lighting effects of course). With the lights() call left in, i get the following stack trace:
I changed the size(640, 360, P3D) call to instead fill the screen:
- size(displayWidth, displayHeight, P3D);
If i comment out the lights() call in the draw() method, it works fine (though no lighting effects of course). With the lights() call left in, i get the following stack trace:
- Smooth is not supported by this hardware (or driver)
- FATAL EXCEPTION: GLThread 21651
- java.lang.RuntimeException: Cannot link shader program:
- --From Fragment Shader:
- --From Vertex Shader:
- at processing.core.PGraphics.showException(PGraphics.java:5426)
- at processing.opengl.PShader.init(PShader.java:745)
- at processing.opengl.PShader.getAttributeLoc(PShader.java:393)
- at processing.opengl.PGraphicsOpenGL$LightShader.loadAttributes(Unknown Source)
- at processing.opengl.PGraphicsOpenGL.getPolyShader(Unknown Source)
- at processing.opengl.PGraphicsOpenGL.flushPolys(Unknown Source)
- at processing.opengl.PGraphicsOpenGL.flush(Unknown Source)
- at processing.opengl.PGraphicsOpenGL.endDraw(Unknown Source)
- at processing.core.PApplet.handleDraw(Unknown Source)
- at processing.opengl.PGL$AndroidRenderer.onDrawFrame(Unknown Source)
- at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
- at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1217)
- pgl.getProgramiv(glProgram, PGL.LINK_STATUS, intBuffer);
- boolean linked = intBuffer.get(0) == 0 ? false : true;
- if (!linked) {
- PGraphics.showException("Cannot link shader program:\n" +
- pgl.getProgramInfoLog(glProgram)); }
I am running Processing 2.0b8 on Windows 7 64 bit, with the Android SDK Tools 21.1, Android SDK Platform-tools 16.0.2, API 17 and API 10. According to Quadrant, my G300 phone supports OpenGL ES 2.0 and OpenGL ES GLSL ES 1.00 (is that shaders v1.00?).
When build with lights enabled, the exact same apk ran fine on a HTC Desire Z, so maybe this is a lack of support from my G300 device?
Other than the stack trace above, i don't see any more details of the problem. I'm not sure what shader is being loaded/linked for lighting, or where to begin looking for the problem. Any ideas? Is my phone's OpenGL support sufficient for Processing?
When build with lights enabled, the exact same apk ran fine on a HTC Desire Z, so maybe this is a lack of support from my G300 device?
Other than the stack trace above, i don't see any more details of the problem. I'm not sure what shader is being loaded/linked for lighting, or where to begin looking for the problem. Any ideas? Is my phone's OpenGL support sufficient for Processing?
1