Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixelated/Blocky 2D in-battle sprites only on android version #7150

Closed
r1c4rd0 opened this issue Dec 8, 2014 · 30 comments
Closed

Pixelated/Blocky 2D in-battle sprites only on android version #7150

r1c4rd0 opened this issue Dec 8, 2014 · 30 comments

Comments

@r1c4rd0
Copy link

r1c4rd0 commented Dec 8, 2014

Since version 0.9.8-1071 in-battle sprites show blocky texture in Tactics Ogre on android devices, this doesn't happen on the windows version as far as my test showed(compared 1071 windows and android versions).
These test were performed on a Razr i with an Intel Atom Z2460 x86 CPU, and a Nook HD+ with a PowerVR SGX544 ARMv7 CPU.

screenshot_2014-12-07-17-59-30_1
^How the sprites look from dev version 0.9.8-1071 up to the most current at this time 0.9.9.1-1100
screenshot_2014-12-07-17-57-53_1
^How it looked in dev versions 0.9.8-1069(tested), 1067(tested), and previous(didn't test each end every single version before, but I do remember it not looking pixelated before).

One thing I noticed is that if you choose the rendering modes "Read framebuffers to Memory"(both CPU and GPU) the sprites look fine(though you then get the problem that the game crashes after a few seconds, this is normal tho). So I suppose it could be a problem with the renderer using lower resolution than what is chosen in the options, like it ignoring x2, or x3 and rendering the sprites at x1 regardless.

@unknownbrackets
Copy link
Collaborator

I suppose you mean v0.9.8-1071-gf6f8d1d?

f6f8d1d

I wonder if it's an issue with mod() on your GPU, or simply an issue of the precision...

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Hmm, Tactics Ogre is just crashing at the intro for me (in a HWTRAP in GL internals.....)

-[Unknown]

@r1c4rd0
Copy link
Author

r1c4rd0 commented Dec 8, 2014

v0.9.8-1071-gf6f8d1d, yes.

The game crashing at the intro happened to me to in the latest builds but since it was unrelated to the sprites thing I didn't mention it. sorry.
If you're able to load a savestate directly to a battle, you'll see it.

Let me upload a save state somewhere.
BRB.

@unknownbrackets
Copy link
Collaborator

If you could find the first version that started crashing at intro that'd also be super helpful. But yes, a savestate is appreciated.

-[Unknown]

@r1c4rd0
Copy link
Author

r1c4rd0 commented Dec 8, 2014

I will do my best.
One thing though, it doesn't crash on my x86 android phone. Only on the armv7 tablet.

This savestate was made on my x86 android phone with the v0.9.9.1-1100-g59d41b1 build. Savestate position 2 I believe.
https://drive.google.com/file/d/0B_gMiJrECRQXYnRQdFNtR2tranc/view?usp=sharing
Settings: I'll only list enabled settings or options selected for convenience(unlisted settings are disabled)
Mode: Buffered rendering
rendering res: 2x
display res: native
hardware transform - enabled
software skinning - enabled
vertex cache - enabled
retain changed textures - enabled
spline/bezier - low
Upscale type - hybrid+bicubic
texture filter - nearest
screen scaling filter - linear
disable alpha test - enabled
PSP model - psp2k/3k

And this savestate was with the armv7 tablet on v0.9.8-1071-gf6f8d1d
https://drive.google.com/file/d/0B_gMiJrECRQXVHdDcXdhOXN4dU0/view?usp=sharing

I'll be back in 15+ hours.
Let me know if you need any other info.

@hrydgard
Copy link
Owner

hrydgard commented Dec 8, 2014

Seems likely to be some texture coordinate precision issue, especially since we've had precision issues on PowerVR before. Maybe we need to change the texcoords to highp precision

@unknownbrackets
Copy link
Collaborator

Hmm, are you sure that was created with v0.9.9.1-1100-g59d41b1? It says in the header it was created in v0.9.8. Unfortunately, it won't load on my phone due to cross platform issues we had with savestates then...

-[Unknown]

@r1c4rd0
Copy link
Author

r1c4rd0 commented Dec 8, 2014

Strange, I was sure I made that one on 0.9.9.1...

https://drive.google.com/file/d/0B_gMiJrECRQXMllqZHN6RFdlbGs/view?usp=sharing
If you want you may try this^ one which I made on 0.9.9.1-701-g1fe2af3 after uninstalling 0.9.9.1-1100(after clearing its cache and data), installing 0.9.9.1-537, and then upgrading to 0.9.9.1-701.
I haven't deleted the PSP folder between uninstalls assuming that wouldn't cause it to retain any data from previous installations.

If you do manage to get past the crashing intro to the menu then this quick-save might actually be better since I suppose it won't have the issues you'd get with savestate data.
https://drive.google.com/file/d/0B_gMiJrECRQXNTNtZFRYTnZmMnM/view?usp=sharing

Also, just found the last working(non-intro crashing build).
Last one booting intro build was v0.9.9.1-892-ge43c7af <works
First non-booting intro build was v0.9.9.1-896-g4ed97f9 <doesn't
Do note that there were a few builds between the two that I was unable to test due to there not being any builds available for download.

The order I went to find this was:(all are builds of 0.9.9.1, and first three are listed above)
-1100
-537
-701
-803-g47b731b
-850-g01c2b88
-885-g22515d1
-927-g6a49337
-899-g07ec247
-892-ge43c7af
-896-g4ed97f9
This might not be useful but I think that you should at least know which builds I tested and which I didn't.

@unknownbrackets
Copy link
Collaborator

Hmm... somehow 74d8a9b then? Not many changes between those two...

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Hmm, that savestate loads but I crash instantly as soon as it tries to draw anything... hmmph.

-[Unknown]

@jay-arco07
Copy link

I hope in the next update this problem would be fixed.

@hrydgard
Copy link
Owner

OK, got a fix that works on my Zenfone at least. Please try the latest builds on your PowerVR devices.

@r1c4rd0
Copy link
Author

r1c4rd0 commented Dec 14, 2014

Tried the latest build v0.9.9.1-1189-gf424bf7 on my 2 android devices. Found no change.
On the intel phone sprites continue to look pixelated and the nook tablet still crashes whenever it tries to draw anything that isn't the 2 boot screens(Square Enix & Basiscape) like unknownbrackets mentioned.
On the intel I tried un/checking each graphic setting, didn't change Audio/Control settings, and tried the System settings:
Fast memory
Multithreaded
I/O on thread
Respect FPU rounding
PSP model
but none seemed to help.

As I mentioned before, changing the rendering mode to "Read framebuffers to memory(CPU/GPU)" does render the sprites correctly but the game slows down and crashes after a few seconds(which from what I've seen is normal on other games on android).

I've been trying to see if I can get a log using the debugging option "Dump next frame to log" but I'm unable to find any log file when browsing the memory card after closing ppsspp.

@hrydgard
Copy link
Owner

Weird, because the fix does seem to work just fine on Zenfone, which is intel/powervr. I'll dig out my Nexus S...

@r1c4rd0
Copy link
Author

r1c4rd0 commented Dec 15, 2014

Just tried the latest build(v0.9.9.1-1190-gd9e543f) on my phone and it appears to have fixed it.
Gonna try the nook next, but since that one appears to have some other issue I don't think it'll even load.
But preliminarily I'm assuming this issue to be fixed.

Thank you hrydgard and unknown.

-Update-
Yep the nook still crashes, but seeing as that is an unrelated issue to the main topic, I would consider this issue closed.
IDK if you want to wait for others to confirm before closing this so I'm gonna let you do it.
Once again, thanks.

@jay-arco07
Copy link

Here on iOS there still no (v0.9.9.1-1190-gd9e543f) update. I'm still having problem with (v0.9.9.1-1189-gf424bf7)

@hrydgard
Copy link
Owner

I wonder if we are misdetecting the GPU on your device. Can you take a screenshot of the following page:

Settings / System / Developer Tools / System Information / GPU

@jay-arco07
Copy link

image

@jay-arco07
Copy link

Is it the one you are looking for mr. Hrydgard?

@jay-arco07
Copy link

By the way mr. Hrydgard thank u for always responding on my problem you are such a professional man :)

@hrydgard
Copy link
Owner

Thanks, yes, that's the one :) We might have to count the SGX543 in with the older generation..

BTW how weird that some letters are offset by a pixel... looks like coordinates are being rounded to something, might actually be related..

@jay-arco07
Copy link

By the way mr. Rydgard why does (v0.9.9.1-1190-gd9e543f) is not yet available on cydia?

@hrydgard
Copy link
Owner

There was a small compilation error introduced that affected non-windows, will fix it tonight.

@jay-arco07
Copy link

Ok thanks! I hope that version would fix my problem :)

@jay-arco07
Copy link

The latest update has a lot of improvements, but when I'm in the menu of the game, the graphics is still pixelated. When I started playing the game the graphics is already fine, I find it more enjoyable than before. Great work mr. Rydgard!! Even though there are still a little bit problem I am now also considering that this issue is already solved :) appreciate the effort!

@hrydgard
Copy link
Owner

Great, I want to see if I can find workarounds for the remaining issues too later, but this is good news.

@unknownbrackets
Copy link
Collaborator

I have confirmed that 74d8a9b is the first commit where it crashes. It seems somewhat broken before anyway, but definitely this commit crashes.

Reverting the BKPT change does fix it, but it still flickers like a beast.

Maybe it's when linking the last block or something somehow?

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Hmm. "Would write 512 BKPTs", "Would write 494 BKPTs"... Some of these sound like a lot. Should it really write this many? Something seems fishy.

Oh wait, I did something wrong counting I think. Duh, was skipping and emitting the first one.

But there's still a case where it "Would write 5 BKPTs".

-[Unknown]

@unknownbrackets
Copy link
Collaborator

The block address is 0x089fffc0. If I disable BKPT writing for that block only, the crash goes away. It's also the one writing that many BKPTs.

While it is trying to emit BKPTs, I had it log what it was overwriting.

Overwriting op: eafdbfd4
Overwriting op: e2577005
Overwriting op: e30f0fd4
Overwriting op: e340089f
Final op: eafdbfd0
Would write 5 BKPTs at 089fffc0 exit #0

So, the instructions it thinks it is overwriting are:

b somewhere
subs r7, r7, #5
movw r0, #65492 ; 0xffd4
movt r0, #2207 ; 0x89f
b somewhere

The disasm is:

xori a0, a0 1
sltiu a0, a0, 1 ; By the way, this looks like a combinable code sequence...
andi a0, a0, 0xFF ; This one is clearly pointless.
bne a0, s1, ->08a00000
lui a0, 0x4

The dest is a suspiciously round number. That can be composed in one op, I think. So, that's probably the issue...

326c298

-[Unknown]

@r1c4rd0
Copy link
Author

r1c4rd0 commented Jan 1, 2015

Just tried the latest build v0.9.9.1-1334-ga125178(latest yesterday) on the nook and it loads fine without any crashes and played fine as far as I could tell. So as for now it appears the game has no other problems that I could tell from my test on both my powervr drvices.

Thank you both for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants