Author Topic: Custom Video Profile  (Read 5537 times)

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Custom Video Profile
« on: August 20, 2013, 09:13:59 AM »
I've been asking for this for a while and finally just did it myself. Its a build with custom video profiles for newer devices where the current profiles do not work properly. As usual, you'll have to uninstall the previous apk.
APK: http://db.tt/AsOSzj0s
Source: http://db.tt/OuF49bN8
Check these files for changes:
Code: [Select]
jni/ae-bridge/ae_bridge.h
jni/ae-bridge/ae_imports.cpp
src/paulscode/android/mupen64plusae/CoreInterfaceNative.java
src/paulscode/android/mupen64plusae/persistent/UserPrefs.java
res/values/arrays.xml
res/values/strings.xml
res/xml/preferences.xml

 

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #1 on: August 20, 2013, 09:32:49 AM »
Cool, thanks for taking the initiative :)

Do you have a github account?  If you did, it would be trivial to put this on a branch to make it easy to test and integrate into the master build.  You've made so many great contributions to this project, it's hard to believe you haven't authored any code in the repository. :D
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Custom Video Profile
« Reply #2 on: August 20, 2013, 10:06:08 AM »
Maybe I will, but first I'd like to know what exactly this code does
Code: [Select]
*f1 = bias > 0 ? customOffset : 0.0f;
*f2 = bias > 0 ? customOffset : 0.0f;
I haven't learned fancy concise statements like that yet.

Also, after playing around a bit with the offset, it would appear that there is no perfect value. It helps, but I agree, something better should be implemented. (New nexus 7's offset appears to be from -0.02 to -0.05)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3496
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Custom Video Profile
« Reply #3 on: August 20, 2013, 11:27:16 AM »
I'd like to know what exactly this code does
Code: [Select]
*f1 = bias > 0 ? customOffset : 0.0f;
*f2 = bias > 0 ? customOffset : 0.0f;

That is a short-hand conditional syntax used in several C-like languages.  Just a shorter way to write this:
Code: [Select]
if( bias > 0 )
{
    *f1 = customOffset;
}
else
{
    *f1 = 0.0f;
}

if( bias > 0 )
{
    *f2 = customOffset;
}
else
{
    *f2 = 0.0f;
}

(those could of course have been combined into one if statement, but for demonstration purposes I broke them out to how the compiler actually reads it)
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 littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #4 on: August 20, 2013, 11:44:57 AM »
@xperia64 - Even if you're not interested in using github, I'd encourage you to at least create a github account.  Then we can provide proper attribution (authorship) if/when we merge your changes, and it's always good to know who wrote what part of the code.  We'd only need your github username and the email address you registered with (just send us a PM).
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #5 on: August 20, 2013, 11:55:58 AM »
Also, after playing around a bit with the offset, it would appear that there is no perfect value. It helps, but I agree, something better should be implemented. (New nexus 7's offset appears to be from -0.02 to -0.05)

For a completely different solution, another option would be to make a separate little test app, which would just render a scene with overlapping and near-overlapping polygons (might be able to write the whole thing Java-side for simplicity).  User pushes a slider to fine tune the value, then when satisfied, hits a submit button.  Or it could be a questionnaire like the Microsoft's ClearText setup dialog.  Shoot off the user's choice (and the GL_RENDERER and device info) to a surveymonkey or google docs form to collect the info via HTTP POST.  Put the app on the store, and send users there.  With enough data we could make a much better lookup table.  I could probably whip something up in less than a day if I could only find the time...
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Custom Video Profile
« Reply #6 on: August 20, 2013, 12:03:33 PM »
The problem I've found is that when one thing looks good like the shadows, something else doesn't. In star road, the water in the moat is always above the ground when the shadows are propely displayed. In Banjo-Tooie, when walking in grass, the shadow is still displayed even though it shouldn't. And no matter what I set it to, shadows always have trouble rendering on slopes.

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #7 on: August 20, 2013, 12:07:37 PM »
Is Star Road homebrew?

I recommend using the trees and shadows outside the castle in Super Mario 64 to fine-tune the value.  If things really vary between games, then we should just pick a single reference game and stick to it.  Mario 64 seems like a good standard...
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline xperia64

  • Moderator
  • double
  • *****
  • Posts: 591
    • View Profile
    • My Apps
Re: Custom Video Profile
« Reply #8 on: August 20, 2013, 12:10:59 PM »
Star Road is a Mario64 mod. I suppose plain mario 64 is probably the best. I'd say -0.029 should be the offset for Adreno 320 devices. Banjo-Tooie doesn't like -0.03. Also, is there any reason that glide is more susceptible to offset changes than the other plugins?
« Last Edit: August 20, 2013, 12:20:18 PM by xperia64 »

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #9 on: August 20, 2013, 01:18:55 PM »
Also, is there any reason that glide is more susceptible to offset changes than the other plugins?

In a perfect world each plugin would render a given polygon with OpenGL in exactly the same state.  But since the world isn't perfect...  In this case glide's glPolygonOffset(.) values might not match what the others are using.  Or maybe the near and far clipping planes are set to different values in glide, which affects the granularity of the depth buffer at a given distance.  Or there may be shader differences, which you'd have to ask Kris about.  Off the top of my head...
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version

Offline littleguy

  • Moderator
  • double
  • *****
  • Posts: 1945
    • View Profile
Re: Custom Video Profile
« Reply #10 on: August 20, 2013, 08:25:29 PM »
Just posted xperia64's source to github.
2012 Nexus 7, rooted stock Lollipop
Samsung Galaxy Victory, rooted stock Jelly Bean
Xperia PLAY, stock Gingerbread
OUYA, retail version