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

Taiko DX (JP) Missing Text #4836

Closed
skittyz321 opened this issue Dec 15, 2013 · 35 comments
Closed

Taiko DX (JP) Missing Text #4836

skittyz321 opened this issue Dec 15, 2013 · 35 comments

Comments

@skittyz321
Copy link

Happens in the mail
screen00000
and in the pause menu
screen00001

@unknownbrackets
Copy link
Collaborator

Probably a stencil issue. If you use the GE debugger and hit "step draw" does the text ever show up, or never?

If you hit "step tex", do you ever see text (might just be an alphabet) on the left side?

-[Unknown]

@skittyz321
Copy link
Author

using step tex it shows what looks like the text that should be on the pause menu.
untitled

@skittyz321
Copy link
Author

and step draw never made the text show up in the game

@unknownbrackets
Copy link
Collaborator

And this never worked right, it's not something that recently broke (there were a lot of recent stencil changes is why I ask)?

The most likely thing is a stencil/depth test that isn't passing when it should.

-[Unknown]

@skittyz321
Copy link
Author

From my experience it hasn't worked before, but I could be wrong. It hasn't shown in the last few weeks at least.

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

I also tested in softgu , also no text show up .

@skittyz321
Copy link
Author

@unknownbrackets
Copy link
Collaborator

Hmm, I'm at least 80% sure softgpu does stencil accurately. Maybe it's depth then or something else...

What flags does it have set? Can you show me the Settings tab when it's drawing them? (use step tex until you see the alphabet, then hit step prim, then screenshot.)

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Do you mean this one ? I also tried to disable depth testing , not helping

1

@unknownbrackets
Copy link
Collaborator

When you step prim, does it ever highlight in red the area the text should be on (this is what vertex preview was born to help with)? Or does it never even show any red boxes on the right side?

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Yes, it does

1

@unknownbrackets
Copy link
Collaborator

Hmm. What's alpha blending set to? And stencil test/depth test (settings, scroll down a bit)?

If it is trying to draw it in the right place and not showing up, it's pretty much limited to being a texfunc, blend, or some test issue I think.

When you're at that stage (where the text positions are highlighted in red), you can go to the Flags tab and toggle the tests, blending, etc. off and see if it shows up.

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Alpha blending set to 1 and stencil/depth are all 0

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Just tested where the text positions are highlighted in red) and toggle those test and blending , seems to be not helping

@unknownbrackets
Copy link
Collaborator

It could be a scissor test, or etc. Try just turning them all off.

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Humm looks like we don;'t have scissor test in FLAG tab

@hrydgard
Copy link
Owner

Scissor test is always enabled on PSP. The way for the game to "disable" it is to set the scissor rectangle to the entire framebuffer.

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

I tested jpcsp just in case .It also didn't show the text

1

@hrydgard
Copy link
Owner

What is the alpha blend func set to?

@dbz400
Copy link
Contributor

dbz400 commented Dec 15, 2013

Here it is

2

@hrydgard
Copy link
Owner

Hm, nothing suspicious there...

Maybe the Z coordinate of the vertices ends up out of range somehow?

@unknownbrackets
Copy link
Collaborator

Does this still happen (I assume it does)?

Try the following, in GPU/GLES/VertexShaderGenerator.cpp:

Change:

        if (gstate.isModeThrough()) {
            WRITE(p, "  gl_Position = u_proj_through * vec4(position.xyz, 1.0);\n");
        } else {
            WRITE(p, "  gl_Position = u_proj * vec4(position.xyz, 1.0);\n");
        }

To:

        if (gstate.isModeThrough()) {
            WRITE(p, "  gl_Position = u_proj_through * vec4(position.xyz, 1.0);\n");
        } else {
            WRITE(p, "  gl_Position = u_proj * vec4(position.xyz, 1.0);\n");
        }
        WRITE(p, "  gl_Position.z = clamp(gl_Position.z, 0.0, 1.0);\n");

Change:

        // 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, 0.0, 1.0);\n");

In GPU/Software/TransformUnit.cpp, change:

        vertex.modelpos = ModelCoords(pos[0], pos[1], pos[2]);
        vertex.worldpos = WorldCoords(TransformUnit::ModelToWorld(vertex.modelpos));
        vertex.clippos = ClipCoords(TransformUnit::ViewToClip(TransformUnit::WorldToView(vertex.worldpos)));
        vertex.screenpos = ClipToScreenInternal(vertex.clippos);

To:

        vertex.modelpos = ModelCoords(pos[0], pos[1], pos[2]);
        vertex.worldpos = WorldCoords(TransformUnit::ModelToWorld(vertex.modelpos));
        vertex.clippos = ClipCoords(TransformUnit::ViewToClip(TransformUnit::WorldToView(vertex.worldpos)));
        vertex.screenpos = ClipToScreenInternal(vertex.clippos);
        if (vertex.clippos < 0.0f)
            vertex.clippos = 0.0f;
        if (vertex.clippos > 1.0f)
            vertex.clippos = 1.0f;

I've relatively sure this isn't correct, but it should show if the z is being completely clipped.

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Jan 19, 2014

Let me try it .

@dbz400
Copy link
Contributor

dbz400 commented Jan 19, 2014

Wow. Text show up well ! (Though break other games)

GLES
screen00385

@dbz400
Copy link
Contributor

dbz400 commented Jan 19, 2014

For the following , it complaints as follow

1>Software\TransformUnit.cpp(176): error C2784: 'bool operator <(const PSPPointer &,const PSPPointer &)' : could not deduce template argument for 'const PSPPointer &' from 'ClipCoords'
1> E:\ppsspp-master\Core/MemMap.h(464) : see declaration of 'operator <'
1>Software\TransformUnit.cpp(176): error C2784: 'bool operator <(const S &,const swap_struct_t<T,F>)' : could not deduce template argument for 'const swap_struct_t<T,F>' from 'float'
1> e:\ppsspp-master\common\Swap.h(429) : see declaration of 'operator <'
1>Software\TransformUnit.cpp(176): error C2676: binary '<' : 'ClipCoords' does not define this operator or a conversion to a type acceptable to the predefined operator
1>Software\TransformUnit.cpp(177): error C2679: binary '=' : no operator found which takes a right-hand operand of type 'float' (or there is no acceptable conversion)
1> E:\ppsspp-master\GPU/Math3D.h(489): could be 'Math3D::Vec4 &Math3D::Vec4::operator =(const Math3D::Vec4 &)'

    if (vertex.clippos < 0.0f)
        vertex.clippos = 0.0f;
    if (vertex.clippos > 1.0f)
        vertex.clippos = 1.0f;

@unknownbrackets
Copy link
Collaborator

Oops, that's supposed to be vertex.clippos.z in each case.

Interesting, though. So that means this is some sort of z clipping issue. Either:

  • The z value coming from the game is wrong (possibly a cpu bug.)
  • The z value is not being transformed correctly (this seems unlikely?)
  • The z value is supposed to have additional handling or is not being scaled correctly.

-[Unknown]

@hrydgard
Copy link
Owner

Can you try to clamp depth in through mode only? Maybe we should do that, games are probably not expecting depth clipping to happen anyway when drawing in that mode...

@unknownbrackets
Copy link
Collaborator

Oh, that could be. It seems like it's affecting #4786's video also from what I understand.

-[Unknown]

@dbz400
Copy link
Contributor

dbz400 commented Jan 20, 2014

Basically we need the following to show the text correcttly but will break other games.

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

However if clamp in through mode , it is not working .

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

@hrydgard
Copy link
Owner

Hm, that's unfortunate, would have been nice if that would have taken care of it...

@dbz400
Copy link
Contributor

dbz400 commented Jan 26, 2014

In Tekken 5 , software T&L renders the power bar correct but not here in Taiko DX however they are same depth issue .

@unknownbrackets
Copy link
Collaborator

I notice this, like Tekken, has min z/max z set to some values. Hmm.

When drawing the missing elements, what vertex types does it use? I see above one that is throughmode, but apparently throughmode alone doesn't fix it, so what others? Also for the dialog background, etc.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Has this changed at all with the new scaling of positions and the throughmode rounding change? Try with hardware transform on and off.

-[Unknown]

@daniel229
Copy link
Collaborator

No change with hardware transform on or off.

@daniel229
Copy link
Collaborator

Fixed in #7920

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

5 participants