ZGameEditor & Android Setting
Moderator: Moderators
Re: ZGameEditor & Android Setting
No blending at all. For example the ball in Zpong is white in API 26, but if I add MeshExpression C.A=1; to the BallMesh, it appears red.
Re: ZGameEditor & Android Setting
Hi guys,
Keep in mind that currently when you do the following ..
- Start a new project
- Add a Mesh to App.Content
- Add a MeshBox to the Mesh
- Select the Mesh component
... the Mesh appears red in the preview window ( don't let that fool you ).
Anyway, when you add a MeshExpression ( with VertexColors enabled ) to a Mesh that doesn't contain vertex color data yet, you need to set the color values because otherwise you end up with "junk" values that are currently in memory.
K
Keep in mind that currently when you do the following ..
- Start a new project
- Add a Mesh to App.Content
- Add a MeshBox to the Mesh
- Select the Mesh component
... the Mesh appears red in the preview window ( don't let that fool you ).
Anyway, when you add a MeshExpression ( with VertexColors enabled ) to a Mesh that doesn't contain vertex color data yet, you need to set the color values because otherwise you end up with "junk" values that are currently in memory.
K
Re: ZGameEditor & Android Setting
Based on this I would assume that on Android GL_BLEND is enabled by default somehow?
Can you try adding "glDisable(GL_BLEND);" in OnRender, or in OnLoad?
Can you try adding "glDisable(GL_BLEND);" in OnRender, or in OnLoad?
Re: ZGameEditor & Android Setting
Hej Ville,
K
That doesn't have anything to do with blending ( vertex colors mix with the material diffuse color without having to use blending ). It's because when you don't explicitly set certain components of the vertex color, it ends up using whatever value is in memory.
K
Re: ZGameEditor & Android Setting
Ah, you are right. Ok then indeed Ats you need to set full RGBA values in your MeshExpressions when using vertexcolors.Kjell wrote: ↑Thu Dec 20, 2018 3:16 pm Hej Ville,
That doesn't have anything to do with blending ( vertex colors mix with the material diffuse color without having to use blending ). It's because when you don't explicitly set certain components of the vertex color, it ends up using whatever value is in memory.
Re: ZGameEditor & Android Setting
Happy new year everyone !
So I set the A values on all my models and now everything is almost fine. Now the problem is the framerate:
When exported to API 16, the game runs at a constant 60 fps. But when it is exported to API 26, I get huge drops from time to time (15 fps). I disabled the particles and a lot of things. Maybe it comes from the number of models on screen but I'm not even sure... Do we have some kind of ZGE benchmark project somewhere so I can run tests?
So I set the A values on all my models and now everything is almost fine. Now the problem is the framerate:
When exported to API 16, the game runs at a constant 60 fps. But when it is exported to API 26, I get huge drops from time to time (15 fps). I disabled the particles and a lot of things. Maybe it comes from the number of models on screen but I'm not even sure... Do we have some kind of ZGE benchmark project somewhere so I can run tests?
Re: ZGameEditor & Android Setting
Thanks for the update, I was wondering about your progress on this.
Maybe check if API 26 has some new manifest options to set higher priority for graphics applications?
Do you mean this happens when using the same libzgeandroid.so for API 16 and 26? So it cannot be things like Freepascal compilation options that differs?
Maybe check if API 26 has some new manifest options to set higher priority for graphics applications?
Re: ZGameEditor & Android Setting
It is entirely possible that the problem comes from the Freepascal compilation of libzgeandroid.so since I removed the "-CfVFPv2" parameter...
I'm going to compile libzgeandroid.so for API 16 and see if there is a difference with the one provided with ZGE. I'll try that when I get home.
Also, if I remember the thread correctly, weird problems have started to appear with API 23. So I'm going to compile some libzgeandroid.so for API 22 and 23 and see at what point the problem is showing up.
Edit:
By the way, did you manage to follow my tutorial?
I tried to do it on my home computer but I'm getting stuck at the compilation of libzgeandroid.so, so maybe I forgot one step in the explanations...![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
I'm going to compile libzgeandroid.so for API 16 and see if there is a difference with the one provided with ZGE. I'll try that when I get home.
Also, if I remember the thread correctly, weird problems have started to appear with API 23. So I'm going to compile some libzgeandroid.so for API 22 and 23 and see at what point the problem is showing up.
Edit:
By the way, did you manage to follow my tutorial?
I tried to do it on my home computer but I'm getting stuck at the compilation of libzgeandroid.so, so maybe I forgot one step in the explanations...
![Rolling Eyes :roll:](./images/smilies/icon_rolleyes.gif)
Re: ZGameEditor & Android Setting
Please note that the lib file itself has no dependency to a specific API-level, as far as I know. So you should be able to use the same .so file in a API 16 apk.
Indeed if there is no floating point option set enabled (which is what CfVFPv2 does) then performance will suffer. So you might need to rebuild Fpc for Android with that option set.
No I haven't tried your tutorial yet. Just by looking at it I can tell it will take me too long
. I have to say that the Android platform has lost a bit of its appeal to be. With the first android phones it was still a very small and limited platform and a technical challenge to get anything working (which is what made it interesting to me). These days a modern smartphone is almost like a portable PC and anything can be built for it as long as you can configure the tools correctly.
Indeed if there is no floating point option set enabled (which is what CfVFPv2 does) then performance will suffer. So you might need to rebuild Fpc for Android with that option set.
No I haven't tried your tutorial yet. Just by looking at it I can tell it will take me too long
![Smile :)](./images/smilies/icon_smile.gif)
Re: ZGameEditor & Android Setting
So I didn't find much about CfVFPv2... How should I enable this in the line that compiles FPC Android?
By adding something like CROSSOPT="-CfVFPv2" ?
What about those other options I saw on some random internet page? CROSSOPT="-dANDROID -CpARMv6 -CfVFPv2" ?
Since -dANDROID -CpARMv6 are needed in order to compile libzgeandroid.so ...
Code: Select all
make clean crossall crossinstall OS_TARGET=android CPU_TARGET=arm INSTALL_PREFIX=C:\FPC\trunk
What about those other options I saw on some random internet page? CROSSOPT="-dANDROID -CpARMv6 -CfVFPv2" ?
Since -dANDROID -CpARMv6 are needed in order to compile libzgeandroid.so ...
Re: ZGameEditor & Android Setting
With CfVFPv2 activated, it works perfectly. YES!!!
So I compiled the lib directly and set the manifest so it can run from API 16 to API 28 (Android 9, the latest).
I modified the tutorial accordingly.
I'm going to send the omeganaut apk to the friends I know couldn't play it on their phones to see if everything's fine before sending to Google Play Store and verify if there are a few more bad surprises. I'm so happy![Very Happy :D](./images/smilies/icon_biggrin.gif)
Edit:
By the way, shouldn't I opt for CpARMv7 instead? Since there are no devices under CpARMv6 with API>=16...
![Cool 8)](./images/smilies/icon_cool.gif)
So I compiled the lib directly and set the manifest so it can run from API 16 to API 28 (Android 9, the latest).
I modified the tutorial accordingly.
I'm going to send the omeganaut apk to the friends I know couldn't play it on their phones to see if everything's fine before sending to Google Play Store and verify if there are a few more bad surprises. I'm so happy
![Very Happy :D](./images/smilies/icon_biggrin.gif)
Edit:
By the way, shouldn't I opt for CpARMv7 instead? Since there are no devices under CpARMv6 with API>=16...
- Attachments
-
- 9.zip
- Android 9 Template (API 28)
- (253.89 KiB) Downloaded 427 times