1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Remove affect_selection and has_selection checks from Shaders

This commit is contained in:
Emmanouil Papadeas 2022-04-23 14:39:17 +03:00
parent 2da5b1e944
commit 63759d3607
3 changed files with 5 additions and 26 deletions

View file

@ -6,8 +6,6 @@ uniform bool blue;
uniform bool green;
uniform bool alpha;
uniform sampler2D selection;
uniform bool affect_selection;
uniform bool has_selection;
float stolChannel(float x) {
return (x < 0.04045) ? (x / 12.92) : pow((x + 0.055) / 1.055, 2.4);
@ -54,12 +52,7 @@ void fragment() {
blue ? lum : lin.b);
vec3 stdPrime = linearToStandard(des);
vec3 output;
if(affect_selection && has_selection) {
output = mix(original_color.rgb, stdPrime, selection_color.a);
} else {
output = stdPrime;
}
vec3 output = mix(original_color.rgb, stdPrime, selection_color.a);
if (alpha) {
COLOR = vec4(output.rgb, ltosChannel(lum));

View file

@ -6,8 +6,6 @@ uniform float hue_shift_amount : hint_range(-1, 1);
uniform float sat_shift_amount : hint_range(-1, 1);
uniform float val_shift_amount : hint_range(-1, 1);
uniform sampler2D selection;
uniform bool affect_selection;
uniform bool has_selection;
vec3 rgb2hsb(vec3 c){
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
@ -61,11 +59,6 @@ void fragment() {
col = hsb2rgb(hsb);
vec3 output;
if(affect_selection && has_selection)
output = mix(original_color.rgb, col, selection_color.a);
else
output = col;
vec3 output = mix(original_color.rgb, col, selection_color.a);
COLOR = vec4(output.rgb, original_color.a);
}
}

View file

@ -6,8 +6,6 @@ uniform bool blue;
uniform bool green;
uniform bool alpha;
uniform sampler2D selection;
uniform bool affect_selection;
uniform bool has_selection;
void fragment() {
@ -24,11 +22,6 @@ void fragment() {
if (alpha)
col.a = 1f - col.a;
vec4 output;
if(affect_selection && has_selection)
output = mix(original_color.rgba, col, selection_color.a);
else
output = col;
vec4 output = mix(original_color.rgba, col, selection_color.a);
COLOR = output;
}
}