Viable engine?

Started by MrAdam, May 02, 2012, 05:04:46 PM

Previous topic - Next topic

EgonOlsen

This might be really far fetched, but try to call Object3D.setFixedPointMode(false); after loading the models.

MrAdam

Quote from: EgonOlsen on May 22, 2012, 02:31:00 PM
This might be really far fetched, but try to call Object3D.setFixedPointMode(false); after loading the models.
Sorry, didn't make a difference :-/

Thomas.

try to disable anti-aliasing

MrAdam


Thomas.

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

MrAdam

Quote from: Thomas. on May 22, 2012, 03:37:28 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.

EgonOlsen

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

EgonOlsen

BTW: I've noticed another visual flaw in my test app as well as in your app...on some devices (like mine), the GPU seems to have a startup problem with high polygon counts, i.e. the first rendered image after a context change misses some polygons when rendering high polygon objects. I consider this to be a driver issue (i had the same problem in my benchmark app). The best solution that could come up with was to discard the first frame after creating a new FrameBuffer, i.e. to do something like:


fb.clear(back);
world.renderScene(fb);
world.draw(fb);
fb.display();

if (!init) {
fb.clear(back);
init=true;
}


...and to set init to false each time you create a new FrameBuffer.

It's not great, but it shouldn't hurt either...

MrAdam

Quote from: EgonOlsen on May 22, 2012, 08:52:41 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 ;-)

MrAdam

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:
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!

EgonOlsen

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.

MrAdam

Quote from: EgonOlsen on May 24, 2012, 12:30:47 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 :-)

EgonOlsen


Thomas.

so, compilation can be serialized?

EgonOlsen

No. It still has to happen on the device. You just don't have to create a FrameBuffer to trigger it.