{"action":"created","comment":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/42575589","id":42575589,"diff_hunk":"@@ -375,23 +378,22 @@ THREE.ShaderLib = {\n \t\t\t\tTHREE.ShaderChunk[ \"specularmap_fragment\" ],\n \t\t\t\tTHREE.ShaderChunk[ \"normal_phong_fragment\" ],\n \t\t\t\tTHREE.ShaderChunk[ \"lightmap_fragment\" ],\n-\t\t\t\tTHREE.ShaderChunk[ \"hemilight_fragment\" ],\n \t\t\t\tTHREE.ShaderChunk[ \"aomap_fragment\" ],\n \t\t\t\tTHREE.ShaderChunk[ \"emissivemap_fragment\" ],\n \n \t\t\t\tTHREE.ShaderChunk[ \"lights_phong_fragment\" ],\n \t\t\t\tTHREE.ShaderChunk[ \"shadowmap_fragment\" ],\n \n-\t\t\t\t\"totalDiffuseLight *= shadowMask;\",\n-\t\t\t\t\"totalSpecularLight *= shadowMask;\",\n+\t\t\t\t\"directReflectedLight.diffuse *= shadowMask;\",\n+\t\t\t\t\"directReflectedLight.specular *= shadowMask;\",\n \n \t\t\t\t\"#ifdef METAL\",\n \n-\t\t\t\t\"\toutgoingLight += diffuseColor.rgb * ( totalDiffuseLight + totalAmbientLight ) * specular + totalSpecularLight + totalEmissiveLight;\",\n+\t\t\t\t\"\toutgoingLight += diffuseColor.rgb * ( directReflectedLight.diffuse + indirectReflectedLight.diffuse + totalAmbientLight ) * specular + directReflectedLight.specular + indirectReflectedLight.specular + totalEmissiveLight;\",\n ","path":"src/renderers/shaders/ShaderLib.js","position":48,"original_position":48,"commit_id":"08fe98963762ed4feaf0309c1b06792cc90d8cfb","original_commit_id":"08fe98963762ed4feaf0309c1b06792cc90d8cfb","user":{"login":"WestLangley","id":1000017,"avatar_url":"https://avatars.githubusercontent.com/u/1000017?v=3","gravatar_id":"","url":"https://api.github.com/users/WestLangley","html_url":"https://github.com/WestLangley","followers_url":"https://api.github.com/users/WestLangley/followers","following_url":"https://api.github.com/users/WestLangley/following{/other_user}","gists_url":"https://api.github.com/users/WestLangley/gists{/gist_id}","starred_url":"https://api.github.com/users/WestLangley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WestLangley/subscriptions","organizations_url":"https://api.github.com/users/WestLangley/orgs","repos_url":"https://api.github.com/users/WestLangley/repos","events_url":"https://api.github.com/users/WestLangley/events{/privacy}","received_events_url":"https://api.github.com/users/WestLangley/received_events","type":"User","site_admin":false},"body":"You are double-counting the `diffuseColor` term for both Phong and Lambert.","created_at":"2015-10-21T01:41:04Z","updated_at":"2015-10-21T01:41:04Z","html_url":"https://github.com/mrdoob/three.js/pull/7324#discussion_r42575589","pull_request_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7324","_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/42575589"},"html":{"href":"https://github.com/mrdoob/three.js/pull/7324#discussion_r42575589"},"pull_request":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7324"}}},"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/7324","id":47309023,"html_url":"https://github.com/mrdoob/three.js/pull/7324","diff_url":"https://github.com/mrdoob/three.js/pull/7324.diff","patch_url":"https://github.com/mrdoob/three.js/pull/7324.patch","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/7324","number":7324,"state":"open","locked":false,"title":"attempt to simplify the phong shaders and lights.","user":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"body":"This is an attempt to clean up the lighting code.  I got this far -- and I think the results are beautiful:\r\n\r\nhttps://github.com/bhouston/three.js/blob/simplified_lighting/src/renderers/shaders/ShaderChunk/lights_phong_fragment.glsl","created_at":"2015-10-09T19:14:09Z","updated_at":"2015-10-21T01:41:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a04440b27f46332e348e6b77dd6e4cd9d4cb1f40","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7324/commits","review_comments_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7324/comments","review_comment_url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mrdoob/three.js/issues/7324/comments","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/08fe98963762ed4feaf0309c1b06792cc90d8cfb","head":{"label":"bhouston:simplified_lighting","ref":"simplified_lighting","sha":"08fe98963762ed4feaf0309c1b06792cc90d8cfb","user":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"repo":{"id":6941890,"name":"three.js","full_name":"bhouston/three.js","owner":{"login":"bhouston","id":588541,"avatar_url":"https://avatars.githubusercontent.com/u/588541?v=3","gravatar_id":"","url":"https://api.github.com/users/bhouston","html_url":"https://github.com/bhouston","followers_url":"https://api.github.com/users/bhouston/followers","following_url":"https://api.github.com/users/bhouston/following{/other_user}","gists_url":"https://api.github.com/users/bhouston/gists{/gist_id}","starred_url":"https://api.github.com/users/bhouston/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhouston/subscriptions","organizations_url":"https://api.github.com/users/bhouston/orgs","repos_url":"https://api.github.com/users/bhouston/repos","events_url":"https://api.github.com/users/bhouston/events{/privacy}","received_events_url":"https://api.github.com/users/bhouston/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bhouston/three.js","description":"JavaScript 3D library.","fork":true,"url":"https://api.github.com/repos/bhouston/three.js","forks_url":"https://api.github.com/repos/bhouston/three.js/forks","keys_url":"https://api.github.com/repos/bhouston/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bhouston/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bhouston/three.js/teams","hooks_url":"https://api.github.com/repos/bhouston/three.js/hooks","issue_events_url":"https://api.github.com/repos/bhouston/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/bhouston/three.js/events","assignees_url":"https://api.github.com/repos/bhouston/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/bhouston/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/bhouston/three.js/tags","blobs_url":"https://api.github.com/repos/bhouston/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bhouston/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bhouston/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/bhouston/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bhouston/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/bhouston/three.js/languages","stargazers_url":"https://api.github.com/repos/bhouston/three.js/stargazers","contributors_url":"https://api.github.com/repos/bhouston/three.js/contributors","subscribers_url":"https://api.github.com/repos/bhouston/three.js/subscribers","subscription_url":"https://api.github.com/repos/bhouston/three.js/subscription","commits_url":"https://api.github.com/repos/bhouston/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/bhouston/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/bhouston/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/bhouston/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/bhouston/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/bhouston/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bhouston/three.js/merges","archive_url":"https://api.github.com/repos/bhouston/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bhouston/three.js/downloads","issues_url":"https://api.github.com/repos/bhouston/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/bhouston/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/bhouston/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/bhouston/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bhouston/three.js/labels{/name}","releases_url":"https://api.github.com/repos/bhouston/three.js/releases{/id}","created_at":"2012-11-30T16:19:02Z","updated_at":"2014-01-07T03:12:34Z","pushed_at":"2015-10-20T18:42:05Z","git_url":"git://github.com/bhouston/three.js.git","ssh_url":"git@github.com:bhouston/three.js.git","clone_url":"https://github.com/bhouston/three.js.git","svn_url":"https://github.com/bhouston/three.js","homepage":"http://threejs.org/","size":333318,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mrdoob:dev","ref":"dev","sha":"8f9ab7a32bfd6f9a2505efaa432e2de5254d2ac9","user":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars.githubusercontent.com/u/97088?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"repo":{"id":576201,"name":"three.js","full_name":"mrdoob/three.js","owner":{"login":"mrdoob","id":97088,"avatar_url":"https://avatars.githubusercontent.com/u/97088?v=3","gravatar_id":"","url":"https://api.github.com/users/mrdoob","html_url":"https://github.com/mrdoob","followers_url":"https://api.github.com/users/mrdoob/followers","following_url":"https://api.github.com/users/mrdoob/following{/other_user}","gists_url":"https://api.github.com/users/mrdoob/gists{/gist_id}","starred_url":"https://api.github.com/users/mrdoob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrdoob/subscriptions","organizations_url":"https://api.github.com/users/mrdoob/orgs","repos_url":"https://api.github.com/users/mrdoob/repos","events_url":"https://api.github.com/users/mrdoob/events{/privacy}","received_events_url":"https://api.github.com/users/mrdoob/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrdoob/three.js","description":"JavaScript 3D library.","fork":false,"url":"https://api.github.com/repos/mrdoob/three.js","forks_url":"https://api.github.com/repos/mrdoob/three.js/forks","keys_url":"https://api.github.com/repos/mrdoob/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrdoob/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrdoob/three.js/teams","hooks_url":"https://api.github.com/repos/mrdoob/three.js/hooks","issue_events_url":"https://api.github.com/repos/mrdoob/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/mrdoob/three.js/events","assignees_url":"https://api.github.com/repos/mrdoob/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/mrdoob/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/mrdoob/three.js/tags","blobs_url":"https://api.github.com/repos/mrdoob/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrdoob/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrdoob/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrdoob/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mrdoob/three.js/languages","stargazers_url":"https://api.github.com/repos/mrdoob/three.js/stargazers","contributors_url":"https://api.github.com/repos/mrdoob/three.js/contributors","subscribers_url":"https://api.github.com/repos/mrdoob/three.js/subscribers","subscription_url":"https://api.github.com/repos/mrdoob/three.js/subscription","commits_url":"https://api.github.com/repos/mrdoob/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrdoob/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrdoob/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrdoob/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrdoob/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/mrdoob/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrdoob/three.js/merges","archive_url":"https://api.github.com/repos/mrdoob/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrdoob/three.js/downloads","issues_url":"https://api.github.com/repos/mrdoob/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/mrdoob/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mrdoob/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mrdoob/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrdoob/three.js/labels{/name}","releases_url":"https://api.github.com/repos/mrdoob/three.js/releases{/id}","created_at":"2010-03-23T18:58:01Z","updated_at":"2015-10-21T00:56:06Z","pushed_at":"2015-10-21T00:04:51Z","git_url":"git://github.com/mrdoob/three.js.git","ssh_url":"git@github.com:mrdoob/three.js.git","clone_url":"https://github.com/mrdoob/three.js.git","svn_url":"https://github.com/mrdoob/three.js","homepage":"http://threejs.org/","size":422724,"stargazers_count":21601,"watchers_count":21601,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":6696,"mirror_url":null,"open_issues_count":499,"forks":6696,"open_issues":499,"watchers":21601,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7324"},"html":{"href":"https://github.com/mrdoob/three.js/pull/7324"},"issue":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/7324"},"comments":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/7324/comments"},"review_comments":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7324/comments"},"review_comment":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7324/commits"},"statuses":{"href":"https://api.github.com/repos/mrdoob/three.js/statuses/08fe98963762ed4feaf0309c1b06792cc90d8cfb"}}}}