{"action":"created","issue":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/1672","labels_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/1672/labels{/name}","comments_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/1672/comments","events_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/1672/events","html_url":"https://github.com/MovingBlocks/Terasology/pull/1672","id":69294836,"number":1672,"title":"LwjglRenderingProcess no longer a singleton, Dimension instances used more extensively","user":{"login":"emanuele3d","id":6934584,"avatar_url":"https://avatars.githubusercontent.com/u/6934584?v=3","gravatar_id":"","url":"https://api.github.com/users/emanuele3d","html_url":"https://github.com/emanuele3d","followers_url":"https://api.github.com/users/emanuele3d/followers","following_url":"https://api.github.com/users/emanuele3d/following{/other_user}","gists_url":"https://api.github.com/users/emanuele3d/gists{/gist_id}","starred_url":"https://api.github.com/users/emanuele3d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emanuele3d/subscriptions","organizations_url":"https://api.github.com/users/emanuele3d/orgs","repos_url":"https://api.github.com/users/emanuele3d/repos","events_url":"https://api.github.com/users/emanuele3d/events{/privacy}","received_events_url":"https://api.github.com/users/emanuele3d/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MovingBlocks/Terasology/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-04-18T10:23:16Z","updated_at":"2015-04-19T07:31:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/pulls/1672","html_url":"https://github.com/MovingBlocks/Terasology/pull/1672","diff_url":"https://github.com/MovingBlocks/Terasology/pull/1672.diff","patch_url":"https://github.com/MovingBlocks/Terasology/pull/1672.patch"},"body":"The [first commit](https://github.com/MovingBlocks/Terasology/commit/47ec5d348448357c9dc59bce418aa738882576d8) is an easy and hopefully uncontroversial one:\r\n* it takes advantage of FBO.Dimensions instances throughout to simplify FBO generation code and dimensions handling, making more explicit the sizes of the FBOs involved and any change to them.\r\n* it also add a couple of small method wrapping unsightly glViewport() calls into setViewportToFullScale() and setViewportTo().\r\n\r\nThe [second commit](https://github.com/MovingBlocks/Terasology/commit/09a6c9203d256a0e7d212c0171bd238e190166ed) is only a little more involved because it changes the LwjglRenderingProcess class from a singleton obtainable via its getInstance() method to an object instantiated by the WorldRenderer upon construction, and then made available throughout the application via the CoreRegistry. \r\n\r\nThis allows for a more explicit control of the life cycle of the instance. Previously the instance was implicitely created by ShaderParameters instances within ShaderManager.initShaders() during Display initialization, well before the rendering process (or the shaders for that matter) were actually needed. Shaders are now initialized just after the rendering process is initialized, during WorldRenderer construction.\r\n\r\nThis second commit deals, perhaps a bit bluntly, also with shader initialization in headless mode. The headless version of the ShaderManager was used to call its initShaders() method a number times in headless. initShaders() is however an empty method and I removed calls to it. In hindsight, as I write this, this was perhaps unnecessary and maybe even wrong. An headless mode smoke test didn't reveal any problem with the changes though. And what do shaders do in headless mode anyway?\r\n\r\n\r\nFinally, as a reference to where I am heading, you can take advantage of the last commit on [this branch](https://github.com/emanuele3d/Terasology/tree/RendererChangesBKP)."},"comment":{"url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/comments/94248154","html_url":"https://github.com/MovingBlocks/Terasology/pull/1672#issuecomment-94248154","issue_url":"https://api.github.com/repos/MovingBlocks/Terasology/issues/1672","id":94248154,"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},"created_at":"2015-04-19T07:31:23Z","updated_at":"2015-04-19T07:31:23Z","body":"Sounds great. Looking forward to this!"}}