shaderlib: Implement a simple pixelate function (effects.gdshaderinc), examples/hsv.gdshader -> color_and_pixelate.gdshader; implements #30

This commit is contained in:
ChaoticByte 2025-01-08 19:40:36 +01:00
parent 6c48c9fe72
commit 4d12ad4432
No known key found for this signature in database
4 changed files with 30 additions and 10 deletions

View file

@ -0,0 +1,13 @@
shader_type canvas_item;
#include "res://shaderlib/hsv.gdshaderinc"
#include "res://shaderlib/effects.gdshaderinc"
//!load ./swamp.jpg
void fragment() {
COLOR = pixelate(TEXTURE, UV, 200.0);
vec4 hsv = rgb2hsv(COLOR);
COLOR = hsv_offset(COLOR, 0.65, .42-(hsv.y*.3), -.125);
COLOR = hsv_multiply(COLOR, 1.0, 1.0, 1.25);
}

View file

@ -1,9 +0,0 @@
shader_type canvas_item;
#include "res://shaderlib/hsv.gdshaderinc"
//!load ./swamp.jpg
void fragment() {
COLOR = hsv_multiply(hsv_offset(COLOR, -0.3, 0.9, 0.0), 1.0, 0.44, 1.0);
}