From 7d30aed62d20480692eb8c0aab042513b31e5d9a Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 30 Jul 2024 18:29:01 +0300 Subject: [PATCH] Fix some image effects resulting in wrong colors when the image has non-opaque pixels --- src/Shaders/Effects/OffsetPixels.gdshader | 1 + src/Shaders/Effects/Palettize.gdshader | 1 + src/Shaders/Effects/Pixelize.gdshader | 1 + src/Shaders/Effects/Posterize.gdshader | 1 + src/Shaders/Effects/Rotation/OmniScale.gdshader | 1 + src/Shaders/Effects/Rotation/cleanEdge.gdshader | 1 + 6 files changed, 6 insertions(+) diff --git a/src/Shaders/Effects/OffsetPixels.gdshader b/src/Shaders/Effects/OffsetPixels.gdshader index b0a3d9501..13ced8740 100644 --- a/src/Shaders/Effects/OffsetPixels.gdshader +++ b/src/Shaders/Effects/OffsetPixels.gdshader @@ -1,4 +1,5 @@ shader_type canvas_item; +render_mode unshaded; uniform sampler2D selection : filter_nearest; uniform vec2 offset = vec2(0.0); // In pixels diff --git a/src/Shaders/Effects/Palettize.gdshader b/src/Shaders/Effects/Palettize.gdshader index 74eb78835..6e6814c10 100644 --- a/src/Shaders/Effects/Palettize.gdshader +++ b/src/Shaders/Effects/Palettize.gdshader @@ -1,6 +1,7 @@ // Maps the color of the input to the nearest color in the selected palette. // Similar to Krita's Palettize filter shader_type canvas_item; +render_mode unshaded; uniform sampler2D palette_texture : filter_nearest; uniform sampler2D selection : filter_nearest; diff --git a/src/Shaders/Effects/Pixelize.gdshader b/src/Shaders/Effects/Pixelize.gdshader index 88a7efb36..2c3433ac7 100644 --- a/src/Shaders/Effects/Pixelize.gdshader +++ b/src/Shaders/Effects/Pixelize.gdshader @@ -5,6 +5,7 @@ https://godotshaders.com/shader/pixelate-2/ This shader is under MIT license */ shader_type canvas_item; +render_mode unshaded; uniform uvec2 pixel_size = uvec2(4); uniform sampler2D selection : filter_nearest; diff --git a/src/Shaders/Effects/Posterize.gdshader b/src/Shaders/Effects/Posterize.gdshader index 47ef388e9..05d4b38d9 100644 --- a/src/Shaders/Effects/Posterize.gdshader +++ b/src/Shaders/Effects/Posterize.gdshader @@ -1,5 +1,6 @@ // https://godotshaders.com/shader/color-reduction-and-dither/ shader_type canvas_item; +render_mode unshaded; uniform sampler2D selection : filter_nearest; uniform float colors : hint_range(1.0, 255.0) = 2.0; diff --git a/src/Shaders/Effects/Rotation/OmniScale.gdshader b/src/Shaders/Effects/Rotation/OmniScale.gdshader index 92baeb71f..cdb492aaf 100644 --- a/src/Shaders/Effects/Rotation/OmniScale.gdshader +++ b/src/Shaders/Effects/Rotation/OmniScale.gdshader @@ -1,6 +1,7 @@ // No AA version from https://github.com/deakcor/godot-omniscale/blob/5dfee6e89cd955dd01dccfe70c9979f9b55bb1bf/OmniScale.shader // Edited slightly by Overloaded to add rotation support for Pixelorama shader_type canvas_item; +render_mode unshaded; //#version 130 diff --git a/src/Shaders/Effects/Rotation/cleanEdge.gdshader b/src/Shaders/Effects/Rotation/cleanEdge.gdshader index e71a5fa42..91ae96609 100644 --- a/src/Shaders/Effects/Rotation/cleanEdge.gdshader +++ b/src/Shaders/Effects/Rotation/cleanEdge.gdshader @@ -25,6 +25,7 @@ OTHER DEALINGS IN THE SOFTWARE. shader_type canvas_item; +render_mode unshaded; #include "res://src/Shaders/Effects/Rotation/CommonRotation.gdshaderinc" //enables 2:1 slopes. otherwise only uses 45 degree slopes #define SLOPE