{"action":"created","comment":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/40424676","id":40424676,"diff_hunk":"@@ -26,148 +41,252 @@\n \n \t\tbool frustumTest = all( frustumTestVec );\n \n-\t\tif ( frustumTest ) {\n-\n-\t\t\tshadowCoord.z += shadowBias[ i ];\n+\t\tif ( frustumTest || isPointLight ) {\t\t\t\n \n \t\t\t#if defined( SHADOWMAP_TYPE_PCF )\n \n+\t\t\t\t#if defined(POINT_LIGHT_SHADOWS)\n+\n+\t\t\t\t\tif( isPointLight ) {\n+\n+\t\t\t\t\t\tfloat cubeTexelSize = 1.0 / ( shadowMapSize[ i ].x * 0.25 );\n+\t\t\t\t\t\tvec3 baseDirection3D = normalize( lightToPosition );\n+\t\t\t\t\t\tvec2 baseDirection2D = cubeToUV( baseDirection3D, texelSizeX, texelSizeY );\n+\n+\t\t\t\t\t\tinitGridSamplingDisk();\n+\n+\t\t\t\t\t\tfloat diskRadius = 1.25;\n+\t\t\t\t\t\tfloat numSamples = 1.0;\n+\t\t\t\t\t\tshadow = 0.0;\n+\n+\t\t\t\t\t\tvec3 baseDirection = normalize( lightToPosition );\n+\t\t\t\t\t\tfloat curDistance = length( lightToPosition );\n+\n+\t\t\t\t\t\tfloat dist = unpack1K( texture2D( shadowMap[ i ],  baseDirection2D ) ) + 0.1;\n+\t\t\t\t\t\tif ( curDistance >= dist )\n+\t\t\t\t\t\t\tshadow += 1.0;\n+\t\t\t\t\t\t\n+\t\t\t\t\t\t// evaluate each sampling direction\n+\t\t\t\t\t\tfor( int s = 0; s < 20; s++ ) {\n+\t\t\t\t\t\t \n+\t\t\t\t\t\t\tvec3 offset = gridSamplingDisk[ s ] * diskRadius * cubeTexelSize;\n+\t\t\t\t\t\t\tvec3 adjustedBaseDirection3D = baseDirection3D + offset;\n+\t\t\t\t\t\t\tvec2 adjustedBaseDirection2D = cubeToUV( adjustedBaseDirection3D, texelSizeX, texelSizeY );\n+\t\t\t\t\t\t\tdist = unpack1K( texture2D( shadowMap[ i ],  adjustedBaseDirection2D ) ) + shadowBias[ i ];\n+\t\t\t\t\t\t\tif ( curDistance >= dist )\n+\t\t\t\t\t\t\t\tshadow += 1.0;\n+\t\t\t\t\t\t\tnumSamples += 1.0;\n+\n+\t\t\t\t\t\t}\n+\n+\t\t\t\t\t\tshadow /= numSamples;\n+\n+\t\t\t\t\t} else {\n+\n+\t\t\t\t#endif\n+\n \t\t\t\t\t\t// Percentage-close filtering\n \t\t\t\t\t\t// (9 pixel kernel)\n \t\t\t\t\t\t// http://fabiensanglard.net/shadowmappingPCF/\n+\t\t\t\t\t\t\n+\t\t\t\t\t\t/*\n+\t\t\t\t\t\t\t\t// nested loops breaks shader compiler / validator on some ATI cards when using OpenGL\n+\t\t\t\t\t\t\t\t// must enroll loop manually\n+\t\t\t\t\t\t\tfor ( float y = -1.25; y <= 1.25; y += 1.25 )\n+\t\t\t\t\t\t\t\tfor ( float x = -1.25; x <= 1.25; x += 1.25 ) {","path":"src/renderers/shaders/ShaderChunk/shadowmap_fragment.glsl","position":87,"original_position":87,"commit_id":"a7eed9d638082b6dacfddd96f7b39d76118686fb","original_commit_id":"a7eed9d638082b6dacfddd96f7b39d76118686fb","user":{"login":"tschw","id":3916357,"avatar_url":"https://avatars.githubusercontent.com/u/3916357?v=3","gravatar_id":"","url":"https://api.github.com/users/tschw","html_url":"https://github.com/tschw","followers_url":"https://api.github.com/users/tschw/followers","following_url":"https://api.github.com/users/tschw/following{/other_user}","gists_url":"https://api.github.com/users/tschw/gists{/gist_id}","starred_url":"https://api.github.com/users/tschw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschw/subscriptions","organizations_url":"https://api.github.com/users/tschw/orgs","repos_url":"https://api.github.com/users/tschw/repos","events_url":"https://api.github.com/users/tschw/events{/privacy}","received_events_url":"https://api.github.com/users/tschw/received_events","type":"User","site_admin":false},"body":"Anyone remember details / when it was / has an affected GPU for testing? /ping @WestLangley @mrdoob \r\nI guess the issue in this comment *may* be specific to the index being of type `float`?","created_at":"2015-09-25T12:38:34Z","updated_at":"2015-09-25T12:38:34Z","html_url":"https://github.com/mrdoob/three.js/pull/7153#discussion_r40424676","pull_request_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7153","_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/comments/40424676"},"html":{"href":"https://github.com/mrdoob/three.js/pull/7153#discussion_r40424676"},"pull_request":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7153"}}},"pull_request":{"url":"https://api.github.com/repos/mrdoob/three.js/pulls/7153","id":44816418,"html_url":"https://github.com/mrdoob/three.js/pull/7153","diff_url":"https://github.com/mrdoob/three.js/pull/7153.diff","patch_url":"https://github.com/mrdoob/three.js/pull/7153.patch","issue_url":"https://api.github.com/repos/mrdoob/three.js/issues/7153","number":7153,"state":"closed","locked":false,"title":"Added shadow functionality for point lights.","user":{"login":"mkkellogg","id":6249005,"avatar_url":"https://avatars.githubusercontent.com/u/6249005?v=3","gravatar_id":"","url":"https://api.github.com/users/mkkellogg","html_url":"https://github.com/mkkellogg","followers_url":"https://api.github.com/users/mkkellogg/followers","following_url":"https://api.github.com/users/mkkellogg/following{/other_user}","gists_url":"https://api.github.com/users/mkkellogg/gists{/gist_id}","starred_url":"https://api.github.com/users/mkkellogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkkellogg/subscriptions","organizations_url":"https://api.github.com/users/mkkellogg/orgs","repos_url":"https://api.github.com/users/mkkellogg/repos","events_url":"https://api.github.com/users/mkkellogg/events{/privacy}","received_events_url":"https://api.github.com/users/mkkellogg/received_events","type":"User","site_admin":false},"body":"Added shadow functionality for point lights.","created_at":"2015-09-11T18:53:29Z","updated_at":"2015-09-25T12:38:34Z","closed_at":"2015-09-25T12:14:17Z","merged_at":"2015-09-25T12:14:17Z","merge_commit_sha":"eeb1dc51f2b33622363271b584e98bb0da0d6dbd","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7153/commits","review_comments_url":"https://api.github.com/repos/mrdoob/three.js/pulls/7153/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/7153/comments","statuses_url":"https://api.github.com/repos/mrdoob/three.js/statuses/a7eed9d638082b6dacfddd96f7b39d76118686fb","head":{"label":"mkkellogg:dev","ref":"dev","sha":"a7eed9d638082b6dacfddd96f7b39d76118686fb","user":{"login":"mkkellogg","id":6249005,"avatar_url":"https://avatars.githubusercontent.com/u/6249005?v=3","gravatar_id":"","url":"https://api.github.com/users/mkkellogg","html_url":"https://github.com/mkkellogg","followers_url":"https://api.github.com/users/mkkellogg/followers","following_url":"https://api.github.com/users/mkkellogg/following{/other_user}","gists_url":"https://api.github.com/users/mkkellogg/gists{/gist_id}","starred_url":"https://api.github.com/users/mkkellogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkkellogg/subscriptions","organizations_url":"https://api.github.com/users/mkkellogg/orgs","repos_url":"https://api.github.com/users/mkkellogg/repos","events_url":"https://api.github.com/users/mkkellogg/events{/privacy}","received_events_url":"https://api.github.com/users/mkkellogg/received_events","type":"User","site_admin":false},"repo":{"id":42012806,"name":"three.js","full_name":"mkkellogg/three.js","owner":{"login":"mkkellogg","id":6249005,"avatar_url":"https://avatars.githubusercontent.com/u/6249005?v=3","gravatar_id":"","url":"https://api.github.com/users/mkkellogg","html_url":"https://github.com/mkkellogg","followers_url":"https://api.github.com/users/mkkellogg/followers","following_url":"https://api.github.com/users/mkkellogg/following{/other_user}","gists_url":"https://api.github.com/users/mkkellogg/gists{/gist_id}","starred_url":"https://api.github.com/users/mkkellogg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkkellogg/subscriptions","organizations_url":"https://api.github.com/users/mkkellogg/orgs","repos_url":"https://api.github.com/users/mkkellogg/repos","events_url":"https://api.github.com/users/mkkellogg/events{/privacy}","received_events_url":"https://api.github.com/users/mkkellogg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mkkellogg/three.js","description":"JavaScript 3D library.","fork":true,"url":"https://api.github.com/repos/mkkellogg/three.js","forks_url":"https://api.github.com/repos/mkkellogg/three.js/forks","keys_url":"https://api.github.com/repos/mkkellogg/three.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mkkellogg/three.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mkkellogg/three.js/teams","hooks_url":"https://api.github.com/repos/mkkellogg/three.js/hooks","issue_events_url":"https://api.github.com/repos/mkkellogg/three.js/issues/events{/number}","events_url":"https://api.github.com/repos/mkkellogg/three.js/events","assignees_url":"https://api.github.com/repos/mkkellogg/three.js/assignees{/user}","branches_url":"https://api.github.com/repos/mkkellogg/three.js/branches{/branch}","tags_url":"https://api.github.com/repos/mkkellogg/three.js/tags","blobs_url":"https://api.github.com/repos/mkkellogg/three.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mkkellogg/three.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mkkellogg/three.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mkkellogg/three.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mkkellogg/three.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mkkellogg/three.js/languages","stargazers_url":"https://api.github.com/repos/mkkellogg/three.js/stargazers","contributors_url":"https://api.github.com/repos/mkkellogg/three.js/contributors","subscribers_url":"https://api.github.com/repos/mkkellogg/three.js/subscribers","subscription_url":"https://api.github.com/repos/mkkellogg/three.js/subscription","commits_url":"https://api.github.com/repos/mkkellogg/three.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mkkellogg/three.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mkkellogg/three.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mkkellogg/three.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/mkkellogg/three.js/contents/{+path}","compare_url":"https://api.github.com/repos/mkkellogg/three.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mkkellogg/three.js/merges","archive_url":"https://api.github.com/repos/mkkellogg/three.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mkkellogg/three.js/downloads","issues_url":"https://api.github.com/repos/mkkellogg/three.js/issues{/number}","pulls_url":"https://api.github.com/repos/mkkellogg/three.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mkkellogg/three.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mkkellogg/three.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mkkellogg/three.js/labels{/name}","releases_url":"https://api.github.com/repos/mkkellogg/three.js/releases{/id}","created_at":"2015-09-06T18:13:14Z","updated_at":"2015-09-06T18:13:19Z","pushed_at":"2015-09-25T03:59:23Z","git_url":"git://github.com/mkkellogg/three.js.git","ssh_url":"git@github.com:mkkellogg/three.js.git","clone_url":"https://github.com/mkkellogg/three.js.git","svn_url":"https://github.com/mkkellogg/three.js","homepage":"http://threejs.org/","size":338896,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"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":"mrdoob:dev","ref":"dev","sha":"c95ac998ad3f8020f44daf89a8060eeeb3155d0d","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-09-25T12:24:16Z","pushed_at":"2015-09-25T12:14:30Z","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":418347,"stargazers_count":21258,"watchers_count":21258,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":6524,"mirror_url":null,"open_issues_count":539,"forks":6524,"open_issues":539,"watchers":21258,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7153"},"html":{"href":"https://github.com/mrdoob/three.js/pull/7153"},"issue":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/7153"},"comments":{"href":"https://api.github.com/repos/mrdoob/three.js/issues/7153/comments"},"review_comments":{"href":"https://api.github.com/repos/mrdoob/three.js/pulls/7153/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/7153/commits"},"statuses":{"href":"https://api.github.com/repos/mrdoob/three.js/statuses/a7eed9d638082b6dacfddd96f7b39d76118686fb"}}}}