# Post Processing
Many effects can be achieved via mere post-processing on raw pixel data, without any geometry processing at all. Trial offers a simple interface for such effects, the post-effect-pass
and simple-post-effect-pass
. A post effect pass is a pass that takes a number of input textures, and outputs a number of output textures, simply running a fragment shader for every output pixel.
The simple version always declares an input port called previous-pass
and an output port called color
. Using the port texspec
you can further customise things such as the resolution of the textures, internal format, etc. See shader passes for more info on that.
Typically you'll then just implement a fragment shader on your class, using the uv
input variable, and the color
output variable.
Presets
Trial also ships a number of useful preset post processing passes:
copy-pass
Just copies the texture.negative-pass
Negates the colours. Only works on low dynamic range.pixellate-pass
Simply downsamples the image with nearest-neighbour.color-band-pass
Reduce the colour pallette by banding the colours and optionally dithering it.color-adjustment-pass
Perform various colour adjustments like brightness, contrast, etc.fisheye-pass
Distort the image by a fisheye lens.halftone-pass
Give the image a halftone print rendering appearance.bokeh-blur-pass
Applies a circular Bokeh blur to the image.box-blur-pass
Applies a box blur to the image.sobel-pass
Applies a sobel edge detection filter.shapren-pass
Sharpens edges.gaussian-blur-pass
Applies a gaussian blur in a single direction.kawase-blur-pass
Applies a dual-Kawase blur.radial-blur-pass
Applies a radial blur with a specific origin.swirl-pass
Swirl the pixel around the center of a circle.fxaa-pass
A very easy-to-use and cheap anti-aliasing pass.blend-pass
Blends two images (a-pass
,b-pass
) together using one of many blending methods::b-over
:a-over
:add
:subtract
:multiply
:screen
:overlay
:hard-light
:soft-light
:color-dodge
:color-burn
:darken-only
:lighten-only
:divide
:difference
:linear-burn
:erase
high-pass-filter
Only keeps pixels with a luminance above the threshold. Others are set to transparent.low-pass-filter
Only keeps pixels with a luminance below the threshold. Others are set to transparent.chromatic-aberration-filter
Applies a chromatic aberration effect, shifting the three colour channels separately.displacement-pass
Displace the pixels locally based on the shift amount stored in adisplacement-map
.luminance-pass
Outputs a grayscale version based on the color luminance.light-scatter-pass
Performs a light scattering effect.visualizer-pass
Composes one or more textures (t[0]
...t[3]
) together for easier debug viewing.