Author Topic: GLideN64 Android port  (Read 126919 times)

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #240 on: May 28, 2015, 02:26:50 AM »
@retroben cite from mupen64plus.cfg:
Code: [Select]
# Texture Enhancement (0=none, 1=store as is, 2=X2, 3=X2SAI, 4=HQ2X, 5=HQ2XS, 6=LQ2X, 7=LQ2XS, 8=HQ4X, 9=2xBRZ, 10=3xBRZ, 11=4xBRZ, 12=5xBRZ)
txEnhancementMode = 0

@littleguy - unicode strings are necessary mainly because User folder on Windows is often non-ASCII. User names on my PC use Cyrillic symbols. If path to texture pack has folder with non-ASCII name, it may not work with plain char*. Djipi' texture packs also had non-ASCII sub-folders. So, you should use wchar_t for all user data to be safe.

This problem can be considered as solved. Two problems need to solve to get functional build:
- FreeType support. Technical issue.
- read png errors. GLideNHQ crashes on read png files on some devices. cite TxImage::getPNGInfo:
Code: [Select]
if (setjmp(png_jmpbuf(*png_ptr))) {
DBG_INFO(80, wst("error reading png!\n"));
png_destroy_read_struct(png_ptr, info_ptr, NULL);
return 0;
}
I know nothing about libpng. I just know that compiler warns about this code as deprecated.
However, it works on desktop and on some Android devices. May be other devices use obsolete libpng, which can't read the file? Is it possible to use our own build of lib png based of fresh sources?

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #241 on: May 28, 2015, 03:32:50 AM »
Someone managed to make an amazing APNG viewer for Android called Omni Gif,so it should be possible.
It should definitely be possible to implement your own customized version of libpng.

So that 5xBRZ enhancement has amazingly no performance hits from it at all. 8)

Try to use 5xBR on Retroarch for Android,then it will slow to a crawl on most devices,even for 2d system games.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: GLideN64 Android port
« Reply #242 on: May 28, 2015, 07:08:45 AM »
I know nothing about libpng. I just know that compiler warns about this code as deprecated.
However, it works on desktop and on some Android devices. May be other devices use obsolete libpng, which can't read the file? Is it possible to use our own build of lib png based of fresh sources?

libpng is not part of the Android platform.  We are already compiling it directly into mupen64plus-ae, and it is part of the repository.  Though I'm sure it hasn't been updated in a very long time.  I don't even know what version we've been using.

I am totally swamped the rest of the week but hope to have time this weekend to sort out the png/freetype issues.  If you want to let me know which config options to disable for GLES2.0 and GLES 3.0, I can update the front-end as well to make it more user friendly (hide options and use drop-downs or sliders instead of text).
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline Mikhail

  • long
  • ***
  • Posts: 127
    • View Profile
Re: GLideN64 Android port
« Reply #243 on: May 28, 2015, 07:20:01 AM »
Tried using GLTools with gliden64 Gles 2.0 and it results in black screens even when disabled for the app, you have to unistall it for gles 2.0 to show anything, glide64 is however uneffected and works with GLTools  :o

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #244 on: May 29, 2015, 09:19:18 AM »
I've checked the code, which plugin's config options are available for Android.

MultiSampling – GLES3.1 only
MaxAnisotropy – remove at all. I see no GLES support for it
EnableLOD – remove from GUI for GLES2. GLES2 unable to calculate lod.
EnableCopyColorToRDRAM – not available for GLES2
EnableCopyDepthToRDRAM– not available for GLES2
EnableN64DepthCompare – GLES3.1 only

Texture library options – include all, but txDump. Texture dumping is for Windows only.

Font options – include all if FreeType will be available. Otherwise, remove all.

Bloom options. Bloom currently not available for GLES2, but it can be fixed. I haven’t tested Bloom on Android yet, may be some additional work needed here.

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #245 on: May 29, 2015, 10:25:28 AM »
I tried bloom on the enhancement build,and it did not work yet.

HWLighting works on GLES2 in Super Smash Bros.,but is immensely slow.

I think MultiSampling is actually working on GLES2,if not on GLideN64,someone please mod source code to patch in Rice's MultiSampling if at all possible since it does in fact work.
(I believe Rice's MultiSampling is independant of the plugin,and was implemented by hand quite a few years ago)

I want to have access to MultiSampling on GLideN64 to combine with 5xBRZ for maximum crispness.

https://code.google.com/p/mupen64plus/issues/detail?id=338

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #246 on: May 29, 2015, 11:02:42 AM »
retroben, there are two ways to get MSAA:
1. create graphics content with AA enabled. Content created by Mupen64Plus core, not by the plugin. Plugin may just say to core that AA is desired. GLideN64 does that, but it does not guarantees that emulator's core will create necessary context. MSAA is not OpenGL core feature.
2. OpenGL core specification defines MSAA only for Frame Buffer Objects. That is plugin uses it only when frame buffer emulation is enabled. Only GLES3.1 specification supports MSAA for FBO.

Offline fzurita

  • Moderator
  • double
  • *****
  • Posts: 560
    • View Profile
Re: GLideN64 Android port
« Reply #247 on: May 29, 2015, 02:22:56 PM »
I just tried the GLideN64 3.1 version on a nexus player and all I'm getting is a black screen. I tried open gl es 3.1, 3.0, and 2.0 and all give me the same results. The other plugins seem to work fine. The nexus player has a PowerVR 6 processor which is supposed to support 3.1. 

Is there anything I can gather to help debug the issues with the nexus player?

Also, aside from that, there is one other issue with the nexus player that I see. After entering a game, there does not seem to be a way to bring up the menu. I even tried assigning the menu function to one of the keys on my gamepad. This does mean that after entering a game, there is no way to exit the game without going back to the android home screen.
« Last Edit: May 29, 2015, 02:29:54 PM by fzurita »

Offline Mikhail

  • long
  • ***
  • Posts: 127
    • View Profile
Re: GLideN64 Android port
« Reply #248 on: May 29, 2015, 03:30:12 PM »
How does the Force 4x MSAA for gles2.0 option that's been under developer options since jelly bean work then?

when I select AA in Dolphin it says only 1x is supported.

opengl es 3.0 shader from the app store works for me without issue, opengl es 2.0 vs 3.0, 3.0
shows a major increase in speed for
instanced rendering and transform feedback.

Max Anisotropy is listed as 16x with OpenGL extensions viewer.

www.informit.com/articles/article.aspx?p=770639&seqNum=2
« Last Edit: May 29, 2015, 04:37:30 PM by Mikhail »

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #249 on: May 29, 2015, 05:09:39 PM »
Oop,forgot to respond about the Nexus Player issue...

So this issue is general to ALL x86 Android devices!
Probably the same issue where it destroys GL Context immediately after creating it.

Offline fzurita

  • Moderator
  • double
  • *****
  • Posts: 560
    • View Profile
Re: GLideN64 Android port
« Reply #250 on: May 29, 2015, 07:39:20 PM »
Oop,forgot to respond about the Nexus Player issue...

So this issue is general to ALL x86 Android devices!
Probably the same issue where it destroys GL Context immediately after creating it.

Interesting, only GLideN64 has this issue?

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #251 on: May 29, 2015, 08:54:54 PM »
The other plugins all work fine on x86.

Offline retroben

  • float
  • ****
  • Posts: 432
    • View Profile
Re: GLideN64 Android port
« Reply #252 on: May 30, 2015, 02:49:59 AM »
DK64's textures are perfect for me on GLES2 now! ;D
I did not expect it to be fixed for me,but it is.
Still missing pause effect and the zipper effect is black because of this.
Yes,the zipper effect is intact despite being solid black.

How do I stop dithering/stipple from wreaking havik on my visual quality like when underwater on DK64?

Offline Mikhail

  • long
  • ***
  • Posts: 127
    • View Profile
Re: GLideN64 Android port
« Reply #253 on: May 30, 2015, 05:19:13 AM »
android:dither="false" in the manifest xml
or
persist.sys.use_dithering = 0 in the build prop

How does dithering look for you in fpse on the bios osd bubbles, the large one in the miiddle on the front screen and the ones in the
cd player should all appear with colour banding without dithering applied.
« Last Edit: May 30, 2015, 05:22:27 AM by Mikhail »

Offline Gonetz

  • Developer
  • long
  • *****
  • Posts: 104
    • View Profile
Re: GLideN64 Android port
« Reply #254 on: May 30, 2015, 09:57:07 AM »
Gillou68310 added FreeType and new pnglib:
https://github.com/Gillou68310/mupen64plus-ae/commits/gliden64

I have corrected my code, and now TextDrawer works fine.
Details:
https://github.com/gonetz/GLideN64/commit/037d2d8e1db2ae3287f6b6742b1b1ba644355204#commitcomment-11438428

Next thing to fix is Bloom post filter.

Attached is a patch with makefiles corrections for Gillou68310's gliden64 branch.
« Last Edit: May 30, 2015, 10:04:19 AM by Gonetz »