Coder Social home page Coder Social logo

seanj29 / godot-post-process-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itskorin/godot-post-process-plugin

0.0 0.0 0.0 296 KB

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

License: Other

GDScript 100.00%

godot-post-process-plugin's Introduction

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:

  • Korin Owner๐Ÿ‘‘
  • Loufe Contributor๐Ÿ–Š๏ธ
  • SAED2906 Contributor๐Ÿ–Š๏ธ

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

godot-post-process-plugin's People

Contributors

itskorin avatar saed2906 avatar loufe avatar seanj29 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.