{"action":"closed","number":247,"pull_request":{"url":"https://api.github.com/repos/tangrams/tangram/pulls/247","id":59573132,"html_url":"https://github.com/tangrams/tangram/pull/247","diff_url":"https://github.com/tangrams/tangram/pull/247.diff","patch_url":"https://github.com/tangrams/tangram/pull/247.patch","issue_url":"https://api.github.com/repos/tangrams/tangram/issues/247","number":247,"state":"closed","locked":false,"title":"Raster tile support","user":{"login":"bcamper","id":16733,"avatar_url":"https://avatars.githubusercontent.com/u/16733?v=3","gravatar_id":"","url":"https://api.github.com/users/bcamper","html_url":"https://github.com/bcamper","followers_url":"https://api.github.com/users/bcamper/followers","following_url":"https://api.github.com/users/bcamper/following{/other_user}","gists_url":"https://api.github.com/users/bcamper/gists{/gist_id}","starred_url":"https://api.github.com/users/bcamper/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bcamper/subscriptions","organizations_url":"https://api.github.com/users/bcamper/orgs","repos_url":"https://api.github.com/users/bcamper/repos","events_url":"https://api.github.com/users/bcamper/events{/privacy}","received_events_url":"https://api.github.com/users/bcamper/received_events","type":"User","site_admin":false},"body":"Adds support for raster tile rendering, with addition of new data source and built-in styles:\r\n\r\n- `Raster` data source type\r\n  - Requires a `url` tile template, in the same manner as other tiled sources.\r\n  - Optionally allows the GL texture `filtering` mode to be set, with the same allowed values (`mipmap`, `linear`, `nearest`) as for other texture definitions in the scene file. Default is `mipmap` for power-of-2 images, and `linear` for non-power-of-2 images (raster tiles are generally power-of-2, though other sizes would be scaled to fit the tile square). Setting `filtering: nearest` allows for the raster tiles to be pixelated when scaled past their `max_zoom`.\r\n  - Optionally defines a `max_zoom` beyond which tiles are over-zoomed. As with other data sources, defaults to `18`.\r\n  - Implementation-wise, the raster source simply synthesizes a single quad geometry covering the entire tile area, and accompanying texture UVs from [0, 1].\r\n  - Example:\r\n   ```\r\n   sources:\r\n       stamen-terrain:\r\n           type: Raster\r\n           url: http://a.tile.stamen.com/terrain-background/{z}/{x}/{y}.jpg\r\n   ```\r\n- `raster` built-in rendering style\r\n  - Raster data sources must be added to a `layer` and `draw` group before they are rendered. This is done with the `raster` style.\r\n  - `order` determines the layer order as with other styles.\r\n  - `color` defaults to white and any other value set by the draw group will *tint* the raster texture. For example, setting `color: [0.5, 0.5, 0.5]` will darken the underlying tiles by 50%.\r\n  - Implementation-wise, the raster style is simply a textured polygon, that automatically samples from the provided raster source for that tile.\r\n  - Example:\r\n   ```\r\n   layers:\r\n       terrain:\r\n           data: { source: stamen-terrain }\r\n           draw:\r\n               raster:\r\n                   order: 0 # draw on bottom\r\n                   color: [0.5, 0.5, 0.5] # darken by 50%\r\n   ```\r\n![tangram-tue feb 16 2016 18-28-13 gmt-0500 est](https://cloud.githubusercontent.com/assets/16733/13094787/1d522a10-d4db-11e5-8daa-ae53704dceb1.png)\r\n- Custom raster styles can be defined in `styles` with `base: raster`.\r\n  - The `raster` style is derived from the `polygons` rendering style, and provides the same shader blocks. \r\n  - Raster-specific uniforms are defined for:\r\n    - `u_raster_texture`: texture sampler (`sampler2D`) for that tile's texture\r\n    - `u_raster_texture_size`: `vec2` of width/height pixel dimensions of the raster texture\r\n    - `u_raster_texture_pixel_size`: `vec2` of UV size of a single pixel in the raster texture, e.g. inverse of width/height or 1/256 for a 256x256 image, for sampling nearby pixels\r\n  - Example style that converts raster tiles to greyscale:\r\n   ```\r\n    greyscale:\r\n        base: raster\r\n        shaders:\r\n            blocks:\r\n                filter: |\r\n                    float luma = dot(color.rgb, vec3(0.299, 0.587, 0.114));\r\n                    color.rgb = vec3(luma);\r\n   ```\r\n![tangram-tue feb 16 2016 18-27-50 gmt-0500 est](https://cloud.githubusercontent.com/assets/16733/13094788/20029b0a-d4db-11e5-8145-1b60675bc7a8.png)\r\n  - That example could itself be extended to apply a colorize effect, in this case yellow:\r\n   ```\r\n    colorize:\r\n        mix: greyscale\r\n        shaders:\r\n            uniforms:\r\n                colorize: [0.9, 0.9, 0.2] # yellow\r\n            blocks:\r\n                filter: |\r\n                    color.rgb *= colorize;\r\n   ```\r\n![tangram-tue feb 16 2016 18-28-00 gmt-0500 est](https://cloud.githubusercontent.com/assets/16733/13094805/2d487726-d4db-11e5-91ae-d2f4af2f4d4c.png)","created_at":"2016-02-16T23:35:00Z","updated_at":"2016-03-31T02:11:20Z","closed_at":"2016-03-31T02:11:20Z","merged_at":null,"merge_commit_sha":"01f80217069d6e29a22fcfc7f87937e7b60dea76","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tangrams/tangram/pulls/247/commits","review_comments_url":"https://api.github.com/repos/tangrams/tangram/pulls/247/comments","review_comment_url":"https://api.github.com/repos/tangrams/tangram/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tangrams/tangram/issues/247/comments","statuses_url":"https://api.github.com/repos/tangrams/tangram/statuses/59eebe98760b07a76f94da2605940e057da72dc1","head":{"label":"tangrams:raster-source","ref":"raster-source","sha":"59eebe98760b07a76f94da2605940e057da72dc1","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":13203894,"name":"tangram","full_name":"tangrams/tangram","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram","description":"Real-Time WebGL Maps","fork":false,"url":"https://api.github.com/repos/tangrams/tangram","forks_url":"https://api.github.com/repos/tangrams/tangram/forks","keys_url":"https://api.github.com/repos/tangrams/tangram/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram/events","assignees_url":"https://api.github.com/repos/tangrams/tangram/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram/merges","archive_url":"https://api.github.com/repos/tangrams/tangram/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram/deployments","created_at":"2013-09-30T01:59:45Z","updated_at":"2016-03-30T06:39:30Z","pushed_at":"2016-03-31T02:10:31Z","git_url":"git://github.com/tangrams/tangram.git","ssh_url":"git@github.com:tangrams/tangram.git","clone_url":"https://github.com/tangrams/tangram.git","svn_url":"https://github.com/tangrams/tangram","homepage":"http://tangrams.github.io/tangram","size":116531,"stargazers_count":646,"watchers_count":646,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":87,"mirror_url":null,"open_issues_count":20,"forks":87,"open_issues":20,"watchers":646,"default_branch":"master"}},"base":{"label":"tangrams:master","ref":"master","sha":"c1e115947dc78b2be2da44ec5c7d3934ffd112fb","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":13203894,"name":"tangram","full_name":"tangrams/tangram","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram","description":"Real-Time WebGL Maps","fork":false,"url":"https://api.github.com/repos/tangrams/tangram","forks_url":"https://api.github.com/repos/tangrams/tangram/forks","keys_url":"https://api.github.com/repos/tangrams/tangram/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram/events","assignees_url":"https://api.github.com/repos/tangrams/tangram/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram/merges","archive_url":"https://api.github.com/repos/tangrams/tangram/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram/deployments","created_at":"2013-09-30T01:59:45Z","updated_at":"2016-03-30T06:39:30Z","pushed_at":"2016-03-31T02:10:31Z","git_url":"git://github.com/tangrams/tangram.git","ssh_url":"git@github.com:tangrams/tangram.git","clone_url":"https://github.com/tangrams/tangram.git","svn_url":"https://github.com/tangrams/tangram","homepage":"http://tangrams.github.io/tangram","size":116531,"stargazers_count":646,"watchers_count":646,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":87,"mirror_url":null,"open_issues_count":20,"forks":87,"open_issues":20,"watchers":646,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tangrams/tangram/pulls/247"},"html":{"href":"https://github.com/tangrams/tangram/pull/247"},"issue":{"href":"https://api.github.com/repos/tangrams/tangram/issues/247"},"comments":{"href":"https://api.github.com/repos/tangrams/tangram/issues/247/comments"},"review_comments":{"href":"https://api.github.com/repos/tangrams/tangram/pulls/247/comments"},"review_comment":{"href":"https://api.github.com/repos/tangrams/tangram/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tangrams/tangram/pulls/247/commits"},"statuses":{"href":"https://api.github.com/repos/tangrams/tangram/statuses/59eebe98760b07a76f94da2605940e057da72dc1"}},"merged":false,"mergeable":false,"mergeable_state":"dirty","merged_by":null,"comments":5,"review_comments":0,"commits":12,"additions":221,"deletions":15,"changed_files":10}}