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
@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
• | • | ||||
---|---|---|---|---|---|
Get ambient light occlusion switch Returns
| Set ambient occlusion switch Parameters
|
ambientOcclusionIntensity
• | • | ||||
---|---|---|---|---|---|
Get ambient occlusion intensity Returns
| The higher the ambient light occlusion intensity (0~1), the higher the intensity Parameters
|
ambientOcclusionRadius
• | • | ||||
---|---|---|---|---|---|
Obtain the ambient light shielding radius Returns
| The smaller the value of the ambient light shielding radius (0.1~500.0), the smaller the radius Parameters
|
bloom
• | • | ||||
---|---|---|---|---|---|
Get bloom Returns
| Set bloom Parameters
|
bloomExposureFactor
• | • | ||||
---|---|---|---|---|---|
Obtain bloom Exposure coefficient Returns
| Set bloom Exposure coefficient Parameters
|
bloomRange
• | • | ||||
---|---|---|---|---|---|
Get bloom Range Returns
| Set bloom Range Parameters
|
bloomSpread
• | • | ||||
---|---|---|---|---|---|
Obtain bloom Diffusion Returns
| Set bloom Diffusion Parameters
|
blurEnabled
• | • | ||||
---|---|---|---|---|---|
Obtain ambiguity Returns
| Fuzzy switch Parameters
|
blurIntensity
• | • | ||||
---|---|---|---|---|---|
Obtain fuzzy strength Returns
| Fuzzy intensity switch Parameters
|
config
• | • | ||||
---|---|---|---|---|---|
Obtain post-processing attribute configuration Returns
| Set post-processing attribute configuration Parameters
|
contrast
• | • | ||||
---|---|---|---|---|---|
Obtain global contrast Returns
| Set global contrast (0.2~5.0) Parameters
|
depthOfFieldEnabled
• | • | ||||
---|---|---|---|---|---|
Get Depth of Field Switch Returns
| Switch depth of field Parameters
|
depthOfFieldIntensity
• | • | ||||
---|---|---|---|---|---|
Obtain depth of field intensity Returns
| Set depth of field intensity Parameters
|
focusDistance
• | • | ||||
---|---|---|---|---|---|
Obtain focal length distance Returns
| Set focal length distance Parameters
|
focusPosition
• | • | ||||
---|---|---|---|---|---|
Obtain focal length position Returns
| Set focus position Parameters
|
preset
• | • | ||||
---|---|---|---|---|---|
Get preset settings Returns
| Set presets Parameters
|
saturation
• | • | ||||
---|---|---|---|---|---|
Get global saturation Returns
| Set global saturation (0~2) Parameters
|