Author Topic: Viable engine?  (Read 12597 times)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #45 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.

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #46 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 :-/

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Viable engine?
« Reply #47 on: May 22, 2012, 02:56:22 pm »
try to disable anti-aliasing

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #48 on: May 22, 2012, 03:08:57 pm »
try to disable anti-aliasing
Sorry, didn't work :-/

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Viable engine?
« Reply #49 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...

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #50 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.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #51 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...

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #52 on: May 22, 2012, 09:02:55 pm »
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:

Code: [Select]
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...

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #53 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 ;-)

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #54 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!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #55 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.

Offline MrAdam

  • int
  • **
  • Posts: 51
    • View Profile
Re: Viable engine?
« Reply #56 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 :-)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #57 on: May 24, 2012, 10:24:41 pm »
Removed. Please use this jar: http://jpct.de/download/beta/jpct_ae.jar

Offline Thomas.

  • double
  • *****
  • Posts: 833
    • View Profile
Re: Viable engine?
« Reply #58 on: May 24, 2012, 10:34:57 pm »
so, compilation can be serialized?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11777
    • View Profile
    • http://www.jpct.net
Re: Viable engine?
« Reply #59 on: May 24, 2012, 10:41:31 pm »
No. It still has to happen on the device. You just don't have to create a FrameBuffer to trigger it.