{"action":"created","issue":{"url":"https://api.github.com/repos/tangrams/tangram/issues/449","repository_url":"https://api.github.com/repos/tangrams/tangram","labels_url":"https://api.github.com/repos/tangrams/tangram/issues/449/labels{/name}","comments_url":"https://api.github.com/repos/tangrams/tangram/issues/449/comments","events_url":"https://api.github.com/repos/tangrams/tangram/issues/449/events","html_url":"https://github.com/tangrams/tangram/issues/449","id":189191140,"number":449,"title":"Global variables assigned to shader uniforms are parsed as relative URLs.","user":{"login":"louh","id":2553268,"avatar_url":"https://avatars.githubusercontent.com/u/2553268?v=3","gravatar_id":"","url":"https://api.github.com/users/louh","html_url":"https://github.com/louh","followers_url":"https://api.github.com/users/louh/followers","following_url":"https://api.github.com/users/louh/following{/other_user}","gists_url":"https://api.github.com/users/louh/gists{/gist_id}","starred_url":"https://api.github.com/users/louh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/louh/subscriptions","organizations_url":"https://api.github.com/users/louh/orgs","repos_url":"https://api.github.com/users/louh/repos","events_url":"https://api.github.com/users/louh/events{/privacy}","received_events_url":"https://api.github.com/users/louh/received_events","type":"User","site_admin":false},"labels":[{"id":58660672,"url":"https://api.github.com/repos/tangrams/tangram/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/tangrams/tangram/milestones/21","html_url":"https://github.com/tangrams/tangram/milestones/v0.11.1","labels_url":"https://api.github.com/repos/tangrams/tangram/milestones/21/labels","id":2133886,"number":21,"title":"v0.11.1","description":null,"creator":{"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},"open_issues":1,"closed_issues":7,"state":"open","created_at":"2016-11-14T15:07:05Z","updated_at":"2016-12-05T22:13:52Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-11-14T18:41:25Z","updated_at":"2016-12-05T22:13:52Z","closed_at":"2016-12-05T22:13:52Z","body":"**TO REPRODUCE THE ISSUE, FOLLOW THESE STEPS:**\r\n\r\nHere is a minimal test case:\r\n\r\n```yaml\r\nimport:\r\n    - https://tangrams.github.io/blocks/functions/zoom-full.yaml\r\n\r\nsources:\r\n    mapzen:\r\n        type: TopoJSON\r\n        url: https://tile.mapzen.com/mapzen/vector/v1/all/{z}/{x}/{y}.topojson\r\n\r\nglobal:\r\n    a: [1, 0, 0]\r\n    b: [0, 0, 1]\r\n\r\nlayers: \r\n    earth:\r\n        data: { source: mapzen }\r\n        draw:\r\n            polygons:\r\n                order: 0\r\n                color: grey\r\n    water:\r\n        data: { source: mapzen }\r\n        draw:\r\n            water:\r\n                order: 1\r\n                color: lightblue\r\n\r\nstyles:\r\n    water:\r\n        base: polygons\r\n        mix: [functions-zoom]\r\n        shaders:\r\n            defines:\r\n                ZOOM_START: 1\r\n                ZOOM_END: 20\r\n            uniforms:\r\n                u_a: global.a\r\n                u_b: global.b\r\n            blocks:\r\n                color: |\r\n                    color.rgb = mix(u_a, u_b,zoom());\r\n```\r\n\r\nView in Tangram Play: https://mapzen.com/tangram/play/?scene=https%3A%2F%2Fmapzen.com%2Fapi%2Fscenes%2F7%2F48%2Fresources%2Fscene.yaml#5.022/43.291/-65.717\r\n\r\nI am defining colors as `global` variables and then assigning them as uniforms in the shader block at the bottom of the YAML. We expected these values to be passed along to the uniform values. We see instead that Tangram has parsed the references to `global.a` as relative URLs. When we examine the compiled `scene.config` object, we see that `scene.config.styles.water.shaders.uniforms.u_a` now equals `\"https://gist.githubusercontent.com/anonymous/804452ab17846fa83732e535d73b7d87/raw/555c9626c3893ea634a7590eaa4e9813df184a95/global.a\"` (and similar thing occurs for `u_b`).\r\n\r\nTangram's error in the console is this: \r\n\r\n```\r\nTangram v0.11.0 [error]: ERROR: 0:758: 'mix' : no matching overloaded function found \r\nERROR: 0:758: 'assign' :  cannot convert from 'const float' to 'highp 3-component vector of float'\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/tangrams/tangram/issues/comments/264994912","html_url":"https://github.com/tangrams/tangram/issues/449#issuecomment-264994912","issue_url":"https://api.github.com/repos/tangrams/tangram/issues/449","id":264994912,"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},"created_at":"2016-12-05T22:13:52Z","updated_at":"2016-12-05T22:13:52Z","body":"Released in v0.11.1."}}
{"actor":{"display_login":"bcamper"}}