Admin Posted May 8, 2013 Share Posted May 8, 2013 Technology in Leadwerks passes through two stages. First, it becomes possible through code. Then, it is documented and a front-end in the editor is build so it can be easily controllable with a visual interface. Post-processing effects are now possible with Leadwerks 3, but are still in the first stage of maturity. They will remain undocumented until we are sure how the front-end will work, and we document and lock down the post-processing API. To add a post-processing effect, just call Camera::AddPostEffect(Shader* shader), passing in the loaded shader for your effect. I provided one shader for bloom, found in "Shaders/PostProcess/bloom.shader". The following textures are provided: texture0: color texture1: depth texture2: blurred color (for DOF, bloom, etc.) The engine is smart enough that it will only perform the blurred downsampling if a shader is present that uses that texture slot. The renderer will pass the effects back and forth between two buffers after rendering, so that the output of one pass will be used for the input of the next pass. This lets you combine multiple post-processing effects in a sequence. Post-processing effects will be executed in the order they are attached to the camera. You can call Camera::ClearPostEffects() to remove all post-processing effects. Post-processing effects work on all platforms, but may run slowly on some mobile devices. 3 Quote Link to comment Share on other sites More sharing options...
karmacomposer Posted May 8, 2013 Share Posted May 8, 2013 How would I do this in Lua? Can you assign more than one shader to a camera? For example, I want Bloom, DOF and Water Droplets - is this possible? Where can we get other shaders that would work with Leadwerks 3? Great update, by the way! Now for terrain and water!!! Mike Quote MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 980 GTX with 16gb vram / SSD drives MSI Dominator Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1060 GTX with 8gb vram / SSD drives Alienware Laptop - Core i7 - 8 cores / 3ghz / 32gb RAM / Nvidia 1070 Ti with 16gb vram / SSD drives My Patreon page: https://www.patreon.com/michaelfelkercomposer My music for sale: https://www.tgcstore.net/category/513?format=all&perpage=30&textures=undefined&price=all&order=default&artists[]=87213 Custom synths and sounds - http://www.supersynths.com Link to comment Share on other sites More sharing options...
Admin Posted May 8, 2013 Author Share Posted May 8, 2013 The Lua API is the same as C++. You can assign multiple post-processing effects. At this time, we provide a shader for bloom. Quote Link to comment Share on other sites More sharing options...
Guest Red Ocktober Posted May 8, 2013 Share Posted May 8, 2013 can you comment on what kind of performance hit can be expected for stuff like fog or bloom... --Mike Quote Link to comment Share on other sites More sharing options...
gamecreator Posted May 9, 2013 Share Posted May 9, 2013 As mentioned elsewhere, please try to implement control over how powerful a shader is, if possible. I don't know what the function would look like but I'm thinking something like SetBloom(0.5f) to activate bloom at half strength, SetBloom(2.0f) for double strength, etc. It would be great to have control over at least the strength of the effect. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 11, 2013 Share Posted May 11, 2013 camera->AddPostEffect(); seems to destroy my buffers or something wierd is happening or overwrite all texture bindings putting it's own screen texture into all of them. I also tried to change the texture bindings to something other than textures0,1,2 but didn't seem to resolve my problem. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Admin Posted May 11, 2013 Author Share Posted May 11, 2013 You don't need to use your own buffers with the post effects. The camera will automatically set up what it needs. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 11, 2013 Share Posted May 11, 2013 Yes but I do have som buffers for reflection which won't work when postprosessing is added. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Admin Posted May 12, 2013 Author Share Posted May 12, 2013 I don't know exactly what you're doing, but you might need to use texture slots that aren't being used as described above. Quote Link to comment Share on other sites More sharing options...
shadmar Posted May 12, 2013 Share Posted May 12, 2013 I will send you an example. Quote HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.