mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 17:19:50 +00:00
Set the selection texture's filter to nearest in shaders
This commit is contained in:
parent
7507206726
commit
edf7b1f5e5
|
@ -9,7 +9,7 @@ uniform float similarity_percent : hint_range(0.0, 100.0);
|
|||
|
||||
// Must be the same size as image
|
||||
// Selected pixels are 1,1,1,1 and unselected 0,0,0,0
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
uniform bool has_pattern;
|
||||
uniform sampler2D pattern: repeat_enable;
|
||||
|
|
|
@ -5,7 +5,7 @@ uniform bool red = true;
|
|||
uniform bool blue = true;
|
||||
uniform bool green = true;
|
||||
uniform bool alpha = false;
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
float stolChannel(float x) {
|
||||
return (x < 0.04045) ? (x / 12.92) : pow((x + 0.055) / 1.055, 2.4);
|
||||
|
|
|
@ -3,7 +3,7 @@ render_mode unshaded;
|
|||
|
||||
uniform vec2 offset = vec2(5.0, 5.0); // Offset, in pixel coordinate [0, 1, 2, and so on]
|
||||
uniform vec4 shadow_color : source_color = vec4(0.08, 0.08, 0.08, 0.63);
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
|
||||
void fragment() {
|
||||
|
|
|
@ -2,7 +2,7 @@ shader_type canvas_item;
|
|||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D gradient_map : filter_nearest; // GradientTexture
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
vec4 original_color = texture(TEXTURE, UV);
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D gradient_texture;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
uniform sampler2D gradient_texture : filter_nearest;
|
||||
uniform float position : hint_range(-0.5, 0.5) = 0.0;
|
||||
uniform float size : hint_range(0.01, 2.0) = 1.0;
|
||||
uniform float angle : hint_range(0.0, 360.0) = 0.0;
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D gradient_texture;
|
||||
uniform sampler2D dither_texture : repeat_enable;
|
||||
uniform sampler2D offset_texture;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
uniform sampler2D gradient_texture : filter_nearest;
|
||||
uniform sampler2D dither_texture : filter_nearest, repeat_enable;
|
||||
uniform sampler2D offset_texture : filter_nearest;
|
||||
uniform float position : hint_range(-0.5, 0.5) = 0.0;
|
||||
uniform float size : hint_range(0.01, 2.0) = 1.0;
|
||||
uniform float angle : hint_range(0.0, 360.0) = 0.0;
|
||||
|
@ -69,9 +69,9 @@ void fragment() {
|
|||
modified_uv = mirror_fract(modified_uv);
|
||||
|
||||
int n_of_colors = textureSize(offset_texture, 0).x;
|
||||
float colors_minus = float(n_of_colors - 1);
|
||||
vec4 output;
|
||||
for (int i = 1; i <= n_of_colors; i++) {
|
||||
float colors_minus = float(n_of_colors - 1);
|
||||
float off = texture(offset_texture, vec2(float(i) / colors_minus)).r;
|
||||
float off_prev = texture(offset_texture, vec2(float(i - 1) / colors_minus)).r;
|
||||
vec4 first = texture(gradient_texture, vec2(float((i - 1)) / colors_minus));
|
||||
|
|
|
@ -4,7 +4,7 @@ render_mode unshaded;
|
|||
uniform float hue : hint_range(-1, 1);
|
||||
uniform float saturation : hint_range(-1, 1);
|
||||
uniform float value : hint_range(-1, 1);
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
vec3 rgb2hsb(vec3 c){
|
||||
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||
|
|
|
@ -5,7 +5,7 @@ uniform bool red = true;
|
|||
uniform bool blue = true;
|
||||
uniform bool green = true;
|
||||
uniform bool alpha = false;
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
|
||||
void fragment() {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
uniform vec2 offset = vec2(0.0); // In pixels
|
||||
uniform bool wrap_around = false;
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ uniform vec4 color : source_color = vec4(1.0);
|
|||
uniform float width : hint_range(0, 10, 1) = 1.0;
|
||||
uniform int pattern : hint_range(0, 2) = 0; // diamond, circle, square
|
||||
uniform bool inside = false;
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
|
||||
bool has_contrary_neighbour(vec2 uv, vec2 texture_pixel_size, sampler2D tex) {
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D palette_texture : filter_nearest;
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
vec4 swap_color(vec4 color) {
|
||||
if (color.a <= 0.01) {
|
||||
|
|
|
@ -7,7 +7,7 @@ This shader is under MIT license
|
|||
shader_type canvas_item;
|
||||
|
||||
uniform uvec2 pixel_size = uvec2(4);
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
|
||||
void fragment() {
|
||||
vec4 original_color = texture(TEXTURE, UV);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
// https://godotshaders.com/shader/color-reduction-and-dither/
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
uniform float colors : hint_range(1.0, 255.0) = 2.0;
|
||||
uniform float dither_intensity : hint_range(0.0, 0.5) = 0.0;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
uniform sampler2D selection_tex;
|
||||
uniform sampler2D selection_tex : filter_nearest;
|
||||
uniform vec2 pivot_pixel;
|
||||
uniform float angle;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D selection_tex;
|
||||
uniform sampler2D selection_tex : filter_nearest;
|
||||
uniform float initial_angle = 0.0;
|
||||
uniform float ending_angle = 0.0;
|
||||
uniform float tolerance : hint_range(0.0, 255.0) = 100.0;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
shader_type canvas_item;
|
||||
render_mode unshaded;
|
||||
|
||||
uniform sampler2D selection;
|
||||
uniform sampler2D pattern: repeat_enable;
|
||||
uniform sampler2D selection : filter_nearest;
|
||||
uniform sampler2D pattern : filter_nearest, repeat_enable;
|
||||
uniform vec2 size;
|
||||
uniform vec2 pattern_size;
|
||||
uniform vec2 pattern_uv_offset;
|
||||
|
|
Loading…
Reference in a new issue