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

dust effect displays green triangular shapes issue #10969

Closed
joelolopez opened this issue Apr 27, 2018 · 8 comments · Fixed by #10981
Closed

dust effect displays green triangular shapes issue #10969

joelolopez opened this issue Apr 27, 2018 · 8 comments · Fixed by #10981
Labels
D3D9 Direct3D 9 D3D11 Direct3D 11 Vulkan
Milestone

Comments

@joelolopez
Copy link

im playing this Brave story new traveler game using vulkan backend when i notice that the dust effects displays wrong images (green triangular shapes)

1

OS android 7.0 , Octa-core, 2360 MHz, ARM Cortex-A53, 64-bit, 16 nm , Mali-T830 MP2 , 4 GB RAM

@Leopard20
Copy link
Contributor

Did you try changing the options? Like disabling the stencil test?

@joelolopez
Copy link
Author

yup i tested it and still displaying the same image

@unknownbrackets
Copy link
Collaborator

If I remember correctly, this is rendered using flat shading. It might be impacted in some way by render-to-CLUT, though.

Stencil test won't help. Does this happen with both OpenGL and Vulkan?

If it happens with OpenGL, did it work in v1.5.4? Is it broken in the latest git build?

-[Unknown]

@joelolopez
Copy link
Author

joelolopez commented Apr 27, 2018

this only happen with vulkan, im using v. 1.5.4 from the ppsspp. Org

@unknownbrackets
Copy link
Collaborator

The problem here is that flat shading on Vulkan picks a different vertex for the triangle strips:

GLES: i + 2 (default GL_LAST_VERTEX_CONVENTION)
Everyone else: i

Brave Story uses the wrong colors if you follow the wrong convention. So my guess (without testing) is that the PSP used the OpenGL default convention.

In theory, we could pass the offset vertex into the vertex shader and pull the correct color, I guess. Not sure what the most efficient solution is here.

-[Unknown]

@unknownbrackets unknownbrackets added D3D9 Direct3D 9 D3D11 Direct3D 11 labels Apr 28, 2018
@hrydgard hrydgard added this to the v1.7.0 milestone Apr 28, 2018
@hrydgard
Copy link
Owner

hrydgard commented Apr 28, 2018

Oh, that makes sense. Ouch.

Well, depending on the primitive type there can be somewhat easier solutions, like for example if it's TRIANGLE_LIST then we can "just" copy the color from the third to the first vertex in each triangle... Unfortunately that does mean reading back from decoded vertices, which can be expensive on some platforms as we write verts directly to uncached VRAM (remember that slowness bug..). Or we need to make the vertex decoder a lot smarter. Or simply always software-transform FLAT triangles, then we can easily poke around in the vertex data to fix it up and will handle all the types easily, at the cost of losing hardware transform for these triangles. This will also let us simulate FLAT on platforms that don't support it...

@unknownbrackets
Copy link
Collaborator

In this specific case it's a triangle strip. Really, the first two colors are garbage, it's correct after that.

Always software transforming flat really doesn't sound too terrible to me. They're pretty infrequent, although I could imagine finding some crazy game that uses flat for complicated many-vertex shape rendering or something...

-[Unknown]

@hrydgard
Copy link
Owner

Yeah, I think I like that idea best too. Bit of a minor perf regression risk as you say, but probably not common.

unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Apr 28, 2018
Except on GLES where it works fine with the default provoking index.

This fixes hrydgard#10969 so that it works everywhere.
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Apr 28, 2018
Except on GLES where it works fine with the default provoking index.

This fixes hrydgard#10969 so that it works everywhere.
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue May 28, 2018
Except on GLES where it works fine with the default provoking index.

This fixes hrydgard#10969 so that it works everywhere.
unknownbrackets added a commit to unknownbrackets/ppsspp that referenced this issue Jun 6, 2018
Except on GLES where it works fine with the default provoking index.

This fixes hrydgard#10969 so that it works everywhere.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
D3D9 Direct3D 9 D3D11 Direct3D 11 Vulkan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants