OMEGANAUT on Android ZGE bug hunt (split from main topic)

Found a bug? Post information about it here so we can fix it!

Moderator: Moderators

User avatar
Kjell
Posts: 1709
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell » Wed Jan 16, 2019 12:37 pm

Hi Ats,
Ats wrote:
Wed Jan 16, 2019 10:04 am
Can that come from the compilation parameters of the libzgeandroid.so? Or is it a bug in the source code?
Since it appears it's being caused by the BitmapCombine component that would mean it's probably a bug in the ZGameEditor source code. You could double-check this by deleting the BitmapCombine component from the DonutBitmap, in which case it should start with the values being TRUE on the Xperia X as well.

In any case, it's good news .. since you can already fix this yourself by calling "glEnable(GL_CULL_FACE)" and "glEnable(GL_DEPTH_TEST)" after your Bitmaps ( using BitmapCombine ) have been generated.

K

User avatar
VilleK
Site Admin
Posts: 2003
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK » Wed Jan 16, 2019 2:17 pm

I don't see how it could be a bug in ZGE? The code for save and restore the values in fakePush/Pop looks correct to me.

User avatar
Ats
Posts: 240
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats » Thu Jan 17, 2019 5:12 pm

So I had to double check because the result is weird: On the Xperia X (and on the Nexus 5 I'm testing right now) the donut is inside out with both parameters being FALSE during please wait, even though I removed the BitmapCombine component in DonutBitmap.
On Galaxy S6, it still start OK and TRUE.

So I made a few more tests:

TEST 1 : BUG - With BitmapCombine
DonutMaterial
  • MaterialTexture DonutBitmap
DonutBitmap
  • BitmapLoad RedBitmap
  • BitmapLoad BlueBitmap
  • BitmapCombine
RedBitmap
  • BitmapExpression
BlueBitmap
  • BitmapExpression

TEST 2 : BUG - Without BitmapCombine
DonutMaterial
  • MaterialTexture DonutBitmap
DonutBitmap
  • BitmapLoad RedBitmap
  • BitmapLoad BlueBitmap
RedBitmap
  • BitmapExpression
BlueBitmap
  • BitmapExpression

TEST 3: OK - Only one BitmapLoad
DonutMaterial
  • MaterialTexture DonutBitmap
DonutBitmap
  • BitmapLoad RedBitmap
RedBitmap
  • BitmapExpression

TEST 4: OK - Most simple
DonutMaterial
  • MaterialTexture RedBitmap
RedBitmap
  • BitmapExpression

TEST 5: OK - Two BitmapExpression in a row without BitmapCombine
DonutMaterial
  • MaterialTexture RedBitmap
RedBitmap
  • BitmapExpression (red)
  • BitmapExpression (blue)

TEST 6: OK - Two BitmapNoise in a row without BitmapCombine
DonutMaterial
  • MaterialTexture RedBitmap
RedBitmap
  • BitmapNoise (red)
  • BitmapNoise (blue)
Last edited by Ats on Thu Jan 17, 2019 6:33 pm, edited 1 time in total.

User avatar
Kjell
Posts: 1709
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell » Thu Jan 17, 2019 6:32 pm

Hi Ats,
Ats wrote:
Thu Jan 17, 2019 5:12 pm
So I had to double check because the result is weird: On the Xperia X (and on the Nexus 5 I'm testing right now) the donut is inside out with both parameters being FALSE during please wait, even though I removed the BitmapCombine component in DonutBitmap.
Aha, so it's not caused by BitmapCombine after-all :P Not exactly sure what to suspect now ... could it a multi-threading problem perhaps?

K

User avatar
VilleK
Site Admin
Posts: 2003
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK » Fri Jan 18, 2019 7:55 am

BitmapLoad also leads to a call to GLESPixelsFromTexture so it is still the same issue.

I suspect this line in ZOpenGL (line 1715) is not working on this phone:

Code: Select all

  
  glGetIntegerv(GL_DEPTH_TEST, @A^.Depth);
Perhaps also for the cull face setting.

You can try always renabling depthtest like this, in fakePopAttrib line 1753:

Code: Select all

  //if A.Depth=0 then
    //glDisable(GL_DEPTH_TEST)
  //else
    glEnable(GL_DEPTH_TEST);

User avatar
Kjell
Posts: 1709
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell » Fri Jan 18, 2019 9:55 am

Hej Ville,

But that's exactly what the test-project is doing .. reading out GL_CULL_FACE and GL_DEPTH_TEST using glGetIntegerv and toggling between TRUE and FALSE using glDisable and glEnable ( after the "PLEASE WAIT" period ), and all those things work just fine.

K

User avatar
VilleK
Site Admin
Posts: 2003
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK » Fri Jan 18, 2019 10:16 am

Ok then maybe it is TZApplication.Init method that is called too early on the problematic phone so that the initial value (via TGLDriverBase.InitGL) of GL_DEPTH_TEST is not properly set?

User avatar
Kjell
Posts: 1709
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell » Fri Jan 18, 2019 10:48 am

Hej Ville,
VilleK wrote:
Fri Jan 18, 2019 10:16 am
Ok then maybe it is TZApplication.Init method that is called too early on the problematic phone so that the initial value (via TGLDriverBase.InitGL) of GL_DEPTH_TEST is not properly set?
Hmm .. hadn't thought of that. Seems kind of weird that only "TEST 1" and "TEST 2" as reported by Ats on would "fail" in that case though.

Little side-note, any specific reason why you are toggling the Material.ZBuffer flag using glDepthFunc and glDepthMask ( line 256 of GLDrivers.pas ) instead of glEnable / glDisable?

K

User avatar
VilleK
Site Admin
Posts: 2003
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK » Mon Jan 21, 2019 10:09 am

Kjell wrote:
Fri Jan 18, 2019 10:48 am
Little side-note, any specific reason why you are toggling the Material.ZBuffer flag using glDepthFunc and glDepthMask ( line 256 of GLDrivers.pas ) instead of glEnable / glDisable?
That does look a bit funny, perhaps I predicted the ZBuffer setting would evolve into a list of different depth buffer settings later. I guess it was over 10 years ago that code was written so I no longer remember :)

User avatar
Ats
Posts: 240
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats » Mon Jan 21, 2019 3:49 pm

Hi everyone. I didn't find friends with Xperia or Huawei this weekend in order to try...
I think I'm going to buy one on ebay if I find it under 30€.

Ville, can you split up this topic into two from here viewtopic.php?p=8981#p8981
So I can work on my game and search for a way to find this bug in two separate topics? Thanks

Post Reply