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

Pages: 1 [2] 3 4
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 ^^

17
Support / Re: framebuffer getPixels()
« on: May 25, 2012, 10:02:13 am »
...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!

18
Support / Re: Viable engine?
« on: May 25, 2012, 09:59:28 am »
Okay, got the new version in. Only one slight problem:
Code: [Select]
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.

19
Support / Re: framebuffer getPixels()
« on: May 25, 2012, 09:39:30 am »
At first glance, this...

Code: [Select]
int tmpInt = tmpPixels[i] + 0xff000000;

seems to set the alpha to ff for all pixels. Try something like

Code: [Select]
int tmpInt = tmpPixels[i];

instead.
That was my first thought as well, but that made the image 100% transparent ^^

20
Support / Re: framebuffer getPixels()
« on: May 25, 2012, 12:00:10 am »
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.
Im grabbing both and merging them with a canvas. But the frameBuffer.getPixels() is returning all black where it should be transparent after running the:
Code: [Select]
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);

Replacing "tmpInt &= 0xff00ff00" with " tmpInt &= 0x7f00ff00" makes the frameBuffer image semi-transparent.
Im not too shabby with the hex codes, but Im guessing that the alpha is overwritten. I've tried replacing the "ff"'s with "00"'s a few places to see if that did it, but to no avail

21
Support / Re: Viable engine?
« on: May 24, 2012, 11:58:34 pm »
Removed. Please use this jar: http://jpct.de/download/beta/jpct_ae.jar
Thanks! Ill try it first thing in the morning ;-)

22
Support / Re: framebuffer getPixels()
« on: May 24, 2012, 06:05:13 pm »
the alpha was in the right place, but not so the red and blue. Switching those generated the desired result:

                            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);
Sorry for the bump, but Im having a bit of a problem with this, as the background is completely black
Any chance you can tell me how you fixed it?

23
Support / Re: Viable engine?
« on: May 24, 2012, 01:04:44 pm »
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 :-)

24
Support / Re: Viable engine?
« on: May 24, 2012, 10:42:24 am »
I know I already asked this question, but the answer didn't resolve my issue :-/

Im trying to load the model in the background (load and compile) so that it shows up more quickly when opening one of the two 3D activities containing the model.

My problem is that the FrameBuffer is needed to compile the object, but the framebuffer isn't created yet, as the activity containing jpct haven't been launched yet. I've tried creating the FrameBuffer in another activity and resuing it, but its only giving me errors:
Code: [Select]
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!

25
Support / Re: Viable engine?
« on: May 23, 2012, 12:47:32 pm »
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.

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...
Well, thats bad :-/ I tried disabling AA yesterday, but couldn't see a difference, must have made a mistake.
Anyways, It works now. But won't be as sharp as before ..

But thanks a lot for the help! Almost done with the app now ;-)

26
Support / Re: Viable engine?
« on: May 22, 2012, 04:05:14 pm »
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.

27
Support / Re: Viable engine?
« on: May 22, 2012, 03:08:57 pm »
try to disable anti-aliasing
Sorry, didn't work :-/

28
Support / Re: Viable engine?
« on: May 22, 2012, 02:41:18 pm »
This might be really far fetched, but try to call Object3D.setFixedPointMode(false); after loading the models.
Sorry, didn't make a difference :-/

29
Support / Re: Viable engine?
« on: May 22, 2012, 01:27:11 pm »
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 ^^

EDIT: It appears that this is not a shader-problem, as its still visible without the shader enabled:

30
Support / Re: Viable engine?
« on: May 22, 2012, 11:59:50 am »
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.
And what is the best way to expose the GL20 object to do raw gl calls inside the IRenderHook?

Pages: 1 [2] 3 4