Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Goombert

1306
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.

1307
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.

1308
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.


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

1309
Works in Progress / Re: Project Mario
« on: June 02, 2014, 09:53:34 AM »
Fervi, it is unlikely to build for Linux right now because there are no working INI functions for XLIB yet.

1310
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: (C++) [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: (C++) [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: (C++) [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: (C++) [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);

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

Code: (C++) [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: (C++) [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: (C++) [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);

1312
Off-Topic / Re: The choice was obvious, and it wasn't Enigma
« on: June 01, 2014, 12:49:52 PM »
Ok, I see your points, and they are very good. Can't say I disagree, but I don't have time to maintain hosting of ENIGMA on a bazillion websites, like other projects, there should be other people helping out, but nobody ever does.

1313
General ENIGMA / Re: New Beginnings
« on: June 01, 2014, 12:47:46 PM »
My only complaint with ENIGMA is the fact that it is sexually confused.

Anyway I am thinking of keeping the object resource for my spinoff and allowing sources and headers to be added with a simplification of the instance system allowing it to be easily coded giving you more control.

I am not sure if any of my ideas will come to fruition or not.

1314
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

1315
Issues Help Desk / Re: Can't rename a resource under linux
« on: June 01, 2014, 10:45:20 AM »
Ugh, thanks for finding it out egofree. But I can't do that one line fix I don't think, I should actually fix the collection sorting. But also, this doesn't make sense, because renaming a resource in the tree does not do any sorting?

1316
General ENIGMA / Re: New Beginnings
« on: June 01, 2014, 10:41:32 AM »
Ok, a couple of things.

1) XNA, BlitzBasic, DarkBasic are all proprietary.
2) BlitzBasic, DarkBasic, and XNA are not very modern.
3) XNA is C#
4) 99.99% of the time your C++ code would not look any different, lol, you guys keep failing to understand this, just because you can use C++ doesn't mean you have to use pointers, you've coded in GM fine for years without pointers, and just because all of the sudden you can use pointers, doesn't mean you have to, it just means that you can if you want and you can also learn to write your games more efficiently that way, but overall the difference does not affect you except provide you with more power, why do you guys keep failing to recognize this?

1317
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?

1318
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: (C++) [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.

1319
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.

1320
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