Author Topic: Glide GL ES 2.0 Port (WIP)  (Read 43762 times)

Offline Kris

  • Developer
  • int
  • *****
  • Posts: 91
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #30 on: March 30, 2013, 10:47:10 PM »
Thanks for the info xperia64 and scorpio16v. The bug which goes away if you restart sounds like it could have be the one caused by me disabling something during testing and I think it should be better now. I will try to give the Paper Mario one a closer look, is that far into the game?

The nexus4 problems sound a bit familiar to what was happening when I tried using later versions of the emulator so when that is dealt with it may work, if not I should be able to do a bit of testing with a nexus4 at some stage.

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Glide GL ES 2.0 Port (WIP)
« Reply #31 on: March 30, 2013, 11:34:24 PM »
Try changing it from 24 to 16 in glitch64/main.cpp line 436.
I did think that the request for 16 bits in GameSurface.Java would be the one used and the sdl one ignored.

Changing it had no effect.  I'll do a couple tests to grab some information about what profile is getting chosen to make sure it is one of the ones with a depth buffer.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Kris

  • Developer
  • int
  • *****
  • Posts: 91
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #32 on: March 31, 2013, 08:57:29 AM »
Try using 24 in both both places. Looking at the docs it seems I was wrong and PowerVR does support 24bit. You could also try changing it from GL_DEPTH_COMPONENT16 to GL_DEPTH_COMPONENT24_OES at main.cpp line 881. Sorry I don't have a suitable device to test.

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Glide GL ES 2.0 Port (WIP)
« Reply #33 on: March 31, 2013, 11:16:05 PM »
The first switch is at the end of the path leading back to the town from goomba village which isnt that far (after you beat the goomba king)

Offline CatalystG

  • byte
  • *
  • Posts: 13
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #34 on: April 02, 2013, 12:38:51 PM »
Awesome! Would you mind if I tried this on my BlackBerry port?

Offline Kris

  • Developer
  • int
  • *****
  • Posts: 91
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #35 on: April 02, 2013, 02:34:55 PM »
Awesome! Would you mind if I tried this on my BlackBerry port?

Go for it, when it does work it seems to work quite well but there are devices and configurations with problems. You will probably need to tweak the biasFactor for glPolygonOffset, if you find a good value that would helpful to know as it should apply to other PowerVR devices. Currently there seems to be problems creating a depth buffer on android for PowerVR so look out for that too.

Offline CatalystG

  • byte
  • *
  • Posts: 13
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #36 on: April 02, 2013, 07:33:31 PM »
It seems to work well on the BlackBerry Z10 so far, which is a Qualcomm S4. Tried Zelda OoT, Diddy Kong Racing and Super Mario. No depth issues that I've seen, though I'm creating the context in the frontend natively rather than through SDL. The glPolygonOffset seems to be okay too at it's default. A bit of flicker on some shadows in Super Mario but not bad at all. Speed seems a bit slower from my short test (that's with using the optimization flags). DKR has a fairly consistent stutter which doesn't happen on other plugins. Zelda doesn't have the subscreen crash which is nice. I've noticed a number of issues from Rice were fixed like the wood backing on the DKR menus. Seems to be the best of both gles2n64 and rice so far. Overall, an amazing start.

I'll give it a try on the PlayBook sometime (OMAP4/PowerVR) and see what issues there are.

Let me know if there's anything in particular you'd like me to test.
« Last Edit: April 02, 2013, 07:35:30 PM by CatalystG »

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Glide GL ES 2.0 Port (WIP)
« Reply #37 on: April 02, 2013, 07:53:36 PM »
No luck for me with the depth problem after tinkering in the settings.  I've tried with "SDL_GL_DEPTH_SIZE, 16", changing to 24 in GameSurface, and with using GL_DEPTH_COMPONENT24_OES.  Anyway, here is the test for other folks to use.  I still need to do some diagnostics to see what profile is getting selected to make sure its one with some depth.

Glide64 Test

I added a preference dialog to the Video settings for selecting the bias factor, which is easier than posting a series of tests builds with different values :)

If depth is working and you find a good bias factor, please post it and send me the logcat output so I can see what string it returned for the renderer.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Glide GL ES 2.0 Port (WIP)
« Reply #38 on: April 02, 2013, 08:12:23 PM »
I can't find a good bias factor. It worked perfectly in the old build (except for a few gaps in some of the polys)

Offline Evil King Stan

  • byte
  • *
  • Posts: 33
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #39 on: April 02, 2013, 08:54:08 PM »
I tried using this but I'm running into a bit of a speed bump. The test apk installs separately just like all of your other tests do, that's normal other than the fact that the app is named Mupen64 Plus AE like the official build instead of just Mupen64Plus like other tests. I open it fine, change the plugin to Glide, everything is fine. When I press Controller option to do my key mappings, android asks me which application to complete the action with, both are named Mupen64 Plus AE. The top one has a caption under it that says paulscode.android.mupen64plus, the bottom one has a caption that reads paulscode.android.mupen64plusae. I tried both just to be sure and keys mapped fine on both. (Although I'm certain that the bottom app is the Glide test as paulscode.android.mupen64plusae was the folder it told me it was downloading the resources to when I first started the app.) After that I selected Mario 64 in the game menu and clicked Play. Android again asked me to pick an app, I chose the bottom one and I was brought to the menu to chose Resume or Restart. Either one immediately force closes the emulator. I then tried the top app and picked restart. The emulator then chose to run Ocarina of Time, (the game I have selected in the official build) and is playing it using what I am absolutely sure is gels2n64. (The video plugin I have selected on the official build.) Choosing the top app makes it use the official build. (I'm sure of this because changing the game in the official build to Banjo-Kazooie makes the test apk play Banjo-Kazooie. Unless I chose the bottom app in which case it doesn't run at all.) I also tried uninstalling and reinstalling, without messing with any settings other than switching to the Glide plugin, same result. I'd love to test, but I can't until I can sort this out. Any insight would be appreciated.

Offline Kris

  • Developer
  • int
  • *****
  • Posts: 91
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #40 on: April 02, 2013, 09:34:28 PM »
Thanks for sorting out the test. It seems like 0.2 is a bit high for adreno, shadows render solid but in-front of the object. Maybe other gpus will also need finer than 0.2 adjustments.

I don't know why the depthbuffer is not working assuming that is really the problem and it doesn't just look like it. I just tried to initialize the same way as the other plugins.

You can see how many bits are actually being used by doing something like the following after SDL_SetVideoMode in glitch64/main.cpp
Code: [Select]
GLint depthBits;
glGetIntegerv(GL_DEPTH_BITS,&depthBits);

The plugin works with the first commit that changed it from SurfaceView to GLSurfaceView so something between then and current version is causing the problems I look again soon.

Offline scorpio16v

  • long
  • ***
  • Posts: 203
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #41 on: April 02, 2013, 11:44:23 PM »
Test on Super Mario 64:
On my tablet with A31 CPU, graphics are messed like in the old version.
On Nexus 4, I can see only only the "Super Mario64" screen for a second. After that, the screen is black again.
If I go back to menu, the graphics is shown for a second. Same as the first test, but the graphic looks fine now.
If you can solve the black screen issue, maybe that could be the right setting for this hardware.

Offline Tom.K

  • Green Team
  • long
  • *
  • Posts: 130
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #42 on: April 03, 2013, 09:13:03 AM »
No luck for me with the depth problem after tinkering in the settings.  I've tried with "SDL_GL_DEPTH_SIZE, 16", changing to 24 in GameSurface, and with using GL_DEPTH_COMPONENT24_OES.  Anyway, here is the test for other folks to use.  I still need to do some diagnostics to see what profile is getting selected to make sure its one with some depth.

Glide64 Test

I added a preference dialog to the Video settings for selecting the bias factor, which is easier than posting a series of tests builds with different values :)

If depth is working and you find a good bias factor, please post it and send me the logcat output so I can see what string it returned for the renderer.
I'm not able to launch any game using any video plugin.

Offline scorpio16v

  • long
  • ***
  • Posts: 203
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #43 on: April 03, 2013, 09:01:41 PM »
Some remark about the black screen on N4. It doesn't seem related to the plugin.
If I switch the volume buttons up or down and the loudness bar is faded onscreen, the graphics are visible.

Offline Kris

  • Developer
  • int
  • *****
  • Posts: 91
    • View Profile
Re: Glide GL ES 2.0 Port (WIP)
« Reply #44 on: April 04, 2013, 04:22:25 PM »
I found out was was causing a blank screen when using glide with the latest version, it wasn't even related to graphics.  ::)

When the window is opened glide changes the window caption, this used to change the title on android too but for some reason in the more recent versions it causes an exception.

I pushed the fix to not set the title and merged the latest version, there shouldn't be any other noteworthy changes to glide but maybe with the other changes to the emulator it might work for more devices.

I plan to look try an online device testing service to help with some of the issues. Samsung have a free one and there are others, anyone have experience with these?