Hi,
I am currently working on a project where I need to do a lot of postprocessing. I implemented multiple effects, all in the same material, and enable/disable them via parameters and if-blocks.
This material looks terrible and is impossible to debug.
I though of putting each effect in a seperate material, and then only use the materials that are needed and swap them at runtime. Would this approach slow down my render? Or would it improve performance because of the if-blocks that are not needed any more?
Basically I have a few effects that (as of now) are performed one after the other:
- Move pixels via Look-up-tables
- Move the whole scene by an (x,y) offset
- Zoom in/out
- Apply color filters (black and white, grayscale, colorscale, threshold filter)
- Change contrast and brightness
It would not be difficult to move each of the steps into a seperate material.