Visual bug on Android with GPU Qualcomm Adreno

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

Moderator: Moderators

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

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote: Wed Jan 16, 2019 10:04 amCan 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: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK »

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: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

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: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hi Ats,
Ats wrote: Thu Jan 17, 2019 5:12 pmSo 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: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK »

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: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

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: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK »

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: 1876
Joined: Sat Feb 23, 2008 11:15 pm

Re: OMEGANAUT

Post by Kjell »

Hej Ville,
VilleK wrote: Fri Jan 18, 2019 10:16 amOk 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: 2274
Joined: Mon Jan 15, 2007 4:50 pm
Location: Stockholm, Sweden
Contact:

Re: OMEGANAUT

Post by VilleK »

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: 603
Joined: Fri Sep 28, 2012 10:05 am
Contact:

Re: OMEGANAUT

Post by Ats »

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€.
Post Reply