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_postmaterial 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 editorchoose a postprocess material (any one starting withpost_*).
- 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 RenderorPostfield, depending on the order they should be rendered in.
- If you specify your postprocess material in the Renderfield, 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 Postfield 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 Renderfield, it will be rendered before any other postprocesses (such as HDR, DOF, etc.) are applied.
- Make sure that Main menu->Render tab -> Auxiliary bufferoption is checked.
- In the Material editorchoose a material you want to apply the postprocess for.
- Go to the Statestab ->Passes -> Auxiliarypass and set itDefault. It means that the material is rendered into theauxiliary 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->Maskand setred.
- Go to the surface material to be rendered with a postprocess. Choose Parameterstab and double-click on theAuxiliary -> Colorfield.
- Set Green and Blue channels to 0.