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

Texture bug with healthbar in Tekken 5 #2077

Closed
Itachinight opened this issue Jun 4, 2013 · 28 comments · Fixed by #6737
Closed

Texture bug with healthbar in Tekken 5 #2077

Itachinight opened this issue Jun 4, 2013 · 28 comments · Fixed by #6737

Comments

@Itachinight
Copy link

There is a problem with viewing the health bar with hardware decoding. Example:
NO HW
screenshot_2013-06-04-16-41-51 1
WITH HW
screenshot_2013-06-04-16-41-39 1

@hrydgard
Copy link
Owner

hrydgard commented Jun 4, 2013

In which version of PPSSPP? I thought I fixed this one recently.

@xsacha
Copy link
Collaborator

xsacha commented Jun 4, 2013

I've never seen this one fixed.
Has been like this in all versions I know of, from at least v0.7.5 to now.

@hrydgard
Copy link
Owner

hrydgard commented Jun 4, 2013

Ah, I thought my texture coordinate offset fix took care of this one but never tested it. Wonder what it might be then.

@solarmystic
Copy link
Contributor

This is a very, very old confirmed issue.

Disabling Hardware Transform is a solution for now, but may be unfeasible for the drastic performance loss incurred for mobile devices.

@Itachinight
Copy link
Author

These screens are from android v0.7.6 1084
On pc versions it's o.k. even with HW.

@hrydgard
Copy link
Owner

hrydgard commented Jun 5, 2013

Oh that's interesting. And strange...

@dbz400
Copy link
Contributor

dbz400 commented Sep 24, 2013

Just wonder what is the texture coordinate offset fix ? (is it the // Step 3: UV generation ? ) may be we can revisit to test it and fix the issue here. As HW T&L indeed has a bug affect at least this game and Midnight Club 3 .

@unknownbrackets
Copy link
Collaborator

Can someone with this game do the following (on Windows)? I'm told it may not work properly on ATI cards.

  1. Disable hardware transform.
  2. Get to an area affected by this problem.
  3. Open the GE debugger in the Debug menu.
  4. Click Step Frame.
  5. Click Step Prim until you see the problem area of the healthbar highlighted in red (meaning, it's about to draw there.) This will probably be after it draws the bar background.
  6. Resize the GE debugger window taller (as tall as your screen.)
  7. Take screenshots of the "Flags", "Lighting", "Texture", and "Settings" tabs and post them here (the top visible portions of each are enough if you have a decent resolution.)

Specifically I'm wondering if it's using stencil testing or something.

-[Unknown]

@xsacha
Copy link
Collaborator

xsacha commented Nov 20, 2013

@unknownbrackets Here you go :) Hope you figure it out
http://imgur.com/WSe3Czm,sg79W0K,w6m99Cj,UHF0AbB,cSXoRbq
In order: Screenshot, Flags, Lighting, Texture, Settings

@Bigpet
Copy link
Collaborator

Bigpet commented Nov 20, 2013

@xsacha is that at 1x scale though?

As far as I've seen the red primitive markers don't work correctly unless it's at 1x scale.

@xsacha
Copy link
Collaborator

xsacha commented Nov 20, 2013

Yeah the marker wasn't working. I was at 2x scale. Everything else is correct though.
Location of marker just needs to be multiplied by internal resolution (or other way around), I guess.

By the way, I have an ATI card. I also get NO healthbar when Hardware Transform is enabled.
This is with hardware transform enabled: http://imgur.com/sU4yCfj,azPBumF,c4gvFYg,lR0tDTF,7DuExCy

@unknownbrackets
Copy link
Collaborator

So not using alpha testing (flag is on, but set to ALWAYS.) Just blending. Lighting isn't even enabled. The clipping seems a bit odd. Oh right, 2x.

What if, from there, you change "Material update" to 0 (double click it), does it show in hardware transform?

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Nov 20, 2013

Let me try this out .

@xsacha
Copy link
Collaborator

xsacha commented Nov 20, 2013

Material Update is already 0.
http://imgur.com/sU4yCfj,azPBumF,c4gvFYg,lR0tDTF,7DuExCy
It's only 'ambient' if hardware transform is disabled.

@unknownbrackets
Copy link
Collaborator

That's really strange. What if you change it to 1, does it work?

And the lights are enabled. Are you sure this is at the same place?

-[Unknown]

@xsacha
Copy link
Collaborator

xsacha commented Nov 20, 2013

Hardware Transform On (shows health bar and time icon): http://imgur.com/UN1cDT1,2euZneI,Bya2sDS,tTj2Tdo,k7dZz64
Hardware Transform Off: http://imgur.com/wVPp3YK,PunWdZw,Cm5m6E7,2eWbsir,GOTT0oJ

Both 1x scale now. They match up.

@unknownbrackets
Copy link
Collaborator

Was this improved at all by the recent change to the UV coordinate problem (seems unlikely, but possible...) or anything?

Also, just to confirm, vertex cache doesn't affect this? I probably asked this before but I don't see it here...

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets

Nope, the issue is still present in the latest build (v0.9.6-584-ga0a9ad4), and vertex cache does not affect it at all.

HW Transform ON
screen00340

HW Transform OFF
screen00339

@unknownbrackets
Copy link
Collaborator

Apparently, altering the z coordinate in the vertex shader affects this, so this is another depth issue of some kind. Interesting that it's different between hardware and software transform.

It seems that this change makes the health bars visible:

        // Final view and projection transforms.
        WRITE(p, "  gl_Position = u_proj * viewPos;\n");

To:

        // Final view and projection transforms.
        WRITE(p, "  gl_Position = u_proj * viewPos;\n");
        WRITE(p, "  gl_Position.z = clamp(gl_Position.z, -1.0, 1.0);\n");

Sounds like it causes other glitches, but at least it tells us z is somehow involved / affects it.

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Jan 26, 2014

Yep , it will cause other glitches as below however it did prefectly fix the power bar .

screen00395

@dbz400
Copy link
Contributor

dbz400 commented Jan 26, 2014

Let me link it to #4836 which is same depth issue here (Taiko DX (JP) Missing Text)

@hrydgard
Copy link
Owner

Seems likely to be a case where in software transform, through mode and non-through manages to produce exactly the same depth value so that a depth test passes, while in hardware transform, something is very slightly different to the bar ends up behind the "empty bar holder". Tricky.

@unknownbrackets
Copy link
Collaborator

Well, the depth test is not enabled here. See @xsacha's screenshots of the GE debugger. I'm guessing it's clipping?

-[Unknown]

@hrydgard
Copy link
Owner

Oh if the depth test isn't enabled, then yeah, it's clipping. Maybe we need to very slightly tweak the projection matrix, if it's just at the close plane. We did that in Dolphin at some point I think although I think that's gone now somehow...

@unknownbrackets
Copy link
Collaborator

I notice this is using s8 positions. Could possibly be related to #4617, if Z has a different scale as well.

http://imgur.com/wVPp3YK,PunWdZw,Cm5m6E7,2eWbsir,GOTT0oJ#4

I also notice min/max z are set. Still have no idea what they do...

-[Unknown]

@Xcedf
Copy link

Xcedf commented Jun 29, 2014

Tested this issue, God of War ghost of sparta has the same, when Thera's bane is used, the fire on blades is flickering, but if hardware transform is off it works properly, of course it cuts performance mercelessly

@unknownbrackets
Copy link
Collaborator

Could be fixed/improved by the position scaling:

https://github.com/unknownbrackets/ppsspp/compare/pos-scale

-[Unknown]

@solarmystic
Copy link
Contributor

@unknownbrackets
Yep, it's all fixed now, even with HW Transform enabled after your pos-scale branch is applied:-

ucet00424_00000

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

Successfully merging a pull request may close this issue.

8 participants