{"action":"created","comment":{"url":"https://api.github.com/repos/jdolan/quetoo/pulls/comments/105173096","pull_request_review_id":26037442,"id":105173096,"diff_hunk":"@@ -620,6 +620,87 @@ static _Bool NudgeSamplePosition(const vec3_t in, const vec3_t normal, const vec\n \treturn Light_PointPVS(out, pvs);\n }\n \n+/**\n+ * @brief Trace a ray and gather indirect light from surfaces\n+ */\n+static void GatherSampleBounceTrace(int8_t bounce, const vec3_t center, const vec3_t pos, const vec3_t normal, const vec_t dist, vec_t *sample) {\n+\n+\tvec3_t end;\n+\tvec_t dot, sqdist;\n+\tvec3_t color;\n+\tvec_t hardness;\n+\tvec3_t bounce_dir, bounce_pos;\n+\tvec_t bounce_dist;\n+\tcm_trace_t trace;\n+\n+\t// get a trace\n+\n+\tVectorScale(normal, dist, end);\n+\n+\tLight_Trace(&trace, pos, end, CONTENTS_SOLID);\n+\n+\tif (!trace.surface) {\n+\t\treturn;\n+\t}\n+\n+\tif (trace.start_solid) {\n+\t\treturn;\n+\t}\n+\n+\t// distance squared and trace hit normal dot product\n+\n+\tsqdist = trace.fraction * trace.fraction;\n+\tdot = DotProduct(trace.plane.normal, normal);\n+\n+\t// get surface color\n+\n+\tconst cm_material_t *mat = trace.surface->material;\n+\tif (mat) {\n+\t\thardness = Clamp(mat->hardness, 0.0, 5.0);\n+\t\tGetTextureColor(mat->diffuse, color);\n+\t} else {\n+\t\thardness = 1.0;\n+\t\tVectorSet(color, 1.0, 1.0, 1.0);\n+\t}\n+\n+\tconst vec_t reflect = hardness / 5.0;\n+\tVectorScale(color, reflect * sqdist, color);\n+\n+\tif ((trace.fraction * dist) < AMBIENT_OCCLUSION_DIST) {\n+\t\tvec_t ao = (1.0 - reflect) * (trace.fraction * (dist / AMBIENT_OCCLUSION_DIST)) * Max(0.001, dot);\n+\t\tcolor[0] -= ao;\n+\t}\n+\n+\t// multiplicative color\n+\n+\tsample[0] *= color[0];\n+\tsample[1] *= color[1];\n+\tsample[2] *= color[2];\n+\n+\tbounce++;\n+\n+\tif (bounce >= indirect_bounces || bounce >= MAX_INDIRECT_BOUNCES) {\n+\t\treturn; // don't bounce anymore\n+\t}\n+\n+\t// direction of the next bounce\n+\n+\t// FIXME: Is this right? Shouldn't we use a DotProduct here ala Pm_ClipVelocity?\n+\tCrossProduct(normal, trace.plane.normal, bounce_dir);\n+\n+\t// where the next bounce starts\n+\n+\tVectorMA(trace.end, SAMPLE_NUDGE, bounce_dir, bounce_pos);\n+\n+\t// length of the next bounce\n+\n+\tbounce_dist = Clamp(reflect * sqdist * INDIRECT_BOUNCE_DIST, INDIRECT_BOUNCE_MIN_DIST, dist);","path":"src/tools/quemap/lightmap.c","position":87,"original_position":87,"commit_id":"a26b95fa7ed1708af75435b47693600e66ab459a","original_commit_id":"a26b95fa7ed1708af75435b47693600e66ab459a","user":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"body":"This isn't right, either. You need to factor in the incoming distance (which is really the amount of light we have).","created_at":"2017-03-09T14:19:54Z","updated_at":"2017-03-09T14:20:07Z","html_url":"https://github.com/jdolan/quetoo/pull/449#discussion_r105173096","pull_request_url":"https://api.github.com/repos/jdolan/quetoo/pulls/449","_links":{"self":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/comments/105173096"},"html":{"href":"https://github.com/jdolan/quetoo/pull/449#discussion_r105173096"},"pull_request":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/449"}}},"pull_request":{"url":"https://api.github.com/repos/jdolan/quetoo/pulls/449","id":109905014,"html_url":"https://github.com/jdolan/quetoo/pull/449","diff_url":"https://github.com/jdolan/quetoo/pull/449.diff","patch_url":"https://github.com/jdolan/quetoo/pull/449.patch","issue_url":"https://api.github.com/repos/jdolan/quetoo/issues/449","number":449,"state":"open","locked":false,"title":"Kaadmy/quemap indirect","user":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-03-09T12:42:05Z","updated_at":"2017-03-09T14:20:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"96f59e2464586e5c103cafdae6555807ac75670a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jdolan/quetoo/pulls/449/commits","review_comments_url":"https://api.github.com/repos/jdolan/quetoo/pulls/449/comments","review_comment_url":"https://api.github.com/repos/jdolan/quetoo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jdolan/quetoo/issues/449/comments","statuses_url":"https://api.github.com/repos/jdolan/quetoo/statuses/a26b95fa7ed1708af75435b47693600e66ab459a","head":{"label":"jdolan:kaadmy/quemap_indirect","ref":"kaadmy/quemap_indirect","sha":"a26b95fa7ed1708af75435b47693600e66ab459a","user":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"repo":{"id":9587373,"name":"quetoo","full_name":"jdolan/quetoo","owner":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdolan/quetoo","description":"A Free, standalone first person shooter video game based on id Tech2.","fork":false,"url":"https://api.github.com/repos/jdolan/quetoo","forks_url":"https://api.github.com/repos/jdolan/quetoo/forks","keys_url":"https://api.github.com/repos/jdolan/quetoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdolan/quetoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdolan/quetoo/teams","hooks_url":"https://api.github.com/repos/jdolan/quetoo/hooks","issue_events_url":"https://api.github.com/repos/jdolan/quetoo/issues/events{/number}","events_url":"https://api.github.com/repos/jdolan/quetoo/events","assignees_url":"https://api.github.com/repos/jdolan/quetoo/assignees{/user}","branches_url":"https://api.github.com/repos/jdolan/quetoo/branches{/branch}","tags_url":"https://api.github.com/repos/jdolan/quetoo/tags","blobs_url":"https://api.github.com/repos/jdolan/quetoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdolan/quetoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdolan/quetoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdolan/quetoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdolan/quetoo/statuses/{sha}","languages_url":"https://api.github.com/repos/jdolan/quetoo/languages","stargazers_url":"https://api.github.com/repos/jdolan/quetoo/stargazers","contributors_url":"https://api.github.com/repos/jdolan/quetoo/contributors","subscribers_url":"https://api.github.com/repos/jdolan/quetoo/subscribers","subscription_url":"https://api.github.com/repos/jdolan/quetoo/subscription","commits_url":"https://api.github.com/repos/jdolan/quetoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdolan/quetoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdolan/quetoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdolan/quetoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdolan/quetoo/contents/{+path}","compare_url":"https://api.github.com/repos/jdolan/quetoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdolan/quetoo/merges","archive_url":"https://api.github.com/repos/jdolan/quetoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdolan/quetoo/downloads","issues_url":"https://api.github.com/repos/jdolan/quetoo/issues{/number}","pulls_url":"https://api.github.com/repos/jdolan/quetoo/pulls{/number}","milestones_url":"https://api.github.com/repos/jdolan/quetoo/milestones{/number}","notifications_url":"https://api.github.com/repos/jdolan/quetoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdolan/quetoo/labels{/name}","releases_url":"https://api.github.com/repos/jdolan/quetoo/releases{/id}","deployments_url":"https://api.github.com/repos/jdolan/quetoo/deployments","created_at":"2013-04-21T23:29:53Z","updated_at":"2017-02-10T19:31:30Z","pushed_at":"2017-03-09T14:10:53Z","git_url":"git://github.com/jdolan/quetoo.git","ssh_url":"git@github.com:jdolan/quetoo.git","clone_url":"https://github.com/jdolan/quetoo.git","svn_url":"https://github.com/jdolan/quetoo","homepage":null,"size":31457,"stargazers_count":78,"watchers_count":78,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":33,"forks":12,"open_issues":33,"watchers":78,"default_branch":"master"}},"base":{"label":"jdolan:master","ref":"master","sha":"57bb066c843601e306f9576d2dd3015840199667","user":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"repo":{"id":9587373,"name":"quetoo","full_name":"jdolan/quetoo","owner":{"login":"jdolan","id":643118,"avatar_url":"https://avatars0.githubusercontent.com/u/643118?v=3","gravatar_id":"","url":"https://api.github.com/users/jdolan","html_url":"https://github.com/jdolan","followers_url":"https://api.github.com/users/jdolan/followers","following_url":"https://api.github.com/users/jdolan/following{/other_user}","gists_url":"https://api.github.com/users/jdolan/gists{/gist_id}","starred_url":"https://api.github.com/users/jdolan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdolan/subscriptions","organizations_url":"https://api.github.com/users/jdolan/orgs","repos_url":"https://api.github.com/users/jdolan/repos","events_url":"https://api.github.com/users/jdolan/events{/privacy}","received_events_url":"https://api.github.com/users/jdolan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jdolan/quetoo","description":"A Free, standalone first person shooter video game based on id Tech2.","fork":false,"url":"https://api.github.com/repos/jdolan/quetoo","forks_url":"https://api.github.com/repos/jdolan/quetoo/forks","keys_url":"https://api.github.com/repos/jdolan/quetoo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdolan/quetoo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdolan/quetoo/teams","hooks_url":"https://api.github.com/repos/jdolan/quetoo/hooks","issue_events_url":"https://api.github.com/repos/jdolan/quetoo/issues/events{/number}","events_url":"https://api.github.com/repos/jdolan/quetoo/events","assignees_url":"https://api.github.com/repos/jdolan/quetoo/assignees{/user}","branches_url":"https://api.github.com/repos/jdolan/quetoo/branches{/branch}","tags_url":"https://api.github.com/repos/jdolan/quetoo/tags","blobs_url":"https://api.github.com/repos/jdolan/quetoo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdolan/quetoo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdolan/quetoo/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdolan/quetoo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdolan/quetoo/statuses/{sha}","languages_url":"https://api.github.com/repos/jdolan/quetoo/languages","stargazers_url":"https://api.github.com/repos/jdolan/quetoo/stargazers","contributors_url":"https://api.github.com/repos/jdolan/quetoo/contributors","subscribers_url":"https://api.github.com/repos/jdolan/quetoo/subscribers","subscription_url":"https://api.github.com/repos/jdolan/quetoo/subscription","commits_url":"https://api.github.com/repos/jdolan/quetoo/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdolan/quetoo/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdolan/quetoo/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdolan/quetoo/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdolan/quetoo/contents/{+path}","compare_url":"https://api.github.com/repos/jdolan/quetoo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdolan/quetoo/merges","archive_url":"https://api.github.com/repos/jdolan/quetoo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdolan/quetoo/downloads","issues_url":"https://api.github.com/repos/jdolan/quetoo/issues{/number}","pulls_url":"https://api.github.com/repos/jdolan/quetoo/pulls{/number}","milestones_url":"https://api.github.com/repos/jdolan/quetoo/milestones{/number}","notifications_url":"https://api.github.com/repos/jdolan/quetoo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdolan/quetoo/labels{/name}","releases_url":"https://api.github.com/repos/jdolan/quetoo/releases{/id}","deployments_url":"https://api.github.com/repos/jdolan/quetoo/deployments","created_at":"2013-04-21T23:29:53Z","updated_at":"2017-02-10T19:31:30Z","pushed_at":"2017-03-09T14:10:53Z","git_url":"git://github.com/jdolan/quetoo.git","ssh_url":"git@github.com:jdolan/quetoo.git","clone_url":"https://github.com/jdolan/quetoo.git","svn_url":"https://github.com/jdolan/quetoo","homepage":null,"size":31457,"stargazers_count":78,"watchers_count":78,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":33,"forks":12,"open_issues":33,"watchers":78,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/449"},"html":{"href":"https://github.com/jdolan/quetoo/pull/449"},"issue":{"href":"https://api.github.com/repos/jdolan/quetoo/issues/449"},"comments":{"href":"https://api.github.com/repos/jdolan/quetoo/issues/449/comments"},"review_comments":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/449/comments"},"review_comment":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jdolan/quetoo/pulls/449/commits"},"statuses":{"href":"https://api.github.com/repos/jdolan/quetoo/statuses/a26b95fa7ed1708af75435b47693600e66ab459a"}}}}
{"actor":{"display_login":"jdolan"}}