{"action":"created","issue":{"url":"https://api.github.com/repos/haxenme/nme/issues/391","repository_url":"https://api.github.com/repos/haxenme/nme","labels_url":"https://api.github.com/repos/haxenme/nme/issues/391/labels{/name}","comments_url":"https://api.github.com/repos/haxenme/nme/issues/391/comments","events_url":"https://api.github.com/repos/haxenme/nme/issues/391/events","html_url":"https://github.com/haxenme/nme/issues/391","id":183280737,"number":391,"title":"pixel perfect glyph textures","user":{"login":"codeservice","id":1771547,"avatar_url":"https://avatars.githubusercontent.com/u/1771547?v=3","gravatar_id":"","url":"https://api.github.com/users/codeservice","html_url":"https://github.com/codeservice","followers_url":"https://api.github.com/users/codeservice/followers","following_url":"https://api.github.com/users/codeservice/following{/other_user}","gists_url":"https://api.github.com/users/codeservice/gists{/gist_id}","starred_url":"https://api.github.com/users/codeservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeservice/subscriptions","organizations_url":"https://api.github.com/users/codeservice/orgs","repos_url":"https://api.github.com/users/codeservice/repos","events_url":"https://api.github.com/users/codeservice/events{/privacy}","received_events_url":"https://api.github.com/users/codeservice/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-16T18:01:44Z","updated_at":"2016-10-17T14:56:30Z","closed_at":null,"body":"At some moment nme font rendering method was replaced by tiles drawing on nme. Old method was hardware->BeginBitmapRender(tile.mSurface,tint,false,false); I didnt see random glyph texture distortion on ios (retina) using old way before and now this problem clearly visible on high resolution displays. I know half pixel shift approach can fix it and replacing this line to: mTile->tile(p.x+0.5/tile.mRect.w, p.y+0.5/tile.mRect.h, tile.mRect, trans_2x2, tint); gives result almost perfect. I think this should be done on texture data forming level and can't find it as my nme knowledge has limits. Any one can pointing me out where tile texture forming and this fix can be applied?\r\n\r\nIssue description found here: http://drilian.com/2008/11/25/understanding-half-pixel-and-half-texel-offsets/\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/haxenme/nme/issues/comments/254231750","html_url":"https://github.com/haxenme/nme/issues/391#issuecomment-254231750","issue_url":"https://api.github.com/repos/haxenme/nme/issues/391","id":254231750,"user":{"login":"codeservice","id":1771547,"avatar_url":"https://avatars.githubusercontent.com/u/1771547?v=3","gravatar_id":"","url":"https://api.github.com/users/codeservice","html_url":"https://github.com/codeservice","followers_url":"https://api.github.com/users/codeservice/followers","following_url":"https://api.github.com/users/codeservice/following{/other_user}","gists_url":"https://api.github.com/users/codeservice/gists{/gist_id}","starred_url":"https://api.github.com/users/codeservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codeservice/subscriptions","organizations_url":"https://api.github.com/users/codeservice/orgs","repos_url":"https://api.github.com/users/codeservice/repos","events_url":"https://api.github.com/users/codeservice/events{/privacy}","received_events_url":"https://api.github.com/users/codeservice/received_events","type":"User","site_admin":false},"created_at":"2016-10-17T14:56:30Z","updated_at":"2016-10-17T14:56:30Z","body":"I dint apply any extra transformations to my text, didn't use rotation or\nscale. I have big text field practically over whole screen and in some\n\"sweet\" spots I see these deformations. Maybe its good way to recreate this\nissue in simple app, create big text field, multi line, wrapped, left\nalignment and insert large text.\n\nI dint see this issue on windows or mac(not retina), only ios retina.\n(didn't check android yet)\n\nAlso I have custom UI list based on static text field items. I scroll list\nsimply changing textfield y position, same issue. It could be like 50-60\nitems and one or two items with damaged text.\n(same, no extra transformation in my code)\n\nI didn't see this issue on small text fields sample, its really required a\nlot of text over screen to capture issue on ios.\n\n\nP.S.\nFound more links for texture positioning\nhttp://stackoverflow.com/questions/7272579/iphone-opengl-es-2-0-pixel-perfect-textures\nhttp://stackoverflow.com/questions/33307779/opengl-4-4-texture-atlas-artifacts\nhttp://stackoverflow.com/search?q=opengl+perfect+texture\n\n\n\n\nOn Mon, Oct 17, 2016 at 8:41 AM, Hugh Sanderson <notifications@github.com>\nwrote:\n\n> The old code did not allow arbitrary rotation of text, so if there is a\n> small rotation component this could be showing up now.\n> The font code is a bit different because it takes the scale from the view\n> matrix and transfers it to the font size. It then should lay out the\n> generated font pixels 1:1 with the screen.\n>\n> Does it show up in the sample/02-Text example? Is it only on a ios/retina\n> display? Or do you think there is some other way I can reproduce this.\n> Does it only happen when scrolling? It could be that the scroll distance\n> it not properly snapped to the pixel grid.\n>\n> On Mon, Oct 17, 2016 at 7:44 PM, codeservice <notifications@github.com>\n> wrote:\n>\n>\n> > Text not centered, aligned to left. I tested the same app with old nme\n> > rendering way and new. For some reason tiles can be deformed depending on\n> > position on screen when I scroll text. This happens for the same\n> characters\n> > on whole vertical or horizontal line on screen. For example \"l\" look\n> > twisted in glyph middle and when I scroll text this appears and\n> disappears\n> > for whole vertical text line for all charters \"l\" on this line, same for\n> > horizontal for example if I have text \"TELEVISON\" middle line in all \"E\"\n> > twisted on one horizontal line. Also could be case when whole text line\n> top\n> > and bottom pixels flickering when I changing text field \"y\" coordinate.\n> >\n> > Then I start playing with tile coordinates calculation and was able to\n> > reduce or increase this effect depending on different ways of rounding.\n> > Most close case described by other developers who using a lot of tiles on\n> > screen was this pixel perfect texture issue when half pixel solution need\n> > to be used for texture U and V coordinates to fix it.\n> >\n> > Looks like it require more research time still don't understand why old\n> > rendering way has no this issue.\n> >\n> >\n> >\n> > > On Oct 17, 2016, at 01:32, Hugh Sanderson <notifications@github.com>\n> > wrote:\n> > >\n> > > There is code in TextField.cpp that is supposed to sort this out.\n> > > The 'screenGrid' variable says whether the tile locations should be\n> > snapped to the pixel locations. This is based on not having a skew in the\n> > matrix, or different x and y scales. Maybe this is not getting activated.\n> > You could try forcing on 'grid' and see if this fixes the problem.\n> > >\n> > > It is also possible something like x or y centering is messing up the\n> > pixel locations after they have been calculated. Are you centering the\n> text?\n> > >\n> > > There might also be a non-integer scaling imposed by the retina display\n> > that nme can't see properly, and therefore can't work out the pixel grid.\n> > Would have to have a deeper look at this.\n> > >\n> > > —\n> > > You are receiving this because you authored the thread.\n> > > Reply to this email directly, view it on GitHub, or mute the thread.\n> > >\n> >\n> > —\n> > You are receiving this because you commented.\n> > Reply to this email directly, view it on GitHub\n> > <https://github.com/haxenme/nme/issues/391#issuecomment-254184818>, or\n> mute\n> > the thread\n> > <https://github.com/notifications/unsubscribe-auth/ABlp1rM26ZE_if_\n> UTq1F1kbmzQPqEEXeks5q01-NgaJpZM4KYCN0>\n>\n> > .\n> >\n>\n> —\n> You are receiving this because you authored the thread.\n> Reply to this email directly, view it on GitHub\n> <https://github.com/haxenme/nme/issues/391#issuecomment-254196198>, or mute\n> the thread\n> <https://github.com/notifications/unsubscribe-auth/ABsIG47bK2sQ33NTKB6YXsI3kXE5CUMnks5q02z-gaJpZM4KYCN0>\n> .\n>\n"}}
{"actor":{"display_login":"codeservice"}}