mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-31 07:29:49 +00:00
Remove affect_selection and has_selection checks from Shaders
This commit is contained in:
parent
2da5b1e944
commit
63759d3607
|
@ -6,8 +6,6 @@ uniform bool blue;
|
||||||
uniform bool green;
|
uniform bool green;
|
||||||
uniform bool alpha;
|
uniform bool alpha;
|
||||||
uniform sampler2D selection;
|
uniform sampler2D selection;
|
||||||
uniform bool affect_selection;
|
|
||||||
uniform bool has_selection;
|
|
||||||
|
|
||||||
float stolChannel(float x) {
|
float stolChannel(float x) {
|
||||||
return (x < 0.04045) ? (x / 12.92) : pow((x + 0.055) / 1.055, 2.4);
|
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);
|
blue ? lum : lin.b);
|
||||||
vec3 stdPrime = linearToStandard(des);
|
vec3 stdPrime = linearToStandard(des);
|
||||||
|
|
||||||
vec3 output;
|
vec3 output = mix(original_color.rgb, stdPrime, selection_color.a);
|
||||||
if(affect_selection && has_selection) {
|
|
||||||
output = mix(original_color.rgb, stdPrime, selection_color.a);
|
|
||||||
} else {
|
|
||||||
output = stdPrime;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (alpha) {
|
if (alpha) {
|
||||||
COLOR = vec4(output.rgb, ltosChannel(lum));
|
COLOR = vec4(output.rgb, ltosChannel(lum));
|
||||||
|
|
|
@ -6,8 +6,6 @@ uniform float hue_shift_amount : hint_range(-1, 1);
|
||||||
uniform float sat_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 float val_shift_amount : hint_range(-1, 1);
|
||||||
uniform sampler2D selection;
|
uniform sampler2D selection;
|
||||||
uniform bool affect_selection;
|
|
||||||
uniform bool has_selection;
|
|
||||||
|
|
||||||
vec3 rgb2hsb(vec3 c){
|
vec3 rgb2hsb(vec3 c){
|
||||||
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||||
|
@ -61,11 +59,6 @@ void fragment() {
|
||||||
|
|
||||||
|
|
||||||
col = hsb2rgb(hsb);
|
col = hsb2rgb(hsb);
|
||||||
vec3 output;
|
vec3 output = mix(original_color.rgb, col, selection_color.a);
|
||||||
if(affect_selection && has_selection)
|
|
||||||
output = mix(original_color.rgb, col, selection_color.a);
|
|
||||||
else
|
|
||||||
output = col;
|
|
||||||
COLOR = vec4(output.rgb, original_color.a);
|
COLOR = vec4(output.rgb, original_color.a);
|
||||||
|
|
||||||
}
|
}
|
|
@ -6,8 +6,6 @@ uniform bool blue;
|
||||||
uniform bool green;
|
uniform bool green;
|
||||||
uniform bool alpha;
|
uniform bool alpha;
|
||||||
uniform sampler2D selection;
|
uniform sampler2D selection;
|
||||||
uniform bool affect_selection;
|
|
||||||
uniform bool has_selection;
|
|
||||||
|
|
||||||
|
|
||||||
void fragment() {
|
void fragment() {
|
||||||
|
@ -24,11 +22,6 @@ void fragment() {
|
||||||
if (alpha)
|
if (alpha)
|
||||||
col.a = 1f - col.a;
|
col.a = 1f - col.a;
|
||||||
|
|
||||||
vec4 output;
|
vec4 output = mix(original_color.rgba, col, selection_color.a);
|
||||||
if(affect_selection && has_selection)
|
|
||||||
output = mix(original_color.rgba, col, selection_color.a);
|
|
||||||
else
|
|
||||||
output = col;
|
|
||||||
|
|
||||||
COLOR = output;
|
COLOR = output;
|
||||||
}
|
}
|
Loading…
Reference in a new issue