Skip to content

A simple godot 4.2 plugin that adds shader based "post processing"

License

Notifications You must be signed in to change notification settings

ItsKorin/Godot-Post-Process-Plugin

Repository files navigation

Post Processing Plugin

An add-on for Godot 4.2, available in the Godot Asset Library.

After moving from Unity to Godot in late 2019, I've felt like there was a lack of post-processing tooling. In February 2024 I decided to make and publish this simple add-on.

Features:

  • Custom CanvasLayer node, "PostProcess".
  • 2D/3D support.
  • Custom resource type to save preset configurations, "PostProcessPreset".
  • Ability to dynamically modify effects through code.
  • Effects:

Effects:

  • ASCII (Monochromatic / Render everything as ASCII text) (for now uses only: .:-+*=%@#).
  • Chromatic Aberration
  • Blur
  • Vignette
  • Glitch (Animated)
  • Outline (Not the best implementation, still being worked on).
  • Screen Shake
  • Analog Monitor
  • Grain (Animated)
  • Circular Waves / Speed Lines (Low Quality, still being worked on).
  • Fish eye effect.

Planned Features:

  • Effect Presets
  • More Effects like: Color Grading, Dithering, Motion Blur, VHS, etc.
  • Smooth transitions between previous and future effect states (ex: 0 blur slowly rising to 100)

Basic Use:

Simply add the custom PostProcess node to the scene tree directly or through code. Set the "Configuration" property of the PostProcess to a PostProcessPreset (either pre-made or instantiated on-the-spot) and run the game. The add-on uses some simple "Screen Space" shaders to apply the desired effects.

image
image
image

Loading a preset:

image

Creating an in-place preset:

image

Adding changes only through code:

All values can be modified during runtime and the changes will be applied immediately. This applies to on/off states as well as numbered parameters. All effects can be applied in parallel and work together well.

(NOTE: Effects are applied on rendering layers: 99-120, so i suggest putting UI above 120 and anything else like player, world etc. under 99!)

Changing Effects Through Code.

In this example, we enable/disable ScreenShake!

extends Node3D

func _process(_delta):
    # Change the Screen Shake Power by 0.1 each frame
    $PostProcess.ScreenShakePower += 0.1

    # if Screen Shake Power is bigger than 2, change it back to 0!
    if $PostProcess.ScreenShakePower >= 2:
        $PostProcess.ScreenShakePower = 0


    # if key T is pressed, Enable Screen Shake
    if Input.is_key_pressed(KEY_T):
        $PostProcess.ScreenShake = true
    else:
        $PostProcess.ScreenShake = false

This also works with other effects like: ASCII, Blur, ChromaticAberration, FishEye, etc...

Contributors:

Some Screenshots:

Normal: Godot_v4 2 1-stable_win64_4nCuRDZEv7 ASCII: Godot_v4 2 1-stable_win64_7GbIuOJMaA Chromatic Aberration: Godot_v4 2 1-stable_win64_jjyidzYH5b Vignette: Godot_v4 2 1-stable_win64_sHuRFKLWgJ Glitch: Godot_v4 2 1-stable_win64_nf9MvEGLIF Outline: Godot_v4 2 1-stable_win64_zEyjScQtmE Grain: Godot_v4 2 1-stable_win64_mgGj2yIxPM

About

A simple godot 4.2 plugin that adds shader based "post processing"

Resources

License

Stars

Watchers

Forks

Packages

No packages published