{"action":"created","comment":{"url":"https://api.github.com/repos/aframevr/aframe/pulls/comments/68826799","id":68826799,"diff_hunk":"@@ -0,0 +1,196 @@\n+/* global AFRAME THREE */\n+\n+AFRAME.registerComponent('post-process', {\n+  schema: {type: 'boolean'},\n+\n+  update: function (oldData) {\n+    this.el.sceneEl.enablePostProcessing = this.data;\n+  },\n+\n+  // Cleanup the scene objects opacities.\n+  remove: function () {\n+    this.el.sceneEl.object3D.traverse(function (obj) {\n+      var mat = obj.material;\n+      if (mat && mat.postOpacity !== undefined) {\n+        mat.opacity = 1;\n+      }\n+    });\n+    this.el.sceneEl.enablePostProcessing = false;\n+  }\n+});\n+\n+// The compositor. Blends the blurred renderTarget from the bloom component.\n+// It also checks opacity and converts parts of the frame to ascii(Alpha masking).\n+AFRAME.registerSystem('post-process', {\n+  init: function () {\n+    var self = this;\n+    this.setupPostState();\n+    this.postModified();\n+    this.sceneEl.addEventListener('renderstart', function () {\n+      self.sceneEl.renderTarget.depthTexture = new THREE.DepthTexture();\n+      self.sceneEl.renderTarget.stencilBuffer = false;\n+    });\n+    this.evh = this.postModified.bind(this);\n+    this.sceneEl.addEventListener('post-modified', this.evh);\n+  },\n+\n+  setupPostState: function () {\n+    this.scenePost = new THREE.Scene();\n+    this.cameraPost = new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1);\n+    this.quadPost = new THREE.Mesh(new THREE.PlaneBufferGeometry(2, 2), null);\n+    this.scenePost.add(this.quadPost);\n+  },\n+\n+  postModified: function (ev) {\n+    this.needsConfig = true;\n+  },\n+\n+  // Whenever the postproc setup changes, the compositor shader is recompiled\n+  config: function () {\n+    var scene = this.sceneEl;\n+    var behaviors = scene.behaviors.tock;\n+    var bloom = behaviors.length ? behaviors[0] : null;\n+    console.log('POST-MODIFIED', behaviors);","path":"examples/test/post-processing/components/compositor.js","position":53,"original_position":53,"commit_id":"5de28ab7c8fbc633da398843ba0abd379bc1ba10","original_commit_id":"f2bdcace8f6f8103f34da729fc0c6dc0e470eb18","user":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars.githubusercontent.com/u/674727?v=3","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"body":"Could probably take it out to be more tidy. Anyone is free to add console logs if they're writing their own effects.","created_at":"2016-06-28T19:33:38Z","updated_at":"2016-06-28T19:33:38Z","html_url":"https://github.com/aframevr/aframe/pull/1564#discussion_r68826799","pull_request_url":"https://api.github.com/repos/aframevr/aframe/pulls/1564","_links":{"self":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/comments/68826799"},"html":{"href":"https://github.com/aframevr/aframe/pull/1564#discussion_r68826799"},"pull_request":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/1564"}}},"pull_request":{"url":"https://api.github.com/repos/aframevr/aframe/pulls/1564","id":74337141,"html_url":"https://github.com/aframevr/aframe/pull/1564","diff_url":"https://github.com/aframevr/aframe/pull/1564.diff","patch_url":"https://github.com/aframevr/aframe/pull/1564.patch","issue_url":"https://api.github.com/repos/aframevr/aframe/issues/1564","number":1564,"state":"open","locked":false,"title":"Component tock() method for post processing support.","user":{"login":"wizgrav","id":499393,"avatar_url":"https://avatars.githubusercontent.com/u/499393?v=3","gravatar_id":"","url":"https://api.github.com/users/wizgrav","html_url":"https://github.com/wizgrav","followers_url":"https://api.github.com/users/wizgrav/followers","following_url":"https://api.github.com/users/wizgrav/following{/other_user}","gists_url":"https://api.github.com/users/wizgrav/gists{/gist_id}","starred_url":"https://api.github.com/users/wizgrav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wizgrav/subscriptions","organizations_url":"https://api.github.com/users/wizgrav/orgs","repos_url":"https://api.github.com/users/wizgrav/repos","events_url":"https://api.github.com/users/wizgrav/events{/privacy}","received_events_url":"https://api.github.com/users/wizgrav/received_events","type":"User","site_admin":false},"body":"**Description:**\r\n\r\nEnables post processing in aframe.\r\n\r\n**Changes proposed:**\r\n\r\nExtends a-scene element with a .renderTarget to enable the rendering of the scene in a texture.\r\nAdds a tock() method on components where post processing operations can be implemented.\r\nAlso adds a tock() on systems to implement a final compositor system that outputs to screen.\r\nAn example showcasing the functionality is included.\r\n\r\nhttp://wizgrav.github.io/aframe/examples/test/post-processing/\r\nhttp://wizgrav.github.io/aframe/examples/test/post-processing-grain/","created_at":"2016-06-18T13:29:12Z","updated_at":"2016-06-28T19:33:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e330f573fe8e7d4e101d633b78aec70a692df8c7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/aframevr/aframe/pulls/1564/commits","review_comments_url":"https://api.github.com/repos/aframevr/aframe/pulls/1564/comments","review_comment_url":"https://api.github.com/repos/aframevr/aframe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aframevr/aframe/issues/1564/comments","statuses_url":"https://api.github.com/repos/aframevr/aframe/statuses/5de28ab7c8fbc633da398843ba0abd379bc1ba10","head":{"label":"wizgrav:tock","ref":"tock","sha":"5de28ab7c8fbc633da398843ba0abd379bc1ba10","user":{"login":"wizgrav","id":499393,"avatar_url":"https://avatars.githubusercontent.com/u/499393?v=3","gravatar_id":"","url":"https://api.github.com/users/wizgrav","html_url":"https://github.com/wizgrav","followers_url":"https://api.github.com/users/wizgrav/followers","following_url":"https://api.github.com/users/wizgrav/following{/other_user}","gists_url":"https://api.github.com/users/wizgrav/gists{/gist_id}","starred_url":"https://api.github.com/users/wizgrav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wizgrav/subscriptions","organizations_url":"https://api.github.com/users/wizgrav/orgs","repos_url":"https://api.github.com/users/wizgrav/repos","events_url":"https://api.github.com/users/wizgrav/events{/privacy}","received_events_url":"https://api.github.com/users/wizgrav/received_events","type":"User","site_admin":false},"repo":{"id":58052047,"name":"aframe","full_name":"wizgrav/aframe","owner":{"login":"wizgrav","id":499393,"avatar_url":"https://avatars.githubusercontent.com/u/499393?v=3","gravatar_id":"","url":"https://api.github.com/users/wizgrav","html_url":"https://github.com/wizgrav","followers_url":"https://api.github.com/users/wizgrav/followers","following_url":"https://api.github.com/users/wizgrav/following{/other_user}","gists_url":"https://api.github.com/users/wizgrav/gists{/gist_id}","starred_url":"https://api.github.com/users/wizgrav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wizgrav/subscriptions","organizations_url":"https://api.github.com/users/wizgrav/orgs","repos_url":"https://api.github.com/users/wizgrav/repos","events_url":"https://api.github.com/users/wizgrav/events{/privacy}","received_events_url":"https://api.github.com/users/wizgrav/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/wizgrav/aframe","description":"Building Blocks for the VR Web","fork":true,"url":"https://api.github.com/repos/wizgrav/aframe","forks_url":"https://api.github.com/repos/wizgrav/aframe/forks","keys_url":"https://api.github.com/repos/wizgrav/aframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wizgrav/aframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wizgrav/aframe/teams","hooks_url":"https://api.github.com/repos/wizgrav/aframe/hooks","issue_events_url":"https://api.github.com/repos/wizgrav/aframe/issues/events{/number}","events_url":"https://api.github.com/repos/wizgrav/aframe/events","assignees_url":"https://api.github.com/repos/wizgrav/aframe/assignees{/user}","branches_url":"https://api.github.com/repos/wizgrav/aframe/branches{/branch}","tags_url":"https://api.github.com/repos/wizgrav/aframe/tags","blobs_url":"https://api.github.com/repos/wizgrav/aframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wizgrav/aframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wizgrav/aframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/wizgrav/aframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wizgrav/aframe/statuses/{sha}","languages_url":"https://api.github.com/repos/wizgrav/aframe/languages","stargazers_url":"https://api.github.com/repos/wizgrav/aframe/stargazers","contributors_url":"https://api.github.com/repos/wizgrav/aframe/contributors","subscribers_url":"https://api.github.com/repos/wizgrav/aframe/subscribers","subscription_url":"https://api.github.com/repos/wizgrav/aframe/subscription","commits_url":"https://api.github.com/repos/wizgrav/aframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/wizgrav/aframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/wizgrav/aframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/wizgrav/aframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/wizgrav/aframe/contents/{+path}","compare_url":"https://api.github.com/repos/wizgrav/aframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wizgrav/aframe/merges","archive_url":"https://api.github.com/repos/wizgrav/aframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wizgrav/aframe/downloads","issues_url":"https://api.github.com/repos/wizgrav/aframe/issues{/number}","pulls_url":"https://api.github.com/repos/wizgrav/aframe/pulls{/number}","milestones_url":"https://api.github.com/repos/wizgrav/aframe/milestones{/number}","notifications_url":"https://api.github.com/repos/wizgrav/aframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wizgrav/aframe/labels{/name}","releases_url":"https://api.github.com/repos/wizgrav/aframe/releases{/id}","deployments_url":"https://api.github.com/repos/wizgrav/aframe/deployments","created_at":"2016-05-04T12:56:29Z","updated_at":"2016-05-04T12:56:31Z","pushed_at":"2016-06-24T10:02:18Z","git_url":"git://github.com/wizgrav/aframe.git","ssh_url":"git@github.com:wizgrav/aframe.git","clone_url":"https://github.com/wizgrav/aframe.git","svn_url":"https://github.com/wizgrav/aframe","homepage":"https://aframe.io/","size":119481,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"aframevr:master","ref":"master","sha":"0c27033d7193e9e030ec7e7dc94d4d62b1eb2227","user":{"login":"aframevr","id":16024092,"avatar_url":"https://avatars.githubusercontent.com/u/16024092?v=3","gravatar_id":"","url":"https://api.github.com/users/aframevr","html_url":"https://github.com/aframevr","followers_url":"https://api.github.com/users/aframevr/followers","following_url":"https://api.github.com/users/aframevr/following{/other_user}","gists_url":"https://api.github.com/users/aframevr/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr/subscriptions","organizations_url":"https://api.github.com/users/aframevr/orgs","repos_url":"https://api.github.com/users/aframevr/repos","events_url":"https://api.github.com/users/aframevr/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr/received_events","type":"Organization","site_admin":false},"repo":{"id":42488903,"name":"aframe","full_name":"aframevr/aframe","owner":{"login":"aframevr","id":16024092,"avatar_url":"https://avatars.githubusercontent.com/u/16024092?v=3","gravatar_id":"","url":"https://api.github.com/users/aframevr","html_url":"https://github.com/aframevr","followers_url":"https://api.github.com/users/aframevr/followers","following_url":"https://api.github.com/users/aframevr/following{/other_user}","gists_url":"https://api.github.com/users/aframevr/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr/subscriptions","organizations_url":"https://api.github.com/users/aframevr/orgs","repos_url":"https://api.github.com/users/aframevr/repos","events_url":"https://api.github.com/users/aframevr/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aframevr/aframe","description":"Building Blocks for the VR Web","fork":false,"url":"https://api.github.com/repos/aframevr/aframe","forks_url":"https://api.github.com/repos/aframevr/aframe/forks","keys_url":"https://api.github.com/repos/aframevr/aframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aframevr/aframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aframevr/aframe/teams","hooks_url":"https://api.github.com/repos/aframevr/aframe/hooks","issue_events_url":"https://api.github.com/repos/aframevr/aframe/issues/events{/number}","events_url":"https://api.github.com/repos/aframevr/aframe/events","assignees_url":"https://api.github.com/repos/aframevr/aframe/assignees{/user}","branches_url":"https://api.github.com/repos/aframevr/aframe/branches{/branch}","tags_url":"https://api.github.com/repos/aframevr/aframe/tags","blobs_url":"https://api.github.com/repos/aframevr/aframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aframevr/aframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aframevr/aframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/aframevr/aframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aframevr/aframe/statuses/{sha}","languages_url":"https://api.github.com/repos/aframevr/aframe/languages","stargazers_url":"https://api.github.com/repos/aframevr/aframe/stargazers","contributors_url":"https://api.github.com/repos/aframevr/aframe/contributors","subscribers_url":"https://api.github.com/repos/aframevr/aframe/subscribers","subscription_url":"https://api.github.com/repos/aframevr/aframe/subscription","commits_url":"https://api.github.com/repos/aframevr/aframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/aframevr/aframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/aframevr/aframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/aframevr/aframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/aframevr/aframe/contents/{+path}","compare_url":"https://api.github.com/repos/aframevr/aframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aframevr/aframe/merges","archive_url":"https://api.github.com/repos/aframevr/aframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aframevr/aframe/downloads","issues_url":"https://api.github.com/repos/aframevr/aframe/issues{/number}","pulls_url":"https://api.github.com/repos/aframevr/aframe/pulls{/number}","milestones_url":"https://api.github.com/repos/aframevr/aframe/milestones{/number}","notifications_url":"https://api.github.com/repos/aframevr/aframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aframevr/aframe/labels{/name}","releases_url":"https://api.github.com/repos/aframevr/aframe/releases{/id}","deployments_url":"https://api.github.com/repos/aframevr/aframe/deployments","created_at":"2015-09-15T02:04:40Z","updated_at":"2016-06-28T18:51:07Z","pushed_at":"2016-06-28T19:30:34Z","git_url":"git://github.com/aframevr/aframe.git","ssh_url":"git@github.com:aframevr/aframe.git","clone_url":"https://github.com/aframevr/aframe.git","svn_url":"https://github.com/aframevr/aframe","homepage":"https://aframe.io/","size":155615,"stargazers_count":2266,"watchers_count":2266,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":385,"mirror_url":null,"open_issues_count":231,"forks":385,"open_issues":231,"watchers":2266,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/1564"},"html":{"href":"https://github.com/aframevr/aframe/pull/1564"},"issue":{"href":"https://api.github.com/repos/aframevr/aframe/issues/1564"},"comments":{"href":"https://api.github.com/repos/aframevr/aframe/issues/1564/comments"},"review_comments":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/1564/comments"},"review_comment":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/1564/commits"},"statuses":{"href":"https://api.github.com/repos/aframevr/aframe/statuses/5de28ab7c8fbc633da398843ba0abd379bc1ba10"}}}}
{"actor":{"display_login":"ngokevin"}}