Post Processing

You can do realtime image processing for rendered picture
of 3d scene. For post processing, program first render 3d scene to a
texture, then do processing on the texture by every Post in turn. A Post
is similarly to a Filter in Photoshop.
Workflow:
1. Create a new material
Click the "New" button in the Material Panel.
Select a D3D Effect file from Awakening's 'effects\post'
folder for the new material.
2. New a post
Click the "New" button in the Post Panel. A Select Material Dialog
appears, select the material created in previous step.
3. Set Material Properties
Some effects like distort
and levels
needs setting textures to works well. Most effects have factors, you can
define a Script Variable for the material, then do dynamic changing by
scripting.
Preset Effects List:
Name |
Preview | Explanation |
| original image | ![]() |
no post processing |
| auto - contrast | ![]() |
result = (source + factor - 0.5 ) X 2
Factor: Shader File: auto_contrast.sha |
| brightness/contrast | ![]() |
Factor: number brightness = [ -0.5 .. 0.5 ] number contrast = [ 0 .. 2 ] Usage: post_setBrightnessContrast( material, brightness ,contrast ) PixelShader: 1.0 Shader File: brightness_contrast.sha |
| blur | ![]() |
Factor:
Usage: Shader File: blur.sha |
| blur 2x |
Factor:
Usage: Shader File: blur_2x.sha |
|
| blur 4x
|
Factor: Shader File: blur_4x.sha |
|
| color change | ![]() |
result = source X factor
Factor:
Usage: Shader File: color_change.sha |
| distort | ![]() |
Factor:
Usage: Shader File: distort.sha |
| glow | ![]() |
Factor: number blurfactor number blendfactor number threshold= [ 0 .. 1 ] Usage: post_setGlow( material, blurfactor, blendfactor, threshold ) PixelShader: 1.4 Shader File: glow.sha |
| desaturate | ![]() |
Factor: None Usage: None PixelShader: 1.4 Shader File: gray.sha |
| invert | ![]() |
Factor: None Usage: None PixelShader: 1.0 Shader File: invert.sha |
| levels | ![]() |
Factor:
Usage: Shader File: levels.sha |
| gray levels | ![]() |
Factor: Shader File: levels_gray.sha |
| threshold | ![]() |
if ( source > 0.5 ) then result =
lightcolor
Factor: PixelShader: 1.4 Shader File: threshold.sha |
| flexible threshold | if ( source >= threshold ) then result =
lightcolor
Factor: Shader File: threshold_flexible.sha |
|
| gray threshold | ![]() |
1. first desaturate
source color
Factor: PixelShader: 1.4 Shader File: threshold_gray.sha |
| flexible gray threshold | 1. first desaturate
source color
Factor: Shader File: threshold_gray_flexible.sha |
|
| edge detect | ![]() |
1. first invert
source color and output to a texture PixelShader: 1.0 Shader File: invert.sha, addtex0.sha |
| glow and brighter | ![]() |
1. first do auto - contrast
and output to a texture PixelShader: No Shader File: auto_contrast.sha, addtex0.sha |
Output to Texture:
You can assign a render target to a post, so output the post result to
texture, not to screen any more. Then you can reuse the texture in succeeding
posts. For example, you can first use a post to output whole image to a small
texture, then enlarge the small texture to full screen in succeeding post, to
create a consuming blurring effect.