Skip to content
PostProcess

Scene / PostProcess

PostProcess Class

Post-Processing


Post-Processing refers to a series of techniques and effects for image processing after rendering. Post-Processing is usually used to enhance or modify the contrast, saturation and other characteristics of the final rendered image to achieve a specific visual effect or style.

Usage example: You can control the real-time effect of post-processing in the editor by following the steps below Create a script named "PostProcessExample", place it in the object bar, open the script, enter the following code, run the game, and you can control the gamma value of Post-Processing through the+and - keys

ts
@Component
export default class PostProcessExample extends mw.Script {
    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if(SystemUtil.isClient())
        {
            mw.InputUtil.onKeyDown(Keys.Add,()=>{
                // Keypad+Jian, increase Post-Processing saturation by 1 unit
                PostProcess.saturation = PostProcess.saturation + 1;
                Console.log ("current post-processing saturation:"+PostProcess. condition);
            });
            InputUtil.onKeyDown(Keys.Subtract,()=>{
                // Keypad - Jian, reduce Post-Processing saturation by 1 unit
                PostProcess.saturation = PostProcess.saturation - 1;
                Console.log ("current post-processing saturation:"+PostProcess. condition);
            });
        }
    }
}
@Component
export default class PostProcessExample extends mw.Script {
    // When the script is instantiated, this function will be called before the first frame update
    protected async onStart(): Promise<void> {
        if(SystemUtil.isClient())
        {
            mw.InputUtil.onKeyDown(Keys.Add,()=>{
                // Keypad+Jian, increase Post-Processing saturation by 1 unit
                PostProcess.saturation = PostProcess.saturation + 1;
                Console.log ("current post-processing saturation:"+PostProcess. condition);
            });
            InputUtil.onKeyDown(Keys.Subtract,()=>{
                // Keypad - Jian, reduce Post-Processing saturation by 1 unit
                PostProcess.saturation = PostProcess.saturation - 1;
                Console.log ("current post-processing saturation:"+PostProcess. condition);
            });
        }
    }
}

Table of contents

Accessors

ambientOcclusionEnabled(): boolean other
Get ambient light occlusion switch
ambientOcclusionIntensity(): number other
Get ambient occlusion intensity
ambientOcclusionRadius(): number other
Obtain the ambient light shielding radius
bloom(): number other
Get bloom
bloomExposureFactor(): number other
Obtain bloom Exposure coefficient
bloomRange(): number other
Get bloom Range
bloomSpread(): number other
Obtain bloom Diffusion
blurEnabled(): boolean other
Obtain ambiguity
blurIntensity(): number other
Obtain fuzzy strength
config(): PostProcessConfig other
Obtain post-processing attribute configuration
contrast(): number other
Obtain global contrast
depthOfFieldEnabled(): boolean other
Get Depth of Field Switch
depthOfFieldIntensity(): number other
Obtain depth of field intensity
focusDistance(): number other
Obtain focal length distance
focusPosition(): number other
Obtain focal length position
preset(): PostProcessPreset other
Get preset settings
saturation(): number other
Get global saturation

Accessors

ambientOcclusionEnabled

Static get ambientOcclusionEnabled(): boolean other

Static set ambientOcclusionEnabled(Value): void other

Get ambient light occlusion switch

Returns

booleanGet value

Set ambient occlusion switch

Parameters

Value booleanUsage: setting value

ambientOcclusionIntensity

Static get ambientOcclusionIntensity(): number other

Static set ambientOcclusionIntensity(Value): void other

Get ambient occlusion intensity

Returns

numberGet value

The higher the ambient light occlusion intensity (0~1), the higher the intensity

Parameters

Value numberUsage: setting value

ambientOcclusionRadius

Static get ambientOcclusionRadius(): number other

Static set ambientOcclusionRadius(Value): void other

Obtain the ambient light shielding radius

Returns

numberGet value

The smaller the value of the ambient light shielding radius (0.1~500.0), the smaller the radius

Parameters

Value numberUsage: setting value

bloom

Static get bloom(): number other

Static set bloom(Value): void other

Get bloom

Returns

numberGet value

Set bloom

Parameters

Value numberUsage: setting value

bloomExposureFactor

Static get bloomExposureFactor(): number other

Static set bloomExposureFactor(Value): void other

Obtain bloom Exposure coefficient

Returns

numberGet value

Set bloom Exposure coefficient

Parameters

Value numberUsage: setting value

bloomRange

Static get bloomRange(): number other

Static set bloomRange(Value): void other

Get bloom Range

Returns

numberGet value

Set bloom Range

Parameters

Value numberUsage: setting value

bloomSpread

Static get bloomSpread(): number other

Static set bloomSpread(Value): void other

Obtain bloom Diffusion

Returns

numberGet value

Set bloom Diffusion

Parameters

Value numberUsage: setting value

blurEnabled

Static get blurEnabled(): boolean other

Static set blurEnabled(Value): void other

Obtain ambiguity

Returns

booleanGet value

Fuzzy switch

Parameters

Value booleanUsage: setting value

blurIntensity

Static get blurIntensity(): number other

Static set blurIntensity(Value): void other

Obtain fuzzy strength

Returns

numberGet value

Fuzzy intensity switch

Parameters

Value numberUsage: setting value

config

Static get config(): PostProcessConfig other

Static set config(newConfig): void other

Obtain post-processing attribute configuration

Returns

PostProcessConfigGet value

Set post-processing attribute configuration

Parameters

newConfig PostProcessConfigUsage: setting value

contrast

Static get contrast(): number other

Static set contrast(Value): void other

Obtain global contrast

Returns

numberGet value

Set global contrast (0.2~5.0)

Parameters

Value numberUsage: setting value

depthOfFieldEnabled

Static get depthOfFieldEnabled(): boolean other

Static set depthOfFieldEnabled(Value): void other

Get Depth of Field Switch

Returns

booleanGet value

Switch depth of field

Parameters

Value booleanUsage: setting value

depthOfFieldIntensity

Static get depthOfFieldIntensity(): number other

Static set depthOfFieldIntensity(Value): void other

Obtain depth of field intensity

Returns

numberGet value

Set depth of field intensity

Parameters

Value numberUsage: setting value

focusDistance

Static get focusDistance(): number other

Static set focusDistance(Value): void other

Obtain focal length distance

Returns

numberGet value

Set focal length distance

Parameters

Value numberUsage: setting value

focusPosition

Static get focusPosition(): number other

Static set focusPosition(Value): void other

Obtain focal length position

Returns

numberGet value

Set focus position

Parameters

Value numberUsage: setting value

preset

Static get preset(): PostProcessPreset other

Static set preset(newPreset): void other

Get preset settings

Returns

PostProcessPresetPreset enumeration

Set presets

Parameters

newPreset PostProcessPresetUsage: preset enumeration

saturation

Static get saturation(): number other

Static set saturation(Value): void other

Get global saturation

Returns

numberGet value

Set global saturation (0~2)

Parameters

Value numberUsage: setting value