Tetrisphere "Lines" #450

Closed
thecoreyburton opened this Issue May 1, 2015 · 30 comments

Comments

Projects
None yet
7 participants
@thecoreyburton

This seems to occur on Tetrisphere (intro screen).
Emulator used: anything Zilmar spec. Unsure about other versions
lines

@thecoreyburton

This comment has been minimized.

Show comment
Hide comment
@thecoreyburton

thecoreyburton May 8, 2015

Additionally, in the 1.1 release disabling frame buffer emulation makes these lines flicker.

Additionally, in the 1.1 release disabling frame buffer emulation makes these lines flicker.

@purplemarshmallow

This comment has been minimized.

Show comment
Hide comment
@purplemarshmallow

purplemarshmallow May 11, 2015

Contributor

there are no lines when rendering in 640x480 or lower
#290 same issue?

Contributor

purplemarshmallow commented May 11, 2015

there are no lines when rendering in 640x480 or lower
#290 same issue?

@standard-two-simplex

This comment has been minimized.

Show comment
Hide comment
@standard-two-simplex

standard-two-simplex Jul 1, 2015

Contributor

@gonetz I spotted this piece of code in gSP.cpp, constructor of ObjCoordinates:
lrs = uls + (lrx - ulx) * scaleW

lrx - ulx is the width of the frame -1, so lrs - uls will become (size-1)*scale. Shouldn't it be size*scale - 1 ?

Contributor

standard-two-simplex commented Jul 1, 2015

@gonetz I spotted this piece of code in gSP.cpp, constructor of ObjCoordinates:
lrs = uls + (lrx - ulx) * scaleW

lrx - ulx is the width of the frame -1, so lrs - uls will become (size-1)*scale. Shouldn't it be size*scale - 1 ?

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Jul 3, 2015

Owner

May be you're right. Need to check it with game, which uses scaled sprites.

Owner

gonetz commented Jul 3, 2015

May be you're right. Need to check it with game, which uses scaled sprites.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Jul 9, 2015

megaman 64 seems to have the same issue

megaman 64 seems to have the same issue

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Mar 17, 2016

Contributor

Fixed by native. (Although @standard-two-simplex did mention a possible scaling problem.)

Contributor

AmbientMalice commented Mar 17, 2016

Fixed by native. (Although @standard-two-simplex did mention a possible scaling problem.)

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 9, 2016

ok fixed in native, can it be in non native? what about the suggestion of standard-two-simplex?

ok fixed in native, can it be in non native? what about the suggestion of standard-two-simplex?

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 9, 2016

Owner

can it be in non native?

I don't see how.

what about the suggestion of standard-two-simplex?

His suggestion is about S2DEX microcode. This issue is in texrects.

Owner

gonetz commented Apr 9, 2016

can it be in non native?

I don't see how.

what about the suggestion of standard-two-simplex?

His suggestion is about S2DEX microcode. This issue is in texrects.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

Well, that " Align sprite hack" works the same, as Glide64 increase_texrect_edge option. The same hack. As I understand, the only important difference is that "The hack will detect rectangle primitives that are too small and then extend them". Glide64 has no small primitive detection. It would be useful to implement and apply the hack automatically. Could you point me on source code, where that " Align sprite hack" is implemented?

Note, the hack solves only black lines issue. Texture alignment issues, like in Mario Kart title screen, are caused by bilinear filtering and can be solved only with native resolution.

Owner

gonetz commented Apr 10, 2016

Well, that " Align sprite hack" works the same, as Glide64 increase_texrect_edge option. The same hack. As I understand, the only important difference is that "The hack will detect rectangle primitives that are too small and then extend them". Glide64 has no small primitive detection. It would be useful to implement and apply the hack automatically. Could you point me on source code, where that " Align sprite hack" is implemented?

Note, the hack solves only black lines issue. Texture alignment issues, like in Mario Kart title screen, are caused by bilinear filtering and can be solved only with native resolution.

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Apr 10, 2016

Contributor

@gonetz This is all I could find. GSDX is structured so strangely. It makes finding things difficult. https://github.com/PCSX2/pcsx2/blob/master/plugins/GSdx/GSRendererHW.cpp#L523

Note, the hack saves only black lines issue. Texture alignment issues, like in Mario Kart title screen, are caused by bilinear filtering and can be solved only with native resolution.

There's also the 2D fix branch, but that has complications.

Contributor

AmbientMalice commented Apr 10, 2016

@gonetz This is all I could find. GSDX is structured so strangely. It makes finding things difficult. https://github.com/PCSX2/pcsx2/blob/master/plugins/GSdx/GSRendererHW.cpp#L523

Note, the hack saves only black lines issue. Texture alignment issues, like in Mario Kart title screen, are caused by bilinear filtering and can be solved only with native resolution.

There's also the 2D fix branch, but that has complications.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

Thanks! I understand the idea. It is close to what I do in my 2DFix branch.
Ok, I'll make that hack, it's not hard.

Owner

gonetz commented Apr 10, 2016

Thanks! I understand the idea. It is close to what I do in my 2DFix branch.
Ok, I'll make that hack, it's not hard.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

Which games suffer from black lines issue? Beside Army Men - Air Combat

Owner

gonetz commented Apr 10, 2016

Which games suffer from black lines issue? Beside Army Men - Air Combat

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 10, 2016

40 winks, sf rush, california games, few others. Need to check later

40 winks, sf rush, california games, few others. Need to check later

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Apr 10, 2016

Contributor

Mario Kart 64 portraits in character select develop vertical lines. Certain Rainbow 6 screens get thick lines.

Contributor

AmbientMalice commented Apr 10, 2016

Mario Kart 64 portraits in character select develop vertical lines. Certain Rainbow 6 screens get thick lines.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

40 winks, sf rush, california games - different issue. It is not a gap between polygons, it is something wrong with texture mapping. Mario Kart 64 issue also has different origin.

Thus, the hack is useful for 3-4 games.

Owner

gonetz commented Apr 10, 2016

40 winks, sf rush, california games - different issue. It is not a gap between polygons, it is something wrong with texture mapping. Mario Kart 64 issue also has different origin.

Thus, the hack is useful for 3-4 games.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 10, 2016

you have also new tetris, megaman64, tetrisphere.

you have also new tetris, megaman64, tetrisphere.

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Apr 10, 2016

Contributor

Thus, the hack is useful for 3-4 games.

That's a pity. But better than nothing, I suppose.

Contributor

AmbientMalice commented Apr 10, 2016

Thus, the hack is useful for 3-4 games.

That's a pity. But better than nothing, I suppose.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 10, 2016

also would it fix the error in quest64 texts?

also would it fix the error in quest64 texts?

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Apr 10, 2016

Contributor

also would it fix the error in quest64 texts?

That's an alpha issue, AFAIK. Very different.

Contributor

AmbientMalice commented Apr 10, 2016

also would it fix the error in quest64 texts?

That's an alpha issue, AFAIK. Very different.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 10, 2016

odd that native fix the matter :(

odd that native fix the matter :(

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

also would it fix the error in quest64 texts?

No. Only gaps between polygons.
Make things a bit better without proper 2D fix.

Owner

gonetz commented Apr 10, 2016

also would it fix the error in quest64 texts?

No. Only gaps between polygons.
Make things a bit better without proper 2D fix.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 10, 2016

Owner

Black lines fix implemented in fix_black_lines branch.
Mupen64plus binary:
https://drive.google.com/file/d/0B0YqMPjGo3B2SW0tZWNtQkJEeFE/view?usp=sharing

I also made a fix 71e3475
which fixes logo in sf rush, california

The meaning of that fix is simple. The problem explained here:
http://pcsx2.net/developer-blog/267-explanation-hacks-needed-for-upscaling-glitches.html
in native - 2x scale pictures.
In native resolution pixel's texture coordinate points on the center of a texel. In high-res it points on texel's edge. Last row of pixels point to edge of last row of texels and eventually wrap to the first row of texels. That is last row of pixels take color from the beginning of the texture. Force texture clamp does not allow the texture coordinate to wrap. This is a hack to avoid that problem with upscaling.
It is not my invention, it was made yet by orkin. The hack did not work for situation when texture coordinates are upside-down, as in sf rush logo. I fixed it.

Unfortunately, that hack does not help for text in these games. The characters are taken from one large font texture, and pixels on the edge of the character may point to adjacent character in the font texture. Texture clamp can't help here. There is no good solution.

Owner

gonetz commented Apr 10, 2016

Black lines fix implemented in fix_black_lines branch.
Mupen64plus binary:
https://drive.google.com/file/d/0B0YqMPjGo3B2SW0tZWNtQkJEeFE/view?usp=sharing

I also made a fix 71e3475
which fixes logo in sf rush, california

The meaning of that fix is simple. The problem explained here:
http://pcsx2.net/developer-blog/267-explanation-hacks-needed-for-upscaling-glitches.html
in native - 2x scale pictures.
In native resolution pixel's texture coordinate points on the center of a texel. In high-res it points on texel's edge. Last row of pixels point to edge of last row of texels and eventually wrap to the first row of texels. That is last row of pixels take color from the beginning of the texture. Force texture clamp does not allow the texture coordinate to wrap. This is a hack to avoid that problem with upscaling.
It is not my invention, it was made yet by orkin. The hack did not work for situation when texture coordinates are upside-down, as in sf rush logo. I fixed it.

Unfortunately, that hack does not help for text in these games. The characters are taken from one large font texture, and pixels on the edge of the character may point to adjacent character in the font texture. Texture clamp can't help here. There is no good solution.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 10, 2016

well lines are still here in tetrisphere during intro:

disuof

well lines are still here in tetrisphere during intro:

disuof

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 11, 2016

Owner

"small primitive detection" method is limited. It works only for 2D images rendered by "strips", that is line by line. This image is loaded by "tiles" and problem polygons not detected.

I'll add an option to force texrects alignment. It will work as Glide64 increase_texrect_edge option, for all texrects.

Owner

gonetz commented Apr 11, 2016

"small primitive detection" method is limited. It works only for 2D images rendered by "strips", that is line by line. This image is loaded by "tiles" and problem polygons not detected.

I'll add an option to force texrects alignment. It will work as Glide64 increase_texrect_edge option, for all texrects.

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu Apr 11, 2016

I believe this increase_texrect_edge option will be the best.

btw how does it work in Lemmy plugin? there is not line and i cannot see hacks in it (but i may miss something?)

I believe this increase_texrect_edge option will be the best.

btw how does it work in Lemmy plugin? there is not line and i cannot see hacks in it (but i may miss something?)

@AmbientMalice

This comment has been minimized.

Show comment
Hide comment
@AmbientMalice

AmbientMalice Apr 11, 2016

Contributor

I'll add an option to force texrects alignment. It will work as Glide64 increase_texrect_edge option, for all texrects.

Maybe it should only be enabled when rendering above 1x?

Contributor

AmbientMalice commented Apr 11, 2016

I'll add an option to force texrects alignment. It will work as Glide64 increase_texrect_edge option, for all texrects.

Maybe it should only be enabled when rendering above 1x?

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 11, 2016

Owner

I believe this increase_texrect_edge option will be the best.

It will increase edges for all texrects, thus all texrects will be slightly incorrect.

btw how does it work in Lemmy plugin?

It works because Lemmy plugin calculates texture coordinates incorrectly. As the result, images are slightly oblate.

Maybe it should only be enabled when rendering above 1x?

Yes, it has no use for native resolution.

Owner

gonetz commented Apr 11, 2016

I believe this increase_texrect_edge option will be the best.

It will increase edges for all texrects, thus all texrects will be slightly incorrect.

btw how does it work in Lemmy plugin?

It works because Lemmy plugin calculates texture coordinates incorrectly. As the result, images are slightly oblate.

Maybe it should only be enabled when rendering above 1x?

Yes, it has no use for native resolution.

@gonetz

This comment has been minimized.

Show comment
Hide comment
@gonetz

gonetz Apr 12, 2016

Owner

Added "Force" option

Owner

gonetz commented Apr 12, 2016

Added "Force" option

@olivieryuyu

This comment has been minimized.

Show comment
Hide comment
@olivieryuyu

olivieryuyu May 17, 2016

that should be closed now, no?

that should be closed now, no?

@gonetz gonetz closed this May 18, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment