java.lang.RuntimeException:
at com.threed.jpct.Logger.log (Logger.java:206)
at com.threed.jpct.GL20.checkError (GL20.java:163)
at com.threed.jpct.GL20.glGenBuffers (GL20.java:1385)
at com.threed.jpct.CompiledInstance.compileToVBO (CompiledInstance.java:1478)
at com.threed.jpct.CompiledInstance.render (CompiledInstance.java:606)
at com.threed.jpct.GLRenderer.drawWireframe (GLRenderer.java:2552)
at com.threed.jpct.World.draw (World.java:1424)
at com.threed.jpct.World.drawWireframe (World.java:1132)
at com.aeroshark333.artofearthify.lw.ArtOfEarthify$34.run (ArtOfEarthify.java:1492)
at com.aeroshark333.artofearthify.utils.WorkerThread$2.run (WorkerThread.java:46)
at com.aeroshark333.artofearthify.lw.ArtOfEarthify.onDrawFrame (ArtOfEarthify.java:1681)
at com.aeroshark333.artofearthify.lw.LiveWallpaperRenderer.onDrawFrame (LiveWallpaperRenderer.java:73)
at android.opengl.GLSurfaceView$GLThread.guardedRun (GLSurfaceView.java:1553)
at android.opengl.GLSurfaceView$GLThread.run (GLSurfaceView.java:1253)
Any idea what this could be? I've only received this once so maybe it could be ignored...No idea what that error should be. Something isn't quite right with the gl state for some reason. I would ignore it for now.Okay, thank you
And yes, 4 is a hard coded limit. I looked into expanding it once, but decided against it for reasons that I can't remember anymore. Must have been a technical limitation of some kind. There's no way to hack around it, I'm afraid.I found this post (Reply #1) for a possible reason why: http://www.jpct.net/forum2/index.php?topic=3371.0
//VERTEX SHADER
...
attribute vec4 texture01;
...
void main(){
...
vec2 texture0 = texture01.xy;
vec2 texture1 = texture01.zw;
...
}
State | Minimum value |
MAX VERTEX TEXTURE IMAGE UNITS | 0 |
MAX TEXTURE IMAGE UNITS | 8 |
MAX VERTEX ATTRIBS | 8 |
TextureInfo blah ... // first 4 textures go here
obj.setTexture(blah);
obj.setTextureBindingHook(new TextureBindingHook(){
@Override
public void beforeFinishedBinding(){
Texture tex = fifthTex;
int stage = 5;
String variableName = "textureUnit4";
methodToBind(tex, stage, variableName);
}
});
(Additional texture coordinates attributes I don't really need; but only being able to access the textures in the fragment shader)
Haven't tried it yet. I'm busy with other stuff ATM, but I'll come to it eventually.Oh okay, take your time ;)
I suppose because the default shaders use an 'unwrapped' for loop, it'd be annoying to change it all.Yes, I had to do that because using the index from a loop didn't work. I can't remember if in general or only on some devices (more likely), but that's how it is now.
Actually I believe it is generally like that. GLSL doesn't seem to allow non-constant variables for accessing arrays or something. I believe some devices might support it because they've added the support but overall generally not.I suppose because the default shaders use an 'unwrapped' for loop, it'd be annoying to change it all.Yes, I had to do that because using the index from a loop didn't work. I can't remember if in general or only on some devices (more likely), but that's how it is now.
can you use while loop?I don't think that'd work for the general case.
int i=lightcount; while (i>0) { do something; i--; }
i never used a loop though.
using variable in array seems fine for me. i did something like this:
int i=int(position.x); position.x=uniform[i*3+1];