zaknafean / Godot-Post-Process-Plugin

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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:

  • 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.
  • CRT/VHS

Planned Features:

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

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):
    # Check if Screen Shake is enabled
    if $PostProcess.configuration.ScreenShake:
        # Change the Screen Shake Power by 0.1 each frame
        $PostProcess.configuration.ScreenShakePower += 0.1
    
        # if Screen Shake Power is bigger than 2, change it back to 0!
        if $PostProcess.configuration.ScreenShakePower >= 2:
            $PostProcess.configuration.ScreenShakePower = 0

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

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"

License:Other


Languages

Language:GDScript 100.0%