Pages: 1 2 3 4 5 6 7 8 9
Author Topic: Fonts display glitch / Borders / Scrolling glitches  (630,011 Views)
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Posted on: May 25, 2014, 06:39:08 PM
As I was testing the new changes since #732, I accidentally ran into the same issue I had with font rendering.  I thought this was fixed with the 0.25/0.25 thing, but now it's back:

To reproduce create a project using OGL1 or OGL3, as both exhibit the problem:

Add to the draw code

draw_text(10,10,"11111111111111111111");


Be it window or full screen mode, not displayed right.

In Direct3D window mode it's ok, but could not test full screen as Direct3D fullscreen is still broke, nothing gets displayed in D3D full screen.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #1 Posted on: May 25, 2014, 07:14:20 PM
Ok I don't know if this is in relation to the latest fixes in #723, and will wait for Robert's input on this, but apparently the half pixel adjustment is no longer needed after #723 ?

I fixed this by editing GLMatrix.cpp and GL3Matrix.cpp and commenting out the added offset codes for the HPA.


void d3d_set_projection_ortho(gs_scalar x, gs_scalar y, gs_scalar width, gs_scalar height, gs_scalar angle)
{
    // This is half-pixel alignment, 0.5 only works for some graphics cards, 0.25 works best for Nvidia, AMD, and other common graphics cards and drivers.
   // x += 0.25f; y += 0.25f;


The last line is the one I commented out.

Clean built and it worked for both gfx systems.

Before recent merges, this was required to display fonts properly.

Does this have to do with some of the recent changes made to 723?

If I uncomment and add them back, the problem is back.




Offline (Unknown gender) TheExDeus

Developer
Joined: Apr 2008
Posts: 1,860
View profile
Reply #2 Posted on: May 25, 2014, 09:06:07 PM
It's just possible that it works for one, but doesn't work for the other (GPU differences). What GPU do you have? Maybe 0.375 really is the magic number.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #3 Posted on: May 25, 2014, 09:15:19 PM
Quote from: TheExDeus on May 25, 2014, 09:06:07 PM
It's just possible that it works for one, but doesn't work for the other (GPU differences). What GPU do you have? Maybe 0.375 really is the magic number.

Actually I didn't change GPU or systems.
Initially it was tested by Robert and he also had the problem, so he added those lines and it worked fine.  However, since a latest fix update, even with his new pixel alignment fix, the fonts are not displayed correctly so I had to remove them, and now they work.

My GPU has not changed, it is a GeForce GTX660 Ti SC 2GB

and no, 0.375 is not the magic number unless you want flickering and gaps in scrolling rooms.
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #4 Posted on: May 25, 2014, 11:22:30 PM
No 0.375,0.375 for both the model view matrix and the projection work perfectly here, I was afraid they wouldn't work on your hardware because that makes it a combined 0.75, and I encourage you to try it. Also please try 0.25,0.25 for the projection and 0.125,0.125 for the model view matrix, and then vice versa. Let me know how each one performs, because all of those work for me.

Also, Darkstar2, he's not talking about a difference in your GPU, he's talking about the difference between your GPU and MY GPU, because you have Nvidia, and I have AMD. Both graphics card manufacturers have different rounding implementations.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #5 Posted on: May 26, 2014, 12:21:23 AM
Right but can you explain why did I have to modify the GL/GL3Matrix.cpp and remove what you added previously, for things to work, when you added them there to fix things in the first place, this is what I am wondering now.......:P and again, why should I use 0.375 now that removing 0.25 altogether displays fonts fine and background scrolling works ...
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #6 Posted on: May 26, 2014, 12:34:14 AM
Because that doesn't work for me in fullscreen, that's why, we need a solution that works in both windowed and fullscreen in all cases for both me AND YOU.

These are the two lines to test.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L128

Try each of these combinations and report the behavior:
0.25,0.25 and 0.125,0.125
0.125,0.125 and 0.25,0.25
0.375,0.375 and 0.375,0.375
0.125,0.125 and 0.375,0.375
0.25,0.25 and 0.375,0.375
0.375,0.375 and 0.25,0.25
0.375,0.375 and 0.125,0.125

Once you tell me which ones work for you we can choose one of them that works for me too, and we'll go with it.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #7 Posted on: May 26, 2014, 03:46:28 AM
Ok the Dr. is in with the results :D
When I mention borders they occur only on screen resolution higher than 1600x900 for all tests. Anything at or below shows no border.

0.00,0.00 and 0.25,0.25
text ok - scroll ok - border top left

0.25,0.25 and 0.25,0.25 (original settings)
text bad - scroll ok - border top left

0.25,0.25 and 0.125,0.125
text ok - scroll ok - no border

0.125,0.125 and 0.25,0.25
text ok - scroll ok - no border

0.375,0.375 and 0.375,0.375
text bad - scroll ok - no border

0.125,0.125 and 0.375,0.375
text ok - scroll ok - border top left

0.25,0.25 and 0.375,0.375
text ok - scroll ok - no border

0.375,0.375 and 0.25,0.25
text ok - scroll ok - no border

0.375,0.375 and 0.125,0.125
text ok - scroll ok - border lower right
=======================
So the combinations that work for me
0.25,0.25 and 0.125,0.125
0.125,0.125 and 0.25,0.25
0.25,0.25 and 0.375,0.375
0.375,0.375 and 0.25,0.25

I didn't see the scrolling issue on any test.
So since 0.375 is recommended we should probably pick from one of the last 2.
The rest is in your hands. :)

If you need any more info or testing let me know. 

Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #8 Posted on: May 26, 2014, 04:52:39 AM
Thank you, finally, that's just what we needed. All 4 of those work fine with text and in windowed mode, and dont have the 1px border in fs, but have a problem with repeating scrolling backgrounds in fs for me.

I wish we could eliminate two more of them, I have AMD, you have Nvidia, somebody should test your two sets on an Intel.

Please test these now:
0.375,0.375 and 0.175,0.175
0.175,0.175 and 0.375,0.375
0.1875,0.1875 and 0.1875,0.1875

These are the only values that work for me in all cases.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #9 Posted on: May 26, 2014, 05:29:29 AM
I will progressively post these as I am testing them:
0.375,0.375 and 0.175,0.175
text ok in window NOT ok in fs.
scroll ok, no border.  When tested at 1920x1080 screen res the numbers displayed well, though certain ones slightly fatter, but to me a test fails if at any resolution it does not show correctly. To me it has to show all resolution ok. the lowest to highest.

Same results for the inverse.

Testing the other pair now.

Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #10 Posted on: May 26, 2014, 05:44:08 AM
0.1875,0.1875 and 0.1875,0.1875

Complete mess :D  both fs and window bad text. scroll ok.  You see I have not had any scrolling issues. Now I remembered why I never laid my hands on AMD cards. The only shit from AMD I ever owned was CPU, and the only decent CPU I had from them was the Phenom II X4 965.... Now no more AMD I use Intel CPU and I couldn't be happier. No more shitty chipsets to deal with :D

Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #11 Posted on: May 26, 2014, 05:55:14 AM
How the hell are you criticizing my card? Mine is the one that draws everything fine with no offset, yours is the one that can't round.

At any rate, we're still fucked, we need a magic number that works perfect for both of us.

Try this one.
0.125,0.125 and 0.125,0.125
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #12 Posted on: May 26, 2014, 06:03:12 AM
Quote from: Robert B Colton on May 26, 2014, 05:55:14 AM
How the hell are you criticizing my card? Mine is the one that draws everything fine with no offset, yours is the one that can't round.

LMAO!

BTW, is there a way to dynamically affect this alignment using EDL or GML functions within the game
you mentioned the code in the past...

Quote
At any rate, we're still fucked, we need a magic number that works perfect for both of us.

Try this one.
0.125,0.125 and 0.125,0.125

Fs, window, text = bad.
scroll = ok.
:D

There is one little thing I will try tomorrow, not having to do with these settings,
I am calling it a night for today :D



Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #13 Posted on: May 26, 2014, 06:28:53 AM
Uh yeah, just pass the offsets to d3d_set_projection ortho.

Anyway, I only have a few more that work for me.
0.175,0.175 and 0.175,0.175
0.275,0.275 and 0.175,0.175
0.175,0.175 and 0.275,0.275
0.6,0.6 and 0.4,0.4
0.4,0.4 and 0.6,0.6

Try themtomorrow. The only way this would not be an issue is we could use the one that works when not in fs and do real fullscreen then the display resolution would 1v1 with the game resolution and one of those would work in both cases.
Offline (Unknown gender) Darkstar2

Member
Joined: Jan 2014
Posts: 1,238
View profile
Reply #14 Posted on: May 26, 2014, 07:03:31 AM
Will do and how do I pass the second set of value (model view) ?

Quote from: Robert B Colton on May 26, 2014, 06:28:53 AM
Uh yeah, just pass the offsets to d3d_set_projection ortho.

Anyway, I only have a few more that work for me.
0.175,0.175 and 0.175,0.175
0.275,0.275 and 0.175,0.175
0.175,0.175 and 0.275,0.275
0.6,0.6 and 0.4,0.4
0.4,0.4 and 0.6,0.6

Try themtomorrow. The only way this would not be an issue is we could use the one that works when not in fs and do real fullscreen then the display resolution would 1v1 with the game resolution and one of those would work in both cases.
Pages: 1 2 3 4 5 6 7 8 9