This page has been translated automatically.
UnigineScript
The Language
Core Library
Engine Library
Node-Related Classes
GUI-Related Classes
Plugins Library
High-Level Systems
Samples
Usage Examples
C++ API
API Reference
Integration Samples
Usage Examples
C++ Plugins
Migration
Migrating to UNIGINE 2.0
C++ API Migration
Migrating from UNIGINE 2.0 to UNIGINE 2.1
Внимание! Эта версия документация УСТАРЕЛА, поскольку относится к более ранней версии SDK! Пожалуйста, переключитесь на самую актуальную документацию для последней версии SDK.
Внимание! Эта версия документации описывает устаревшую версию SDK, которая больше не поддерживается! Пожалуйста, обновитесь до последней версии SDK.

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:

  1. Full-screen postprocesses. (To apply them, you need to perform only steps 1-3).
  2. Postprocesses applied to selected materials. These are: (To apply them, you need to perform all steps).

How to Apply Postprocess Materials

  1. In the Material editor choose a postprocess material (any one starting with post_*).

    A list of postprocess materials in the Materials editor

  2. If it is tweakable and you want to use non-default values, inherit this material into the material library of your project.
  3. 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 you want to use several postprocess materials at the same time, separate their names in any of these fields by a comma with no whitespace.

    Copy postprocess materials into Render or Post field in Render settings

    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.

  4. Make sure that Main menu -> Render tab -> Auxiliary buffer option is checked.

    Auxiliary buffer should be enabled

  5. In the Material editor choose a material you want to apply the postprocess for.
  6. Go to the States tab -> Passes -> Auxiliary pass and set it Default. It means that the material is rendered into the auxiliary color buffer.

    Enable Auxiliary pass for the material that should be postprocessed

How to Mask Postprocess Materials

You can create up to three postprocess materials and mask which one should be used for rendering.

  1. For the postprocess material, choose States -> Mask and set red.

    Select auxiliary color mask

  2. Go to the surface material to be rendered with a postprocess. Choose Parameters tab and double-click on the Auxiliary -> Color field.

    On the States tab, double click on the Auxiliary color

  3. Set Green and Blue channels to 0.

    Set Green and Blue to 0

This way only the postprocess with a red mask will be applied to the rendered material.
Last update: 03.07.2017
Build: ()