{"action":"created","comment":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments/66925669","id":66925669,"diff_hunk":"@@ -0,0 +1,146 @@\n+/*\n+ * Copyright 2016 MovingBlocks\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+package org.terasology.rendering.dag;\n+\n+import org.lwjgl.opengl.GL11;\n+import org.terasology.config.Config;\n+import org.terasology.config.RenderingConfig;\n+import org.terasology.context.Context;\n+import org.terasology.math.TeraMath;\n+import org.terasology.math.geom.Vector3f;\n+import org.terasology.monitoring.PerformanceMonitor;\n+import org.terasology.rendering.assets.material.Material;\n+import org.terasology.rendering.backdrop.BackdropProvider;\n+import org.terasology.rendering.cameras.Camera;\n+import org.terasology.rendering.cameras.OrthographicCamera;\n+import org.terasology.rendering.opengl.FBO;\n+import org.terasology.rendering.opengl.FrameBuffersManager;\n+import org.terasology.rendering.primitives.ChunkMesh;\n+import org.terasology.rendering.world.RenderQueuesHelper;\n+import org.terasology.rendering.world.WorldRenderer;\n+import org.terasology.rendering.world.WorldRendererImpl;\n+import static org.lwjgl.opengl.GL11.*;\n+import static org.terasology.rendering.opengl.OpenGLUtils.*;\n+\n+\n+/**\n+ * Diagram of this node can be viewed from:\n+ * TODO: move diagram to the wiki when this part of the code is stable\n+ * - https://docs.google.com/drawings/d/13I0GM9jDFlZv1vNrUPlQuBbaF86RPRNpVfn5q8Wj2lc/edit?usp=sharing\n+ */\n+public class ShadowMapNode implements Node {\n+    private static final int SHADOW_FRUSTUM_BOUNDS = 500;\n+\n+\n+    public Camera camera = new OrthographicCamera(-SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, SHADOW_FRUSTUM_BOUNDS, -SHADOW_FRUSTUM_BOUNDS);\n+    private RenderQueuesHelper renderQueues;\n+    private Context context;\n+    private Material shadowMapShader;\n+    private FBO shadowMap;\n+\n+    // TODO: every node proposes its modifiable configuration?\n+    private RenderingConfig renderingConfig;\n+\n+    private Camera playerCamera;\n+    // FIXME: remove reference to WorldRendererImpl\n+    private WorldRenderer worldRenderer;\n+    private BackdropProvider backdropProvider;\n+\n+\n+    // FIXME: unnecessary arguments must be eliminated\n+    public ShadowMapNode(Context context, Material shadowMapShader, Camera playerCamera) {\n+        this.context = context;\n+        this.shadowMapShader = shadowMapShader;\n+        this.playerCamera = playerCamera;\n+        this.worldRenderer = context.get(WorldRenderer.class);\n+        this.backdropProvider = context.get(BackdropProvider.class);\n+        this.renderingConfig = context.get(Config.class).getRendering();\n+        this.shadowMap = context.get(FrameBuffersManager.class).getFBO(\"sceneShadowMap\");\n+        this.renderQueues = context.get(RenderQueuesHelper.class);\n+    }","path":"engine/src/main/java/org/terasology/rendering/dag/ShadowMapNode.java","position":73,"original_position":73,"commit_id":"98687b4f987ae3778bbaaa3d23219ca2f93947fc","original_commit_id":"98687b4f987ae3778bbaaa3d23219ca2f93947fc","user":{"login":"msteiger","id":1820007,"avatar_url":"https://avatars.githubusercontent.com/u/1820007?v=3","gravatar_id":"","url":"https://api.github.com/users/msteiger","html_url":"https://github.com/msteiger","followers_url":"https://api.github.com/users/msteiger/followers","following_url":"https://api.github.com/users/msteiger/following{/other_user}","gists_url":"https://api.github.com/users/msteiger/gists{/gist_id}","starred_url":"https://api.github.com/users/msteiger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/msteiger/subscriptions","organizations_url":"https://api.github.com/users/msteiger/orgs","repos_url":"https://api.github.com/users/msteiger/repos","events_url":"https://api.github.com/users/msteiger/events{/privacy}","received_events_url":"https://api.github.com/users/msteiger/received_events","type":"User","site_admin":false},"body":"I would use the InjectionHelper here. This enables the `@In` annotation for the fields that are known to the context.","created_at":"2016-06-14T08:11:33Z","updated_at":"2016-06-14T08:11:33Z","html_url":"https://github.com/MovingBlocks/Terasology/pull/2325#discussion_r66925669","pull_request_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325","_links":{"self":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments/66925669"},"html":{"href":"https://github.com/MovingBlocks/Terasology/pull/2325#discussion_r66925669"},"pull_request":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325"}}},"pull_request":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325","id":71427467,"html_url":"https://github.com/MovingBlocks/Terasology/pull/2325","diff_url":"https://github.com/MovingBlocks/Terasology/pull/2325.diff","patch_url":"https://github.com/MovingBlocks/Terasology/pull/2325.patch","issue_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2325","number":2325,"state":"open","locked":false,"title":"[Ready for Review] Wrapping ShadowMap and WorldReflection into a \"Node\"","user":{"login":"tdgunes","id":136392,"avatar_url":"https://avatars.githubusercontent.com/u/136392?v=3","gravatar_id":"","url":"https://api.github.com/users/tdgunes","html_url":"https://github.com/tdgunes","followers_url":"https://api.github.com/users/tdgunes/followers","following_url":"https://api.github.com/users/tdgunes/following{/other_user}","gists_url":"https://api.github.com/users/tdgunes/gists{/gist_id}","starred_url":"https://api.github.com/users/tdgunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdgunes/subscriptions","organizations_url":"https://api.github.com/users/tdgunes/orgs","repos_url":"https://api.github.com/users/tdgunes/repos","events_url":"https://api.github.com/users/tdgunes/events{/privacy}","received_events_url":"https://api.github.com/users/tdgunes/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-25T17:00:51Z","updated_at":"2016-06-14T08:11:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"97be2a4a862bda3eab65f1bbd1ffce8c3ab10326","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325/commits","review_comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325/comments","review_comment_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments{/number}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2325/comments","statuses_url":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/98687b4f987ae3778bbaaa3d23219ca2f93947fc","head":{"label":"tdgunes:dag","ref":"dag","sha":"98687b4f987ae3778bbaaa3d23219ca2f93947fc","user":{"login":"tdgunes","id":136392,"avatar_url":"https://avatars.githubusercontent.com/u/136392?v=3","gravatar_id":"","url":"https://api.github.com/users/tdgunes","html_url":"https://github.com/tdgunes","followers_url":"https://api.github.com/users/tdgunes/followers","following_url":"https://api.github.com/users/tdgunes/following{/other_user}","gists_url":"https://api.github.com/users/tdgunes/gists{/gist_id}","starred_url":"https://api.github.com/users/tdgunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdgunes/subscriptions","organizations_url":"https://api.github.com/users/tdgunes/orgs","repos_url":"https://api.github.com/users/tdgunes/repos","events_url":"https://api.github.com/users/tdgunes/events{/privacy}","received_events_url":"https://api.github.com/users/tdgunes/received_events","type":"User","site_admin":false},"repo":{"id":55730673,"name":"Terasology","full_name":"tdgunes/Terasology","owner":{"login":"tdgunes","id":136392,"avatar_url":"https://avatars.githubusercontent.com/u/136392?v=3","gravatar_id":"","url":"https://api.github.com/users/tdgunes","html_url":"https://github.com/tdgunes","followers_url":"https://api.github.com/users/tdgunes/followers","following_url":"https://api.github.com/users/tdgunes/following{/other_user}","gists_url":"https://api.github.com/users/tdgunes/gists{/gist_id}","starred_url":"https://api.github.com/users/tdgunes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdgunes/subscriptions","organizations_url":"https://api.github.com/users/tdgunes/orgs","repos_url":"https://api.github.com/users/tdgunes/repos","events_url":"https://api.github.com/users/tdgunes/events{/privacy}","received_events_url":"https://api.github.com/users/tdgunes/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tdgunes/Terasology","description":"Terasology - open source voxel world","fork":true,"url":"https://api.github.com/repos/tdgunes/Terasology","forks_url":"https://api.github.com/repos/tdgunes/Terasology/forks","keys_url":"https://api.github.com/repos/tdgunes/Terasology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tdgunes/Terasology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tdgunes/Terasology/teams","hooks_url":"https://api.github.com/repos/tdgunes/Terasology/hooks","issue_events_url":"https://api.github.com/repos/tdgunes/Terasology/issues/events{/number}","events_url":"https://api.github.com/repos/tdgunes/Terasology/events","assignees_url":"https://api.github.com/repos/tdgunes/Terasology/assignees{/user}","branches_url":"https://api.github.com/repos/tdgunes/Terasology/branches{/branch}","tags_url":"https://api.github.com/repos/tdgunes/Terasology/tags","blobs_url":"https://api.github.com/repos/tdgunes/Terasology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tdgunes/Terasology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tdgunes/Terasology/git/refs{/sha}","trees_url":"https://api.github.com/repos/tdgunes/Terasology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tdgunes/Terasology/statuses/{sha}","languages_url":"https://api.github.com/repos/tdgunes/Terasology/languages","stargazers_url":"https://api.github.com/repos/tdgunes/Terasology/stargazers","contributors_url":"https://api.github.com/repos/tdgunes/Terasology/contributors","subscribers_url":"https://api.github.com/repos/tdgunes/Terasology/subscribers","subscription_url":"https://api.github.com/repos/tdgunes/Terasology/subscription","commits_url":"https://api.github.com/repos/tdgunes/Terasology/commits{/sha}","git_commits_url":"https://api.github.com/repos/tdgunes/Terasology/git/commits{/sha}","comments_url":"https://api.github.com/repos/tdgunes/Terasology/comments{/number}","issue_comment_url":"https://api.github.com/repos/tdgunes/Terasology/issues/comments{/number}","contents_url":"https://api.github.com/repos/tdgunes/Terasology/contents/{+path}","compare_url":"https://api.github.com/repos/tdgunes/Terasology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tdgunes/Terasology/merges","archive_url":"https://api.github.com/repos/tdgunes/Terasology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tdgunes/Terasology/downloads","issues_url":"https://api.github.com/repos/tdgunes/Terasology/issues{/number}","pulls_url":"https://api.github.com/repos/tdgunes/Terasology/pulls{/number}","milestones_url":"https://api.github.com/repos/tdgunes/Terasology/milestones{/number}","notifications_url":"https://api.github.com/repos/tdgunes/Terasology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tdgunes/Terasology/labels{/name}","releases_url":"https://api.github.com/repos/tdgunes/Terasology/releases{/id}","deployments_url":"https://api.github.com/repos/tdgunes/Terasology/deployments","created_at":"2016-04-07T21:52:38Z","updated_at":"2016-04-07T21:52:50Z","pushed_at":"2016-06-13T23:14:51Z","git_url":"git://github.com/tdgunes/Terasology.git","ssh_url":"git@github.com:tdgunes/Terasology.git","clone_url":"https://github.com/tdgunes/Terasology.git","svn_url":"https://github.com/tdgunes/Terasology","homepage":"http://terasology.org","size":264992,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"develop"}},"base":{"label":"MovingBlocks:develop","ref":"develop","sha":"0692653714099b156b93a4c5ec5008ff9a2c3240","user":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"repo":{"id":1438007,"name":"Terasology","full_name":"MovingBlocks/Terasology","owner":{"login":"MovingBlocks","id":1292442,"avatar_url":"https://avatars.githubusercontent.com/u/1292442?v=3","gravatar_id":"","url":"https://api.github.com/users/MovingBlocks","html_url":"https://github.com/MovingBlocks","followers_url":"https://api.github.com/users/MovingBlocks/followers","following_url":"https://api.github.com/users/MovingBlocks/following{/other_user}","gists_url":"https://api.github.com/users/MovingBlocks/gists{/gist_id}","starred_url":"https://api.github.com/users/MovingBlocks/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MovingBlocks/subscriptions","organizations_url":"https://api.github.com/users/MovingBlocks/orgs","repos_url":"https://api.github.com/users/MovingBlocks/repos","events_url":"https://api.github.com/users/MovingBlocks/events{/privacy}","received_events_url":"https://api.github.com/users/MovingBlocks/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MovingBlocks/Terasology","description":"Terasology - open source voxel world","fork":false,"url":"https://api.github.com/repos/MovingBlocks/Terasology","forks_url":"https://api.github.com/repos/MovingBlocks/Terasology/forks","keys_url":"https://api.github.com/repos/MovingBlocks/Terasology/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MovingBlocks/Terasology/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MovingBlocks/Terasology/teams","hooks_url":"https://api.github.com/repos/MovingBlocks/Terasology/hooks","issue_events_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/events{/number}","events_url":"https://api.github.com/repos/MovingBlocks/Terasology/events","assignees_url":"https://api.github.com/repos/MovingBlocks/Terasology/assignees{/user}","branches_url":"https://api.github.com/repos/MovingBlocks/Terasology/branches{/branch}","tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/tags","blobs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/refs{/sha}","trees_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/{sha}","languages_url":"https://api.github.com/repos/MovingBlocks/Terasology/languages","stargazers_url":"https://api.github.com/repos/MovingBlocks/Terasology/stargazers","contributors_url":"https://api.github.com/repos/MovingBlocks/Terasology/contributors","subscribers_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscribers","subscription_url":"https://api.github.com/repos/MovingBlocks/Terasology/subscription","commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/commits{/sha}","git_commits_url":"https://api.github.com/repos/MovingBlocks/Terasology/git/commits{/sha}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/comments{/number}","issue_comment_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/comments{/number}","contents_url":"https://api.github.com/repos/MovingBlocks/Terasology/contents/{+path}","compare_url":"https://api.github.com/repos/MovingBlocks/Terasology/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MovingBlocks/Terasology/merges","archive_url":"https://api.github.com/repos/MovingBlocks/Terasology/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MovingBlocks/Terasology/downloads","issues_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues{/number}","pulls_url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls{/number}","milestones_url":"https://api.github.com/repos/MovingBlocks/Terasology/milestones{/number}","notifications_url":"https://api.github.com/repos/MovingBlocks/Terasology/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MovingBlocks/Terasology/labels{/name}","releases_url":"https://api.github.com/repos/MovingBlocks/Terasology/releases{/id}","deployments_url":"https://api.github.com/repos/MovingBlocks/Terasology/deployments","created_at":"2011-03-04T03:49:19Z","updated_at":"2016-06-14T02:46:46Z","pushed_at":"2016-06-13T23:14:51Z","git_url":"git://github.com/MovingBlocks/Terasology.git","ssh_url":"git@github.com:MovingBlocks/Terasology.git","clone_url":"https://github.com/MovingBlocks/Terasology.git","svn_url":"https://github.com/MovingBlocks/Terasology","homepage":"http://terasology.org","size":332335,"stargazers_count":1519,"watchers_count":1519,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":629,"mirror_url":null,"open_issues_count":303,"forks":629,"open_issues":303,"watchers":1519,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325"},"html":{"href":"https://github.com/MovingBlocks/Terasology/pull/2325"},"issue":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2325"},"comments":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/issues/2325/comments"},"review_comments":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325/comments"},"review_comment":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/2325/commits"},"statuses":{"href":"https://api.github.com/repos/MovingBlocks/Terasology/statuses/98687b4f987ae3778bbaaa3d23219ca2f93947fc"}}}}
{"actor":{"display_login":"msteiger"}}