Create and apply image filters using Godot's GLSL dialect.
Find a file
2024-12-22 23:05:03 +01:00
build-template Add a custom godot build template with reduced features for smaller exports - implements #15 2024-12-22 21:55:33 +01:00
dist Add export presets for Linux and Windows 2024-06-05 20:50:48 +02:00
examples Add hsv.gdshaderinc to shaderlibrary, provide an example and update README.md - implement #12 2024-12-22 23:05:03 +01:00
scenes Place the viewer and editor in separate windows 2024-12-21 17:08:26 +01:00
shaderlib Add hsv.gdshaderinc to shaderlibrary, provide an example and update README.md - implement #12 2024-12-22 23:05:03 +01:00
src Cleaned up and refactored some code 2024-12-21 18:25:11 +01:00
.gitattributes Add project files 2024-06-04 18:31:04 +02:00
.gitignore Add a custom godot build template with reduced features for smaller exports - implements #15 2024-12-22 21:55:33 +01:00
export_presets.cfg Add a custom godot build template with reduced features for smaller exports - implements #15 2024-12-22 21:55:33 +01:00
icon.png Added project icon 2024-06-09 13:23:58 +02:00
icon.png.import Added project icon 2024-06-09 13:23:58 +02:00
LICENSE Add project files 2024-06-04 18:31:04 +02:00
project.godot Cleaned up and refactored some code 2024-12-21 18:25:11 +01:00
README.md Add hsv.gdshaderinc to shaderlibrary, provide an example and update README.md - implement #12 2024-12-22 23:05:03 +01:00
screenshot.png Added a new screenshot 2024-12-19 19:01:49 +01:00

Fragmented

screenshot

Create image filters by writing shaders.

Supported Platforms

  • Linux

You can find the latest releases here.

Usage

The repo includes examples. You can use them as a starting-point to write your own filters.
Just load an image using //!load, edit the shader code and hit F5 to see the changes.

Load TEXTURE using the //!load directive

//!load <filepath>

The image file will be read and available as the TEXTURE variable.

Load additional images

//!load+ <name> <filepath>
uniform sampler2D <name>;

Have a look at the mix.gdshader example:

shader_type canvas_item;

//!load ./swamp.jpg

//!load+ img2 ./overlay.jpg
uniform sampler2D img2: repeat_enable, filter_nearest;

void fragment() {
	COLOR = mix(COLOR, texture(img2, UV), .2);
}

Shaderlib

This repo comes with a (still small) shader library including pre-written functions and more. Have a look at the shaderlib folder.

Here is an example on how to use it (the hsv.gdshader example):

shader_type canvas_item;

#include "res://shaderlib/hsv.gdshaderinc"

//!load ./swamp.jpg

void fragment() {
	COLOR = hsv_offset(COLOR, 0.32, 0.2, 0.0);
}