{"action":"created","comment":{"url":"https://api.github.com/repos/OsnaCS/plantex/pulls/comments/72912319","id":72912319,"diff_hunk":"@@ -363,6 +384,60 @@ impl Renderer {\n                                                             self.resolution.1)\n             .unwrap();\n     }\n+\n+\n+    // ===================================================================\n+    //                         Brightness Adaption\n+    // ===================================================================\n+\n+    fn adapt_brightness(&self) -> Result<f32, Box<Error>> {\n+        let mut adaption_buffers: Vec<SimpleFrameBuffer> = Vec::with_capacity(10);\n+\n+        let mut image = &self.quad_tex;\n+\n+        for i in 0..10 {\n+            adaption_buffers.push(try!(SimpleFrameBuffer::new(self.context.get_facade(),\n+                                                              self.lum_texs[i]\n+                                                                  .to_color_attachment())));\n+\n+\n+            if i != 0 {\n+                image = &self.lum_texs[i - 1];\n+            }\n+\n+            let uniforms = uniform!{\n+                image: image,\n+            };\n+\n+            try!(adaption_buffers[i].draw(&self.quad_vertex_buffer,\n+                                          &self.quad_index_buffer,\n+                                          &self.adaption_shrink_program,\n+                                          &uniforms,\n+                                          &Default::default()));\n+\n+        }\n+\n+\n+        // Read only pixel in the lowest level texture from lum_texs.\n+        // never change a working system. Yeah, it's that complicated.\n+        let buf: Vec<Vec<(f32, f32, f32, f32)>> = self.lum_texs\n+            .last()\n+            .unwrap()\n+            .main_level()\n+            .first_layer()\n+            .into_image(None)\n+            .unwrap()\n+            .raw_read(&glium::Rect {\n+                left: 0,\n+                bottom: 0,\n+                width: 1,\n+                height: 1,\n+            });","path":"client/src/renderer.rs","position":134,"original_position":134,"commit_id":"ea6b060e7434076e024458a0474f200fabb4ae28","original_commit_id":"ea6b060e7434076e024458a0474f200fabb4ae28","user":{"login":"jonas-schievink","id":1786438,"avatar_url":"https://avatars.githubusercontent.com/u/1786438?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas-schievink","html_url":"https://github.com/jonas-schievink","followers_url":"https://api.github.com/users/jonas-schievink/followers","following_url":"https://api.github.com/users/jonas-schievink/following{/other_user}","gists_url":"https://api.github.com/users/jonas-schievink/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas-schievink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas-schievink/subscriptions","organizations_url":"https://api.github.com/users/jonas-schievink/orgs","repos_url":"https://api.github.com/users/jonas-schievink/repos","events_url":"https://api.github.com/users/jonas-schievink/events{/privacy}","received_events_url":"https://api.github.com/users/jonas-schievink/received_events","type":"User","site_admin":false},"body":"Yeah this was the thing we needed 4 people to figure out","created_at":"2016-07-31T22:26:12Z","updated_at":"2016-07-31T22:26:12Z","html_url":"https://github.com/OsnaCS/plantex/pull/125#discussion_r72912319","pull_request_url":"https://api.github.com/repos/OsnaCS/plantex/pulls/125","_links":{"self":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/comments/72912319"},"html":{"href":"https://github.com/OsnaCS/plantex/pull/125#discussion_r72912319"},"pull_request":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/125"}}},"pull_request":{"url":"https://api.github.com/repos/OsnaCS/plantex/pulls/125","id":79366886,"html_url":"https://github.com/OsnaCS/plantex/pull/125","diff_url":"https://github.com/OsnaCS/plantex/pull/125.diff","patch_url":"https://github.com/OsnaCS/plantex/pull/125.patch","issue_url":"https://api.github.com/repos/OsnaCS/plantex/issues/125","number":125,"state":"open","locked":false,"title":"(WIP) Most basic dynamic exposure compensation","user":{"login":"gustav1101","id":10332223,"avatar_url":"https://avatars.githubusercontent.com/u/10332223?v=3","gravatar_id":"","url":"https://api.github.com/users/gustav1101","html_url":"https://github.com/gustav1101","followers_url":"https://api.github.com/users/gustav1101/followers","following_url":"https://api.github.com/users/gustav1101/following{/other_user}","gists_url":"https://api.github.com/users/gustav1101/gists{/gist_id}","starred_url":"https://api.github.com/users/gustav1101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustav1101/subscriptions","organizations_url":"https://api.github.com/users/gustav1101/orgs","repos_url":"https://api.github.com/users/gustav1101/repos","events_url":"https://api.github.com/users/gustav1101/events{/privacy}","received_events_url":"https://api.github.com/users/gustav1101/received_events","type":"User","site_admin":false},"body":"Calculation of average brightness is implemented.\r\nThe next step is to reasonably change the exposure level.\r\n\r\nFixes #120 ","created_at":"2016-07-29T14:20:49Z","updated_at":"2016-07-31T22:26:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c08eef4cc4937486b75a6afafb0ff8911cfb4329","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/OsnaCS/plantex/pulls/125/commits","review_comments_url":"https://api.github.com/repos/OsnaCS/plantex/pulls/125/comments","review_comment_url":"https://api.github.com/repos/OsnaCS/plantex/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OsnaCS/plantex/issues/125/comments","statuses_url":"https://api.github.com/repos/OsnaCS/plantex/statuses/ea6b060e7434076e024458a0474f200fabb4ae28","head":{"label":"gustav1101:master","ref":"master","sha":"ea6b060e7434076e024458a0474f200fabb4ae28","user":{"login":"gustav1101","id":10332223,"avatar_url":"https://avatars.githubusercontent.com/u/10332223?v=3","gravatar_id":"","url":"https://api.github.com/users/gustav1101","html_url":"https://github.com/gustav1101","followers_url":"https://api.github.com/users/gustav1101/followers","following_url":"https://api.github.com/users/gustav1101/following{/other_user}","gists_url":"https://api.github.com/users/gustav1101/gists{/gist_id}","starred_url":"https://api.github.com/users/gustav1101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustav1101/subscriptions","organizations_url":"https://api.github.com/users/gustav1101/orgs","repos_url":"https://api.github.com/users/gustav1101/repos","events_url":"https://api.github.com/users/gustav1101/events{/privacy}","received_events_url":"https://api.github.com/users/gustav1101/received_events","type":"User","site_admin":false},"repo":{"id":63776008,"name":"plantex","full_name":"gustav1101/plantex","owner":{"login":"gustav1101","id":10332223,"avatar_url":"https://avatars.githubusercontent.com/u/10332223?v=3","gravatar_id":"","url":"https://api.github.com/users/gustav1101","html_url":"https://github.com/gustav1101","followers_url":"https://api.github.com/users/gustav1101/followers","following_url":"https://api.github.com/users/gustav1101/following{/other_user}","gists_url":"https://api.github.com/users/gustav1101/gists{/gist_id}","starred_url":"https://api.github.com/users/gustav1101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gustav1101/subscriptions","organizations_url":"https://api.github.com/users/gustav1101/orgs","repos_url":"https://api.github.com/users/gustav1101/repos","events_url":"https://api.github.com/users/gustav1101/events{/privacy}","received_events_url":"https://api.github.com/users/gustav1101/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gustav1101/plantex","description":":seedling: open-world game about plants :evergreen_tree: :leaves: :herb: :palm_tree:","fork":true,"url":"https://api.github.com/repos/gustav1101/plantex","forks_url":"https://api.github.com/repos/gustav1101/plantex/forks","keys_url":"https://api.github.com/repos/gustav1101/plantex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gustav1101/plantex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gustav1101/plantex/teams","hooks_url":"https://api.github.com/repos/gustav1101/plantex/hooks","issue_events_url":"https://api.github.com/repos/gustav1101/plantex/issues/events{/number}","events_url":"https://api.github.com/repos/gustav1101/plantex/events","assignees_url":"https://api.github.com/repos/gustav1101/plantex/assignees{/user}","branches_url":"https://api.github.com/repos/gustav1101/plantex/branches{/branch}","tags_url":"https://api.github.com/repos/gustav1101/plantex/tags","blobs_url":"https://api.github.com/repos/gustav1101/plantex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gustav1101/plantex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gustav1101/plantex/git/refs{/sha}","trees_url":"https://api.github.com/repos/gustav1101/plantex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gustav1101/plantex/statuses/{sha}","languages_url":"https://api.github.com/repos/gustav1101/plantex/languages","stargazers_url":"https://api.github.com/repos/gustav1101/plantex/stargazers","contributors_url":"https://api.github.com/repos/gustav1101/plantex/contributors","subscribers_url":"https://api.github.com/repos/gustav1101/plantex/subscribers","subscription_url":"https://api.github.com/repos/gustav1101/plantex/subscription","commits_url":"https://api.github.com/repos/gustav1101/plantex/commits{/sha}","git_commits_url":"https://api.github.com/repos/gustav1101/plantex/git/commits{/sha}","comments_url":"https://api.github.com/repos/gustav1101/plantex/comments{/number}","issue_comment_url":"https://api.github.com/repos/gustav1101/plantex/issues/comments{/number}","contents_url":"https://api.github.com/repos/gustav1101/plantex/contents/{+path}","compare_url":"https://api.github.com/repos/gustav1101/plantex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gustav1101/plantex/merges","archive_url":"https://api.github.com/repos/gustav1101/plantex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gustav1101/plantex/downloads","issues_url":"https://api.github.com/repos/gustav1101/plantex/issues{/number}","pulls_url":"https://api.github.com/repos/gustav1101/plantex/pulls{/number}","milestones_url":"https://api.github.com/repos/gustav1101/plantex/milestones{/number}","notifications_url":"https://api.github.com/repos/gustav1101/plantex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gustav1101/plantex/labels{/name}","releases_url":"https://api.github.com/repos/gustav1101/plantex/releases{/id}","deployments_url":"https://api.github.com/repos/gustav1101/plantex/deployments","created_at":"2016-07-20T11:27:27Z","updated_at":"2016-07-20T11:27:28Z","pushed_at":"2016-07-29T14:16:56Z","git_url":"git://github.com/gustav1101/plantex.git","ssh_url":"git@github.com:gustav1101/plantex.git","clone_url":"https://github.com/gustav1101/plantex.git","svn_url":"https://github.com/gustav1101/plantex","homepage":null,"size":8562,"stargazers_count":0,"watchers_count":0,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"OsnaCS:master","ref":"master","sha":"e4e9910b34b63551b9cdd42cb0f05da89f773618","user":{"login":"OsnaCS","id":8659522,"avatar_url":"https://avatars.githubusercontent.com/u/8659522?v=3","gravatar_id":"","url":"https://api.github.com/users/OsnaCS","html_url":"https://github.com/OsnaCS","followers_url":"https://api.github.com/users/OsnaCS/followers","following_url":"https://api.github.com/users/OsnaCS/following{/other_user}","gists_url":"https://api.github.com/users/OsnaCS/gists{/gist_id}","starred_url":"https://api.github.com/users/OsnaCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OsnaCS/subscriptions","organizations_url":"https://api.github.com/users/OsnaCS/orgs","repos_url":"https://api.github.com/users/OsnaCS/repos","events_url":"https://api.github.com/users/OsnaCS/events{/privacy}","received_events_url":"https://api.github.com/users/OsnaCS/received_events","type":"Organization","site_admin":false},"repo":{"id":61811363,"name":"plantex","full_name":"OsnaCS/plantex","owner":{"login":"OsnaCS","id":8659522,"avatar_url":"https://avatars.githubusercontent.com/u/8659522?v=3","gravatar_id":"","url":"https://api.github.com/users/OsnaCS","html_url":"https://github.com/OsnaCS","followers_url":"https://api.github.com/users/OsnaCS/followers","following_url":"https://api.github.com/users/OsnaCS/following{/other_user}","gists_url":"https://api.github.com/users/OsnaCS/gists{/gist_id}","starred_url":"https://api.github.com/users/OsnaCS/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OsnaCS/subscriptions","organizations_url":"https://api.github.com/users/OsnaCS/orgs","repos_url":"https://api.github.com/users/OsnaCS/repos","events_url":"https://api.github.com/users/OsnaCS/events{/privacy}","received_events_url":"https://api.github.com/users/OsnaCS/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OsnaCS/plantex","description":":seedling: open-world game about plants :evergreen_tree: :leaves: :herb: :palm_tree:","fork":false,"url":"https://api.github.com/repos/OsnaCS/plantex","forks_url":"https://api.github.com/repos/OsnaCS/plantex/forks","keys_url":"https://api.github.com/repos/OsnaCS/plantex/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OsnaCS/plantex/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OsnaCS/plantex/teams","hooks_url":"https://api.github.com/repos/OsnaCS/plantex/hooks","issue_events_url":"https://api.github.com/repos/OsnaCS/plantex/issues/events{/number}","events_url":"https://api.github.com/repos/OsnaCS/plantex/events","assignees_url":"https://api.github.com/repos/OsnaCS/plantex/assignees{/user}","branches_url":"https://api.github.com/repos/OsnaCS/plantex/branches{/branch}","tags_url":"https://api.github.com/repos/OsnaCS/plantex/tags","blobs_url":"https://api.github.com/repos/OsnaCS/plantex/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OsnaCS/plantex/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OsnaCS/plantex/git/refs{/sha}","trees_url":"https://api.github.com/repos/OsnaCS/plantex/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OsnaCS/plantex/statuses/{sha}","languages_url":"https://api.github.com/repos/OsnaCS/plantex/languages","stargazers_url":"https://api.github.com/repos/OsnaCS/plantex/stargazers","contributors_url":"https://api.github.com/repos/OsnaCS/plantex/contributors","subscribers_url":"https://api.github.com/repos/OsnaCS/plantex/subscribers","subscription_url":"https://api.github.com/repos/OsnaCS/plantex/subscription","commits_url":"https://api.github.com/repos/OsnaCS/plantex/commits{/sha}","git_commits_url":"https://api.github.com/repos/OsnaCS/plantex/git/commits{/sha}","comments_url":"https://api.github.com/repos/OsnaCS/plantex/comments{/number}","issue_comment_url":"https://api.github.com/repos/OsnaCS/plantex/issues/comments{/number}","contents_url":"https://api.github.com/repos/OsnaCS/plantex/contents/{+path}","compare_url":"https://api.github.com/repos/OsnaCS/plantex/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OsnaCS/plantex/merges","archive_url":"https://api.github.com/repos/OsnaCS/plantex/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OsnaCS/plantex/downloads","issues_url":"https://api.github.com/repos/OsnaCS/plantex/issues{/number}","pulls_url":"https://api.github.com/repos/OsnaCS/plantex/pulls{/number}","milestones_url":"https://api.github.com/repos/OsnaCS/plantex/milestones{/number}","notifications_url":"https://api.github.com/repos/OsnaCS/plantex/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OsnaCS/plantex/labels{/name}","releases_url":"https://api.github.com/repos/OsnaCS/plantex/releases{/id}","deployments_url":"https://api.github.com/repos/OsnaCS/plantex/deployments","created_at":"2016-06-23T14:25:11Z","updated_at":"2016-07-29T07:19:04Z","pushed_at":"2016-07-31T10:14:30Z","git_url":"git://github.com/OsnaCS/plantex.git","ssh_url":"git@github.com:OsnaCS/plantex.git","clone_url":"https://github.com/OsnaCS/plantex.git","svn_url":"https://github.com/OsnaCS/plantex","homepage":null,"size":10316,"stargazers_count":10,"watchers_count":10,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":24,"mirror_url":null,"open_issues_count":20,"forks":24,"open_issues":20,"watchers":10,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/125"},"html":{"href":"https://github.com/OsnaCS/plantex/pull/125"},"issue":{"href":"https://api.github.com/repos/OsnaCS/plantex/issues/125"},"comments":{"href":"https://api.github.com/repos/OsnaCS/plantex/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OsnaCS/plantex/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/OsnaCS/plantex/statuses/ea6b060e7434076e024458a0474f200fabb4ae28"}}}}
{"actor":{"display_login":"jonas-schievink"}}