AddPostEffect

This function attaches a post-processing effect to the camera effects stack. Post-processing effects can be loaded as either .shader or .lua files, and will be rendered in the order they are attached to the camera.

Syntax

Parameters

Returns

Returns an index to the post-processing effect if it was successfully added to the camera effects stack, otherwise -1 is returned.

Remarks

Post-processing scripts must contain a function called
"Script:Render" to be loaded. The arguments for the function are as follows:
function Script:Render(camera, context, buffer, depthtexture, diffusetexture, normaltexture)

Post-effect scripts may bind textures, downsample images, or perform other operations during the Render() function, which makes them very powerful.