Page 2 of 2

Re: OMEGANAUT

Posted: Wed Jan 16, 2019 12:37 pm
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

Re: OMEGANAUT

Posted: Wed Jan 16, 2019 2:17 pm
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.

Re: OMEGANAUT

Posted: Thu Jan 17, 2019 5:12 pm
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)

Re: OMEGANAUT

Posted: Thu Jan 17, 2019 6:32 pm
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

Re: OMEGANAUT

Posted: Fri Jan 18, 2019 7:55 am
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);

Re: OMEGANAUT

Posted: Fri Jan 18, 2019 9:55 am
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

Re: OMEGANAUT

Posted: Fri Jan 18, 2019 10:16 am
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?

Re: OMEGANAUT

Posted: Fri Jan 18, 2019 10:48 am
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

Re: OMEGANAUT

Posted: Mon Jan 21, 2019 10:09 am
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 :)

Re: OMEGANAUT

Posted: Mon Jan 21, 2019 3:49 pm
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€.