Jump to content

Post-processing effects


Admin
 Share

Recommended Posts

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.

  • Upvote 3

 

 

Link to comment
Share on other sites

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

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

Guest Red Ocktober

can you comment on what kind of performance hit can be expected for stuff like fog or bloom...

 

--Mike

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

HP Omen - 16GB - i7 - Nvidia GTX 1060 6GB

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...