{"action":"created","issue":{"url":"https://api.github.com/repos/GoranM/bdx/issues/444","labels_url":"https://api.github.com/repos/GoranM/bdx/issues/444/labels{/name}","comments_url":"https://api.github.com/repos/GoranM/bdx/issues/444/comments","events_url":"https://api.github.com/repos/GoranM/bdx/issues/444/events","html_url":"https://github.com/GoranM/bdx/issues/444","id":109238155,"number":444,"title":"Suggestion: 2D Screen Filter Downsampling","user":{"login":"SolarLune","id":4733521,"avatar_url":"https://avatars.githubusercontent.com/u/4733521?v=3","gravatar_id":"","url":"https://api.github.com/users/SolarLune","html_url":"https://github.com/SolarLune","followers_url":"https://api.github.com/users/SolarLune/followers","following_url":"https://api.github.com/users/SolarLune/following{/other_user}","gists_url":"https://api.github.com/users/SolarLune/gists{/gist_id}","starred_url":"https://api.github.com/users/SolarLune/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SolarLune/subscriptions","organizations_url":"https://api.github.com/users/SolarLune/orgs","repos_url":"https://api.github.com/users/SolarLune/repos","events_url":"https://api.github.com/users/SolarLune/events{/privacy}","received_events_url":"https://api.github.com/users/SolarLune/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-01T06:28:53Z","updated_at":"2015-10-03T21:25:53Z","closed_at":null,"body":"Hey, there. \r\n\r\nSo basically, I think being able to down-sample / \"render smaller and then upscale\" 2D filters would be a nice feature to add. For some context, I'm working with the Bloom filter in my game, and trying to get it to be smooth and run quickly is just a bit difficult, which reminds me of the same problem with Bloom filters in the BGE, haha. \r\n\r\nSo, I'm thinking that it should be easier on the GPU to render the bloom shader small, and then upscale it later - I believe this is simple downsampling.\r\n\r\nAs a guess, this would require a couple of changes. One would be to make a `size` or `resolutionPercentage` property that would set the size of the FrameBuffer the ShaderProgram uses (i.e. resolutionPercentage = new Vector2f(0.5f, 0.5f) to set it to be half the size of the screen). I'd put it on the ShaderProgram because every ShaderProgram can theoretically have different resolution percentages (i.e. a Bloom filter might be downsampled while a Tint filter would probably be run at full resolution).\r\n\r\nThe other change would be a simple boolean variable called something like `overlay` on the ShaderProgram. This would indicate whether BDX should draw the outputted framebuffer straight:\r\n\r\n`Scene render > Effect > Output`\r\n\r\n... or overlay it on the previous, unaltered render output:\r\n\r\n`Scene render > Effect > Scene Render + Effect > Output`\r\n\r\nThis way, the \"low quality\" bloom filter result would be overlaid on top of the normal, high-fidelity game render for the final output for that ShaderProgram.\r\n\r\nThis is to present the idea - if it's OK'd, then I'll look into it to see if it'll work / if it actually does improve things GPU workload-wise. I'm not sure if simply changing the size of the frame buffer would work, or if we would actually need to render it small for the downsampling to take effect. I guess I'll see when I test it."},"comment":{"url":"https://api.github.com/repos/GoranM/bdx/issues/comments/145291916","html_url":"https://github.com/GoranM/bdx/issues/444#issuecomment-145291916","issue_url":"https://api.github.com/repos/GoranM/bdx/issues/444","id":145291916,"user":{"login":"GoranM","id":2141814,"avatar_url":"https://avatars.githubusercontent.com/u/2141814?v=3","gravatar_id":"","url":"https://api.github.com/users/GoranM","html_url":"https://github.com/GoranM","followers_url":"https://api.github.com/users/GoranM/followers","following_url":"https://api.github.com/users/GoranM/following{/other_user}","gists_url":"https://api.github.com/users/GoranM/gists{/gist_id}","starred_url":"https://api.github.com/users/GoranM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoranM/subscriptions","organizations_url":"https://api.github.com/users/GoranM/orgs","repos_url":"https://api.github.com/users/GoranM/repos","events_url":"https://api.github.com/users/GoranM/events{/privacy}","received_events_url":"https://api.github.com/users/GoranM/received_events","type":"User","site_admin":false},"created_at":"2015-10-03T21:25:53Z","updated_at":"2015-10-03T21:25:53Z","body":"Suggestion threads should be used to discuss the merits of the proposed feature. Implementation details should be discussed in the PR, assuming we agreed that the feature in question should be added, and therefore warrants a PR to begin with.\r\n\r\nI agree that this feature has merit, so in this case it's fine, but please, in the future, don't make PRs until we actually agree on adding a particular feature.\r\n\r\nIn cases where you really need to show code ahead of time, in order to support the idea itself, you can just push a commit that references the issue in question, and that will make it available in the issue."}}