Postprocess Materials
Unigine offers a number of materials to create image postprocessing effects out of the box. These effects are applied after the scene in the viewport has been rendered, but before outputting it onto the screen. (Other postprocessing effects, such as HDR and DOF, can be adjusted directly in Render settings).
Postprocess materials are found in a unigine_post material library.
There are two types of postprocess materials:
- Full-screen postprocesses. (To apply them, you need to perform only steps 1-3).
- Postprocesses applied to selected materials. These are:
- post_filter_reflection
- post_filter_scattering
- post_hblur_mask
- post_vblur_mask
How to Apply Postprocess Materials
- In the Material editor choose a postprocess material (any one starting with post_*).
- If it is tweakable and you want to use non-default values, inherit this material into the material library of your project.
- Open Render settings -> Common tab and copy the name of postprocess material you want to apply into Render or Post field, depending on the order they should be rendered in.
- If you specify your postprocess material in the Render field, it will be rendered before any other postprocesses (such as HDR, DOF, etc.) are applied.
For example, we would not want subsurface scattering to be applied after the HDR blur. If we specify post_filter_scattering here, in Render field, sub-surface scattering is rendered first and HDR is applied after it. - On the contrary, postprocess material set in the Post field are rendered in the very end, after everything else has already been drawn. For example, such postprocess will also affect the color of glowing areas or HDR flares.
If it is a full-screen postprocess, that is it: the postprocess will be applied on the spot.
However, some postprocesses can be applied per material. To use them, you need to perform the following actions as well. - If you specify your postprocess material in the Render field, it will be rendered before any other postprocesses (such as HDR, DOF, etc.) are applied.
- Make sure that Main menu -> Render tab -> Auxiliary buffer option is checked.
- In the Material editor choose a material you want to apply the postprocess for.
- Go to the States tab -> Passes -> Auxiliary pass and set it Default. It means that the material is rendered into the auxiliary color buffer.
How to Mask Postprocess Materials
You can create up to three postprocess materials and mask which one should be used for rendering.
- For the postprocess material, choose States -> Mask and set red.
- Go to the surface material to be rendered with a postprocess. Choose Parameters tab and double-click on the Auxiliary -> Color field.
- Set Green and Blue channels to 0.