mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-13 09:13:07 +00:00
Make the preview of the gradient dialog be more accurate with the result
Basically just pixelate the UVs to the canvas size.
This commit is contained in:
parent
93bbdb7c7b
commit
3fa0110614
|
@ -69,9 +69,9 @@ float dither(vec2 uv, float modified_uv, ivec2 image_size) {
|
||||||
void fragment() {
|
void fragment() {
|
||||||
vec4 original_color = texture(TEXTURE, UV);
|
vec4 original_color = texture(TEXTURE, UV);
|
||||||
vec4 selection_color = texture(selection, UV);
|
vec4 selection_color = texture(selection, UV);
|
||||||
//vec2 tex_size = 1.0 / TEXTURE_PIXEL_SIZE;
|
vec2 tex_size = 1.0 / TEXTURE_PIXEL_SIZE;
|
||||||
//vec2 uv = floor(UV * tex_size) / (tex_size - 1.0);
|
vec2 uv = floor(UV * tex_size) / (tex_size - 1.0);
|
||||||
float modified_uv = modify_uv(UV);
|
float modified_uv = modify_uv(uv);
|
||||||
if (repeat == 1)
|
if (repeat == 1)
|
||||||
modified_uv = fract(modified_uv);
|
modified_uv = fract(modified_uv);
|
||||||
else if (repeat == 2)
|
else if (repeat == 2)
|
||||||
|
@ -92,7 +92,7 @@ void fragment() {
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (modified_uv > off) {
|
if (modified_uv >= off) {
|
||||||
if (i == n_of_colors) {
|
if (i == n_of_colors) {
|
||||||
output = second;
|
output = second;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue