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

tales of destiny 2 grahpics problem and speed problem #7587

Closed
asbel123 opened this issue Mar 13, 2015 · 18 comments
Closed

tales of destiny 2 grahpics problem and speed problem #7587

asbel123 opened this issue Mar 13, 2015 · 18 comments

Comments

@asbel123
Copy link

i play the game on andriod it works perfect on 1x resoution on samsung galaxy s4 but there a problem is if u put 3x resloutoin u get black screen on the background and menu even same problem is windows and andriod.

i playing it too much on my phone i have to put 1 frameskip to play the game properly fix it for andriod.

@daniel229
Copy link
Collaborator

The game is cpu and gpu demanding,and full speed at 60 fps.On desktop i can get 100 fps with 4x resolution, 170 fps with 2x resolution in battle, If disable slower effect,I can get 230 fps with 4x and 250 with 2x.

@unknownbrackets
Copy link
Collaborator

Hmm, it spends 64% of its time in the texture cache in a town. Retain changed textures doesn't help, nor does lazy texture caching.

It uses the same texture offset to get to different coordinates, which only makes the texture cache slower, but I'm not seeing the texture change... hmm. It keeps deindexing.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

So, in town, including the dim in the cache key (as a test) makes it run much faster. This is because it uses different dimensions (e.g. 512x512 and 512x16) of the same texture data, multiple times per frame. Previously, this caused us to delete the 512x512 texture and recreate it multiple times in the same frame.

I wonder how safe it would be to include dim in the cache key...

https://github.com/hrydgard/ppsspp/compare/hrydgard:master...unknownbrackets:texcache?expand=1

I haven't really tested it with other games, although it ought to be safe. Does it improve battles?

Assuming it doesn't improve battles... can you give me some savedata? Not sure how to get through the intro, haven't played this yet and my Japanese is weak.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

It also spends 10% of its time in SAS, which could probably be optimized, but also needs pitch adjustment, which I'm not planning to mess with right now since I won't be able to tell clicks and such.

Anyway, making it use a thread the easy way (not using copies or syncing, yay for non-determinism) adds about 7% performance (700% -> 750%) on my desktop. The remaining time (the 3%) is waiting in the subsequent call to sceSasCore for the previous to finish.

Anyway, even with the above changes it still spends 30% of its time in the texture cache, now hashing (this is still because of the different offsets it uses, I think.) Switching to lazy texture caching brings us to about 1200% (+60%), since it skips a lot of that. With that, it spends about 36% of its time drawing in general, so I guess more time in the jit at that point.

This is still from the town, though.

-[Unknown]

@asbel123
Copy link
Author

tales of destiny 2 on pcsx2 emulator always go to slow alot on pc but on ppsspp always got fullspeed 0 glitches and andriod works too. pcsx2 cant run tales of destiny 2 propely some areas go slow alot

@daniel229
Copy link
Collaborator

The battle won't get improvement unless slower effects is off,when it off it gets improvement for speed from 250fps to 700fps.The battle does not require a savedata,it's from the new game.

savestate for the battle (rename jpg to 7z)
uljs00097_1 00_2

@unknownbrackets
Copy link
Collaborator

Thanks, I'll load that a bit later.

Hmm, maybe I just need to restart. I have some savedata in the first town but the guy won't let me leave town and I can't tell why or what I'm supposed to do first...

Edit: oh, there was another part of the town, oops. I'm free, hurray.

It uses (src * 2 * src.a) + (dst * (1 - src.a)) AND color doubling, for almost all drawing, ugh. Luckily it's generally full alpha. I somehow don't understand what it's doing to need the doubling, because the original texture looks fine. It's basically halving the color with the vertex color and then doubling to compensate... ugh.

For shadows it's using fixed + dst * (1 - 2 * src.a). That's what's causing the slowness.

Note to self: uvscale not properly supported by texture preview?

-[Unknown]

@daniel229
Copy link
Collaborator

That change fixes the glitch in split /second.
01

@unknownbrackets
Copy link
Collaborator

Hmm, do you mean the circle/shadow? Well, I guess I should figure out why it affected that because I was aiming for no functional changes, just performance. Hmm.

-[Unknown]

@daniel229
Copy link
Collaborator

Yes,it's the circle one.

@unknownbrackets
Copy link
Collaborator

Ugh. I know why. This change might cause problems for Type-0, maybe. In the menus....

Because it makes it so there's a different tex cache entry when using render-to-texture with a different size.

But the split/second thing is a bug, since it's always a render-to-texture, and the render size changes, so it should not reject the framebuffer.

If this doesn't cause problems for Type-0 it might be okay. I think I could reproduce the issue in the demo, if I can remember what it was.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

This is what I was thinking of - #4274. But actually the real issue I was thinking of was related to Tactics Ogre (#3664, #2758.) But I think it's all still working now, afaict.

-[Unknown]

@daniel229
Copy link
Collaborator

Tested some games it seems good.it also affect #4112

with that chenge
01

witout that change
02

@unknownbrackets
Copy link
Collaborator

Okay, I have an idea what that game might be doing then, and it's nothing good. But I don't think it's worse with this change.

-[Unknown]

@hrydgard
Copy link
Owner

I somehow don't understand what it's doing to need the doubling, 
because the original texture looks fine. It's basically halving the color
with the vertex color and then doubling to compensate... ugh.

This is an old technique from the PSX and a similar idea was also used in Quake 3, by modifying the gamma ramp to get 2x color. The idea is to give yourself headroom to not only darken things by setting vertex colors but also brightening them by setting them over 1.0 - which with this kind of trick is really 0.5.

Of course, it may be that the game doesn't even utilize the possibility to brighten things, if it just took parts of an engine from some older game that did..

@unknownbrackets
Copy link
Collaborator

Does this improve anything in the battle?

https://github.com/hrydgard/ppsspp/compare/hrydgard:master...unknownbrackets:tex-split?expand=1

Don't have time to check myself now, but if you do before me, just wondering if I'm barking up the right tree.

-[Unknown]

@daniel229
Copy link
Collaborator

No,it doesn't.

@unknownbrackets
Copy link
Collaborator

I'm going to mark this fixed now that #8213 is merged. There's always more room for improvement, but the major wins for battle and town have already been made.

-[Unknown]

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