{"action":"created","issue":{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/435","labels_url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/435/labels{/name}","comments_url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/435/comments","events_url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/435/events","html_url":"https://github.com/Bertram25/ValyriaTear/issues/435","id":57190823,"number":435,"title":"A try at improving how the map layers are displayed.","user":{"login":"Bertram25","id":765917,"avatar_url":"https://avatars.githubusercontent.com/u/765917?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertram25","html_url":"https://github.com/Bertram25","followers_url":"https://api.github.com/users/Bertram25/followers","following_url":"https://api.github.com/users/Bertram25/following{/other_user}","gists_url":"https://api.github.com/users/Bertram25/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertram25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertram25/subscriptions","organizations_url":"https://api.github.com/users/Bertram25/orgs","repos_url":"https://api.github.com/users/Bertram25/repos","events_url":"https://api.github.com/users/Bertram25/events{/privacy}","received_events_url":"https://api.github.com/users/Bertram25/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/labels/Comment%20or%20Feedback","name":"Comment or Feedback","color":"DDDDDD"},{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/labels/Feature","name":"Feature","color":"0b02e1"},{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/labels/Refactoring","name":"Refactoring","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/milestones/2","labels_url":"https://api.github.com/repos/Bertram25/ValyriaTear/milestones/2/labels","id":167134,"number":2,"title":"Low priority (or fancy features)","description":"Here is gathered the issues linked to either:\r\n- Super-duper features that can wait in regards of the story state and/or the engine state and work to do.\r\n- Features very specific or harder to do, not changing the current gameplay.","creator":{"login":"Bertram25","id":765917,"avatar_url":"https://avatars.githubusercontent.com/u/765917?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertram25","html_url":"https://github.com/Bertram25","followers_url":"https://api.github.com/users/Bertram25/followers","following_url":"https://api.github.com/users/Bertram25/following{/other_user}","gists_url":"https://api.github.com/users/Bertram25/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertram25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertram25/subscriptions","organizations_url":"https://api.github.com/users/Bertram25/orgs","repos_url":"https://api.github.com/users/Bertram25/repos","events_url":"https://api.github.com/users/Bertram25/events{/privacy}","received_events_url":"https://api.github.com/users/Bertram25/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":5,"state":"open","created_at":"2012-08-29T08:05:27Z","updated_at":"2015-02-10T15:38:46Z","due_on":null,"closed_at":null},"comments":10,"created_at":"2015-02-10T15:38:46Z","updated_at":"2015-02-23T16:38:17Z","closed_at":null,"body":"@authenticate I must say it is more a question than a feature desired in game, but since you have the technical background about this, I thought I would just ask out. ;)\r\n\r\nAt the moment, the map layers are drawn tiles per tiles for each layers. I've nothing about it but since we're drawing them in a magnified way, the tile grid is unfortunately visible even on tile with the same color, due to the way OpenGL magnify textures.\r\n\r\n![vt-diff-tileset](https://cloud.githubusercontent.com/assets/765917/6151587/26781362-b217-11e4-9a3e-fa5106b45d51.png)\r\n\r\nTo fix this, I wondered whether we could draw the map layers to temporary texture at their actual size, thus avoiding to magnify them and then magnify the whole layer when drawing it.\r\nThis could also permit us to render tiles per tiles only once and then render part of the whole layer depending on the map offset.\r\n\r\nThis would also later permit us to add random zoom support.\r\n\r\nWhat do you think of the idea? Does this sound a sane way to do it using OpenGL?"},"comment":{"url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/comments/75578608","html_url":"https://github.com/Bertram25/ValyriaTear/issues/435#issuecomment-75578608","issue_url":"https://api.github.com/repos/Bertram25/ValyriaTear/issues/435","id":75578608,"user":{"login":"Bertram25","id":765917,"avatar_url":"https://avatars.githubusercontent.com/u/765917?v=3","gravatar_id":"","url":"https://api.github.com/users/Bertram25","html_url":"https://github.com/Bertram25","followers_url":"https://api.github.com/users/Bertram25/followers","following_url":"https://api.github.com/users/Bertram25/following{/other_user}","gists_url":"https://api.github.com/users/Bertram25/gists{/gist_id}","starred_url":"https://api.github.com/users/Bertram25/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bertram25/subscriptions","organizations_url":"https://api.github.com/users/Bertram25/orgs","repos_url":"https://api.github.com/users/Bertram25/repos","events_url":"https://api.github.com/users/Bertram25/events{/privacy}","received_events_url":"https://api.github.com/users/Bertram25/received_events","type":"User","site_admin":false},"created_at":"2015-02-23T16:38:17Z","updated_at":"2015-02-23T16:38:17Z","body":"@authenticate \r\n> Your solution now makes a lot of sense to me. Linear filtering struggles on boundaries since it does not have accurate data to interpolate from the other side of the boundary. By compositing the image first at the original size and then scaling it, you eliminate the boundaries.\r\nAs an additional approach, you could implement what you described using multiple render targets.\r\nWe could allocate a secondary texture which is also a render target. For simplicity, it could be the same dimensions as the original render target which gets displayed on the screen.\r\n\r\nI'm now at the point where I've cleaned up what I first wanted to cleanup in the new_map_code branch.\r\nBefore moving further, I'd like to add support so that both ground and sky map layers are rendered unscaled on a texture, and then simply drawn scaled using the map zoom ratio on screen.\r\nSee the new DrawLayer() function here: https://github.com/Bertram25/ValyriaTear/blob/new_map_code/src/modes/map/map_tiles.cpp#L326\r\nI would tweak this function to draw the tiles unscaled to the texture.\r\n\r\nNow, what is the best way to do that with the gl API at our disposal? Should I copy pixels on an array and load that array on an existing texture, or is there a better tweak, since tiles are normally already loaded in memory when being rendered?\r\n\r\nBest regards,"}}