Darkstar2
|
|
Reply #60 Posted on: May 28, 2014, 11:21:00 pm |
|
|
Joined: Jan 2014
Posts: 1238
|
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).
|
|
« Last Edit: May 31, 2014, 08:29:11 pm by Darkstar2 »
|
Logged
|
|
|
|
Goombert
|
|
Reply #61 Posted on: May 31, 2014, 02:32:27 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #62 Posted on: May 31, 2014, 07:52:53 pm |
|
|
Joined: Jan 2014
Posts: 1238
|
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.
|
|
« Last Edit: May 31, 2014, 08:34:27 pm by Darkstar2 »
|
Logged
|
|
|
|
Goombert
|
|
Reply #63 Posted on: June 01, 2014, 12:39:30 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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
|
|
« Last Edit: June 01, 2014, 12:44:51 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #64 Posted on: June 01, 2014, 01:03:07 am |
|
|
Joined: Jan 2014
Posts: 1238
|
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.
|
|
« Last Edit: June 01, 2014, 01:05:09 am by Darkstar2 »
|
Logged
|
|
|
|
Goombert
|
|
Reply #65 Posted on: June 01, 2014, 01:15:00 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #66 Posted on: June 01, 2014, 01:22:21 am |
|
|
Joined: Jan 2014
Posts: 1238
|
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
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #67 Posted on: June 01, 2014, 01:32:50 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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#L369Try 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. 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.
|
|
« Last Edit: June 01, 2014, 01:37:27 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #68 Posted on: June 01, 2014, 01:49:49 am |
|
|
Joined: Jan 2014
Posts: 1238
|
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 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. 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 ? 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.
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.
|
|
« Last Edit: June 01, 2014, 01:59:49 am by Darkstar2 »
|
Logged
|
|
|
|
Goombert
|
|
Reply #69 Posted on: June 01, 2014, 02:02:26 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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. 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/736is 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. 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?
|
|
« Last Edit: June 01, 2014, 02:07:26 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #70 Posted on: June 01, 2014, 02:42:58 am |
|
|
Joined: Jan 2014
Posts: 1238
|
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. 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...... 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 but fonts remained crisp throughout the entire ranges of offsets. 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. 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 ?
|
|
|
Logged
|
|
|
|
Goombert
|
|
Reply #71 Posted on: June 01, 2014, 10:49:00 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
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. 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
|
|
« Last Edit: June 01, 2014, 10:53:18 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #72 Posted on: June 01, 2014, 11:11:32 pm |
|
|
Joined: Jan 2014
Posts: 1238
|
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 :
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.
|
|
« Last Edit: June 01, 2014, 11:30:44 pm by Darkstar2 »
|
Logged
|
|
|
|
Goombert
|
|
Reply #73 Posted on: June 01, 2014, 11:36:16 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Yes, try that with floor, ceil and float. And also try this mix.
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.
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.
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);
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
Darkstar2
|
|
Reply #74 Posted on: June 02, 2014, 12:12:19 am |
|
|
Joined: Jan 2014
Posts: 1238
|
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 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.
|
|
« Last Edit: June 02, 2014, 12:14:01 am by Darkstar2 »
|
Logged
|
|
|
|
|