UDN
Search public documentation:

PostProcessTechnicalGuide
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Post Process Effects > Post Process Technical Guide

Post Process Technical Guide


Document Changelog: Created by Daniel Wright.

Overview


This document is geared towards programmers, it describes how the major features of the Unreal Post Process system are designed and implemented.

See the Post Process Editor User Guide page for information on working with Post Process Effects in UnrealEd.

Default Post Process Chain


The default post process chain that will be used in-game is specified by a setting in the Engine.ini:

[Engine.Engine]
DefaultPostProcessName=EngineMaterials.DefaultScenePostProcess

Cooking


When running the game with cooked data, make sure the package that contains the PostProcessChain is specified in the Engine.StartupPackages section in the Engine.ini file. Since a PostProcessChain often isn't referenced by other content or script code, it must be explicitly included by the .ini settings:

[Engine.StartupPackages]
+Package=FX_HitEffects

How effect settings are applied


Post process effects are controlled by settings from one of following three sources (not including game code):

  1. Effect node properties in the PostProcessChain (if "Use World Settings?" is FALSE)
  2. PostProcessVolume properties (if "Use World Settings?" is TRUE and the player is inside a PP volume)
  3. Default Post Process Settings in WorldInfo (if "Use World Settings?" is TRUE and the player is not inside a PP volume)

MotionBlur And UberPostProcessEffect


On Xbox, motion blur is handled by the UberPostProcessEffect. All motion blur settings are taken from the UberPostProcessEffect node (depending on its "Use World Settings?" checkbox) and any MotionBlurEffect node in the PostProcessChain is ignored. On other platforms, motion blur is handled by a specific MotionBlurEffect node in the PostProcessChain. All motion blur settings are taken from the MotionBlurEffect node (depending on its "Use World Settings?" checkbox) and any motion blur settings in the UberPostProcessEffect node is ignored.

Post Process Manager


At runtime, prost process effects can be modified through UnrealScript or native code using the PostProcessManager class. In this case, game script code often replaces the entire PostProcessChain and modifies MaterialInstanceConstant values in a MaterialEffect for a custom look. It can be a good idea to set "Use World Settings?" (bUseWorldSettings) to FALSE for these game-controlled effect nodes to avoid conflicts with any PostProcessVolume settings.

Creating New Effects


The process for creating a new post process effect is pretty simple. You need to create a new class derived from UPostProcessEffect which creates a new scene proxy derived from FPostProcessSceneProxy. Then you also need to create your global shaders that will be used for rendering that proxy. You can pretty much just cut and paste from UMotionBlurEffect, FMotionBlurProcessSceneProxy, FMotionBlurPixelShader, FMotionBlurVertexShader to get you started.

Controlling Effects through Gameplay Script


Often it is necessary to change certain post process effects while the game is running based on some gameplay criteria. For example, in Gears of War the post process settings were changed whenver the in-game pause menu came up so that the screen could be blurred and to give the scene a more menacing red tone. By using the ULocalPlayer.bOverridePostProcessSettings property you can override what post process values are currently being used for the player. Then, the player's FCurrentPostProcessVolumeInfo CurrentPPInfo struct gets filled in with the new desired values and the interpolation times to transition to these values.

Performance: Tuning Effects


Here are some useful techniques for tuning post process effects.

Useful Console Commands

There are some useful Console Commands, such as SHOW POSTPROCESS.

Additionally, there is the following:

SET <EFFECT> bShowInGame FALSE

Where EFFECT can be either MOTIONBLUREFFECT, DOFANDBLOOMEFFECT or MATERIALEFFECT.

Ambient Occlusion


Screen Space Ambient Occlusion (SSAO) was originally introduced; and then later improved upon. Visit the Improving SSAO page for information about the proposed changes.