Custom Post Effects
As with a few of the newer features and upgrades we are moving to the new plugin extensions as this will speed up our Skyline development time.
This also has the added bonus of providing the end users with a lua based sdk. This can then be used to develop new or extend features complete with their own editors.
We now have the first stages of the new post effect system. The new system allows for internal and custom post effects to be easily added along with shader values that can be dynamically changed by using Lua.
The Post Effect development pipeline now consists of few steps:
- 1) Create the shader files for Compositor, Material and hlsl - This can be done by making a copy of the provided custom template and renaming to your new effect name. At some point we aim to make this a create all button!
- 2) Create your own editor controls by using Qt or edit and extend the provided Post effects editor.
- 3) Create the hook ins with an Extension plugin Lua file and the new postFx library.
To add your effects use the command postFx.addFx(CompositorName) before you want to use the effect. This will register the material,compositor and shader for this effect.
When you want the effect to become visible in the scene, you must now enable it using : postFx.enable(CompositorName,state)
Then you need to tell the system if any parameters are to be changed: postFx.addParam(CompositorName, ParamName, MaterialName, FragmentName)
postFx.addParam("Custom_node", "red", "Custom", "Custom_Frag")
postFx.addParam("Custom_node", "green", "Custom", "Custom_Frag")
postFx.addParam("Custom_node", "blue", "Custom", "Custom_Frag")
And finally you would need to send the new values when they change to the shader using:postFx.sendValue(CompositorName, ParamName, value).
function sld_pfx_Customred_Changed(v) postFx.sendValue("Custom_node", "red", v) end
function sld_pfx_Customgreen_Changed(v) postFx.sendValue("Custom_node", "green", v) end
function sld_pfx_Customblue_Changed(v) postFx.sendValue("Custom_node", "blue", v)
These commands can be used in an extension editor or run from within your game at runtime to change values in response to player actions making your scene more dynamic.
We do have plans to make this a simple creation process as simple as a press of a button! although you will still need to have basic/beginner shader skills.
Have no fears though, if you don't want to make any post effects we have a few shaders already for conversion to give you some cool effects to play with.
Our intentions with this new Post Effects pipeline is to eventually get it so that you can use modules to create the shaders, but this a little while off yet as the core stability and base feature set are to be completed first.