{"action":"created","comment":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/37140874","id":37140874,"diff_hunk":"@@ -30,25 +30,40 @@ uniform float g_scale;\n uniform float g_bias;\n uniform float g_sample_rad;\n uniform float g_intensity;\n-uniform float bufferWidth;\n-uniform float bufferHeight;\n \n-const float PI = 3.14159265;\n+// the distance to the near clip plane\n+uniform float near;\n+\n+// scale factor for depth: (far - near) / far\n+uniform float depthScale;\n+\n+// offset for depth texture coordinates\n+uniform vec2 depthTexCoordOffset;\n \n-const vec2 FocalLen = vec2(1.0, 1.0);\n+// scale for depth texture coordinates\n+uniform vec2 depthTexCoordScale;\n \n-const vec2 LinMAD = vec2(0.1-10.0, 0.1+10.0) / (2.0*0.1*10.0);\n+// the resolution of the occlusion buffer\n+// and its inverse\n+uniform vec2 renderTargetRes;\n+uniform vec2 renderTargetResInv;\n \n-const vec2 AORes = vec2(1024.0, 768.0);\n-const vec2 InvAORes = vec2(1.0/1024.0, 1.0/768.0);\n-const vec2 NoiseScale = vec2(1024.0, 768.0) / 4.0;\n+\n+\n+const float PI = 3.14159265;\n \n const float AOStrength = 1.9;\n-const float R = 0.3;\n-const float R2 = 0.3*0.3;\n-const float NegInvR2 = - 1.0 / (0.3*0.3);\n+\n+\n+// TODO: R (radius) should be exposed as a uniform parameter\n+const float R = 0.01;\n+const float R2 = 0.01*0.01;\n+const float NegInvR2 = - 1.0 / (0.01*0.01);","path":"libraries/render-utils/src/ambient_occlusion.slf","position":43,"original_position":43,"commit_id":"21dc58eb85fcf795f98fa8e7be7d24ccc1274e10","original_commit_id":"21dc58eb85fcf795f98fa8e7be7d24ccc1274e10","user":{"login":"ZappoMan","id":2093195,"avatar_url":"https://avatars.githubusercontent.com/u/2093195?v=3","gravatar_id":"","url":"https://api.github.com/users/ZappoMan","html_url":"https://github.com/ZappoMan","followers_url":"https://api.github.com/users/ZappoMan/followers","following_url":"https://api.github.com/users/ZappoMan/following{/other_user}","gists_url":"https://api.github.com/users/ZappoMan/gists{/gist_id}","starred_url":"https://api.github.com/users/ZappoMan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZappoMan/subscriptions","organizations_url":"https://api.github.com/users/ZappoMan/orgs","repos_url":"https://api.github.com/users/ZappoMan/repos","events_url":"https://api.github.com/users/ZappoMan/events{/privacy}","received_events_url":"https://api.github.com/users/ZappoMan/received_events","type":"User","site_admin":false},"body":"coding standard: 4.2.1. Conventional operators should be surrounded by a space character\r\n\r\nhttps://docs.highfidelity.com/docs/coding-standard#section-4-2-1-conventional-operators-should-be-surrounded-by-a-space-character-","created_at":"2015-08-16T00:53:09Z","updated_at":"2015-08-16T00:53:09Z","html_url":"https://github.com/highfidelity/hifi/pull/5577#discussion_r37140874","pull_request_url":"https://api.github.com/repos/highfidelity/hifi/pulls/5577","_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/37140874"},"html":{"href":"https://github.com/highfidelity/hifi/pull/5577#discussion_r37140874"},"pull_request":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/5577"}}},"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/5577","id":42526527,"html_url":"https://github.com/highfidelity/hifi/pull/5577","diff_url":"https://github.com/highfidelity/hifi/pull/5577.diff","patch_url":"https://github.com/highfidelity/hifi/pull/5577.patch","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/5577","number":5577,"state":"open","locked":false,"title":"Horiz amb occl performance updates","user":{"login":"vastcharade","id":5768541,"avatar_url":"https://avatars.githubusercontent.com/u/5768541?v=3","gravatar_id":"","url":"https://api.github.com/users/vastcharade","html_url":"https://github.com/vastcharade","followers_url":"https://api.github.com/users/vastcharade/followers","following_url":"https://api.github.com/users/vastcharade/following{/other_user}","gists_url":"https://api.github.com/users/vastcharade/gists{/gist_id}","starred_url":"https://api.github.com/users/vastcharade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vastcharade/subscriptions","organizations_url":"https://api.github.com/users/vastcharade/orgs","repos_url":"https://api.github.com/users/vastcharade/repos","events_url":"https://api.github.com/users/vastcharade/events{/privacy}","received_events_url":"https://api.github.com/users/vastcharade/received_events","type":"User","site_admin":false},"body":"Interview test project assigned by Brad Hefta-Gaub in an attempt to improve the performance of the horizon ambient occlusion algorithm. The changes have increased performance by 20fps on a macbook pro, but I'm not confident the algorithm is working properly. It works reasonably well for the default avatar scene, but other scenes have not been tested against.","created_at":"2015-08-15T21:59:03Z","updated_at":"2015-08-16T00:53:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31d94b870ba109b3eb3b6ba5d4e9d2d31c17dcef","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/highfidelity/hifi/pulls/5577/commits","review_comments_url":"https://api.github.com/repos/highfidelity/hifi/pulls/5577/comments","review_comment_url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/5577/comments","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/21dc58eb85fcf795f98fa8e7be7d24ccc1274e10","head":{"label":"vastcharade:horizAmbOcclPerf","ref":"horizAmbOcclPerf","sha":"21dc58eb85fcf795f98fa8e7be7d24ccc1274e10","user":{"login":"vastcharade","id":5768541,"avatar_url":"https://avatars.githubusercontent.com/u/5768541?v=3","gravatar_id":"","url":"https://api.github.com/users/vastcharade","html_url":"https://github.com/vastcharade","followers_url":"https://api.github.com/users/vastcharade/followers","following_url":"https://api.github.com/users/vastcharade/following{/other_user}","gists_url":"https://api.github.com/users/vastcharade/gists{/gist_id}","starred_url":"https://api.github.com/users/vastcharade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vastcharade/subscriptions","organizations_url":"https://api.github.com/users/vastcharade/orgs","repos_url":"https://api.github.com/users/vastcharade/repos","events_url":"https://api.github.com/users/vastcharade/events{/privacy}","received_events_url":"https://api.github.com/users/vastcharade/received_events","type":"User","site_admin":false},"repo":{"id":40502777,"name":"hifi","full_name":"vastcharade/hifi","owner":{"login":"vastcharade","id":5768541,"avatar_url":"https://avatars.githubusercontent.com/u/5768541?v=3","gravatar_id":"","url":"https://api.github.com/users/vastcharade","html_url":"https://github.com/vastcharade","followers_url":"https://api.github.com/users/vastcharade/followers","following_url":"https://api.github.com/users/vastcharade/following{/other_user}","gists_url":"https://api.github.com/users/vastcharade/gists{/gist_id}","starred_url":"https://api.github.com/users/vastcharade/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vastcharade/subscriptions","organizations_url":"https://api.github.com/users/vastcharade/orgs","repos_url":"https://api.github.com/users/vastcharade/repos","events_url":"https://api.github.com/users/vastcharade/events{/privacy}","received_events_url":"https://api.github.com/users/vastcharade/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vastcharade/hifi","description":"Open source software for shared virtual worlds using HMDs and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.com/jobs  Documentation at http://docs.highfidelity.com  Contribute by reporting bugs & doing jobs on http://worklist.net","fork":true,"url":"https://api.github.com/repos/vastcharade/hifi","forks_url":"https://api.github.com/repos/vastcharade/hifi/forks","keys_url":"https://api.github.com/repos/vastcharade/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vastcharade/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vastcharade/hifi/teams","hooks_url":"https://api.github.com/repos/vastcharade/hifi/hooks","issue_events_url":"https://api.github.com/repos/vastcharade/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/vastcharade/hifi/events","assignees_url":"https://api.github.com/repos/vastcharade/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/vastcharade/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/vastcharade/hifi/tags","blobs_url":"https://api.github.com/repos/vastcharade/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vastcharade/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vastcharade/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/vastcharade/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vastcharade/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/vastcharade/hifi/languages","stargazers_url":"https://api.github.com/repos/vastcharade/hifi/stargazers","contributors_url":"https://api.github.com/repos/vastcharade/hifi/contributors","subscribers_url":"https://api.github.com/repos/vastcharade/hifi/subscribers","subscription_url":"https://api.github.com/repos/vastcharade/hifi/subscription","commits_url":"https://api.github.com/repos/vastcharade/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/vastcharade/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/vastcharade/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/vastcharade/hifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/vastcharade/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/vastcharade/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vastcharade/hifi/merges","archive_url":"https://api.github.com/repos/vastcharade/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vastcharade/hifi/downloads","issues_url":"https://api.github.com/repos/vastcharade/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/vastcharade/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/vastcharade/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/vastcharade/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vastcharade/hifi/labels{/name}","releases_url":"https://api.github.com/repos/vastcharade/hifi/releases{/id}","created_at":"2015-08-10T19:49:57Z","updated_at":"2015-08-10T19:50:02Z","pushed_at":"2015-08-15T21:40:44Z","git_url":"git://github.com/vastcharade/hifi.git","ssh_url":"git@github.com:vastcharade/hifi.git","clone_url":"https://github.com/vastcharade/hifi.git","svn_url":"https://github.com/vastcharade/hifi","homepage":"","size":171324,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"highfidelity:master","ref":"master","sha":"53c5c75071d43ff606b855523d97ebd5c43bfae7","user":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"repo":{"id":5372872,"name":"hifi","full_name":"highfidelity/hifi","owner":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/highfidelity/hifi","description":"Open source software for shared virtual worlds using HMDs and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.com/jobs  Documentation at http://docs.highfidelity.com  Contribute by reporting bugs & doing jobs on http://worklist.net","fork":false,"url":"https://api.github.com/repos/highfidelity/hifi","forks_url":"https://api.github.com/repos/highfidelity/hifi/forks","keys_url":"https://api.github.com/repos/highfidelity/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/highfidelity/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/highfidelity/hifi/teams","hooks_url":"https://api.github.com/repos/highfidelity/hifi/hooks","issue_events_url":"https://api.github.com/repos/highfidelity/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/highfidelity/hifi/events","assignees_url":"https://api.github.com/repos/highfidelity/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/highfidelity/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/highfidelity/hifi/tags","blobs_url":"https://api.github.com/repos/highfidelity/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/highfidelity/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/highfidelity/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/highfidelity/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/highfidelity/hifi/languages","stargazers_url":"https://api.github.com/repos/highfidelity/hifi/stargazers","contributors_url":"https://api.github.com/repos/highfidelity/hifi/contributors","subscribers_url":"https://api.github.com/repos/highfidelity/hifi/subscribers","subscription_url":"https://api.github.com/repos/highfidelity/hifi/subscription","commits_url":"https://api.github.com/repos/highfidelity/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/highfidelity/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/highfidelity/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/highfidelity/hifi/issues/comments{/number}","contents_url":"https://api.github.com/repos/highfidelity/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/highfidelity/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/highfidelity/hifi/merges","archive_url":"https://api.github.com/repos/highfidelity/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/highfidelity/hifi/downloads","issues_url":"https://api.github.com/repos/highfidelity/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/highfidelity/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/highfidelity/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/highfidelity/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/highfidelity/hifi/labels{/name}","releases_url":"https://api.github.com/repos/highfidelity/hifi/releases{/id}","created_at":"2012-08-10T18:26:22Z","updated_at":"2015-08-15T13:57:47Z","pushed_at":"2015-08-15T23:53:51Z","git_url":"git://github.com/highfidelity/hifi.git","ssh_url":"git@github.com:highfidelity/hifi.git","clone_url":"https://github.com/highfidelity/hifi.git","svn_url":"https://github.com/highfidelity/hifi","homepage":"","size":228296,"stargazers_count":292,"watchers_count":292,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":169,"mirror_url":null,"open_issues_count":57,"forks":169,"open_issues":57,"watchers":292,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/5577"},"html":{"href":"https://github.com/highfidelity/hifi/pull/5577"},"issue":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/5577"},"comments":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/5577/comments"},"review_comments":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/5577/comments"},"review_comment":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/5577/commits"},"statuses":{"href":"https://api.github.com/repos/highfidelity/hifi/statuses/21dc58eb85fcf795f98fa8e7be7d24ccc1274e10"}}}}