16
Support / Re: Viable engine?
« on: May 25, 2012, 10:26:08 am »Loader.loadSerializedObjectArray() isn't threaded...nothing is threaded in the engine...Well, I just did a while(model == null){}
No null pointers now ^^
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.
Loader.loadSerializedObjectArray() isn't threaded...nothing is threaded in the engine...Well, I just did a while(model == null){}
...looks like i'm nulling the alpha values in the code that flips the image after grabbing it from the frame buffer. I'll upload a fixed version later today.Thanks!
model = Loader.loadSerializedObjectArray(getAssets().open("modern.png"));
world.addObjects(model);
world.compileAllObjects();
As Loader.loadSerializedObjectArray() is threaded, I am of course getting a null pointer exception due to the model not being loaded yet when it runs world.addObjects(). I have yet been able to find a way to check if the loading has finished.
i don't think that you can grab the camera image that way, because this grabs only the image created in the gl context. There has to be another way to get a screen shot of both combined...i guess. Worst case would be to grab the camera image in another way and combine both in your code.Sorry, wasn't talking about the camera preview, already got that.
int[] tmpPixels = fb.getPixels();
for (int i = 0; i < tmpPixels.length; i++){
int tmpInt = tmpPixels[i] + 0xff000000;
int red = (tmpInt & 0x00ff0000)>>16;
int blue = (tmpInt & 0x000000ff)<<16;
tmpInt &= 0xff00ff00;
tmpInt += red + blue;
tmpPixels[i] = tmpInt;
}
lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.ARGB_8888);
Removed. Please use this jar: http://jpct.de/download/beta/jpct_ae.jarThanks! Ill try it first thing in the morning ;-)
the alpha was in the right place, but not so the red and blue. Switching those generated the desired result:Sorry for the bump, but Im having a bit of a problem with this, as the background is completely black
int[] tmpPixels = fb.getPixels();
for (int i = 0; i < tmpPixels.length; i++){
int tmpInt = tmpPixels + 0xff000000;
int red = (tmpInt & 0x00ff0000)>>16;
int blue = (tmpInt & 0x000000ff)<<16;
tmpInt &= 0xff00ff00;
tmpInt += red + blue;
tmpPixels = tmpInt;
}
lastImage = Bitmap.createBitmap(tmpPixels, fb.getWidth(), fb.getHeight(), Config.ARGB_8888);
You can't create a FrameBuffer outside of the thread that own the gl context. However, checking the code, the dependence of the compileAllObjects()-method on FrameBuffer doesn't seem to be needed. I'll look at this again this evening and i think i can simply remove it.Thanks! Thats great to hear :-)
05-24 10:31:01.721: E/AndroidRuntime(7063): java.lang.RuntimeException: [ 1337848261728 ] - ERROR: java.lang.RuntimeException: [ 1337848261725 ] - ERROR: java.lang.RuntimeException: [ 1337848261720 ] - ERROR: java.lang.RuntimeException: [ 1337848261718 ] - ERROR: Failed to load and compile vertex shaders!
Ok...i had a look at the app that you sent to me...it's looks really strange. The edges of some polygons are transparent in some cases. You simply see the camera image shining through. I managed to bring the door in a position where actually the whole thing was more or less transparent.Well, thats bad :-/ I tried disabling AA yesterday, but couldn't see a difference, must have made a mistake.
Then, i fired up my test case and tried to reproduce it...i failed...until i enabled AA more or less by accident and then, i got the same visual artifacts in my test app. So i assume, that the issue will disappear if you disable AA. If that's the case, then i've no idea what i can do against this. Most likely nothing, because the AA implementation is part of the GPU hardware. And if it thinks that this is the right way to do it, then i can't tell it otherwise. I fiddled around with the EGL-config settings for AA, but to no avail...
And what geometry? Is possible that some vertices are little bit shifted? If you have 3Ds max, you can try merge vertices in very small distance... editable poly -> vertex selection -> select all vertices -> weld and try some very small distance. Below you can see vertex count before and after weld...Didn't solve the problem.
try to disable anti-aliasingSorry, didn't work :-/
This might be really far fetched, but try to call Object3D.setFixedPointMode(false); after loading the models.Sorry, didn't make a difference :-/
You don't. It's a static class. Just do GLES20.glColorMask(...);Thanks! Worked wonders. Although, now the transparent lines appearing are even more visible ^^
And what is the best way to expose the GL20 object to do raw gl calls inside the IRenderHook?Is it possible to somehow implement this in your engine?Yes. You can add an implementation of the IRenderHook-interface to your transparent object(s) that does this.