ENIGMA Forums

Outsourcing saves money => Issues Help Desk => Topic started by: Darkstar2 on May 25, 2014, 01:39:08 pm

Title: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on May 25, 2014, 01: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
Code: [Select]
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.
Title: Re: Font rendering is broken again !
Post by: Darkstar2 on May 25, 2014, 02: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.

Code: [Select]
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.




Title: Re: Font rendering is broken again !
Post by: TheExDeus on May 25, 2014, 04: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.
Title: Re: Font rendering is broken again !
Post by: Darkstar2 on May 25, 2014, 04:15:19 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.
Title: Re: Font rendering is broken again !
Post by: Goombert on May 25, 2014, 06: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.
Title: Re: Font rendering is broken again !
Post by: Darkstar2 on May 25, 2014, 07:21:23 pm
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 ...
Title: Re: Font rendering is broken again !
Post by: Goombert on May 25, 2014, 07:34:14 pm
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.
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 25, 2014, 10:46:28 pm
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. 

Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 25, 2014, 11:52:39 pm
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.
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 12: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.

Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 12: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

Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 26, 2014, 12: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
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 01:03:12 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



Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 26, 2014, 01: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.
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 02:03:31 am
Will do and how do I pass the second set of value (model view) ?

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.
Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 26, 2014, 02:25:05 am
Quote
Will do and how do I pass the second set of value (model view) ?
......you mean you weren't passing the second set to model view?

Listen, when I say the following.
0.6,0.6 and 0.4,0.4

I mean 0.6,0.6 goes on this line for the projection
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111
And I mean 0.4,0.4 goes on this line for the model view matrix.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L128

That is why I had you trying the opposites as well, you'll have to go back and retest all of them again.

There is one other solution, and that is to round up all 2D vertices that are passed to the ModelStruct. That would make the rounding the same for everyone's graphics hardware, in GL3 it could be done in the vertex shader, this solution would also work for Direct3D. Probably better not to do in the vertex shader though, if we just do it when the vertex is added then it is done one time and one time only.
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 02:45:15 am
......you mean you weren't passing the second set to model view?

LOL  ;D ;D ;D FFS of course I passed the second value ! That was through the CPP file.  Everything was done.   I was talking about function, I asked how do I dynamically change those values inside game, you mentioned using d3d_projection, then I asked how do I pass the model view value, I thought it was obvious I meant through EDL/GML functions.  I already know how to apply changes through the GLMatrix.cpp ! :D

The reason I ask is should we never find a solution perhaps we can find the one set that works for you, and the one set that works for me, and I could make a script in my games with ability for a setting to be configured either internally or through a settings.ini of some sort where GPU=AMD or GPU=NVIDIA or whatever and have the game automatically change settings.  I'm thinking ahead and try to think of workarounds, because I have a feeling this specific issue might be bigger than we think !
Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 26, 2014, 04:56:47 am
It's not bigger than we think, it's the fact Nvidia takes a vertex that is at (0.5, 0.5) and will draw it at 1,1 and AMD will draw it at 0,0

Also, you can't offset the model view matrix unless your handle transformations completely on your own, the model view matrix is the product of the model and view matrices respectively.

At any rate, just test those remaining values I gave you and let me know.
Title: Re: Font rendering is broken again ! (updated)
Post by: TheExDeus on May 26, 2014, 05:14:05 am
Projection matrix is changed by d3d_set_projection.
Model / modelview matrix is changed by d3d_transform_add_translation.

Both of you try not changing the projection (so don't add anything), but add 0.375 to modelview only.
Title: Re: Font rendering is broken again ! (updated)
Post by: Goombert on May 26, 2014, 05:22:24 am
Tried that already Harri, I get the following results, notice the 1px border on the left and top as a result of shifting my geometry because the black rectangle fades over the scrolling background.

(http://i.imgur.com/168GuPo.png)

Harri if those final tests he does do not work, we won't have a set of values that works for both of us. What do you think about rounding up in the Vertex2D function of ModelStruct? That way we emulate the same consistent behavior, i'd prefer not to do it in the vertex shader also because we can't control which vertices are 2D that way.
Title: Re: Font rendering is broken again ! (updated)
Post by: TheExDeus on May 26, 2014, 06:47:19 am
We could try that. But non-integer coordinates are sometimes useful for, like AA sometimes work better with floating point coordinates.
Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 12:30:59 pm
Tried that already Harri, I get the following results, notice the 1px border on the left and top as a result of shifting my geometry because the black rectangle fades over the scrolling background.

(http://i.imgur.com/168GuPo.png)

Harri if those final tests he does do not work, we won't have a set of values that works for both of us. What do you think about rounding up in the Vertex2D function of ModelStruct? That way we emulate the same consistent behavior, i'd prefer not to do it in the vertex shader also because we can't control which vertices are 2D that way.

Before doing anymore tests there is something I have to do.  I will go update my drivers to the latest version.  My drivers a little outdated.  Will go install
the latest WHQL ones.  Currently using 314.22.

Title: Re: Font rendering is broken again ! (updated)
Post by: Darkstar2 on May 26, 2014, 02:12:24 pm
Ok what mess.  Since I have been extremely busy for quite some time I kinda neglected updating stuff on my PC.  Didn't have the need to.  Anyhow now I am up to date on the NVIDIA drivers, they are the latest official WHQL.

Robert, are your AMD graphics card drivers up to date as well ? 

--------------------
After updating lots have changed, I will re-run those tests again

Now I see those flickering lines too !!!!!

Not only that but bad text & flickering lines.  Am I to assume by this that they fixed the rounding issue ? Guess we shall find out :D

Will re-run tests, I will start with
0.375 / 0.375 (update: Nope no go)

@Harri:  model view only 0.375 does not work for me either.  Flickering lines (scroll) bad text.
So far I tried many and all have bad text and bad scroll, will try the set above.

Pissed off I thought recent drivers would solve it.
Why the bloody hell don't I have any issues running any other 2D or 3D game...... ?


Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Darkstar2 on May 26, 2014, 03:25:41 pm
Read previous posts for the shit update.

Nothing works !

0.00,0.00 and 0.25,0.25
pile of dung all around.  Scroll bad text bad border bad

0.25,0.25 and 0.25,0.25 (original settings)
pile of dung all around.  Scroll bad text bad border bad

0.25,0.25 and 0.125,0.125
pile of dung all around.  Scroll bad text bad border bad

0.125,0.125 and 0.25,0.25
pile of dung all around.  Scroll bad text bad border bad

0.375,0.375 and 0.375,0.375
pile of dung all around.  Scroll bad text bad border bad

0.125,0.125 and 0.375,0.375
pile of dung all around.  Scroll bad text bad border bad

0.25,0.25 and 0.375,0.375
pile of dung all around.  Scroll bad text bad border bad

0.375,0.375 and 0.25,0.25
pile of dung all around.  Scroll bad text bad border bad

0.375,0.375 and 0.125,0.125`
pile of dung all around.  Scroll bad text bad border bad

0.000,0.000 and 0.000,0.000
pile of dung all around.  Scroll bad text bad border bad

(Seems nothing has any effect everything is identical)

Same shit, full screen, window mode, all resolutions,
OGL1,OGL3 and even DX9 !!!!

Everything has gone to complete utter shite!

All I did was update my driver, and yes I did a clean install.  and yes I rebuild all each time.
Seems no matter what numbers I use they all have the same look, I don't see any difference between all of the above.

What in fuck just happened here ?

---
UPDATE:

Instead of going back and forth editing and rebuilding
(time consuming) I wrote a script that I plugged into
the game, allowing me in real-time to tweak settings with keyboard and view the changes live.
Not a single settings work, be it full screen, window, scroll is always bad.  I swept the entire range using the script.

So it's no bloody use, I don't know what else to do
and I am pissed at this.
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Goombert on May 26, 2014, 05:16:58 pm
Uhm, yah, my drivers are up to date, I just bought this computer. Second, I don't think updating your drivers should have had any effect on floating point rounding, that's something that is somewhat built into the graphics card.

At any rate, try not offsetting at all, and try 0.5,0.5. And also, I told you. I don't know how Unity3D solves this either.

You can also try rounding up or down x and y on the following line. Also try rounding up or down and offsetting by 0.5,0.5
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLModelStruct.h#L260
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Darkstar2 on May 26, 2014, 06:14:42 pm
Uhm, yah, my drivers are up to date, I just bought this computer. Second, I don't think updating your drivers should have had any effect on floating point rounding, that's something that is somewhat built into the graphics card.

Prior to updating my drivers, I did not have the scrolling glitch on any offsets.   Since updating my drivers, I see the scrolling glitch on ALL offsets, and text glitch on ALL offsets as well.  I suspect there is more to it, must be something in ENIGMA.  I am currently investigating this now as I tried making a new project and using tiled background scrolling and did not see the scroll glitch on ANY offset.  I think this is in relation to some function not working right within ENIGMA and in the game code. Regarding the text glitch, that still remains.  With my older drivers text displayed fine with many tested offsets.  With new drivers, ALL offsets glitch, I tried every possible increment range between 0.000 and 1.000, no go.

Quote
At any rate, try not offsetting at all, and try 0.5,0.5. And also, I told you. I don't know how Unity3D solves this either.

As I mentioned already, I tried ALL possible ranges, from 0.000 to 1.000 in every increment, any possible combination.  I suspect where the scrolling bug is coming from, but regarding text don't know.   I have lots to work on and test for now.

Quote
You can also try rounding up or down x and y on the following line. Also try rounding up or down and offsetting by 0.5,0.5
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLModelStruct.h#L260

Will do.
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Goombert on May 26, 2014, 06:31:07 pm
Yes of course it is an ENIGMA bug when you've encountered it in Studio as well. It's not, it's an OpenGL and Direct3D issue, the same issue occurs in Unity3D if you try to use regular textures for 2D, only UnityGUI and certain extensions account for half pixel, otherwise you have to account for it yourself.

See for yourself.
https://www.google.com/#q=unity3d+half+pixel

At any rate, there was a real simple fix I told you to try that would almost certainly work.

Round up or down x and y on the following line. Also try rounding up or down and offsetting by 0.5,0.5 and various values. This makes the rounding consistent on all hardware.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLModelStruct.h#L260
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Darkstar2 on May 26, 2014, 07:05:52 pm
This has nothing to do with the blurry texture reported in unity. the problem I am experiencing is not blurriness.....but artifacting.

When I refer to text display being bad I mean the letters themselves are fine, but there are tiny veritcal and horizontal lines around edges of the font.

I really feel hopeless.  I tried even defining fonts,
I used many different kinds of fonts and sizes ranging
from tiny to huge and see those artifacts !!! and what's more upsetting is the artifact is not consistent across a range of x,y but it is variable, depending on each letter in the font so this proves beyond doubt something deep in ENIGMA perhaps nothing to do with what we are trying to fix :D

I use a script to change the offset within the game,
it resolves it to where my 1111111 example is, but
breaks the lines below it and if moving the position more artifacts come.
  it seems impossible to have a fix that will allow text to display fine regardless of its x,y coordinate.  I'm certainly not reverting my gfx card drivers because I know the driver is fine.  The new driver happen to coincidentally enhance or make more visible what was already broken in ENIGMA.

You might be chasing the wrong problem.
None of the suggestions worked.
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Darkstar2 on May 26, 2014, 08:04:55 pm
...continuation from above post.  Regarding scrolling I found a workaround, I looked at the code, I don't know who wrote this, but they could have coded it better. There are simpler ways of doing the scroll thing using existing functions, I replaced and simplified some code and the scroll works now in every resolution and offset possible.  Before, the scrolling was handled manually using a formula/calculations, now I have it handled by built in functions.  I will test this more and will send you a copy and would like you to tell me if you see anymore lines.  If it works on your end then the problem is caused elsewhere which I am pretty sure it is.

Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Goombert on May 26, 2014, 08:37:45 pm
A screenshot would help, do you know why? Pictures speak a billion words.


Quote from: Darkstar2
None of the suggestions worked.
You didn't even add the round function where I told you to, this is the third time now.

Quote from: Darkstar2
You might be chasing the wrong problem.
I can only tell you what works on my hardware, I can't tell you what doesn't work on your hardware.
Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Darkstar2 on May 26, 2014, 09:00:15 pm
That's exactly it I don't think it's GPU related :D

BTW, yes I put the code exactly where you told me to.
and again, it had no effect. you know why ? Because it has nothing to do with the problem.  Will post a screenshot later on.

Title: Re: Font rendering is broken again ! (has gone to SHIT!)
Post by: Goombert on May 26, 2014, 09:04:56 pm
Did you round up or round down, and did you try additionally adding pixel offsets to the rounded values?
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 02:35:47 am
Say what you want but the problem is with ENIGMA.

1) Nothing wrong with my hardware. I never had this shit happen to me in any 2D game, 3D game, or whatever.

2) It has NOTHING to do with blurriness, everything is sharp that is not the issue. The issue is the fucking pixel vertical line on scrolling that I did not use to have and text that is displayed wrong, NOT BLURRY, but rendered wrong.  I already posted a screen shot in the past, you too, so it can't only be card related.

3) It's no use testing gl model view and d3d projection ortho no combination works.  I tried all the combinations suggested even my own even sweeping through the entire possible range, no combination bloody works.  If I find a setting that works in fullscreen it won't in windows and etc. having swept all the combinations.

4)  void AddVertex(gs_scalar x, gs_scalar y)
  {
    vertices.push_back(x); vertices.push_back(y);
vertexStride = 2;
what the fuck am I supposed to do with this ?
more offsets as in x+=0.5f; y+=0.5f ?
did change fuck all, same shit.  Tried other numbers.

You mean to tell me that everything works fine on your end without any need for offsets in the glmatrix ?  I thought you said otherwise back when I reported it the first time.

ENIGMA is completely useless to me now until I find a solution for at least text.

If I take the same bkg_clouds and load it as a sprite and have it scroll (non tiled) across the screen, I don't see any lines.  It only
happens with H tiled backgrounds, and I haven't even tried V tiling too to see if this affects V scrolling.........
1) Cannot render text properly !
2) Cannot do scrolling background.
3) Though I had figured out how to fix it but did not work.
Only thing I could emulate a fix was to subtract 1 to the code
with cloudswidth but that was simply an overlapping pixel, that is rubbish and still does not fix text and not a proper way to do things
When using normal code for room scrolling / background, etc it glitches now like crazy.

you are telling me that studio does this, O RLY?  Because as much as GMS is dog's shite, it has never had scroll glitching or text artifacting.   I will try this with gaystudio tomorrow morning with my new set of drivers.

what if the problem is in the font rendering or sprite/background handling or deeper in the graphic system ?

If I have time I will make a video showing the display sweep through
all possible combinations for you to see and believe we have ourselves one giant steaming hot pile of turd, and I honestly exhausted all my tests I don't know what more I could try or do.

Guess I have to forget about scrolling......
and text, no way...... a game without text lol. not gonna happen.
or I could just say the fuck with it I don't care if the game won't display properly for all......... but that's not me.  I cannot swallow this shit that everyone with NVIDIA cards will not be able to run a game compiled with ENIGMA...........rather the game will not render properly and look like shit!  WTF.... no way, this can't be happening.

What seem to work with scrolling is setting display resolution 1:1 with room width room height, but only works for full screen, windowed = glitchy scroll ( lines).

vertices.push_back(x+0.5f); vertices.push_back(y+0.5f);
or variations of that have no effect no visual difference no nothing.
because this is not what is causing the issue.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 03:48:18 am
Quote
1) Nothing wrong with my hardware. I never had this shit happen to me in any 2D game, 3D game, or whatever.
All I know is, you updated drivers which exacerbated the behavior in ENIGMA and you did not appear to have tested Studio or Unity or anything else, or even an empty OpenGL application. This obviously doesn't affect other 3D games because half pixel alignment is not relevant to anything except an orthographic projection, and you obviously haven't experienced it in any other 2D game because whatever game it was uses proper half pixel alignment as suggested by Microsoft or others, which is what we are trying to do for ENIGMA.

Quote
2) It has NOTHING to do with blurriness, everything is sharp that is not the issue. The issue is the fucking pixel vertical line on scrolling that I did not use to have and text that is displayed wrong, NOT BLURRY, but rendered wrong.  I already posted a screen shot in the past, you too, so it can't only be card related.
I'm sorry, but I simply can not deduct what you mean by wrong, other than that you now have the vertical line for the scrolling backgrounds, I do not know what you mean by wrong in the context of text rendering. Which is very easy for you to take a picture of.

Quote
3) It's no use testing gl model view and d3d projection ortho no combination works.  I tried all the combinations suggested even my own even sweeping through the entire possible range, no combination bloody works.  If I find a setting that works in fullscreen it won't in windows and etc. having swept all the combinations.
Ok, you told me that already, I wasn't telling you to test anymore combinations there, I was telling you test rounding in the ModelStruct.

Quote
what the fuck am I supposed to do with this ?
more offsets as in x+=0.5f; y+=0.5f ?
No, I told you to round x and y before they are pushed into the vector using cmath or w/e. And if that didn't work, I told you to then try offsetting the ROUNDED value starting with a full half pixel (0.5,0.5)

Quote
You mean to tell me that everything works fine on your end without any need for offsets in the glmatrix ?  I thought you said otherwise back when I reported it the first time.
Yes, if I remove all offsets in everything, my graphics driver displays everything in OpenGL perfect whether in FS or windowed, I only have problems with Direct3D.

Quote
what if the problem is in the font rendering or sprite/background handling or deeper in the graphic system ?
You're being dramatic, I gave you a solution as low-level in the engine as possible, rounding every 2D vertex to a full pixel.

Quote
If I have time I will make a video showing the display sweep through
That is not necessary, I simply asked for a screenshot of how text rendering is behaving since you updated drivers.

Quote
vertices.push_back(x+0.5f); vertices.push_back(y+0.5f);
Or you could try doing what it was that I actually suggested.
vertices.push_back(round(x)); vertices.push_back(round(y));
and...
vertices.push_back(round(x)+0.5f); vertices.push_back(round(y)+0.5f);

That also works for me and makes vertices round consistently on all hardware.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: TheExDeus on May 27, 2014, 05:50:14 am
Quote
Or you could try doing what it was that I actually suggested.
vertices.push_back(round(x)); vertices.push_back(round(y));
and...
vertices.push_back(round(x)+0.5f); vertices.push_back(round(y)+0.5f);
He could also try:
Code: [Select]
vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));
For me everything works fine on Nvidia for now. Will test it at evening with even newer driver (Nvidia released it yesterday or something).

There has been a problem with texture coordinates in text though for a while. I think LGM packs them too tightly and so lines from other characters are sometimes visible (rarely though and only in certain fonts). Especially when interpolation is on. I think we should try adding texture atlas and while doing that rewamp most of the texturing for more consistent results.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 06:44:39 am
The interpolation I was already aware of, having interpolation on for fonts may be desired in some cases as well, and can be simply solved by adding padding parameters to any font functions. However, yes, I wish we did have the texture paging implemented, but I am afraid to do it.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 12:22:35 pm
So we are all on the same page here, I will upload new screenshots to show exactly what I mean. 

There is one easy way to solve the scrolling glitch in FS, is to do 1:1 resolution.

Making a room size a valid screen resolution
then in create event of a controller object
setting:
OscrW=display_get_width();
OscrH=display_get_height();
display_set_size(room_width, room_height);

and in an end game event
display_set_size(OscrW, OscrH);

But for text it's impossible have not found any way.

Will try the rounding thing though this won't have any effect, since I already manually swept all ranges.  I don't see what rounding up or down will do more, it will just fall on some of the same ranges I hit already.

Regarding NVIDIA, indeed, there is a new driver out this morning, it is the 337.88.

Prior to 335 (with 314) I did not have any scrolling glitch, I really don't know what happened. and it worries me that my game would have inconsistent looks based on people's drivers, with functionality so basic!

I intend to use 1:1 and fullscreen for most of my games anyway, in worst case where we cannot resolve the scrolling glitch.  But now text is the harder one to tackle.  There is another way using custom font resources and a custom script but that would increase the size of games and would take time.

Here are the screenshots, I don't need to comment them as they are self explanatory, no complaints with sharpness, the problem is the dots, vertical and sometimes horizontal lines around letters.  Despite sweeping projection ranges they only shift but never disappear.

(http://s15.postimg.org/kw2p89qa3/rubbish001.gif)

I zoomed these images for better viewing.
Be it small or large same shit all around.
I tried with other fonts same, so it's not a specific font. but all.

Here is even big text !

(http://s17.postimg.org/m8314t6pr/rubbish002.gif)

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 01:28:39 pm
I edited post above to add screenshots and more information.  BTW these are results with the push vertex changes.  I really feel this has nothing to do with the above nor the scrolling issue...... I even tried completely commenting out the vertex push lines and adding all kinds of insanely weird values and absolutely no visual change.  I have something else to try.

And Robert, I have tried exactly as suggested with the push vertices that's what I did...... Has no visual effect, anything I put as value changes nothing, the text is still displayed bad.

Code: [Select]
vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));

This does not work, whenever I use round
I get compile errors.

Quote
Graphics_Systems/OpenGL1/GLModelStruct.h:260:35: error: conversion from 'double' to 'const value_type {aka const VertexElement}' is ambiguous
   vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));
                                   ^
Graphics_Systems/OpenGL1/GLModelStruct.h:260:34: note: candidates are:
   vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));
                                  ^
In file included from Graphics_Systems/OpenGL1/GLmodel.cpp:17:0:
Graphics_Systems/OpenGL1/GLModelStruct.h:138:2: note: VertexElement::VertexElement(long unsigned int)
  VertexElement(unsigned long v): d(v) {}
  ^
Graphics_Systems/OpenGL1/GLModelStruct.h:137:2: note: VertexElement::VertexElement(gs_scalar)
  VertexElement(gs_scalar v): f(v) {}
  ^
In file included from d:\enigma\enigma\mingw32\include\c++\4.8.2\vector:64:0,
                 from Graphics_Systems/OpenGL1/GLModelStruct.h:41,
                 from Graphics_Systems/OpenGL1/GLmodel.cpp:17:
d:\enigma\enigma\mingw32\include\c++\4.8.2\bits\stl_vector.h:901:7: error:   initializing argument 1 of 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = VertexElement; _Alloc = std::allocator<VertexElement>; std::vector<_Tp, _Alloc>::value_type = VertexElement]'
       push_back(const value_type& __x)
       ^
In file included from Graphics_Systems/OpenGL1/GLmodel.cpp:17:0:
Graphics_Systems/OpenGL1/GLModelStruct.h:260:70: error: conversion from 'double' to 'const value_type {aka const VertexElement}' is ambiguous
   vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));
                                                                      ^
Graphics_Systems/OpenGL1/GLModelStruct.h:260:69: note: candidates are:
   vertices.push_back(round(x+0.5f)); vertices.push_back(round(y+0.5f));
                                                                     ^
In file included from Graphics_Systems/OpenGL1/GLmodel.cpp:17:0:
Graphics_Systems/OpenGL1/GLModelStruct.h:138:2: note: VertexElement::VertexElement(long unsigned int)
  VertexElement(unsigned long v): d(v) {}
  ^
Graphics_Systems/OpenGL1/GLModelStruct.h:137:2: note: VertexElement::VertexElement(gs_scalar)
  VertexElement(gs_scalar v): f(v) {}
  ^
In file included from d:\enigma\enigma\mingw32\include\c++\4.8.2\vector:64:0,
                 from Graphics_Systems/OpenGL1/GLModelStruct.h:41,
                 from Graphics_Systems/OpenGL1/GLmodel.cpp:17:
d:\enigma\enigma\mingw32\include\c++\4.8.2\bits\stl_vector.h:901:7: error:   initializing argument 1 of 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = VertexElement; _Alloc = std::allocator<VertexElement>; std::vector<_Tp, _Alloc>::value_type = VertexElement]'
       push_back(const value_type& __x)
       ^
mingw32-make.exe[1]: Leaving directory `D:/enigma/ENIGMA/enigma-dev/ENIGMAsystem/SHELL'
mingw32-make.exe: *** [Game] Error 2

I believe I know why this error, so I just
added a line above the code
x=round(x); y=round(y);
and below
vertices.push_back(x+0.5f); vertices.push_back(y+0.5f);

NO changes.  I also removed the 0.5f, I tried other numbers, no visual change.

The only changes I make in the source code
that has any visual effect is the
d3d project ortho, it simply shifts the artifacts, but no range whatsoever eliminates them.
The rest of the tweaks have no visual effect be it on text or scroll glitch.

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: TheExDeus on May 27, 2014, 04:51:16 pm
Quote
I believe I know why this error, so I just
That actually didn't do what I posted, it does what you did before. This would do what I posted:
Code: [Select]
x=round(x+0.5); y=round(y+0.5);
vertices.push_back(x); vertices.push_back(y);
But I also don't think that would change much, because the screenshots you posted show something very peculiar. The first screenshot has two intensities, meaning there are different alpha channels in the texture. If you have AA set to None (as that is for the default font anyway), then you shouldn't see that.

I just tested on my nvidia 660ti with newest drivers and the text is slightly buggy with default font in GL1 and GL3 (almost like before, maybe slightly worse). DX9 looks fine with default font. With a custom font GL1, GL3 and DX9 looks fine. So I cannot replicate your problems with an nvidia card and newest drivers.
Can you also try downloading the newest ENIGMA installer and try that from scratch? It's possible you have changed something somewhere previously and that causes the problems now. I don't really have much ideas on what causes this for you.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 05:06:39 pm
No I know enough about it now not to mess anything I shouldn't touch, and I keep backups of the cpp I touch.

BTW, I tried everything suggested even the first time Robert suggested I did try it, even the rounding thing, and yes even what you posted. 

BTW, I just updated the latest drivers 337.88
from NVIDIA, released today.  When updating drivers I do a clean install. I use driver sweeper (driver uninstall) in safe mode and clean all traces of NVIDIA driver / profiles, etc.

Then I use NVIDIA's official installer set to clean mode. 

So far 337.88 works great, and works like version 314 I was using.  The text is buggy, however I am able to find the proper offsets to display text properly in both FS and window, something I could not do in 335.xx from March.  Weird.  By that I mean the d3d projection ortho.  The push vertices settings has absolute no visual effect.

Could this whole problem be caused by incomplete OpenGL textures or something not done right in ENIGMA's code ?

I have more tests to do now to see if I can find working values scrolling glitch.  So far I am trying with 0.375, 0.375 d3d_projection_ortho and tested with many font sizes, down to size 5 full screen and window and all is well. when I get back home later I will try the rest and we can finally agree on what works for all of us.

If so I will have to re-test all the ranges given to me by Robert.  Hopefully we can resolve this steaming pile of shite soon enough and move on to the next pile lol.
These are the 337.88 drivers DEFAULT,
I will try to see somehow if there is a setting in the driver that might cause this.

Also I'm wondering if ENIGMA used OGL1.4 instead of 1.1 would it help matters ?

//update:
Updated: May 27, 2014:  6:35PM ET

I have clean installed recent NVIDIA drivers 337.88 released yesterday and with those I am able to find working ranges.

So after testing, I have found those to work with window, full screen, proper text, and no border problems, no scrolling glitches.

0.25,0.25 for d3d projection ortho

and 0.125, 0.125 for GL MODEL VIEW

Subject to change of course if new issues are discovered with other driver revisions or specific games.

This tested with default font and with declared fonts, anywhere ranging from size 5 to size 50, bold, no bold, AA no AA (all 3 levels). full screen, window, etc.

Tested at different screen and room resolutions from 640x480 up to 1920x1080.

0.375, 0.375 + 0.375, 0375 did not quite work for me Robert.

Oh and the 0.25, 0.25 and 0.125,0.125 combination that works for me now with the latest drivers, I randomly picked to re-test from your list. I did not test the entire ranges you gave me so I stopped at the one that worked and you mentioned works for you.
If you want me to test the other ranges I will do so when I get back later tonight.
but since they both work for us maybe we should stick to those.



Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 10:26:41 pm
No those do not work for me and exhibit the scrolling artifacts.

These work for me, please try these ones:
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

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
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 10:31:00 pm
No those do not work for me and exhibit the scrolling artifacts.

These work for me, please try these ones:
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

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

Off to testing those I mentioned 0.25, 0.25 + 0.125, 0.125 because you said in a previous post that all these worked for you.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 10:38:16 pm
I never said it worked for me, you can quote me on it.

Quote from: RobertBColton
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.

I said once you tell me which ones work for you, I would test those and pick one that works for me as well. In my next consecutive post I listed only the ones that worked for me.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 11:06:52 pm
This is what you wrote
Quote
...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 something is very strange here, I have finished testing each new range you gave me, most worked fine, but when I came back to one of them, it did not work, I did not change anything but put back values I already tested.

I gone through all the settings again, this time text is all bad, no scrolling issues, but text bad and visually identical in ALL offsets,
when they worked before - I changed nothing else.
Could it be possible ENIGMA is not properly flushing or clearing buffers or something ???
I will restart computer and test again.
and yes I tried reinstalling a clean new ENIGMA install same bloody shit!

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 11:33:13 pm
All I can say is I was lying, I can not tell you if I was being negligent or not. You have to keep your eyes focused quite a bit to notice the scrolling glitch.

At any rate no it has nothing to do with buffers of any sort, just tell me which of those values I just listed work.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 11:40:42 pm
Not to worry, I have good eyes and normally notice things quite well. I know exactly what you mean by the scrolling issue since I experienced it with drivers 335 (Mar2014).
It's a 1 px vertical gap and yes I keep a very close eye and view it long enough to make a call.  In your case probably you had to watch closely, in my case the vertical line was constantly visible and you could clearly see the 1px gap at each tile repeat with previous drivers.

Doing final tests now.  This is one cluster fuck of an issue, I hope we can resolve this shit soon and move on to other things.  :D

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 27, 2014, 11:56:03 pm
For a better understanding of the issue, vector graphics which is what OpenGL and Direct3D are, like things to be half-pixel aligned to be sharp.

(http://www.antigrain.com/tips/line_alignment/rect2.gif)

By offsetting our projection we offset every pixel by that much, it is a cheap way of solving the issue. The driver anomalies come into play because Nvidia drivers may round the pixel up or down, and AMD drivers may do the opposite.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 27, 2014, 11:59:12 pm
One thing I noticed the rounding trick in glmodelstruct.h has no visual effect, I tried everything there.

The ones that have visual impact to me are
the d3d_projection_ortho and GL MODEL VIEW

However I discovered another anomaly.

I have set an interactive code inside the game to allow me to change X and Y offsets and apply them using d3d_set_projection_ortho and the changes apply in real time, I then add code in draw to display those offsets.  Only thing I end up modifying is the GL MODELVIEW inside the CPP.

Whenever I find the right X/Y offsets this way, when I plug them in the CPP file
in the right place, it does not work text goes bad again.
Something is definitely not right !

BTW those scrolling gaps you will always have regardless of offsets.  In last drivers, no matter what offset I used I always had the scrolling gap.
BTW, something is not right.

When using in GLMatrix.cpp
x +=0.1875f; y +=0.1875f;
and GLMODEL VIEW same
I don't get the same visual result, I get bad text.
When using in GLMatrix.cpp
X +=0.00f; y +=0.00f;
OR just // comment that line out and
just use the GL MODEL VIEW 0.1875f
and inside the game apply manually the
d3d projection 0.1875 things work fine.
This defies all logic !

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 28, 2014, 12:44:12 am
Continuation from post above.

I found out why I am having the issue I explained above., meaning that when I plug the numbers in GLMatrix they don't perform the same as when I plug them in a GML function.  I found a way to fix this. There is another cpp file that must be edit as well.
GLScreen.cpp.

In this example, I am editing GLMatrix.cpp
for d3d projection ortho
I am using x +=0.1875f; y +=0.1875;
and in GL MODEL VIEW.

In addition I also edited GLScreen.cpp
and added the same line as shown below.

Code: [Select]
void clear_view(float x, float y, float w, float h, float angle, bool showcolor)
{
  x+=0.1875f; y+=0.1875f;
  d3d_set_projection_ortho(x, y, w, h, angle);

If this works for us GL3Matrix and GL3Screen will have to be modified as well.

I vote to use 1.875, since both d3d and model view add up to the magic 0.375 :D

Just to make sure this is relevant and I am right I messed up the void clear view function by changing a letter calling it cleaur view instead and when I compiled the game, there was an error, so this function IS called, and the offsets are required to be placed there as well.
Quote
Graphics_Systems/OpenGL1/GLscreen.cpp:309:70: error: 'clear_view' was not declared in this scope
     clear_view(0, 0, room_width, room_height, 0, background_showcolor);
                                                                      ^
Graphics_Systems/OpenGL1/GLscreen.cpp:336:132: error: 'clear_view' was not declared in this scope
       clear_view(view_xview[vc], view_yview[vc], view_wview[vc], view_hview[vc], view_angle[vc], background_showcolor && draw_backs);

Renamed it again to clear view, and ran again, works !

Now with GLMatrix, GLScreen modified
with 0.1875 offset + the GL MODEL VIEW in GLMatrix, all works fine. no scrolling glitch, no draw text problems, no borders, all resolutions work fine.

Now again, I am assuming all those numbers you gave me today worked for you, you said it, unless you change your mind again.

Done for today.

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 28, 2014, 03:05:45 am
Slow down, you're getting yourself mixed up.

Take a closer look at the clear_view function, do you see anything wrong with what you are suggesting? clear_view only uses x and y one time, when calling the ortho function, so it should make no difference translating it there or in the ortho function.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: TheExDeus on May 28, 2014, 03:40:03 am
Quote
Take a closer look at the clear_view function, do you see anything wrong with what you are suggesting? clear_view only uses x and y one time, when calling the ortho function, so it should make no difference translating it there or in the ortho function.
It does change things depending on what was done previously. Darkstar, did you really change this line?:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111
or did you change this?:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L116

Quote
In addition I also edited GLScreen.cpp
and added the same line as shown below.
It should mean you actually have the equivalent of x+=0.375, y+=0.375 in:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111
and 0.1875 for model view on line:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L128
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 28, 2014, 03:42:31 am
Slow down, you're getting yourself mixed up.

Take a closer look at the clear_view function, do you see anything wrong with what you are suggesting? clear_view only uses x and y one time, when calling the ortho function, so it should make no difference translating it there or in the ortho function.

O RLY ? I knew you'd say that, because to make sure I tried adding both up and putting the equivalent myself in one place, and it didn't bloody work :(
I already said I tried 0.375, 0.375 and it did not work for me.
ONLY works if I apply it myself INSIDE my game using the d3d function. Again as I stated if I plug those values myself in the CPP they will have a different effect.
I spent much time this evening trying every possibility.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 28, 2014, 03:50:24 am
It does change things depending on what was done previously. Darkstar, did you really change this line?:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111

I followed EXACTLY to the T what was suggested.  Yes I changed the first,
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L111
ONLY that  + the GL MODEL VIEW.  But the values I put there have strange effects and don't behave the same as if I were to do them myself inside the game, meaning  for example set the offset for d3d to 0, and use the D3d_set_projection_ortho function inside game to whatever value I want.  If I were to do 0.1875's within the game with the d3d function, it would not give the same visually if I put it inside the CPP.  AND YES I figured doing 0.1875 on that line + GLScreen would = 0.375 BUT visually if I do 0.375 for d3d + model view in GLMatrix, it did not work....
only worked if I did 0.00/0.00 d3d + 0.375 GL MODEL + 0.375 inside the game through the EDL function !
I hope this is understood I did it over and over and over
.
Quote
or did you change this?:
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/OpenGL1/GLmatrix.cpp#L116

Did not touch this.

Ok well my future games done in ENIGMA will require an NVIDIA card, I already have code to check for that  - problem solved.

This is a pile of horse's manure.

Tomorrow I will make a test project that
has text, scrolling ,etc........ and post a link
to it.  Whoever wants to test it be my guest,
AMD ,Intel, NVIDIA,  I am thrown numbers to play with, they don't work visually well when I plug them in the CPP in the ortho area....  So I'd leave the GL MODEL with the working offset, and manually do the ortho one IN GAME..... this way I won't have to touch GLSCREEN.  If this works for all parties, then to me I will have done my part and will consider it fixed.

Any other suggestions I will listen, but
I will not edit anymore numbers in the GLMatrix.cpp other than the GL MODEL VIEW area..... I've spent HOURS going through all possible numbers in the d3d inside the cpp....won't do that again, I have better things to do.  I am going nowhere and going in circles......I will focus tomorrow on finding what the bloody fucking hell does a driver update make a big difference that has me puzzled too.  NVIDIA back in the very old days had OGL/D3D settings, now they seem to have streamlined quite a bit. I'm sure there are some internal settings that might affect things.  Is this really related to a rounding issue, I don't think so, because the rounding alone or rounding + offset trick as suggested and tried (Yes I did do it and yes as shown) did not have ANY effect on anything.

Cheers

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 28, 2014, 04:25:45 am
Quote from: Darkstar2
Is this really related to a rounding issue, I don't think so, because the rounding alone or rounding + offset trick as suggested and tried (Yes I did do it and yes as shown) did not have ANY effect on anything.
But it was behaving as everyone expected before you updated your drivers. And yes the issue is ultimately rounding to get the pixels to transform to half-pixels, whether you do it in your game or in the source files, it is still a transformation.

I think you are fundamentally missing the real problem here.

We've also been following the suggestions by none other than, that's right, Microsoft who know more about OpenGL and their own graphics API Direct3D than all of us combined.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb219690%28v=vs.85%29.aspx
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: TheExDeus on May 28, 2014, 04:33:34 am
Quote
GLScreen would = 0.375 BUT visually if I do 0.375 for d3d + model view in GLMatrix, it did not work....
only worked if I did 0.00/0.00 d3d + 0.375 GL MODEL + 0.375 inside the game through the EDL function !
Knowing some kind of hack to fix it is not enough, we need to figure out why it is happening. Right now your fix kind of denies logic, but we will check and see what could be the reason. Sadly, neither I or Robert can replicate your problems, so I cannot easily test all of that myself.

Quote
Is this really related to a rounding issue, I don't think so, because the rounding alone or rounding + offset trick as suggested and tried (Yes I did do it and yes as shown) did not have ANY effect on anything.
As Robert said, it probably is because of rounding whatever you do. Because rasterization operation on the GPU involved multiplication of floating point matrices with vertex positions. If your vertex positions is something else than 0,0, then you probably will have some kind of round issues regardless. But that is why we test a lot of things. I personally think that another good thing to check would be texture coordinates. I think a problem could be precision issues with that, as the position of the glyphs are correct right? It's just that you see lines and malformed letters? Because then it should be a texture problem. Even gaps between tiled images could technically be a texture problem, but they usually are connected with vertex positions.

Quote
Ok well my future games done in ENIGMA will require an NVIDIA card, I already have code to check for that  - problem solved.
Also, no need to get emotional. We appreciate your testing and it is slowly getting us on the right track. It's just that we need to properly fix it, and doing it trough "magic" isn't something we want to do. And the fact that we cannot replicate the problem also hurts us. So we already determined that it's not just the AMD/NVIDIA issue, as I have Nvidia, Robert has ATI and none of us can replicate these problems.

Maybe later release an exact .egm that has the example you experience the problems in. I will test on an AMD laptop and Nvidia GPU.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Goombert on May 28, 2014, 04:41:06 am
Yeah I am getting kind of curious of the texture matrix as well Harri, the only thing is, trying to map those fuckers directly to pixels that are properly rounded.

Also, and I can't stress it enough, he's comparing the behavior of ENIGMA after updating his drivers ex post facto to old graphics demos he's run in the past without testing a single other application. Including Studio which has also demonstrated blurry text and odd rendering artifacts for him.

Quote
Also, no need to get emotional. We appreciate your testing and it is slowly getting us on the right track. It's just that we need to properly fix it, and doing it trough "magic" isn't something we want to do. And the fact that we cannot replicate the problem also hurts us. So we already determined that it's not just the AMD/NVIDIA issue, as I have Nvidia, Robert has ATI and none of us can replicate these problems.
Yes, but also, I have AMD, ATI is defunct.
Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 28, 2014, 01:39:06 pm
We've also been following the suggestions by none other than, that's right, Microsoft who know more about OpenGL and their own graphics API Direct3D than all of us combined.
http://msdn.microsoft.com/en-us/library/windows/desktop/bb219690%28v=vs.85%29.aspx

I don't give a flying crap about their recommendations ! They are not taking into account many variables.  I go with what will work for at least 2 of the most commonly used cards, AMD and NVIDIA, and if possible the most other type of cards.

Right now I am reporting on what I am seeing.

What you are referring as far as rounding, will most likely affect sharpness.  Problem I am experiencing is not blurriness, it's text anomalies such as for example a vertical line next to a 1, dots or other lines surrounding text, these lines are also sharp.  The reason in my screenshot that some lines appeared different shades is because in that example I used AA.....but I also tested AA or non AA, default font or declared font, same issue.  That's what I mean by artifact. 

Title: Re: Font rendering/text/sprites/scrol/EVERYTHING is broken ! (Hopeless, no solution)
Post by: Darkstar2 on May 28, 2014, 02:11:01 pm
Knowing some kind of hack to fix it is not enough, we need to figure out why it is happening. Right now your fix kind of denies logic,

Ok I have reset GLScreen.cpp as it was, and will work with GLMatrix.cpp so we are all on the same level.

More so, I did a change to the modified project.  I simplified the projectchaos, removed sounds and all unnecessary sprites and code to keep only the scrolling screen, and added text.  Also removed my code to dynamically change the d3d projection ortho, as that adds a bias to the offsets already present in the source code.  Now I am working with direct changes to the GLMatrix.   Trust me, that's what I did from the start, I only went those extra steps because all was failing.  So now with new drivers, I am back to playing strictly with the GLMatrix and yes I am modifying the right lines.

Quote
but we will check and see what could be the reason. Sadly, neither I or Robert can replicate your problems, so I cannot easily test all of that myself.

If you want my system specs it's posted in that other topic it has not changed.

Windows 7 64bit, 16GB RAM.
(Up to date windows, chipsets and drivers)
EVGA GeForce GTX660 Ti 2GB SC edition
NVIDIA drivers 337.88 (64bit) WHQL (CLEAN install)
P8Z77-V Pro ASUS Motherboard
Intel core i5-3570K (OC: 4Ghz)  Ivy Bridge

Quote
But that is why we test a lot of things. I personally think that another good thing to check would be texture coordinates. I think a problem could be precision issues with that, as the position of the glyphs are correct right? It's just that you see lines and malformed letters?

The ONLY problem I ever witnessed so far with ENIGMA is the lines.  Text is crisp and sharp but may have bits of vertical lines next to the text, and bits of horizontal lines top or bottom, and sometimes dots.  No blurriness. Any other anomaly such as certain letters appearing fatter or any other issue would be attributed to monitor scaling or hardware scaling, in which case this issue is completely gone if your monitor resolution 1:1 with the game room.   So this is why doing my tests I will always account for the monitor's native resolution to determine if it is a PASS or a FAIL. I test all other lower resolutions going up, if all pass including native then I mark it as PASS.  Problem with the lines with text occurs in all modes even native and 1:1.

I posted a screen shot above so you'd see what I mean, look closely at the letters, the lines - The letter itself is NOT malformed, it is the added lines surrounding it of different sizes.  I used AA in the examples above, but this occurs no matter if AA is turned on or off....regardless of font used and font size.

As far as Robert's vertical line issue during scroll, I think that is another issue completely.  I was not having this problem at all until I went from 314 to 335, then it disappeared with new drivers 337.  Go look at the code how the scrolling is handled......Whoever wrote projectchaos could have done the scrolling differently using fewer lines of code. 

Quote
Also, no need to get emotional. We appreciate your testing and it is slowly getting us on the right track. It's just that we need to properly fix it, and doing it trough "magic" isn't something we want to do. And the fact that we cannot replicate the problem also hurts us.

As said earlier, GLScreen.cpp is reset back to normal, and working on GLMAtrix.cpp now.
Right now without the hacks, all of Robert's ranges do not work, text artifacts.  I am wondering if the problem with text lies elsewhere......all we are doing with the offsets is simply shifting the problem away, sort of like a band aid approach.  I have not seen this issue with GMS, the issues I have seen is elsewhere, they do have a problem with sharpness inconsistency and v position of letters and other issues, that are not present in ENIGMA, however there are workarounds to get perfect display in GMS. The one thing that stands out in ENIGMA is the lines issue (refer to screenshots). 

Right now my work is to determine if there is any relation to the driver I installed, meaning changes in the NVIDIA panel and if so, which one.  Normally I am aware that the changes you can make in the drivers will affect image quality (sharpness) but should not in theory affect the text artifacting, unless NVIDIA uses internal driver settings that affect offsets too?

Quote
So we already determined that it's not just the AMD/NVIDIA issue, as I have Nvidia, Robert has ATI and none of us can replicate these problems.

It's called AMD now.  And wrong, Robert did notice the problem with text as this was discussed in previous issues and he acknowledged it.

Quote
Maybe later release an exact .egm that has the example you experience the problems in. I will test on an AMD laptop and Nvidia GPU.

I will do so this way we can all this the same thing and be on the same playing field.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on May 28, 2014, 04:29:15 pm
Quote from: Darkstar
I don't give a flying crap about their recommendations ! They are not taking into account many variables.  I go with what will work for at least 2 of the most commonly used cards, AMD and NVIDIA, and if possible the most other type of cards.
I know but you keep wanting to think half-pixel alignment is not an issue because you have new issues now. It is still an issue, and it sounds as though something external is influencing your results.

Quote from: Darkstar
What you are referring as far as rounding, will most likely affect sharpness.  Problem I am experiencing is not blurriness, it's text anomalies such as for example a vertical line next to a 1, dots or other lines surrounding text, these lines are also sharp.  The reason in my screenshot that some lines appeared different shades is because in that example I used AA.....but I also tested AA or non AA, default font or declared font, same issue.  That's what I mean by artifact. 

Ok, but it is important to note, that for testing purposes, it is good to be consistent (the scientific method). For instance, the fonts you used were fonts you drew with before? And it is also important to isolate these new artifacts to the updating of graphics drivers, because it very VERY well could have another OpenGL setting flipped on or off.

Quote
The ONLY problem I ever witnessed so far with ENIGMA is the lines.  Text is crisp and sharp but may have bits of vertical lines next to the text, and bits of horizontal lines top or bottom, and sometimes dots.  No blurriness. Any other anomaly such as certain letters appearing fatter or any other issue would be attributed to monitor scaling or hardware scaling, in which case this issue is completely gone if your monitor resolution 1:1 with the game room.   So this is why doing my tests I will always account for the monitor's native resolution to determine if it is a PASS or a FAIL. I test all other lower resolutions going up, if all pass including native then I mark it as PASS.  Problem with the lines with text occurs in all modes even native and 1:1.
Wait, so you never had blurry text this entire time we've been testing? I was under the impression you had at least experienced it before.

Quote from: Darkstar
I posted a screen shot above so you'd see what I mean, look closely at the letters, the lines - The letter itself is NOT malformed, it is the added lines surrounding it of different sizes.  I used AA in the examples above, but this occurs no matter if AA is turned on or off....regardless of font used and font size.
Interpolation can sometimes cause this to happen as well. You had it turned off right? I mean explicitly calling texture_set_interpolation(false) because other texture settings may be overriding the application in your graphics card control panel.

Quote from: Darkstar
As far as Robert's vertical line issue during scroll, I think that is another issue completely.  I was not having this problem at all until I went from 314 to 335, then it disappeared with new drivers 337.  Go look at the code how the scrolling is handled......Whoever wrote projectchaos could have done the scrolling differently using fewer lines of code. 
If I remove all offsets, guess what, then I don't have those vertical gaps either. In fact, with default OpenGL I have no rendering anomalies, only with Direct3D.

Quote from: Darlstar
The one thing that stands out in ENIGMA is the lines issue (refer to screenshots). 
You did not have that problem before updating your drivers, again I would encourage you to visit your control panel and ensure that nothing external is influencing the game. Or also to test another application, such as Studio, with your new drivers.

Quote from: Darkstar
It's called AMD now.  And wrong, Robert did notice the problem with text as this was discussed in previous issues and he acknowledged it.
No he means we, me and him, notice half pixel issues, but you seem to have all these other problems that none of us have.

Quote from: Darkstar
Right now my work is to determine if there is any relation to the driver I installed, meaning changes in the NVIDIA panel and if so, which one.  Normally I am aware that the changes you can make in the drivers will affect image quality (sharpness) but should not in theory affect the text artifacting, unless NVIDIA uses internal driver settings that affect offsets too?
It's not so much those things, but you may have turned on interpolation or god knows some random OpenGL texture setting. Anyway, yes, I can't encourage you enough to check that panel.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on May 28, 2014, 05:04:19 pm
I agree about consistency that's my method, that's why I will set up one single template we can all test the same thing.

No, I never complained of blurry text, if you go back from the beginning I made very clear in my posts that the problem is text not displaying properly and I mentioned very specifically the lines next to text.  There were issues before where I posted screenshots that you looked at, remember that alpha image demo where I mentioned the 1 is not drawn properly ? (was displayed like |1 with a dot on top of the 1 ? Never did I mention once text was blurry, and I repeated many times during out testing :D
What we are doing is a temporary fix to "shift" the anomaly around so it  disappears from view but not actually fixing the problem.
What we are doing now is a band aid solution. Mind you I have nothing to say about that really, YYG has been doing this from day 1. (intentionally).  Right now with ENIGMA since a complete re-write is not realistic, I guess we should focus on a temp fix for now.

As far as external influence....As mentioned, I am not an expert level C++, but when it comes to hardware, software, setting up, troubleshooting, I know my way around. I've troubleshooted the hardest of hardware related and software issues before.  My system is rock solid, well configured, and when testing I usually set up a dedicated area for the OS, clean install, no junk installed aside from all the latest chipset drivers, and hardware drivers and the bare minimum, no other applications installed or stuff that could possibly interfere externally.

I honestly cannot think of something external that may influence my results other than graphic card and graphic card driver.

I have already ruled out defective RAM or VRAM or other issues as those were tested and functioning properly, no defect.
There are no traces or corruption or badly installed drivers or any conflicts.

GMS has a whole set of different problems on their own unrelated.  I have no complaints about the quality render in ENIGMA, the only issues I have seen are the artifacts (refer to screenshots), and the spacing issue is minor really, quite acceptable.  To me BLURRY is unacceptable, and so far I have not seen this with ENIGMA, but the artifacts are also unacceptable.

One thing to understand about blurry and malformed text, most people make games with very low resolution, and nowadays most people have LCD monitor which work quite different than CRT.  So obviously the low resolution material gets upscaled by the monitor or GPU and will look deformed or blurry depending on the screen resolution you have set.  Games at 1:1 with monitor resolution would look better and the best quality would be native resolution obviously. Much the same in your paint program if you upscale the text, if you do a pixel resize you will retain sharp edges but you get the jagged edges, if you use bicubic samping, etc, your edges will blur in this case.

The scaling method in the engine is pixel resize, but if your monitor is not native resolution it is upscaling.  So any slight blur or letters appearing fatter in some areas are the effects of monitor upscaling.  If you switch monitor res to native, in my case 1920x1080, such anomalies go away.

So right now the issue facing is completely different and totally unrelated to any of the above.  The artifacts I see on and around letters are independent of screen resolution, font, font size, etc.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on May 28, 2014, 11:21:00 pm
First I am uploading an EGM, this is the projectchaos game I stripped down, removed sound, logo and kept scrolling and the black background that fades in.
I added a text display on top.  This is what I am using to test.

I have a second project I modified to allow me to dynamically sweep ranges for the ortho offsets without having to go in the CPP and recompile each time.  Of course just to recap GLScreen.cpp is untouched now, GLMatrix, d3d set projection ortho offsets are set to 0, and controlling them from the project. Only the GL MODEL VIEW offsets I change in the source after I do each range sweep. This allows me quicker testing of ranges.  I input all the GL MODEL VIEW ranges you gave me that you said worked, but I tested different ranges for the ortho.

Here are results, I won't go into details on each, to me a test that is PASS means no text glitch in window and full screen, no border, no scrolling glitch, and tested on all range of screen resolution up to native.


d3d set projcection ortho offset values
All these are X/Y offsets. These were tested with latest NVIDIA 337.88 WHQL, and all pass window and full screen.

0.00 ~ 0.375  (increments of 0.0625) -- Excluding 0.1875
with GL MODEL VIEW
0.1875

basically in all tests when the ortho is 1:1 with the model view there is text glitching.  AGAIN I stress I am talking about the weird lines next to letters and numbers, not blurriness nor am I referring to some letters appearing fatter than others, that's the result of monitor upscaling / game scaling and is NOT a problem. 

======================
d3d ortho
0.0625 ~ 0.1875  (increments of 0.0625)

with GL MODEL VIEW
0.00
======================
d3d ortho
0.00 ~ 0.3125  (increments of 0.0625) (0.375 did not fully work with lower screen res) so exclude this number in this range.

with GL MODEL VIEW
0.175
======================
d3d ortho
0.1875 ~ 0.3125  (increments of 0.0625)

with GL MODEL VIEW
0.375
======================
d3d ortho
0.0625 ~ 0.3125  (increments of 0.0625)

with GL MODEL VIEW
0.275
======================
d3d ortho
0.1875 ~ 0.375  (increments of 0.0625)

with GL MODEL VIEW
0.4
======================
GL MODEL VIEW
0.6 no go, bad range for me to test

----------------------------------------------
So surely there is something in there that works for you, I don't know what more I can do to contribute in this, I feel have provided more than enough information.

If you still have issues, I will send you a dynamic adjustment project for you to use so you can find more working ranges.

Right now I am attaching the stripped down projectchaos that I use for testing.

/side note:

I have finished testing all possible settings combinations in NVIDIA panel, none have affected outcome.  So honestly cannot explain why I saw vertical lines on scrolling backgrounds with a previous driver (335 March WHQL).
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on May 31, 2014, 02:32:27 pm
0.375,0.375 and 0.175,0.175 works for as well. I have sent a pull request with these values implemented.
https://github.com/enigma-dev/enigma-dev/pull/735
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on May 31, 2014, 07:52:53 pm
Robert, just curious, out of all the ranges in green I posted, is this the only set that worked for you ? or are there others ? The ranges in green I tested cover a wide range.

fact remains we are only shifting the problem, and I still think there is more to this glitch.

BTW cancel the pull request........ There is something I need to resolve.

//update: Somehow there was a small mistake when I updated my ranges at the last minute forgot to edit the forum post.
Please refer again to the ranges in green I tested, I have updated them.  Unfortunately, 0.375 / 0.375  + 0.175, 0.175 GLVIEW does not work for me on lower screen res.  At 1920x1080 it did.  but not lower.  So for that range 0.3125, 0.3125 + GL VIEW 0.175 work on all screen res, I also updated the rest of the ranges.
This shit can become tricky, might work on several screen res but not others.  It can be tedious to test each resolution for each offset.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 12:39:30 am
0.325/0.175 and 0.3125/0.175 are a no go for me, I see gaps in fullscreen on repeating scrolling background. Will try the other ranges tomorrow.

Here are the other ones that didn't work:
0.1875 and 0.4
0.3125 and 0.175
0.3125 and 0.275
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 01, 2014, 01:03:07 am
0.325/0.175 and 0.3125/0.175 are a no go for me, I see gaps in fullscreen on repeating scrolling background. Will try the other ranges tomorrow.

Here are the other ones that didn't work:
0.1875 and 0.4
0.3125 and 0.175
0.3125 and 0.275

Are you testing only at your monitor's native resolution ?  What resolution are you using for the test ?
Ok let me know which ranges work for you from the green ones I updated.
Meanwhile I have another idea to help automate and make things easier, working on it (will save lot of time)...
Meanwhile I was getting different results with different NVIDIA driver revisions, very odd.  I wonder if it would be the same with AMD drivers.  If you were to clean uninstall and re-install your AMD drivers, would you get the same results?  If you were to install other drivers (older ones) would you also get same results?

BTW are you using the test file I attached in my post....NOT the original chaos game ?
Please use the file I modified.  I included text in it to test that at the same time.
Also I changed coding.  Whoever made the game used an odd way of scrolling the background, there was a much simpler and faster way of doing it without all the code they used.


Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 01:15:00 am
No it was the same way on my old AMD card.

The real problem here Darkstar, there's very little information on fixing half pixel alignment. I'm still confused as to whether or not you even have blurry text or if these offsets are fixing the bars on font characters.

Everytime I open this topic I want to cry.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 01, 2014, 01:22:21 am
No it was the same way on my old AMD card.

The real problem here Darkstar, there's very little information on fixing half pixel alignment. I'm still confused as to whether or not you even have blurry text or if these offsets are fixing the bars on font characters.

Everytime I open this topic I want to cry.

I submitted every info I have, please re-read the entire topic
I uploaded a couple of screen shots to show you exactly what I mean.  Blur is not and has never been a problem, I showed you exactly what I mean by text problem, they are artifacts (small lines / dots around text) look at the screenshots I posted in this topic and you will see.

The offsets are indeed shifting out of view the lines next to text.
That's why I kept telling you the problem is not pixel alignment in regards to blur, but just so happens the fixes work because it is offsetting the artifacts out of view, maybe the real problem is in the fonts system / renderer ? Maybe something else can fix it I don't know.
Go check my screenshots I magnified and made it so big you will understand what I mean if you had seen them :D
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 01:32:50 am
Yes but that doesn't make any sense. The bars on every side of characters, how can shifting the projection 1px cause them to disappear? Did you make sure texture_set_interpolate(false); was off? Also, did you tell me whether or not Direct3D exhibited this issue?

Ok let us try something else. Follow these exact steps.

1) Comment out the pixel offsetting in GLmatrix for the ortho projection, do not offset the model view and do not offset the projection.
2) Open the following file.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/General/GSfont.cpp#L369
Try the following rounding calls for each of the texture coordinates of each vertice for the character.
floor(x * 100) / 100;
ceil(x * 100) / 100;
round(x * 100) / 100;
So for instance replace the first vertex as follows.
Code: (cpp) [Select]
draw_vertex_texture(xx + g->x, yy + g->y, g->tx, g->ty);
// change it to this
draw_vertex_texture(xx + g->x, yy + g->y, floor(g->tx * 100) / 100, floor(g->ty * 100) / 100);
3) Test the draw_text function for each combination and see how each behaves. Try with 1000, 10000 as well if 100 doesn't yield expected results.

This is a fairly simple test.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 01, 2014, 01:49:49 am
Yes but that doesn't make any sense. The bars on every side of characters, how can shifting the projection 1px cause them to disappear? Did you make sure texture_set_interpolate(false); was off? Also, did you tell me whether or not Direct3D exhibited this issue?

I know it makes no sense I am just as puzzled about this :P
I already mentioned it is impossible to test with Direct3D because it is broken.  The moment you go full screen or even move the window or lose focus everything disappears.  So it's impossible
to test wit DX9 at this time.

Regarding texture_set function I never used this in my project.
is that the function that can be set inside the IDE ? Yes it's always off.  And yes I have tried setting it on, no change.  This doesn't relate to the artifacts. I've never had to turn this on. You mentioned something about font glyphs and font renderer, maybe the problem is somewhere there?


Ok let us try something else. Follow these exact steps.

Quote
1) Comment out the pixel offsetting in GLmatrix for the ortho projection, do not offset the model view and do not offset the projection.

By that you mean the 2 places I was changing offsets in the CPP,
the d3d set projection ortho and GL MODEL VIEW right ?

Quote
2) Open the following file.
https://github.com/enigma-dev/enigma-dev/blob/master/ENIGMAsystem/SHELL/Graphics_Systems/General/GSfont.cpp#L369
Try the following rounding calls for each of the texture coordinates of each vertice for the character.
floor(x * 100) / 100;
ceil(x * 100) / 100;
round(x * 100) / 100;
So for instance replace the first vertex as follows.
Code: (cpp) [Select]
draw_vertex_texture(xx + g->x, yy + g->y, g->tx, g->ty);
// change it to this
draw_vertex_texture(xx + g->x, yy + g->y, floor(g->tx * 100) / 100, floor(g->ty * 100) / 100);
3) Test the draw_text function for each combination and see how each behaves. Try with 1000, 10000 as well if 100 doesn't yield expected results.

This is a fairly simple test.

Very interesting thanks !  I will try this tomorrow during the day.

So will remove offsets in GLMatrix.cpp in 2 places as mentioned above and work on that file !

Thanks.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 02:02:26 am
Quote
I already mentioned it is impossible to test with Direct3D because it is broken.  The moment you go full screen or even move the window or lose focus everything disappears.  So it's impossible
to test wit DX9 at this time.
I know that, and I don't care, I want to know if the fonts do the same shit to you in windowed mode. If you have any sort of intuition as to whether Direct3D exhibits this, because it only had blurry text for me.

Quote
Regarding texture_set function I never used this in my project.
is that the function that can be set inside the IDE ? Yes it's always off.  And yes I have tried setting it on, no change.  This doesn't relate to the artifacts. I've never had to turn this on. You mentioned something about font glyphs and font renderer, maybe the problem is somewhere there?
The reason I mention is because when interpolation is on it does the same thing your fonts are doing now, because interpolation is on and all the characters are right next to each other on the texture, they interpolate into each other along their border, which causes similar artifacts to the ones you are describing. We also plan on fixing this by adding padding options to the font packer.

I've also sent a pull request to remove all pixel offsets from OGL, there is no need for it, originally that is what I was doing before you stopped and said "hey, vertical bars!"

OpenGL does not have half pixel problems like Direct3D and I never experienced it on any of my cards, and people only seem to complain when we add the offsets. This as you said is more deeply rooted elsewhere.
https://github.com/enigma-dev/enigma-dev/pull/736

Quote
is that the function that can be set inside the IDE ? Yes it's always off.  And yes I have tried setting it on, no change.  This doesn't relate to the artifacts. I've never had to turn this on. You mentioned something about font glyphs and font renderer, maybe the problem is somewhere there?
I didn't say that Harri did, and no, the text appears the same as GM8.1 with no anti-aliasing given there are no artifacts which only seem to be present on your hardware.

Quote
By that you mean the 2 places I was changing offsets in the CPP,
the d3d set projection ortho and GL MODEL VIEW right ?
Yep, as I said in my pull request above, I never had half pixel alignment issues with OGL I only had it with D3D where you reported D3D9 had blurry text and we fixed that for both of us. So I am now taking your word for it that OGL does not have half pixel alignment issues and this issue is more deeply related to texture sampling. Which it has to be because the overdraw in your characters is obviously coming from the other characters on the texture. Would also be good to mention this wouldn't be an issue if our font packer had padding options, which need added anyway.

Just to reaffirm, you have been having these vertical bar problems with fonts since you first used ENIGMA?
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 01, 2014, 02:42:58 am
I know that, and I don't care, I want to know if the fonts do the same shit to you in windowed mode. If you have any sort of intuition as to whether Direct3D exhibits this, because it only had blurry text for me.

I will have to check again with DX9 will let you know.

Quote
The reason I mention is because when interpolation is on it does the same thing your fonts are doing now, because interpolation is on and all the characters are right next to each other on the texture, they interpolate into each other along their border, which causes similar artifacts to the ones you are describing. We also plan on fixing this by adding padding options to the font packer.

Ahh yes good point indeed, but I can assure you interpolation has always been off. BTW when I had this font issue that is the first thing I checked.

One thing to note, I use the 11111111111111 as example,
not all 1's have artifacts as I explained.  Wouldn't interpolation or vertex changing have an effect on all the 1's ? Why am I seeing those artifacts only on some 1's and not all ? I am using 1 as an example, but I tried with all the letters range and numbers, same, sometimes the lines are on top or bottom of letter or dots.

It was NEVER mentioned by me that my fonts are blurry in ENIGMA.
I had complained about that about GM and GMS, many have, they seem to use an alternate method of scaling.  I rather see stair stepped fonts (upscale) than ugly blurry fonts.  That has never been an issue for me in ENIGMA.  But I don't recall ever seeing the artifacts in GM:S either.    You are telling me that it is my hardware......:P  I would like for other people who have NVIDIA cards to test files I will upload soon, and more people with different cards.   BTW I will mention that no matter all offsets I have worked with none produced blurry fonts, only artifacts changed position :D
but fonts remained crisp throughout the entire ranges of offsets.

Quote
Which it has to be because the overdraw in your characters is obviously coming from the other characters on the texture.

But how would it explain that the artifacts are not unfirm on all characters?  Example if I were to use 1111111111111111111, not ALL the 1's would have the verticle line next to the 1, in fact most would be displayed ok but 1 in some offsets, in other offsets every 2nd 1 would have artifacts, etc.

Quote
Just to reaffirm, you have been having these vertical bar problems with fonts since you first used ENIGMA?

Good question.  I don't really recall seeing this when I first started using ENIGMA, but then again, I did not use text that much. and did not use full screen as much either.

The first time I ever noticed this glitch was with the image alpha project experiment where I was displaying text on the screen, this is the first time I accidentally stumbled on it. and reported the 1 being displayed weirdly.

Should I try downloading early revisions of ENIGMA and testing ?

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 10:49:00 am
No, you should not bother with older ENIGMA revisions.

Don't you remember when you had the image alpha example I told you that I was not experiencing the issue the same as you? And yes, you are write about the 111's

But explain to me how it was that offsetting the projection managed to fix it, because it shouldn't have if it was around every character, that makes no sense. Also, run the test above.

Quote
It was NEVER mentioned by me that my fonts are blurry in ENIGMA.
No, yes it was, you reported it for Direct3D 9, and there I ALSO had the blurry text problems, and offsetting the projection fixed it for both of us. But something else is happening in OGL.

Also, after you try the test above, you could try what they are saying here on stackoverflow. While we are using regular OpenGL and not ES, they are both practically the same except ES has no immediate mode.
http://stackoverflow.com/questions/6023400/opengl-es-texture-coordinates-slightly-off
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 01, 2014, 11:11:32 pm
Ok working on your suggestions now.

But first,  I did some google searching and found out that people's definition of artifacts varies.  I came upon sites where people were complaining of font artifacts and they were clearly not the same thing as I was describing.  The fix suggested on stackoverflow is for a different matter, whoever reported it called it artifact, when in reality it is truncation of edges.
Anyhow, so I'm assuming by what you are asking me that I have to change each vertice right ?
Such as following :
Code: (cpp) [Select]
draw_vertex_texture(xx + g->x,  yy + g->y, floor(g->tx * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, floor(g->tx2 * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, floor(g->tx * 100) / 100,  floor(g->ty2 * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, floor(g->tx2 * 100) / 100, floor(g->ty2 * 100) / 100);

then changing the 100 to 1000 and / 1000, then 10000 and / 10000, then using ceil for all of them then round for all of them.  Just want to make sure I understood correctly.

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 01, 2014, 11:36:16 pm
Yes, try that with floor, ceil and float. And also try this mix.

Code: (cpp) [Select]
draw_vertex_texture(xx + g->x,  yy + g->y, floor(g->tx * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, ceil(g->tx2 * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, floor(g->tx * 100) / 100,  ceil(g->ty2 * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, ceil(g->tx2 * 100) / 100, ceil(g->ty2 * 100) / 100);

And also try this one.
Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 + xoff) * 100) / 100, round((g->ty2 + yoff)* 100) / 100);

And this one.
Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 + xoff, g->ty2 + yoff);
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 12:12:19 am
lol, thanks, I've done all the first ones you suggested I will call it a night and work on the rest tomorrow.
BTW, this still is not a 100% fix, and a band aid, as there is something somewhere causing this, again this is just seems to shift things much like when I played with the projection ortho and GL MODEL VIEW offsets before :)

So anyhow,
1) if I understood your comment to me, you are telling me that with offsets 0.00/0.00 for BOTH projection ortho and GL VIEW your text displays fine and no scrolling glitch right ?

2) With round on all vertices with 1000, it solves the problem for window and full screen with default font and size so far across all screen resolutions I tested, from 320x200 ~ 1920x1080 (my native) hoping I did not miss anything.

However, when I tried different fonts and sizes I saw some vertical lines / dots on some letters / numbers, even when big.  Also there are other font glitches one might notice, if using too small fonts and certain screen resolutions, this is NOT an ENIGMA problem and so is up to the developer to use the appropriate size fonts for their game size.  but the lines, dots, etc those influenced by ENIGMA.

So finally after trial and error I found that with the combination of round 1000 across the board and the default font, things work great.  If using declared fonts, it is recommended using no smaller than 14 px, and using aa 1.  I found that with min 14 font size and above + 1 aa worked fine for me across all resolutions, window / full screen and tried different fonts.

So here are the changes I have done :
GSFont.cpp
Code: (cpp) [Select]
draw_vertex_texture(xx + g->x,  yy + g->y, round(g->tx * 1000) / 1000, round(g->ty * 1000) / 1000);
draw_vertex_texture(xx + g->x2, yy + g->y, round(g->tx2 * 1000) / 1000, round(g->ty * 1000) / 1000);
draw_vertex_texture(xx + g->x,  yy + g->y2, round(g->tx * 1000) / 1000,  round(g->ty2 * 1000) / 1000);
draw_vertex_texture(xx + g->x2, yy + g->y2, round(g->tx2 * 1000) / 1000, round(g->ty2 * 1000) / 1000);

Also, these changes apply for the default halign left and valign top.  Whatever is decided to be used, we'll have to change the other vertice for the others.

Will try the rest tomorrow.

See if you are ok with the changes above Robert and that they work for you.  I'm ok with this for now until we find a permanent fix.

Thanks.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 02, 2014, 09:48:26 am
Quote
BTW, this still is not a 100% fix, and a band aid, as there is something somewhere causing this, again this is just seems to shift things much like when I played with the projection ortho and GL MODEL VIEW offsets before
Yes, that something is OpenGL, OpenGL uses texel centers for texturing, this is why OpenGL has pixel alignment problems in the sampler for certain cards such as yours, and Direct3D has the problem in the projection.

Quote
1) if I understood your comment to me, you are telling me that with offsets 0.00/0.00 for BOTH projection ortho and GL VIEW your text displays fine and no scrolling glitch right ?
Actually, GL_MODELVIEW, and yes, no offsets works fine for me, everybody only complains when we add the offsets, you seem to have other problems though.

Now, please try these four for me, as I have a feeling one of these will work perfectly. I need an accurate report for each one of these.

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 + xoff) * 100) / 100, round((g->ty2 + yoff)* 100) / 100);

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 + xoff, g->ty2 + yoff);

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 - xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 - yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 - xoff) * 100) / 100, round((g->ty2 - yoff)* 100) / 100);

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 - xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 - yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 - xoff, g->ty2 - yoff);
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 01:05:32 pm
Thanks will go through the new ones you posted today + some left overs from yesterday.

You said "there is something else wrong with you...." No.  There is only one thing so far, it's to do with fonts.  The other minor things with fonts have nothing to do with ENIGMA but scaling.  Normal that if you upscale fonts to native resolution they will exhibit strange looks, (stair step or some letters fatter, etc) that is NOT a problem, but an effect of upscaling when using game res that don't match your screen res....  Good practices are up to the game developer.....

I could care less about that - What I am focusing on strictly now is the vertical line, dots and horizontal lines sometimes appearing on the fonts or around them.The fonts are neither blurry nor anything else.

BTW as I mentioned before, round 100 did not work too well on the first set of tests tried yesterday round 1000 did, should I still use round 100 in your examples above or change it to 1000 ?

Again here is another screenshot, result of 0 offset everywhere and all files back to their defaut.

(http://s28.postimg.org/76g0gfhbh/rubbish003.gif)

Now if I declare a font, example arial size 50, no AA, the fonts display crisp but there is a straight vertical line to the left of 1, but not all 1's, only a few out of the lot of 1's. unfortunately cannot take a screenshot of that in FS.......

When using AA 1 + size 14 and above minimum these disappear and provide best results combined with the round 1000 as tested first time.

For my testing I use
Code used in draw event
Code: (GML) [Select]
draw_text(10,10,"11111111111111111111111111111111");

Ignore the blurry look on the text, I resized them 200% in PSP to make them bigger, and used bicubic sample instead of pixel resize......  The text was razor sharp otherwise, coming from ENIGMA.

This was done using monitor resolution 800x600,
game room 640x480

But I've seen this behaviour also on 1920x1080 and other res.

BTW, this is for OPENGL.

I went back and checked DX9, it's unaffected, so
DX9 works. so far.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 02, 2014, 02:04:01 pm
(http://s28.postimg.org/76g0gfhbh/rubbish003.gif)

This seems to me be perfect Runes fonts ! What's the problem ?   ;D  ;)

http://en.wikipedia.org/wiki/Runes
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 02:11:06 pm
(http://s28.postimg.org/76g0gfhbh/rubbish003.gif)

This seems to me be perfect Runes fonts ! What's the problem ?   ;D  ;)

http://en.wikipedia.org/wiki/Runes

Right FUNNY. :D

Trust me, these are 11111111111's you should be seeing !
The same when compiled using DX9 displays fine.
Title: Re: Font rendering is broken again !
Post by: egofree on June 02, 2014, 02:42:09 pm
My GPU has not changed, it is a GeForce GTX660 Ti SC 2GB

This is really strange, i've the GeForce GTX660 (OEM) 1.5GB, which is almost the same model, with the latest Nvidia drivers, and i don't have this problem.
I didn't read the whole thread, but just in case, did you try some OpenGl demos with text ? To see if the problem comes from OpenGl drivers or only with Enigma.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 02, 2014, 02:52:42 pm
What about using font_add_sprite ? :

http://enigma-dev.org/docs/Wiki/Font_add_sprite

Quote
Adds a new font from the given sprite with the sub images mapped to the characters.

Perhaps it could be a workaround for your problem ?
Title: Re: Font rendering is broken again !
Post by: Darkstar2 on June 02, 2014, 03:30:25 pm
My GPU has not changed, it is a GeForce GTX660 Ti SC 2GB

This is really strange, i've the GeForce GTX660 (OEM) 1.5GB, which is almost the same model, with the latest Nvidia drivers, and i don't have this problem.
I didn't read the whole thread, but just in case, did you try some OpenGl demos with text ? To see if the problem comes from OpenGl drivers or only with Enigma.

Only with ENIGMA and yes I mentioned this before :D

But that means nothing, the games or demos could be using their own internal fixes.

Here use this test:
copy and paste it in an object's draw event
set your monitor resolution to 800x600 (for the purpose of this test) and room size 640x480
Set interpolation to off, scale aspect ratio, window mode and let me know.
Make sure d3d set projection ortho offsets and GL MODEL VIEW offsets in GLMatrix.cpp are nil, meaning no offset at all !

draw_text(10,10,"11111111111111111111111111111111");

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 03:33:30 pm
Robert, your latest suggestions didn't give me results, only worse:

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 + xoff) * 100) / 100, round((g->ty2 + yoff)* 100) / 100);

and


Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 + xoff, g->ty2 + yoff);

Text is not rendered at all, nothing is shown.

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 - xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 - yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 - xoff) * 100) / 100, round((g->ty2 - yoff)* 100) / 100);

and

Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 - xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 - yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 - xoff, g->ty2 - yoff);

Text completely distorted mess.  Here is an example, ignore blurriness again, the postimage hosting somehow
completely messes up the image quality.  The edges are razor sharp otherwise originally.
(http://s24.postimg.org/hbewrcecl/222.gif)



Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 03:44:56 pm
Also tried all the below, even worse, and the ones with xoff/yoff don't render any text at all.
So as of now I tried everything suggested,
the only thing that works for me is
Code: (cpp) [Select]
draw_vertex_texture(xx + g->x,  yy + g->y, round(g->tx * 1000) / 1000, round(g->ty * 1000) / 1000);
draw_vertex_texture(xx + g->x2, yy + g->y, round(g->tx2 * 1000) / 1000, round(g->ty * 1000) / 1000);
draw_vertex_texture(xx + g->x,  yy + g->y2, round(g->tx * 1000) / 1000,  round(g->ty2 * 1000) / 1000);
draw_vertex_texture(xx + g->x2, yy + g->y2, round(g->tx2 * 1000) / 1000, round(g->ty2 * 1000) / 1000);

This works for default font.

For declared font, any size 14 and above + AA of 1 or above works.

Please refer to the many posts previous to this for explanations and screenshots.

Thanks.


Yes, try that with floor, ceil and float. And also try this mix.

Code: (cpp) [Select]
draw_vertex_texture(xx + g->x,  yy + g->y, floor(g->tx * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, ceil(g->tx2 * 100) / 100, floor(g->ty * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, floor(g->tx * 100) / 100,  ceil(g->ty2 * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, ceil(g->tx2 * 100) / 100, ceil(g->ty2 * 100) / 100);

And also try this one.
Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, round((g->tx + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y, round((g->tx2 + xoff) * 100) / 100, round((g->ty + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x,  yy + g->y2, round((g->tx + xoff) * 100) / 100,  round((g->ty2 + yoff) * 100) / 100);
draw_vertex_texture(xx + g->x2, yy + g->y2, round((g->tx2 + xoff) * 100) / 100, round((g->ty2 + yoff)* 100) / 100);

And this one.
Code: (cpp) [Select]
float xoff = 0.5 / texture_get_width(fnt->texture),
        yoff = 0.5 / texture_get_height(fnt->texture);
draw_vertex_texture(xx + g->x,  yy + g->y, g->tx + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y, g->tx2 + xoff, g->ty + yoff);
draw_vertex_texture(xx + g->x,  yy + g->y2, g->tx + xoff,  g->ty2 + yoff);
draw_vertex_texture(xx + g->x2, yy + g->y2, g->tx2 + xoff, g->ty2 + yoff);

Also want to say that all this clusterFUCK of a problem that is a pain in my arsehole only affects TEXT !  Sprites, parts, shapes drawn all work fine, at least so far :D

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 02, 2014, 04:03:04 pm
Sprites, parts, shapes drawn all work fine, at least so far :D

Did you try 'sprite fonts' as i suggested in my last message ? I've used this method in my game, and i didn't have any problem.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 05:01:41 pm
Very confused here, Robert seems to suggest that everyone complains when offsets are present, and that I am the only one having issues with or without offsets, so by that I am to understand that nobody has any issues with fonts.  I find that really difficult to digest because I tried this shit on different systems and all behaved the same way.

My current system this shit was tested on:
Intel i5-3570k
16GB RAM Windows 7 64bit
EVGA GeForce GTX 660 Ti SC 2GB
Drivers 337.88 WHQL (NVIDIA)
----------------------------------------
My other older system I tried the same project on,
as you can see major differences between hardware
AMD Athlon X2 6400
2GB RAM Windows XP SP3
BFG GeForce 8800GTS 320 MB
Very old forceware drivers

2 completely different systems, same bloody display, same exact thing, identically displayed.

2 different chipsets, CPUs, grpahic cards, OS, so this rules out that anything is wrong with my system !!!
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: TheExDeus on June 02, 2014, 05:13:09 pm
Quote
Very confused here, Robert seems to suggest that everyone complains when offsets are present, and that I am the only one having issues with or without offsets, so by that I am to understand that nobody has any issues with fonts.  I find that really difficult to digest because I tried this shit on different systems and all behaved the same way.
I do have that "111111" rendering problem. But that's about it. Most of the text (especially when defining custom font) looks fine. But I also want to get to the bottom of this rendering nonsense, because it is also the reason why surfaces rendered off-by-one. But I also have tried many values and haven't find one which works for all. But I don't see the text problems you described earlier.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 05:14:57 pm
There you go finally !

I know nothing is wrong with my system and this whole "oh it's you only" thing is rubbish.

Thanks for confirming !  I too tried it on completely different hardware/systems and had the same result.

If people are testing differently then maybe they are not seeing it.

I've never EVER had this problem in any game or any demo, I don't give a crap if they use their own method, fact is nothing is wrong with my hardware.

We already exhausted all the possibilities with offsetting values......

Now the only thing that works is the round 1000 on all vertice, I made a complete report in previous posts.
combined with using font size 14 minimum and aa set to 1.


Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 06:10:21 pm
What screen resolution are you viewing this on ?
I think this has to do with scaling.

I have done tests using game room 1:1 with screen res, (no scaling) and they display fine,
also at monitor's native resolution, evenly spaced and fine.

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 06:26:18 pm
Alright this is getting ridiculous.

I will make a new topic, I will upload ONE project and one alone and would appreciate if as many people run this one project and test it under exactly the same conditions as I am, so that we all can be on the same length.  If people are using different resolutions, sizes, etc, it's not too accurate ....

As far as I'm concerned the problem is reproduced 100% with identical visual flaws on different systems I tested it on, that have completely different hardware.

And again I seem to have to repeat 1000000 times already - The only issue I am having is with fonts not displaying right as I posted in the screen shot, the 1111111111 is just an example,  I see those lines and dots, etc on other letters fonts, sizes, etc.  THAT'S IT, I have no other issues, not with sprites, not with parts, only fucking fonts!!!!!!

If worse comes to worse I will just compile my project with whatever setting works for me and tough fucking luck for the rest....... Thanks to those who posted and confirmed they too saw what I saw seeing, I'm not crazy! (YET but getting there!).

Thanks Robert for the initial suggestions, the round 1000 thing worked and the min 14px + AA1 makes it fully  functional on all fonts and sizes I tried.  Since the real root of the problem might be difficult to fix and requiring a rewrite or time nobody has, why not just use this if it works for everyone !?!?!? 
-----------------------------------------
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 06:28:54 pm
My test was just with the default 640 x 480 window

Your screen resolution was set to what?

When running my tests just for principles I test under every screen resolution down from 800x600 up to native, which in my  case is 1920x1080 (FullHD).
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 02, 2014, 08:01:12 pm
Quote from: egofree
What about using font_add_sprite ? :

http://enigma-dev.org/docs/Wiki/Font_add_sprite
Sprite fonts will obviously work because they use individual textures for each character, currently fonts are the only thing texture paged. The issues they are experiencing are the result of the characters being tightly packed together on the same texture, so obviously sprite fonts would work for him.

Quote from: Darkstar2
If worse comes to worse I will just compile my project with whatever setting works for me and tough fucking luck for the rest....... Thanks to those who posted and confirmed they too saw what I saw seeing, I'm not crazy! (YET but getting there!).

You can calm down because nobody spoke up until we were half why through testing, why? I don't fucking know, so you should be blaming them instead of thanking them, Harri especially, he waited till we were at the end of the topic before speaking up.

I suppose you can also blame me for not getting them to confirm their results, but they seemed avoidant of the subject, which was also destroying my moral to fix the problem.

Also to confirm, I ran it exactly as you said, and do not experience the issue.
(http://i.imgur.com/yylv3lN.png)

Quote from: Darkstar2
Thanks Robert for the initial suggestions, the round 1000 thing worked and the min 14px + AA1 makes it fully  functional on all fonts and sizes I tried.  Since the real root of the problem might be difficult to fix and requiring a rewrite or time nobody has, why not just use this if it works for everyone !?!?!?
Then I am certain it has to do with rounding anomalies in the sampler, where as Direct3D was rounding issues in the screen space, this is why Direct3D we reproduced the same results. Direct3D is known to have less inconsistencies between graphics card manufacturers as well.

OpenGL samples texture coordinates at their centers.
http://hacksoflife.blogspot.com/2009/12/texture-coordinate-system-for-opengl.html

Does that solution work with fonts of other sizes/resolutions/aliasing? That is important because if it does and works that well, then we know we are on the right track.
http://www.opengl.org/wiki/Sampler_%28GLSL%29#Direct_texel_fetches
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 08:48:09 pm
No not blaming you at all Robert, that's what forums are for, I posted the topic and it's up to others confirming themselves if they too have the issue, however you did mention on several occasions that everyone complained when offsets was used and so it gave me the impression that the problem was on my end.

I'll take the whole blame for not waiting until I get enough replies from people before wasting my time !
Before I do anymore testing I will make a new test project that covers everything in one product and upload it for everyone interested (lol every 4 users using ENIGMA), and tell me who is having the issues.

Lonewolf, why does your text render black ? :D
or did you change colours ?

BTW you are not running windows, could this have anything to do?

as to sprite fonts why the hell should I do that, ? Aren't fonts used as sprites already internally?
That would be double to have to convert fonts I need to bitmap and back to font........ I shouldn't have to do that :D  it's a pain in the arse that method. because each time I want to modify something I have to regenerate a new font sprite strip and add the strip to a font index, etc, whereas with the font system I simply  change font properties inside the IDE.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 02, 2014, 08:54:08 pm
This issue will become more lucid in the future when texture paging is added because individual subimages of a sprite will be tightly packaged together. The only quick fix I can think of is adding padding between the font characters.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 08:56:47 pm
This issue will become more lucid in the future when texture paging is added because individual subimages of a sprite will be tightly packaged together. The only quick fix I can think of is adding padding between the font characters.

Will that cause any other problems / visual anomalies ?

BTW did you read my previous posts in this topic ? I tried every suggestion, the ones with xoff and yoff floats rendered nothing, meaning no text displayed at all, only the last 2 sets of xoff yoff displayed garbled characters.  The mixture of ceil /floor also got no good results.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 09:36:35 pm
Without defining the color do you see white text or black ?

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 02, 2014, 11:18:05 pm
Quote
Will that cause any other problems / visual anomalies ?
Yes, the reason you see the same bars on the side of the ones is because your card must round down the texel or something causing texels from the character next to it on the font texture to be drawn on the quad. Again because OGL samples pixel centers. With padding this would not happen because the pixels on each side would be transparent, but that still doesn't fix the problem because if users wanted to create texture sheets manually themselves they would have some problems.

Quote
BTW did you read my previous posts in this topic ? I tried every suggestion, the ones with xoff and yoff floats rendered nothing, meaning no text displayed at all, only the last 2 sets of xoff yoff displayed garbled characters.  The mixture of ceil /floor also got no good results.
Yes you said round with the / 1000 * 1000 worked for you. So to clarify, with that version you had no other issues?

I also tried with the default font, and could not reproduce the issues.
(http://i.imgur.com/SW295NI.png)
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 02, 2014, 11:49:55 pm
Read my PM for some other strange stuff. :P
Also I am uploading something in a bit.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 03, 2014, 12:03:07 am
I already did. This issue is texture paging for different graphics drivers. The issue is in the OpenGL sampler, for Direct3D the issue is in the projection/viewport. The only solution appears to be to round all texture coordinates to the nearest thousandth, but that is no solution.

The only solution I can think  of is adding padding options to font packing and then later texture paging. Since fonts are the only texture paging done by ENIGMA currently. The only problem is then in the future if users want to manually create texture pages they will also have to pad their shit.

We are not going to fix OGL by manipulating the project like we did with Direct3D because the two issues are inherently different.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 03, 2014, 12:09:23 am
I already did. This issue is texture paging for different graphics drivers. The issue is in the OpenGL sampler, for Direct3D the issue is in the projection/viewport. The only solution appears to be to round all texture coordinates to the nearest thousandth, but that is no solution.

The only solution I can think  of is adding padding options to font packing and then later texture paging. Since fonts are the only texture paging done by ENIGMA currently. The only problem is then in the future if users want to manually create texture pages they will also have to pad their shit.

We are not going to fix OGL by manipulating the project like we did with Direct3D because the two issues are inherently different.

How can this be ? I tested the shit on many systems with different drivers, different hardware and all had the 1:1 identical visuals.  So far this seems to be an issue for NVIDIA users so what, are you telling all NVIDIA users to just fuck off and wait for an official fix whenever that will happen if at all OR offer a solution as temporary as it may be that works for all ???

I knew from the damn beginning this was a temporary fix, I would not have wasted my bloody time otherwise had I known offsets would not be accepted as even a temporary solution, why the fuck then did I go through all this ? if you never had intentions of using it !

Then you gave me new rounding tricks, which I tried, worked for me but not fully for other font types.

If the .01 offset works out for NVIDIA and AMD users as ugly as the fix might seem to an ENIGMA developer perspective, then we shouldn't even have this conversation, the whole idea is that things get displayed properly to both NVIDIA and AMD users and beyond.......this is not a coding competition or engine competition, so why all this fuss ???  By all means this would not win any competition that's for sure  :D
I will try some more rounding manipulations and that's it.......if that  does not work I will use what works for myself and everyone else. I'm not a fucking C++ coder so I can't fix ENIGMA myself, so I got to use alternatives, and those seem to work for everyone I asked so far.

and ego, the add font from sprite thing requires a font sprite, these are not made from thin air, it means I have to convert a font to a sprite strip and use that in the function.  I already have the software for that (SpriteFont2), but why should I do that anyway, it's more work, when I could use fonts directly, with a fix that works for everyone !
Also somehow I did not get that to work despite my font sprite sheet being ok.  Also by using fonts directly I can tweak them from the IDE, whereas with the add from sprite I have to change the font sprite sheet each time.......so many detours - defeats the purpose of having a fonts system!  Also you mention it as "fixing my problem" when you know that we are many here having the same issue?

Also the 1000 rounding trick does not work with my latest project, it completely screws up the scrolling, and everything.  the 0.01 works across the board and seems the best hack so far.  Also the font add sprite is broken in ENIGMA, tried that already nothing gets displayed, I have the proper sprite fonts png.



Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 04, 2014, 12:45:01 am
Quote
How can this be ? I tested the shit on many systems with different drivers, different hardware and all had the 1:1 identical visuals.  So far this seems to be an issue for NVIDIA users so what, are you telling all NVIDIA users to just fuck off and wait for an official fix whenever that will happen if at all OR offer a solution as temporary as it may be that works for all
No I'm saying Nvidia sucks, AMD rules, and we'll find a fix once we better identify the problem.

Quote
I knew from the damn beginning this was a temporary fix, I would not have wasted my bloody time otherwise had I known offsets would not be accepted as even a temporary solution, why the fuck then did I go through all this ? if you never had intentions of using it !
I did and still do have intentions of using it, but you haven't even finished confirming it from all the other users in your other topic. So fucking relax, I try to make decisions which most people mutually agree to, so I'm just waiting to see other peoples thoughts.

Also font_add_sprite does work, it does not use external files, just like GM.
http://enigma-dev.org/docs/Wiki/Font_add_sprite
I just tested fundies game, and his sprite font works fine.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 04, 2014, 12:51:26 am
Actually if the problem was with AMD we'd be killing 60%-70% since AMD has a larger market share than Nvidia, you are also forgetting about Intel.

That said, this problem still makes no fucking sense. I don't believe you guys are even having this problem, shifting the projection for you guys is like shifting the fucking texture matrix, it's insane!
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 01:00:45 am

That said, this problem still makes no fucking sense. I don't believe you guys are even having this problem, shifting the projection for you guys is like shifting the fucking texture matrix, it's insane!

Right like we have better things to do and just making shit up and this is all just a bad dream :D  Anyhow this is not a topic about who's dick is larger and who has a better GPU but finding a fix (as gay as it might be) that works for all of us so we can move on to other serious stuff need fixing :D As Harri suggested maybe this fix is helping with the rounding.  I work with what I have.

All the suggestions you gave me I did and none worked 100%.  But of course there was no way of knowing unless trying, which I did......
To be honest this 0.01 thing was random, I too never expected it to be the ideal fix. 

But unless you have a contact at NVIDIA you will never know for sure......  Graphic card issues is nothing new, some games in history have had issues with NVIDIA, some with AMD  etc.....

For legal reasons I won't go into details about why I would never use AMD.....I just know stuff and I will leave it at that.

Yeah NVIDIA has its flaws, so does Intel so does the fucked up AMD CPUs that came after the Phenom x4's.



Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 04, 2014, 01:29:18 am
haha

Quote
But unless you have a contact at NVIDIA you will never know for sure......  Graphic card issues is nothing new, some games in history have had issues with NVIDIA, some with AMD  etc.....
I will call them when I get time.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:09:17 am
Yeah man, we made it up  :D

I just took Darkstar's image and changed the colours around a bit.

Jeez we got you good didn't we?

Dark and I have been swapping PM's for a week seeing what the best way to prank you would be  ;D

Careful he'll actually believe you LOL!
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:11:14 am
haha

Quote
But unless you have a contact at NVIDIA you will never know for sure......  Graphic card issues is nothing new, some games in history have had issues with NVIDIA, some with AMD  etc.....
I will call them when I get time.

Well actually I did earlier and humoured them lol they said that this was the funniest thing they heard like........forever lol and said what the fuck am I doing playing with toys and to use real game engines instead !  ;D ;D ;D ;D
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 04, 2014, 05:04:33 am
So go use one then I won't stop you. You have a thousand choices with more permissive licenses, less buggy, and well designed.

I've provided nothing but suggestions offered by the graphics API developers, the card manufacturers and their affiliates (Microsoft). Maybe they should go back to the drawing board or offer developers some better fucking solutions. This pissing contest attitude of Nvidia is why they are having problems pushing their shit cards into Android and other markets. I'll be glad to see their demise.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: TheExDeus on June 04, 2014, 12:53:19 pm
Quote
The problem is apparent on AMD devices as well.
Until recently no one said that. I have an AMD and I don't have that issue. For now you seem the only one.

Quote
This pissing contest attitude of Nvidia is why they are having problems pushing their shit cards into Android and other markets. I'll be glad to see their demise.
Nothing is wrong with nvidia. They are the only ones who care about OpenGL in the first place. Also, by Steam data 50% have Nvidia and 30% have AMD, which is contrary to what you mentioned. AMD is in consoles though, but Nvidia is actually the only one of the two going into Android and other markets. Nvidia is even in cars now. And spacecraft. I personally like Nvidia as a company and their products, but I have nothing against AMD either.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:02:54 pm
So go use one then I won't stop you. You have a thousand choices with more permissive licenses, less buggy, and well designed.

You know very well that is typical response from a company, be it NVIDIA or AMD or Intel or Microsoft or anybody, will always blame someone else, but rarely if any admit to any issues or claim that most people are idiots and will never notice these minor details.... Mind you not everyone has a keen eye to notice flaws but Christ, the font problem is so damn obvious at first I thought I was seeing double LOL.

I don't have the luxury or time to use something else with steeper learning curve, I need something that is easy to learn and quick.  GayStudio fits the bill, but unfortunately it fall flat on its arse, which is how I discovered here.  They use opensource and charge $800 for it yet they can't provide the BASIC functions, and basically telling people to devleop their own functions, I mean what the fuck, that defeats the whole purpose GM was founded on......I will never support such company.

Quote
I've provided nothing but suggestions offered by the graphics API developers, the card manufacturers and their affiliates (Microsoft). Maybe they should go back to the drawing board or offer developers some better fucking solutions. This pissing contest attitude of Nvidia is why they are having problems pushing their shit cards into Android and other markets. I'll be glad to see their demise.

There are some internal issues with a certain other companies I can't discuss and won't discuss.  NVIDIA is not the only one with issues.  Just because your fonts render nicely on your AMD card does not mean AMD is free of flaws or problems, that's as much as I will say.  Quality control is lacking nowadays, nobody is exempt from this problem, font or no problem, NVIDIA has far bigger issues in its history, i'm sure people forgot all about the overheating and premature chipset failures board and GPU and many others.   Personally I never had issues with NVIDIA graphic cards.

Companies want to push release as quickly as possible and have end-users as guinea pigs (sounds familiar ? :D)  Nobody is exempt from this shit, remember Intel ? NVIDIA ? AMD ? many more to list.

As far as AMD I've been a big fan of their CPUs, and always used them.  The last CPU from AMD I used was the Phenom X4 3.4Ghz, that was great overall and good enough for gaming.  Any processor they released after that was a let down.  It was a blessing for me since then I now use Intel CPUs.  (My board is an ASUS P8Z77-V Pro, IB.  )  way way better stability, speed and functionality than previous boards I had with the NVIDIA chipset.

So as far as GPU, I'm sticking with NVIDIA, the way it's meant to be played  ;D ;D ;D

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:07:40 pm
So go use one then I won't stop you. You have a thousand choices with more permissive licenses, less buggy, and well designed.

I've provided nothing but suggestions offered by the graphics API developers, the card manufacturers and their affiliates (Microsoft). Maybe they should go back to the drawing board or offer developers some better fucking solutions. This pissing contest attitude of Nvidia is why they are having problems pushing their shit cards into Android and other markets. I'll be glad to see their demise.

How is this an Nvidia issue? The problem is apparent on AMD devices as well.

The problem is clearly with how ENIGMA is doing something.

Might be a rounding thing after all, and the fact both type of GPUs round differently, I guess that is a more plausible theory given the 0.01 fixing everything so far.  It is not uncommon for commercial games to have issues with some type of cards, that's why companies add patches and fixes internally to deal with specific issues  - Example I certain games had issues with a specific range of NVIDIA chipsets, so patches released to fix these issues.  Same for other cards.  This is what ENIGMA should do essentially. And a cleaner more permanent fix would require far more than just 1 lor 2 lines of code :D so unless someone wants to volounteer re-writing ENIGMA's font and graphic sengine from scratch in a timely manner (before the apocalypse) I guess the only short term solution is a hack and besides, ENIGMA would not be the first product to use quick hacks and band aid solutions, only difference is that there are good reasons to be doing so, where an $800 product has no fucking excuse. :D

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 04, 2014, 03:13:33 pm
I've tested the test application from Darkstar2, and i've also the bug.  If i create a new project, and i use the following code in an object:

Code: [Select]
draw_set_color(c_white);
draw_text(50,50,"11111111111111111111111111");

I've the bug, BUT if i create a fonts resource, and i specify the fonts :

Code: [Select]
draw_set_color(c_white);
draw_set_font ( myfont);
draw_text(50,50,"11111111111111111111111111");

I don't have the bug. I tried many different fonts, and i didn't have the bug. So i don't know how ENIGMA draws text if the fonts type is not specified, but if you create a fonts resource, it seems you never have this bug.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:13:48 pm
Quote
The problem is apparent on AMD devices as well.
Until recently no one said that. I have an AMD and I don't have that issue. For now you seem the only one.

One has to go lower level than that.  Sometimes at the chipset / chip revision level.  If someone has an AMD GPU and noticing the flaws with fonts as image 1 I would like to know, as well as your specs.

Quote
Nothing is wrong with nvidia. They are the only ones who care about OpenGL in the first place. Also, by Steam data 50% have Nvidia and 30% have AMD, which is contrary to what you mentioned. AMD is in consoles though, but Nvidia is actually the only one of the two going into Android and other markets. Nvidia is even in cars now.

In cars, yikes, if that's the case then where it normally should say turn left on exit 1, would say instead turn left on exit 11.  lol!

Quote
And spacecraft. I personally like Nvidia as a company and their products, but I have nothing against AMD either.

Same here, a big loyal customer of AMD for very long. Spent a fortune on their products.  But now Intel won me over for their CPU (mind you AMD was convenient for me for a while, price wise) but the Intel is worth the extra mile.)  But as far as GPU I am sticking to NVIDIA unless I see serious enough issues / failures, etc. then it will be onboard graphics lol!
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 04, 2014, 03:16:31 pm
Darkstar2:
Read my previous message, and tell me if you have the bug with a fonts resource.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:22:41 pm
I've tested the test application from Darkstar2, and i've also the bug.  If i create a new project, and i use the following code in an object:

Code: [Select]
draw_set_color(c_white);
draw_text(50,50,"11111111111111111111111111");

I've the bug, BUT if i create a fonts resource, and i specify the fonts :

Code: [Select]
draw_set_color(c_white);
draw_set_font ( myfont);
draw_text(50,50,"11111111111111111111111111");

I don't have the bug. I tried many different fonts, and i didn't have the bug. So i don't know how ENIGMA draw text if the fonts is not specified, but if you create a fonts resource, it seems you never had this bug.

Don't be mislead mate - I've done exactly as you did.  Just because you don't see the problem with declared fonts doesn't mean it's not there.  It's there and if you use it enough you will see it.

I've posted some screenshots you will see the big size and fonts, and I mentioned it many times.  True that on declared fonts you see less of the problem, you might even make it go by using AA, which cancels out the 1px left overs at the edges, but the problem exists.   Harder to spot, true, but tried all sorts of fonts, sizes, combination but with AA off, and noticed artifacts too, verticle lines, dots, etc, the fix I am attempting to test on will temporarily fix this and so far does not seem to alter anything else.  Those artifacts are on edges of the glyphs it appears, so it's obvious they will be canceled out and when declaring fonts AA is used by default.  Padding should help indeed, but as mentioned before might create more work for specific developers.

BTW I noticed this lines on edges when importing certain projects from GM to ENIGMA, even on actual sprites.  Yet when the project is re-saved as EGM and re-opened it works fine.   Also noticed major issues when saving as any type of GM file from LGM and importing in GMS, it opens but get asset compiler issues.  But that is off topic :D

Font rendering in GMS is crap basically.  true that I have not seen the artifacts in question maybe they us a different method to render them or round them I don't know, but if you read text you will see they are not on a straight line and each character positioned slightly different on the Y axis, perhaps due to scaling I don't know.   Some filtering is used I'm sure, because the fonts are crisp edged on ENIGMA and smaller sizes display better, where on GMS they have a filtered look.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 04, 2014, 03:26:10 pm
True that on declared fonts you see less of the problem..

Could you give me an example with declared fonts with a problem ? I would like to test it also.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 03:51:20 pm

Could you give me an example with declared fonts with a problem ? I would like to test it also.

Will do so later as I have lots on my plate now.
I already did those tests.  BTW, when running my EXE it dose not matter what you have in your source CPP, but if you are compiling your own project make sure that your GLMatrix.cpp, GSFont.cpp, GLScreen.cpp don't have any offset fixes !  I noticed fixes were merged and later a pull request was made to remove all offsets, but it was not merged yet.  So you may have the source with a previous fix and that might bias your results.

Right now working on 2 things, a revision 2 that will include more extensive tests, scroll, V/H, text, different sizes, fonts, etc and will hardcode the fixes in the CPP instead of the program, this is needed in order for the fixes to apply globally and not only in draw events.  I will address the declared font issue then.

Meanwhile with no fix / no offsets in the CPPs,
here are some examples these are under room 640x480.  Some will be less obvious and not on all characters, so look closely. (obviously this concerns NVIDIA users)  AMD users who don't see any problems will very unlikely see any with declared fonts :D

This is only a sample / example:

Arial size 30 bold unchecked italic unchecked  AA off
Code: (gml) [Select]
draw_set_color(c_white);
draw_set_font(font_0);
draw_text(10,10,"111111111111111111111111");
in draw event.

Look at the 1's very closely you will see some 1's have a tiny vertical line few pixels in height to the left of the 1.

Here is another same font, arial 30, bold OFF italics OFF AA OFF
Code: (gml) [Select]
draw_set_color(c_white);
draw_set_font(font_0);
draw_text(10,10,"ABCDEFGHIJKLMNO
PQRSTUVWXYZ");

Look closely, this one might be harder to spot, depending on your monitor res, press F4 to full screen
you will see a vertical line left to A, a line under Q (very obvious there), and few px left to G.

Try this last one above, with size 50 instead, full screen it, lines below text, so obvious, in many areas.

Using bold and a combination of AA will mask the problem and give you the impression there is none.

I too got fooled at the beginning of my testing and thought this only concerned non declared fonts, which now that I think about it, would not make much sense. Since to the engine it does not discriminate and does not know which font is which.


Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: egofree on June 04, 2014, 04:04:42 pm
Arial size 30 bold unchecked italic unchecked  AA off

Ok, if you uncheck AA,  sometimes  you can see problems, but honestly is it a big concern to check AA ? AA can only improves the quality of rendering, and as far i can see, it will fix your bug. I can understand that you want to fully understand what's going on, but from my point of view with a fonts resource declared, fonts drawing in ENIGMA is far from being bad, and in any case it is not blocking !
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 04, 2014, 04:13:09 pm
Arial size 30 bold unchecked italic unchecked  AA off

Ok, if you uncheck AA,  sometimes  you can see problems, but honestly is it a big concern to check AA ? AA can only improves the quality of rendering, and as far i can see, it will fix your bug. I can understand that you want to fully understand what's going on, but from my point of view with a fonts resource declared, fonts drawing in ENIGMA is far from being bad, and in any case it is not blocking !

You are missing the point ,turning on AA does not resolve every issue  Like I said, I have gone through this extensively, and it can be tricky.  AA may seem to fix it,but there are situations when it does not.  I thought it did at first and that it was the solution, but discovered otherwise.   Also if AA option is there, it is to be used or not used, why should people be forced to use it ? If there is a fix that can be applied that will work for undeclared, declared ,AA or no AA, so be it, shouldn't have to force an end user to use AA or apply their own fix, especially if there is something that can be done as a quick fix.

Thanks but I was already aware about the AA thing, and again I will repeat over and over this does not only concern fonts but flickering on scroll, you will see with my new demo.  the AA is not a complete fix.  my test fix hopefully will patch everything.

Previous to this topic Robert and I were working on finding offsets that worked for the both of us, we played with bigger offsets and even followed hardware recommendations and it resulted in me getting good results and Robert getting bad ones and 1px gaps at the seams of scrolling, so we could not find a range that worked for both of us 100%  What first started as a font only issue is now having to work a fix that will not break something else including scrolling which the previous offsets / fixes did affect !


Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 05, 2014, 02:24:22 am
Yes Darkstar is right, the issue is still there, and we need to find a fix because it will affect other things in the future.

Quote from: TheExDeus
Nothing is wrong with nvidia. They are the only ones who care about OpenGL in the first place. Also, by Steam data 50% have Nvidia and 30% have AMD, which is contrary to what you mentioned. AMD is in consoles though, but Nvidia is actually the only one of the two going into Android and other markets. Nvidia is even in cars now. And spacecraft. I personally like Nvidia as a company and their products, but I have nothing against AMD either.
Sorry Harri, I was talking about Linus Torvalds, it's been a while since I heard that talk so excuse me. I don't have any statistics or facts to refute you or verify my claims, and I'm not going to bother because it's irrelevant anyway.

Quote from: Darkstar2
Previous to this topic Robert and I were working on finding offsets that worked for the both of us, we played with bigger offsets and even followed hardware recommendations and it resulted in me getting good results and Robert getting bad ones and 1px gaps at the seams of scrolling, so we could not find a range that worked for both of us 100%  What first started as a font only issue is now having to work a fix that will not break something else including scrolling which the previous offsets / fixes did affect !
Yes, but important to note here Darkstar, me and you used that method to solve blurry text in Direct3D and it worked, there is no problem with Direct3D text at all now. Isn't that amazing? OpenGL is the one proving to be a bitch to fix, and it's not their fault, it's the graphics card manufacturers who make standard implementations of Direct3D and seem to molest OGL.

Quote from: Darkstar2
In cars, yikes, if that's the case then where it normally should say turn left on exit 1, would say instead turn left on exit 11.  lol!
This actually made me laugh.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 05, 2014, 05:12:22 pm
[quote author=Robert B Colton Yes, but important to note here Darkstar, me and you used that method to solve blurry text in Direct3D and it worked, there is no problem with Direct3D text at all now.
[/quote]

So far so good, and once DX9 gets full screen and window moving fixes it will be even better.   BTW, speaking of DX9 I am aware the lone is working on getting this fixed.  And it's true what you are describing about D3D is spot on.  I noticed it myself in games when alt tabbing and going back to the game the screen is black and there is a delay before everything is initialised again.  However, there are some games that don't have this delay and instantly redraw the window.  Can I assume that they are not using actual real full screen but other methods or different methods of repopulating the VRAM or whatever is done ???

BTW this fix would likely work for built in resources but NOT external resources such as those added by *_add functions, so there would need extra functions added to re-init those, + use of scripts.  So in essence, DX9 will never be truly fixed in ENIGMA unless you handle everything yourself.

Quote
Isn't that amazing? OpenGL is the one proving to be a bitch to fix, and it's not their fault, it's the graphics card manufacturers who make standard implementations of Direct3D and seem to molest OGL.

That's true and has been documented for years.  I guess a good example is the DVD specifications, not 100% of the DVD players on the market adhere to strict DVD Specifications 100%,.

You've mentioned the problem might be caused by the way NVIDIA rounds, I guess it would have to be a chipset / chip revision as some NVIDIA users do not have the issue, although most do.  I guess this would explain why .01 might actually be assisting the rounding ?  Luckily this is an easy fix and once i'm done testing phase 2 and it's implemented, it will be easy to change the GL3Matrix as well.


Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 05, 2014, 07:12:04 pm
So far so good, and once DX9 gets full screen and window moving fixes it will be even better.   BTW, speaking of DX9 I am aware the lone is working on getting this fixed.  And it's true what you are describing about D3D is spot on.  I noticed it myself in games when alt tabbing and going back to the game the screen is black and there is a delay before everything is initialised again.  However, there are some games that don't have this delay and instantly redraw the window.  Can I assume that they are not using actual real full screen but other methods or different methods of repopulating the VRAM or whatever is done ???

This is probably to do partially with where the textures sit in the first place (RAM-wise) coupled with the amount of textures that need to be resent to the VRAM.

The explanation gets pretty complex after that. But essentially, it is pretty easy to saturate the GPU bus when copying textures back to the GPU.

The DX9 renderer I have just finished in my own engine (trying to port to ENIGMA now) switches instantly between true FS and windowed mode, that is without copying textures back though. So, remains to be seen under heavy texture load.

Or a simple fix you could just have code preventing people from ALT-tabbing from your game, ........  ;D ;D ;D

(runs......runs............runs......... fast in the distance!) :P
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 05, 2014, 07:44:46 pm
Yeah but again I am not suggesting it is rounding, Microsoft is, I'm literally just being a parrot here, or a parakeet (no pun intended). But that still doesn't make sense, rounding is in the FPU, and changing drivers should not affect it's hard-wired behavior.

But yeah, lonewolff, your complaint about DX11 is not warranted because OpenGL3 places the same restriction, but it's not necessary unless you want to do a direct port to GLES. Also it is somewhat optional for Direct3D 10 and 11 as well because you can still use the X library, you just have to download it separately because they dumped it from the Windows SDK.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 05, 2014, 08:21:33 pm
Hehe! And take care of CTRL ALT & DEL while we are there :)

The awesome thing about DX11 is that you don't have to handle lost devices. The crap thing about DX11 is that you have to handle every single thing with a shader.

Yeah but not everyone has a DX11 card.  let alone DX10 card.  and you do want your game to run on as many systems as possible.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 05, 2014, 08:24:52 pm
Yeah but again I am not suggesting it is rounding, Microsoft is, I'm literally just being a parrot here, or a parakeet (no pun intended). But that still doesn't make sense, rounding is in the FPU, and changing drivers should affect it's hard-wired behavior.

You meant "should not" :D  In theory no, however keep in mind there are hidden settings in drivers to control many internal things that you can't otherwise with drivers.  I remember back in the days graphic card drivers had an OPENGL and D3D panel separate, now they really simplified drivers and the number of things you can tweak. :D
I forgot what the tool was called, which unlocked tons of settings you could tweak on your card, including hidden OGL and D3D stuff, tuner something....... :D

Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Goombert on June 05, 2014, 09:21:19 pm
My apologies, but yes, so we agree this is in part why this issue is so pervasive.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: TheExDeus on June 06, 2014, 12:09:37 pm
Quote
Yeah but not everyone has a DX11 card.  let alone DX10 card.  and you do want your game to run on as many systems as possible.
I don't think things like lost device are anything to do with hardware version of DX it supports. So it should be possible to use many of the DX11 functions and syntax and still run on DX9/10 hardware.

Quote
Yeah but again I am not suggesting it is rounding, Microsoft is, I'm literally just being a parrot here, or a parakeet (no pun intended). But that still doesn't make sense, rounding is in the FPU, and changing drivers should affect it's hard-wired behavior.
I don't think anything is hard wired anymore. So I am pretty sure all of it can be changed in the drivers. GPU's don't use FFP anymore for a reason.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 06, 2014, 02:31:36 pm
Quote
Yeah but not everyone has a DX11 card.  let alone DX10 card.  and you do want your game to run on as many systems as possible.
I don't think things like lost device are anything to do with hardware version of DX it supports. So it should be possible to use many of the DX11 functions and syntax and still run on DX9/10 hardware.

Quote
Yeah but again I am not suggesting it is rounding, Microsoft is, I'm literally just being a parrot here, or a parakeet (no pun intended). But that still doesn't make sense, rounding is in the FPU, and changing drivers should affect it's hard-wired behavior.
I don't think anything is hard wired anymore. So I am pretty sure all of it can be changed in the drivers. GPU's don't use FFP anymore for a reason.

There are many things you can change in your GPU, majority are hidden from view. You will find such tools online on tweak sites, some allow you to access at firmware level, and some at driver level, many settings for OpenGL, D3D, clock, etc. + some low level advance settings, not for the faint of heart :D  The hardwired ones are actually at the firmware level, and in theory they can be changed with the right tools, although it is never recommended playing with these things.
Title: Re: Fonts display glitch / Borders / Scrolling glitches
Post by: Darkstar2 on June 08, 2014, 12:54:27 pm
I will be locking this topic now.  Thanks to everyone who contributed with ideas, suggestions, etc.  I will start a new more up to date topic later and submit one final testing in hope for an imminent fix.  The offsets discussed here is no longer relevant, as I may have stumbled upon a quick fix that should work for everyone, and those offset and rounding tricks suggested were not a working solution for everyone.