add alpha channel to nodes
|
@ -526,6 +526,7 @@
|
|||
{"name":"node_3d_transform","order":6,"path":"scripts/node_3d_transform/node_3d_transform.yy",},
|
||||
{"name":"node_iterator_each_size","order":3,"path":"scripts/node_iterator_each_size/node_iterator_each_size.yy",},
|
||||
{"name":"panel_console","order":8,"path":"scripts/panel_console/panel_console.yy",},
|
||||
{"name":"sh_gradient_display_alpha","order":37,"path":"shaders/sh_gradient_display_alpha/sh_gradient_display_alpha.yy",},
|
||||
{"name":"s_node_HSV_combine","order":44,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},
|
||||
{"name":"Obj_FirebaseFirestore_Collection_Query_GreaterEqual","order":5,"path":"objects/Obj_FirebaseFirestore_Collection_Query_GreaterEqual/Obj_FirebaseFirestore_Collection_Query_GreaterEqual.yy",},
|
||||
{"name":"s_node_pb_box_contract","order":25,"path":"sprites/s_node_pb_box_contract/s_node_pb_box_contract.yy",},
|
||||
|
@ -751,7 +752,7 @@
|
|||
{"name":"node_registry","order":11,"path":"scripts/node_registry/node_registry.yy",},
|
||||
{"name":"sh_checkerboard","order":12,"path":"shaders/sh_checkerboard/sh_checkerboard.yy",},
|
||||
{"name":"node_unicode","order":1,"path":"scripts/node_unicode/node_unicode.yy",},
|
||||
{"name":"draw_set_text","order":1,"path":"scripts/draw_set_text/draw_set_text.yy",},
|
||||
{"name":"draw_setter","order":1,"path":"scripts/draw_setter/draw_setter.yy",},
|
||||
{"name":"node_pb_draw","order":1,"path":"scripts/node_pb_draw/node_pb_draw.yy",},
|
||||
{"name":"node_iterator_filter_inline_output","order":2,"path":"scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.yy",},
|
||||
{"name":"s_node_warp","order":9,"path":"sprites/s_node_warp/s_node_warp.yy",},
|
||||
|
|
|
@ -751,6 +751,7 @@
|
|||
{"id":{"name":"sh_trans_node_prev_drop","path":"shaders/sh_trans_node_prev_drop/sh_trans_node_prev_drop.yy",},},
|
||||
{"id":{"name":"fd_draw_self_to_collision_mask_surface","path":"scripts/fd_draw_self_to_collision_mask_surface/fd_draw_self_to_collision_mask_surface.yy",},},
|
||||
{"id":{"name":"panel_console","path":"scripts/panel_console/panel_console.yy",},},
|
||||
{"id":{"name":"sh_gradient_display_alpha","path":"shaders/sh_gradient_display_alpha/sh_gradient_display_alpha.yy",},},
|
||||
{"id":{"name":"spr_gameframe_border","path":"sprites/spr_gameframe_border/spr_gameframe_border.yy",},},
|
||||
{"id":{"name":"s_node_HSV_combine","path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",},},
|
||||
{"id":{"name":"Obj_FirebaseFirestore_Collection_Query_GreaterEqual","path":"objects/Obj_FirebaseFirestore_Collection_Query_GreaterEqual/Obj_FirebaseFirestore_Collection_Query_GreaterEqual.yy",},},
|
||||
|
@ -1012,7 +1013,7 @@
|
|||
{"id":{"name":"node_registry","path":"scripts/node_registry/node_registry.yy",},},
|
||||
{"id":{"name":"sh_checkerboard","path":"shaders/sh_checkerboard/sh_checkerboard.yy",},},
|
||||
{"id":{"name":"node_unicode","path":"scripts/node_unicode/node_unicode.yy",},},
|
||||
{"id":{"name":"draw_set_text","path":"scripts/draw_set_text/draw_set_text.yy",},},
|
||||
{"id":{"name":"draw_setter","path":"scripts/draw_setter/draw_setter.yy",},},
|
||||
{"id":{"name":"node_pb_draw","path":"scripts/node_pb_draw/node_pb_draw.yy",},},
|
||||
{"id":{"name":"node_iterator_filter_inline_output","path":"scripts/node_iterator_filter_inline_output/node_iterator_filter_inline_output.yy",},},
|
||||
{"id":{"name":"s_node_array","path":"sprites/s_node_array/s_node_array.yy",},},
|
||||
|
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
@ -11,7 +11,7 @@ event_inherited();
|
|||
name = __txtx("color_selector_title", "Color selector");
|
||||
|
||||
previous_color = c_black;
|
||||
selector = new colorSelector();
|
||||
selector = new colorSelector();
|
||||
drop_target = noone;
|
||||
|
||||
function setDefault(color) {
|
||||
|
|
|
@ -33,8 +33,10 @@ event_inherited();
|
|||
|
||||
function setGradient(grad) {
|
||||
gradient = grad;
|
||||
if(array_length(grad.keys))
|
||||
key_selecting = grad.keys[0];
|
||||
if(array_empty(grad.keys)) return;
|
||||
|
||||
key_selecting = grad.keys[0];
|
||||
selector.setColor(key_selecting.value, false);
|
||||
}
|
||||
|
||||
selector = new colorSelector(setColor);
|
||||
|
@ -108,8 +110,14 @@ event_inherited();
|
|||
if(_hover && isHover) {
|
||||
if(mouse_press(mb_left, interactable && sFOCUS)) {
|
||||
gradient.keys = [];
|
||||
for( var i = 0, n = array_length(_gradient.gradient.keys); i < n; i++ )
|
||||
gradient.keys[i] = _gradient.gradient.keys[i].clone();
|
||||
for( var i = 0, n = array_length(_gradient.gradient.keys); i < n; i++ ) {
|
||||
var k = _gradient.gradient.keys[i].clone();
|
||||
gradient.keys[i] = k;
|
||||
|
||||
if(is_real(k.value)) k.value = cola(k.value);
|
||||
}
|
||||
|
||||
onApply(gradient);
|
||||
}
|
||||
|
||||
if(mouse_press(mb_right, interactable && sFOCUS)) {
|
||||
|
@ -195,7 +203,11 @@ event_inherited();
|
|||
|
||||
var _index = m_gy * col + m_gx;
|
||||
if(_index < pre_amo && _index >= 0) {
|
||||
selector.setColor(pal.palette[_index]);
|
||||
var c = pal.palette[_index];
|
||||
|
||||
if(is_real(c)) c = cola(c);
|
||||
|
||||
selector.setColor(c);
|
||||
selector.setHSV();
|
||||
}
|
||||
} else if(isHover) {
|
||||
|
|
|
@ -178,9 +178,10 @@ if !ready exit;
|
|||
|
||||
var tt = clamp((mouse_mx - gr_x) / gr_w, 0, 1);
|
||||
var cc = gradient.eval(tt);
|
||||
|
||||
var _newkey = new gradientKey(tt, cc);
|
||||
gradient.add(_newkey, true);
|
||||
|
||||
|
||||
key_selecting = _newkey;
|
||||
key_dragging = _newkey;
|
||||
key_drag_sx = tt;
|
||||
|
|
|
@ -86,7 +86,7 @@ event_inherited();
|
|||
palette[j] = pal.palette[j];
|
||||
}
|
||||
|
||||
if(mouse_press(mb_right, interactable && sFOCUS)) {
|
||||
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
|
||||
hovering_name = pal.path;
|
||||
menuCall("palette_window_preset_menu",,, [
|
||||
menuItem(__txtx("palette_editor_delete", "Delete palette"), function() {
|
||||
|
|
|
@ -115,10 +115,27 @@ function buttonColor(_onApply, dialog = noone) : widget() constructor {
|
|||
if(mouse_press(mb_left)) deactivate();
|
||||
}
|
||||
|
||||
var _bx = _x + ui(4);
|
||||
var _by = _y + ui(4);
|
||||
var _bw = _cw - ui(8);
|
||||
var _bh = _h - ui(8);
|
||||
|
||||
if(is_array(current_color))
|
||||
drawPalette(current_color, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8));
|
||||
else if(is_real(current_color))
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _x + ui(4), _y + ui(4), _cw - ui(8), _h - ui(8), current_color, 1);
|
||||
drawPalette(current_color, _bx, _by, _bw, _bh);
|
||||
else if(is_real(current_color))
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by, _bw, _bh, current_color, 1);
|
||||
else if(is_int64(current_color)) {
|
||||
var _a = _color_get_alpha(current_color);
|
||||
|
||||
if(_a == 1) {
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by, _bw, _bh, current_color, 1);
|
||||
} else {
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by, _bw, _bh - ui(8), current_color, 1);
|
||||
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by + _bh - ui(6), _bw, ui(6), c_black, 1);
|
||||
draw_sprite_stretched_ext(THEME.palette_mask, 1, _bx, _by + _bh - ui(6), _bw * _a, ui(6), c_white, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if(WIDGET_CURRENT == self)
|
||||
draw_sprite_stretched_ext(THEME.widget_selecting, 0, _x - ui(3), _y - ui(3), _w + ui(6), _h + ui(6), COLORS._main_accent, 1);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function colToVec4(color, alpha = 1) {
|
||||
return [ color_get_red(color) / 255, color_get_green(color) / 255, color_get_blue(color) / 255, alpha ];
|
||||
var a = is_int64(color)? _color_get_alpha(color) : alpha;
|
||||
return [ _color_get_red(color), _color_get_green(color), _color_get_blue(color), a ];
|
||||
}
|
||||
|
||||
function colaToVec4(color) {
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
function cola(color, alpha = 1) { INLINE return int64((color & 0xFFFFFF) + (round(alpha * 255) << 24)); }
|
||||
function _cola(color, alpha) { INLINE return int64((color & 0xFFFFFF) + (alpha << 24)); }
|
||||
function colda(color) { INLINE return real(color & 0xFFFFFF); }
|
||||
|
||||
function colorFromRGBArray(arr) { #region
|
||||
var r = round(real(arr[0]) * 255);
|
||||
var g = round(real(arr[1]) * 255);
|
||||
|
@ -5,14 +9,15 @@ function colorFromRGBArray(arr) { #region
|
|||
return make_color_rgb(r, g, b);
|
||||
} #endregion
|
||||
|
||||
function color_get_alpha(color) { #region
|
||||
INLINE
|
||||
return (color & (0xFF << 24)) >> 24;
|
||||
} #endregion
|
||||
function color_get_alpha(color) { INLINE return (color & (0xFF << 24)) >> 24; }
|
||||
function _color_get_alpha(color) { INLINE return is_real(color)? 1 : color_get_alpha(color) / 255; }
|
||||
function _color_get_red(color) { INLINE return color_get_red(color) / 255; }
|
||||
function _color_get_green(color) { INLINE return color_get_green(color) / 255; }
|
||||
function _color_get_blue(color) { INLINE return color_get_blue(color) / 255; }
|
||||
|
||||
function colorArrayFromReal(clr) { #region
|
||||
INLINE
|
||||
return [color_get_red(clr) / 255, color_get_green(clr) / 255, color_get_blue(clr) / 255 ];
|
||||
return [ _color_get_red(clr), _color_get_green(clr), _color_get_blue(clr) ];
|
||||
} #endregion
|
||||
|
||||
function colorBrightness(clr, normalize = true) { #region
|
||||
|
@ -28,15 +33,18 @@ function colorMultiply(c1, c2) { #region
|
|||
if(c1 == c_white) return c2;
|
||||
if(c2 == c_white) return c1;
|
||||
|
||||
var r1 = color_get_red(c1);
|
||||
var g1 = color_get_green(c1);
|
||||
var b1 = color_get_blue(c1);
|
||||
var r1 = _color_get_red(c1);
|
||||
var g1 = _color_get_green(c1);
|
||||
var b1 = _color_get_blue(c1);
|
||||
var a1 = _color_get_alpha(c1);
|
||||
|
||||
var r2 = color_get_red(c2);
|
||||
var g2 = color_get_green(c2);
|
||||
var b2 = color_get_blue(c2);
|
||||
var r2 = _color_get_red(c2);
|
||||
var g2 = _color_get_green(c2);
|
||||
var b2 = _color_get_blue(c2);
|
||||
var a2 = _color_get_alpha(c2);
|
||||
|
||||
return make_color_rgb((r1 * r2) / 255, (g1 * g2) / 255, (b1 * b2) / 255);
|
||||
if(is_real(c1)) return make_color_rgb((r1 * r2) * 255, (g1 * g2) * 255, (b1 * b2) * 255);
|
||||
return make_color_rgba((r1 * r2) * 255, (g1 * g2) * 255, (b1 * b2) * 255, (a1 * a2) * 255);
|
||||
} #endregion
|
||||
|
||||
function colorAdd(c1, c2) { #region
|
||||
|
@ -89,6 +97,40 @@ function color_rgb(col) { #region
|
|||
return [ color_get_red(col) / 255, color_get_green(col) / 255, color_get_blue(col) / 255 ];
|
||||
} #endregion
|
||||
|
||||
function make_color_rgba(r, g, b, a) { INLINE return int64(round(r) + (round(g) << 8) + (round(b) << 16) + (round(a) << 24)); }
|
||||
function make_color_hsva(h, s, v, a) { INLINE return _cola(make_color_hsv(h, s, v), a); }
|
||||
|
||||
#macro merge_color merge_color_ext
|
||||
#macro __merge_color merge_color
|
||||
|
||||
function merge_color_ext(c0, c1, t) { #region
|
||||
INLINE
|
||||
if(is_real(c0)) return __merge_color(c0, c1, t);
|
||||
|
||||
return make_color_rgba(
|
||||
clamp(round(lerp(color_get_red(c0), color_get_red(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_green(c0), color_get_green(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_blue(c0), color_get_blue(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_alpha(c0), color_get_alpha(c1), t)), 0, 255),
|
||||
);
|
||||
} #endregion
|
||||
|
||||
function merge_color_hsv(c0, c1, t) { #region
|
||||
INLINE
|
||||
if(is_real(c0)) return make_color_hsv(
|
||||
clamp(round(lerp(color_get_hue(c0), color_get_hue(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_saturation(c0), color_get_saturation(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_value(c0), color_get_value(c1), t)), 0, 255),
|
||||
);
|
||||
|
||||
return make_color_hsva(
|
||||
clamp(round(lerp(color_get_hue(c0), color_get_hue(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_saturation(c0), color_get_saturation(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_value(c0), color_get_value(c1), t)), 0, 255),
|
||||
clamp(round(lerp(color_get_alpha(c0), color_get_alpha(c1), t)), 0, 255),
|
||||
);
|
||||
} #endregion
|
||||
|
||||
#region sorting functions
|
||||
function __valHSV(c, h, s, v) { return color_get_hue(c) * h + color_get_saturation(c) * s + color_get_value(c) * v; }
|
||||
function __valRGB(c, r, g, b) { return color_get_red(c) * r + color_get_green(c) * g + color_get_blue(c) * b; }
|
||||
|
|
|
@ -3,9 +3,9 @@ function colorSelector(onApply = noone) constructor {
|
|||
|
||||
current_color = c_white;
|
||||
|
||||
hue = 1;
|
||||
sat = 0;
|
||||
val = 0;
|
||||
hue = 1;
|
||||
sat = 0;
|
||||
val = 0;
|
||||
|
||||
area_dragging = false;
|
||||
side_dragging = false;
|
||||
|
@ -26,53 +26,76 @@ function colorSelector(onApply = noone) constructor {
|
|||
if(!interactable) return;
|
||||
hue = clamp(_val, 0, 255);
|
||||
setHSV();
|
||||
})
|
||||
});
|
||||
|
||||
tb_sat = new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
sat = clamp(_val, 0, 255);
|
||||
setHSV();
|
||||
})
|
||||
});
|
||||
|
||||
tb_val= new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
val = clamp(_val, 0, 255);
|
||||
setHSV();
|
||||
})
|
||||
|
||||
tb_hue.hdw = ui(16);
|
||||
tb_sat.hdw = ui(16);
|
||||
tb_val.hdw = ui(16);
|
||||
});
|
||||
|
||||
tb_red = new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
var r = clamp(_val, 0, 255);
|
||||
var g = color_get_green(current_color);
|
||||
var b = color_get_blue(current_color);
|
||||
var a = color_get_alpha(current_color);
|
||||
|
||||
current_color = make_color_rgb(r, g, b);
|
||||
current_color = make_color_rgba(r, g, b, a);
|
||||
resetHSV();
|
||||
})
|
||||
});
|
||||
|
||||
tb_green = new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
var r = color_get_red(current_color);
|
||||
var g = clamp(_val, 0, 255);
|
||||
var b = color_get_blue(current_color);
|
||||
var a = color_get_alpha(current_color);
|
||||
|
||||
current_color = make_color_rgb(r, g, b);
|
||||
current_color = make_color_rgba(r, g, b, a);
|
||||
resetHSV();
|
||||
})
|
||||
});
|
||||
|
||||
tb_blue = new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
var r = color_get_red(current_color);
|
||||
var g = color_get_green(current_color);
|
||||
var b = clamp(_val, 0, 255);
|
||||
var a = color_get_alpha(current_color);
|
||||
|
||||
current_color = make_color_rgb(r, g, b);
|
||||
current_color = make_color_rgba(r, g, b, a);
|
||||
resetHSV();
|
||||
})
|
||||
});
|
||||
|
||||
tb_red.hdw = ui(16);
|
||||
tb_alpha = new slider(0, 255, 1, function(_val) {
|
||||
if(!interactable) return;
|
||||
var alp = clamp(_val, 0, 255);
|
||||
|
||||
current_color = _cola(current_color, alp);
|
||||
resetHSV();
|
||||
});
|
||||
|
||||
tb_hue.hdw = ui(16);
|
||||
tb_sat.hdw = ui(16);
|
||||
tb_val.hdw = ui(16);
|
||||
tb_red.hdw = ui(16);
|
||||
tb_green.hdw = ui(16);
|
||||
tb_blue.hdw = ui(16);
|
||||
tb_blue.hdw = ui(16);
|
||||
tb_alpha.hdw = ui(16);
|
||||
|
||||
tb_hue.font = f_p1;
|
||||
tb_sat.font = f_p1;
|
||||
tb_val.font = f_p1;
|
||||
tb_red.font = f_p1;
|
||||
tb_green.font = f_p1;
|
||||
tb_blue.font = f_p1;
|
||||
tb_alpha.font = f_p1;
|
||||
|
||||
tb_hex = new textBox(TEXTBOX_INPUT.text, function(str) {
|
||||
if(!interactable) return;
|
||||
|
@ -82,29 +105,34 @@ function colorSelector(onApply = noone) constructor {
|
|||
var _r = string_hexadecimal(string_copy(str, 1, 2));
|
||||
var _g = string_hexadecimal(string_copy(str, 3, 2));
|
||||
var _b = string_hexadecimal(string_copy(str, 5, 2));
|
||||
var _a = string_length(str) > 6? string_hexadecimal(string_copy(str, 7, 2)) : 255;
|
||||
|
||||
current_color = make_color_rgb(_r, _g, _b);
|
||||
current_color = make_color_rgba(_r, _g, _b, _a);
|
||||
resetHSV();
|
||||
})
|
||||
});
|
||||
|
||||
scr_disp = new buttonGroup(["Hue", "Value"], function(mode) { disp_mode = mode; } );
|
||||
|
||||
function resetHSV() {
|
||||
function resetHSV(_apply = true) {
|
||||
hue = round(color_get_hue(current_color));
|
||||
sat = round(color_get_saturation(current_color));
|
||||
val = round(color_get_value(current_color));
|
||||
|
||||
if(onApply != noone) onApply(current_color);
|
||||
}
|
||||
function setHSV() {
|
||||
if(!interactable) return;
|
||||
current_color = make_color_hsv(hue, sat, val);
|
||||
if(onApply != noone) onApply(current_color);
|
||||
if(_apply && onApply != noone) onApply(current_color);
|
||||
}
|
||||
|
||||
function setColor(color) {
|
||||
function setHSV(_apply = true) {
|
||||
if(!interactable) return;
|
||||
var alp = color_get_alpha(current_color);
|
||||
current_color = make_color_hsva(hue, sat, val, alp);
|
||||
|
||||
if(_apply && onApply != noone) onApply(current_color);
|
||||
}
|
||||
|
||||
function setColor(color, _apply = true) {
|
||||
current_color = color;
|
||||
resetHSV();
|
||||
|
||||
resetHSV(_apply);
|
||||
}
|
||||
|
||||
function colorPicker() {
|
||||
|
@ -160,7 +188,7 @@ function colorSelector(onApply = noone) constructor {
|
|||
#region side control
|
||||
var hue_x = col_x + ui(280);
|
||||
var hue_y = col_y;
|
||||
|
||||
|
||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, hue_x - ui(8), hue_y - ui(8), ui(32), ui(256 + 16));
|
||||
|
||||
if(disp_mode == 0) {
|
||||
|
@ -275,34 +303,42 @@ function colorSelector(onApply = noone) constructor {
|
|||
#region data
|
||||
var data_x = hue_x + ui(40);
|
||||
var data_y = col_y + ui(40);
|
||||
var wdw = ui(160);
|
||||
var wdh = ui( 27);
|
||||
var txh = wdh + ui(4);
|
||||
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(data_x, data_y + ui(36 * 0 + 15), "H");
|
||||
draw_text(data_x, data_y + ui(36 * 1 + 15), "S")
|
||||
draw_text(data_x, data_y + ui(36 * 2 + 15), "V");
|
||||
|
||||
draw_text(data_x, data_y + txh * 0 + ui(15), "H");
|
||||
draw_text(data_x, data_y + txh * 1 + ui(15), "S")
|
||||
draw_text(data_x, data_y + txh * 2 + ui(15), "V");
|
||||
|
||||
tb_hue.setFocusHover(focus, hover);
|
||||
tb_sat.setFocusHover(focus, hover);
|
||||
tb_val.setFocusHover(focus, hover);
|
||||
|
||||
tb_hue.draw(data_x + ui(28), data_y + ui(36 * 0), ui(160), ui(30), round(color_get_hue(current_color)), mouse_ui);
|
||||
tb_sat.draw(data_x + ui(28), data_y + ui(36 * 1), ui(160), ui(30), round(color_get_saturation(current_color)), mouse_ui);
|
||||
tb_val.draw(data_x + ui(28), data_y + ui(36 * 2), ui(160), ui(30), round(color_get_value(current_color)), mouse_ui);
|
||||
|
||||
data_y = data_y + ui(36 * 3 + 8);
|
||||
|
||||
|
||||
tb_hue.draw(data_x + ui(28), data_y + txh * 0, wdw, wdh, round(color_get_hue(current_color)), mouse_ui);
|
||||
tb_sat.draw(data_x + ui(28), data_y + txh * 1, wdw, wdh, round(color_get_saturation(current_color)), mouse_ui);
|
||||
tb_val.draw(data_x + ui(28), data_y + txh * 2, wdw, wdh, round(color_get_value(current_color)), mouse_ui);
|
||||
|
||||
data_y = data_y + txh * 3 + ui(8);
|
||||
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(data_x, data_y + ui(36 * 0 + 15), "R");
|
||||
draw_text(data_x, data_y + ui(36 * 1 + 15), "G");
|
||||
draw_text(data_x, data_y + ui(36 * 2 + 15), "B");
|
||||
draw_text(data_x, data_y + txh * 0 + ui(15), "R");
|
||||
draw_text(data_x, data_y + txh * 1 + ui(15), "G");
|
||||
draw_text(data_x, data_y + txh * 2 + ui(15), "B");
|
||||
draw_text(data_x, data_y + txh * 3 + ui(15), "A");
|
||||
|
||||
tb_red.setFocusHover(focus, hover);
|
||||
tb_red.setFocusHover (focus, hover);
|
||||
tb_green.setFocusHover(focus, hover);
|
||||
tb_blue.setFocusHover(focus, hover);
|
||||
tb_blue.setFocusHover (focus, hover);
|
||||
tb_alpha.setFocusHover(focus, hover);
|
||||
|
||||
tb_red.draw (data_x + ui(28), data_y + ui(36 * 0), ui(160), ui(30), color_get_red(current_color), mouse_ui);
|
||||
tb_green.draw(data_x + ui(28), data_y + ui(36 * 1), ui(160), ui(30), color_get_green(current_color), mouse_ui);
|
||||
tb_blue.draw (data_x + ui(28), data_y + ui(36 * 2), ui(160), ui(30), color_get_blue(current_color), mouse_ui);
|
||||
tb_red.draw (data_x + ui(28), data_y + txh * 0, wdw, wdh, round(color_get_red(current_color)), mouse_ui);
|
||||
tb_green.draw(data_x + ui(28), data_y + txh * 1, wdw, wdh, round(color_get_green(current_color)), mouse_ui);
|
||||
tb_blue.draw (data_x + ui(28), data_y + txh * 2, wdw, wdh, round(color_get_blue(current_color)), mouse_ui);
|
||||
tb_alpha.draw(data_x + ui(28), data_y + txh * 3, wdw, wdh, round(color_get_alpha(current_color)), mouse_ui);
|
||||
|
||||
//////////////////////////////////////////////////////////////////
|
||||
|
||||
tb_hex.active = focus; tb_hex.hover = hover;
|
||||
tb_hex.draw(hue_x - ui(128), col_y + ui(256 + 24), ui(108), TEXTBOX_HEIGHT, color_get_hex(current_color), mouse_ui);
|
||||
|
@ -310,9 +346,10 @@ function colorSelector(onApply = noone) constructor {
|
|||
|
||||
var cx = col_x + ui(16);
|
||||
var cy = col_y + ui(296);
|
||||
|
||||
var aa = _color_get_alpha(current_color);
|
||||
|
||||
draw_sprite_stretched_ext(THEME.color_picker_box, 0, cx - ui(20), cy - ui(20), ui(40), ui(40), COLORS._main_icon_dark, 1);
|
||||
draw_sprite_stretched_ext(THEME.color_picker_box, 1, cx - ui(18), cy - ui(18), ui(36), ui(36), current_color, 1);
|
||||
draw_sprite_stretched_ext(THEME.color_picker_box, 1, cx - ui(18), cy - ui(18), ui(36), ui(36), current_color, aa);
|
||||
|
||||
cx += ui(48);
|
||||
if(buttonInstant(THEME.button_hide, cx - ui(18), cy - ui(18), ui(36), ui(36), mouse_ui, focus, hover, "", THEME.color_picker_dropper, 0, c_white) == 2)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
function colToVec4(color, alpha = 1) {
|
||||
return [ color_get_red(color) / 255, color_get_green(color) / 255, color_get_blue(color) / 255, alpha ];
|
||||
var a = is_int64(color)? _color_get_alpha(color) : alpha;
|
||||
return [ _color_get_red(color), _color_get_green(color), _color_get_blue(color), a ];
|
||||
}
|
||||
|
||||
function colaToVec4(color) {
|
||||
|
|
|
@ -1,6 +0,0 @@
|
|||
function draw_set_text(font, halign, valign) {
|
||||
if(argument_count > 3) draw_set_color(argument[3]);
|
||||
draw_set_font(font);
|
||||
draw_set_halign(halign);
|
||||
draw_set_valign(valign);
|
||||
}
|
35
scripts/draw_setter/draw_setter.gml
Normal file
|
@ -0,0 +1,35 @@
|
|||
#macro draw_set_color draw_set_color_ext
|
||||
#macro __draw_set_color draw_set_color
|
||||
|
||||
#macro draw_clear draw_clear_ext
|
||||
#macro __draw_clear draw_clear
|
||||
|
||||
function draw_set_color_ext(col) {
|
||||
INLINE
|
||||
|
||||
__draw_set_color(col);
|
||||
if(is_real(col)) return;
|
||||
|
||||
var a = _color_get_alpha(col);
|
||||
draw_set_alpha(a);
|
||||
}
|
||||
|
||||
function draw_clear_ext(col) {
|
||||
if(is_real(col)) {
|
||||
__draw_clear(col);
|
||||
return;
|
||||
}
|
||||
|
||||
var a = _color_get_alpha(col);
|
||||
draw_clear_alpha(col, a);
|
||||
}
|
||||
|
||||
function draw_set_text(font, halign, valign) {
|
||||
INLINE
|
||||
|
||||
if(argument_count > 3) draw_set_color(argument[3]);
|
||||
|
||||
draw_set_font(font);
|
||||
draw_set_halign(halign);
|
||||
draw_set_valign(valign);
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "draw_set_text",
|
||||
"name": "draw_setter",
|
||||
"isCompatibility": false,
|
||||
"isDnD": false,
|
||||
"parent": {
|
|
@ -24,7 +24,8 @@ function gradientObject(color = c_black) constructor { #region
|
|||
var g = new gradientObject();
|
||||
for( var i = 0, n = array_length(keys); i < n; i++ )
|
||||
g.keys[i] = keys[i].clone();
|
||||
g.type = type;
|
||||
|
||||
g.type = type;
|
||||
|
||||
return g;
|
||||
} #endregion
|
||||
|
@ -56,7 +57,7 @@ function gradientObject(color = c_black) constructor { #region
|
|||
var _len = array_length(keys);
|
||||
if(_len == 0) return c_black;
|
||||
if(_len == 1) return keys[0].value;
|
||||
|
||||
|
||||
if(position <= keys[0].time) return keys[0].value;
|
||||
if(position >= keys[_len - 1].time) return keys[_len - 1].value;
|
||||
|
||||
|
@ -67,11 +68,12 @@ function gradientObject(color = c_black) constructor { #region
|
|||
if(_key.time < position) continue;
|
||||
if(_key.time == position) return keys[i].value;
|
||||
|
||||
if(type == GRADIENT_INTER.smooth) {
|
||||
var rat = (position - _pkey.time) / (_key.time - _pkey.time);
|
||||
return merge_color(_pkey.value, _key.value, rat);
|
||||
} else if(type == GRADIENT_INTER.none) {
|
||||
return _pkey.value;
|
||||
var rat = (position - _pkey.time) / (_key.time - _pkey.time);
|
||||
|
||||
switch(type) {
|
||||
case GRADIENT_INTER.smooth : return merge_color(_pkey.value, _key.value, rat);
|
||||
case GRADIENT_INTER.hue : return merge_color_hsv(_pkey.value, _key.value, rat);
|
||||
case GRADIENT_INTER.none : return _pkey.value;
|
||||
}
|
||||
|
||||
_pkey = _key;
|
||||
|
@ -90,40 +92,59 @@ function gradientObject(color = c_black) constructor { #region
|
|||
var _grad_time = [];
|
||||
|
||||
var len = min(128, array_length(keys));
|
||||
var aa = false;
|
||||
|
||||
for(var i = 0; i < len; i++) {
|
||||
if(keys[i].value == undefined) return;
|
||||
|
||||
_grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
var _val = keys[i].value;
|
||||
if(_val == undefined) return;
|
||||
|
||||
_grad_color[i * 4 + 0] = _color_get_red(_val);
|
||||
_grad_color[i * 4 + 1] = _color_get_green(_val);
|
||||
_grad_color[i * 4 + 2] = _color_get_blue(_val);
|
||||
_grad_color[i * 4 + 3] = _color_get_alpha(_val);
|
||||
_grad_time[i] = keys[i].time;
|
||||
|
||||
if(_grad_color[i * 4 + 3] != 1) aa = true;
|
||||
}
|
||||
|
||||
surf = surface_verify(surf, _w, _h);
|
||||
|
||||
surface_set_target(surf);
|
||||
DRAW_CLEAR
|
||||
var _gh = aa? _h - ui(8) : _h;
|
||||
draw_sprite_stretched_ext(THEME.gradient_mask, 0, 0, 0, _w, _gh, c_white, _a)
|
||||
|
||||
gpu_set_colorwriteenable(0, 0, 0, 1);
|
||||
draw_sprite_stretched_ext(THEME.gradient_mask, 0, 0, 0, _w, _h, c_white, _a)
|
||||
gpu_set_colorwriteenable(1, 1, 1, 0);
|
||||
|
||||
if(len == 0) {
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _w, _h, c_white, 1);
|
||||
} else {
|
||||
if(len) {
|
||||
BLEND_MULTIPLY
|
||||
|
||||
shader_set(sh_gradient_display);
|
||||
shader_set_uniform_i(uniform_grad_blend, type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color, GRADIENT_LIMIT * 4);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, len);
|
||||
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _w, _h, c_white, 1);
|
||||
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _w, _gh, c_white, 1);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL
|
||||
}
|
||||
|
||||
gpu_set_colorwriteenable(1, 1, 1, 1);
|
||||
if(aa) {
|
||||
draw_sprite_stretched_ext(THEME.gradient_mask, 0, 0, _h - ui(6), _w, ui(6), c_white, _a)
|
||||
|
||||
BLEND_MULTIPLY
|
||||
|
||||
shader_set(sh_gradient_display_alpha);
|
||||
shader_set_uniform_i(uniform_grad_blend, type);
|
||||
shader_set_uniform_f_array_safe(uniform_grad, _grad_color, GRADIENT_LIMIT * 4);
|
||||
shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time);
|
||||
shader_set_uniform_i(uniform_grad_key, len);
|
||||
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, _h - ui(6), _w, ui(6), c_white, 1);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL
|
||||
}
|
||||
surface_reset_target();
|
||||
|
||||
draw_surface(surf, _x, _y);
|
||||
|
@ -133,12 +154,13 @@ function gradientObject(color = c_black) constructor { #region
|
|||
var _grad_color = [], _grad_time = [];
|
||||
|
||||
for(var i = 0; i < array_length(keys); i++) {
|
||||
if(is_undefined(keys[i].value)) continue;
|
||||
var _val = keys[i].value;
|
||||
if(is_undefined(_val)) continue;
|
||||
|
||||
_grad_color[i * 4 + 0] = color_get_red(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 1] = color_get_green(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 2] = color_get_blue(keys[i].value) / 255;
|
||||
_grad_color[i * 4 + 3] = 1;
|
||||
_grad_color[i * 4 + 0] = _color_get_red(_val);
|
||||
_grad_color[i * 4 + 1] = _color_get_green(_val);
|
||||
_grad_color[i * 4 + 2] = _color_get_blue(_val);
|
||||
_grad_color[i * 4 + 3] = _color_get_alpha(_val);
|
||||
_grad_time[i] = keys[i].time;
|
||||
}
|
||||
|
||||
|
|
|
@ -159,7 +159,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
shader_set(shader);
|
||||
gpu_set_colorwriteenable(1, 1, 1, 0);
|
||||
|
||||
shader_set_uniform_f(uniform_intn, _inten);
|
||||
shader_set_uniform_f(uniform_intn, _inten * _color_get_alpha(_color));
|
||||
shader_set_uniform_f(uniform_band, _band);
|
||||
shader_set_uniform_f(uniform_attn, _attn);
|
||||
shader_set_uniform_f_array_safe(uniform_colr, [ color_get_red(_color) / 255, color_get_green(_color) / 255, color_get_blue(_color) / 255 ]);
|
||||
|
|
|
@ -29,7 +29,7 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
|
||||
input_display_list = [ 0,
|
||||
[ "Brush transform", false ], 7, 2, 3, 4,
|
||||
[ "Brush properties", false ], 1, 5, 6, 8,
|
||||
[ "Brush properties", false ], 1, 5, 8,
|
||||
];
|
||||
|
||||
brush_prev = noone;
|
||||
|
@ -61,7 +61,7 @@ function Node_Active_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) const
|
|||
var _brot = getInputData(3);
|
||||
var _bsca = getInputData(4);
|
||||
var _bcol = getInputData(5);
|
||||
var _balp = getInputData(6);
|
||||
var _balp = _color_get_alpha(_bcol);
|
||||
var _bact = getInputData(7);
|
||||
var _bdst = getInputData(8);
|
||||
|
||||
|
|
|
@ -156,9 +156,9 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
input_display_list = [
|
||||
["Output", false], 0, frame_renderer, 12, 13,
|
||||
["Brush", false], 6, 2, 1, 11, 15, 17, 16,
|
||||
["Brush", false], 6, 2, 1, 15, 17, 16,
|
||||
["Fill", false], 3, 4,
|
||||
["Display", false], 8, 10, 14, 9,
|
||||
["Background", true, 10], 8, 14, 9,
|
||||
];
|
||||
|
||||
#region ++++ data ++++
|
||||
|
@ -341,7 +341,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
} #endregion
|
||||
|
||||
function apply_draw_surface() { #region
|
||||
var _alp = getInputData(11);
|
||||
var _alp = _color_get_alpha(getInputData(1));
|
||||
|
||||
storeAction();
|
||||
|
||||
|
@ -526,7 +526,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
} #endregion
|
||||
|
||||
function flood_fill_scanline(_x, _y, _surf, _thres, _corner = false) { #region
|
||||
var _alp = getInputData(11);
|
||||
var _alp = _color_get_alpha(getInputData(1));
|
||||
|
||||
var colorFill = draw_get_color() + (255 << 24);
|
||||
var colorBase = get_color_buffer(_x, _y);
|
||||
|
@ -617,7 +617,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
} #endregion
|
||||
|
||||
function canvas_fill(_x, _y, _surf, _thres) { #region
|
||||
var _alp = getInputData(11);
|
||||
var _alp = _color_get_alpha(getInputData(1));
|
||||
|
||||
var w = surface_get_width_safe(_surf);
|
||||
var h = surface_get_height_safe(_surf);
|
||||
|
@ -975,7 +975,7 @@ function Node_Canvas(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _bg = getInputData(8);
|
||||
var _bga = getInputData(9);
|
||||
var _bgr = getInputData(10);
|
||||
var _alp = getInputData(11);
|
||||
var _alp = _color_get_alpha(getInputData(1));
|
||||
|
||||
var __s = surface_get_target();
|
||||
|
||||
|
|
|
@ -240,7 +240,7 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
shader_set_f_map_s("val", _val, _data[22], inputs[| 5]);
|
||||
|
||||
shader_set_color("blend", _bl);
|
||||
shader_set_f_map_s("blendAmount", _bla, _data[23], inputs[| 7]);
|
||||
shader_set_f_map_s("blendAmount", _bla * _color_get_alpha(_bl), _data[23], inputs[| 7]);
|
||||
shader_set_i("blendMode", _blm);
|
||||
|
||||
shader_set_f_map_s("alpha", _alp, _data[24], inputs[| 9]);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
function Node_Color_Mix(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Mix Color";
|
||||
|
||||
w = 96;
|
||||
name = "Mix Color";
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Color from", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
|
||||
|
@ -19,21 +18,8 @@ function Node_Color_Mix(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
switch(_data[3]) {
|
||||
case 0 : return merge_color(_data[0], _data[1], _data[2]);
|
||||
case 1 :
|
||||
var h0 = color_get_hue(_data[0]);
|
||||
var s0 = color_get_saturation(_data[0]);
|
||||
var v0 = color_get_value(_data[0]);
|
||||
|
||||
var h1 = color_get_hue(_data[1]);
|
||||
var s1 = color_get_saturation(_data[1]);
|
||||
var v1 = color_get_value(_data[1]);
|
||||
|
||||
return make_color_hsv(
|
||||
lerp(h0, h1, _data[2]),
|
||||
lerp(s0, s1, _data[2]),
|
||||
lerp(v0, v1, _data[2]),
|
||||
);
|
||||
case 0 : return merge_color_ext(_data[0], _data[1], _data[2]);
|
||||
case 1 : return merge_color_hsv(_data[0], _data[1], _data[2]);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -56,18 +56,18 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
|
||||
var _colorFrom = array_create(array_length(fr) * 4);
|
||||
for(var i = 0; i < array_length(fr); i++) {
|
||||
_colorFrom[i * 4 + 0] = color_get_red(fr[i]) / 255;
|
||||
_colorFrom[i * 4 + 1] = color_get_green(fr[i]) / 255;
|
||||
_colorFrom[i * 4 + 2] = color_get_blue(fr[i]) / 255;
|
||||
_colorFrom[i * 4 + 3] = 1;
|
||||
_colorFrom[i * 4 + 0] = _color_get_red(fr[i]);
|
||||
_colorFrom[i * 4 + 1] = _color_get_green(fr[i]);
|
||||
_colorFrom[i * 4 + 2] = _color_get_blue(fr[i]);
|
||||
_colorFrom[i * 4 + 3] = _color_get_alpha(fr[i]);
|
||||
}
|
||||
|
||||
var _colorTo = array_create(array_length(to) * 4);
|
||||
for(var i = 0; i < array_length(to); i++) {
|
||||
_colorTo[i * 4 + 0] = color_get_red(to[i]) / 255;
|
||||
_colorTo[i * 4 + 1] = color_get_green(to[i]) / 255;
|
||||
_colorTo[i * 4 + 2] = color_get_blue(to[i]) / 255;
|
||||
_colorTo[i * 4 + 3] = 1;
|
||||
_colorTo[i * 4 + 0] = _color_get_red(to[i]);
|
||||
_colorTo[i * 4 + 1] = _color_get_green(to[i]);
|
||||
_colorTo[i * 4 + 2] = _color_get_blue(to[i]);
|
||||
_colorTo[i * 4 + 3] = _color_get_alpha(to[i]);
|
||||
}
|
||||
|
||||
surface_set_shader(_outSurf, sh_palette_replace);
|
||||
|
|
|
@ -42,7 +42,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
.rejectArray();
|
||||
|
||||
input_display_list = [1,
|
||||
["Styling", false], 2, 0, 3, 4,
|
||||
["Styling", false], 2, 0, 4,
|
||||
["Display", false], 5, 6,
|
||||
];
|
||||
|
||||
|
@ -355,7 +355,7 @@ function Node_Display_Text(_x, _y, _group = noone) : Node(_x, _y, _group) constr
|
|||
if(txt == "") txt = "..."
|
||||
|
||||
var sty = getInputData(2);
|
||||
var alp = getInputData(3);
|
||||
var alp = _color_get_alpha(color);
|
||||
var wid = getInputData(4);
|
||||
var posi = getInputData(5);
|
||||
smooth = getInputData(6);
|
||||
|
|
|
@ -15,7 +15,7 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
inputs[| 4] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 5] = nodeValue("Colors", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black )
|
||||
inputs[| 5] = nodeValue("Colors", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, cola(c_black) )
|
||||
|
||||
inputs[| 6] = nodeValue("Threshold", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
@ -90,30 +90,18 @@ function Node_Flood_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
repeat(it) {
|
||||
ind = !ind;
|
||||
|
||||
surface_set_target(temp_surface[ind]);
|
||||
DRAW_CLEAR
|
||||
|
||||
shader_set(sh_flood_fill_it);
|
||||
shader_set_f("dimension", [ sw, sh ]);
|
||||
shader_set_i("diagonal", _dia);
|
||||
BLEND_OVERRIDE
|
||||
surface_set_shader(temp_surface[ind], sh_flood_fill_it);
|
||||
shader_set_f("dimension", [ sw, sh ]);
|
||||
shader_set_i("diagonal", _dia);
|
||||
draw_surface_safe(temp_surface[!ind], 0, 0);
|
||||
BLEND_NORMAL
|
||||
shader_reset();
|
||||
surface_reset_target();
|
||||
surface_reset_shader();
|
||||
}
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
|
||||
shader_set(sh_flood_fill_replace);
|
||||
shader_set_f("color", colToVec4(_col));
|
||||
shader_set_surface("mask", temp_surface[ind]);
|
||||
BLEND_OVERRIDE
|
||||
surface_set_shader(_outSurf, sh_flood_fill_replace);
|
||||
shader_set_color("color", _col);
|
||||
shader_set_surface("mask", temp_surface[ind]);
|
||||
draw_surface_safe(inSurf, 0, 0);
|
||||
BLEND_NORMAL
|
||||
shader_reset();
|
||||
surface_reset_target();
|
||||
surface_reset_shader();
|
||||
|
||||
__process_mask_modifier(_data);
|
||||
_outSurf = mask_apply(_data[0], _outSurf, _data[1], _data[2]);
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
global.__FRAME_LABEL_SCALE = 1;
|
||||
|
||||
function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||
name = "Frame";
|
||||
w = 240;
|
||||
h = 160;
|
||||
alpha = 1;
|
||||
name = "Frame";
|
||||
w = 240;
|
||||
h = 160;
|
||||
bg_spr = THEME.node_frame_bg;
|
||||
|
||||
size_dragging = false;
|
||||
|
@ -26,7 +25,7 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white )
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, cola(c_white) )
|
||||
.rejectArray();
|
||||
|
||||
inputs[| 2] = nodeValue("Alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.75 )
|
||||
|
@ -41,6 +40,8 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
.rejectArray();
|
||||
|
||||
input_display_list = [ 0, 1, 3, 4 ];
|
||||
|
||||
static onValueUpdate = function(index = 3) { #region
|
||||
global.__FRAME_LABEL_SCALE = getInputData(3);
|
||||
} #endregion
|
||||
|
@ -51,7 +52,7 @@ function Node_Frame(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
|||
h = si[1];
|
||||
|
||||
color = getInputData(1);
|
||||
alpha = getInputData(2);
|
||||
alpha = _color_get_alpha(color);
|
||||
scale = getInputData(3);
|
||||
label_color = getInputData(4);
|
||||
} #endregion
|
||||
|
|
|
@ -58,11 +58,7 @@ function Node_Glow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
|
||||
var s = surface_apply_gaussian(pass1, _size, false, c_black, 1, noone);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE
|
||||
|
||||
shader_set(sh_lum2alpha);
|
||||
surface_set_shader(_outSurf, sh_lum2alpha);
|
||||
shader_set_color("color", cl);
|
||||
shader_set_f("intensity", _stre);
|
||||
draw_surface_ext_safe(s, 0, 0, 1, 1, 0, c_white, 1);
|
||||
|
|
|
@ -4,7 +4,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ c_black, c_white ]) );
|
||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ cola(c_black), cola(c_white) ]) );
|
||||
|
||||
inputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Circular", "Radial" ]);
|
||||
|
|
|
@ -2,7 +2,7 @@ function Node_Gradient_Out(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
name = "Gradient";
|
||||
w = 96;
|
||||
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ c_black, c_white ]) );
|
||||
inputs[| 0] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ cola(c_black), cola(c_white) ]) );
|
||||
|
||||
inputs[| 1] = nodeValue("Sample", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0, "Position to sample a color from the gradient.")
|
||||
.setDisplay(VALUE_DISPLAY.slider)
|
||||
|
|
|
@ -1,10 +1,6 @@
|
|||
function Node_Grey_Alpha(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Grey to Alpha";
|
||||
|
||||
shader = sh_grey_alpha;
|
||||
uniform_rep = shader_get_uniform(shader, "replace");
|
||||
uniform_col = shader_get_uniform(shader, "color");
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue("Replace color", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true, "Replace output with solid color.");
|
||||
|
@ -16,8 +12,8 @@ function Node_Grey_Alpha(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [ 3,
|
||||
["Effect", false], 0, 1, 2,
|
||||
input_display_list = [ 3, 0,
|
||||
["Replace Color", false, 1], 2,
|
||||
]
|
||||
|
||||
attribute_surface_depth();
|
||||
|
@ -31,18 +27,12 @@ function Node_Grey_Alpha(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
|||
var _replace = getInputData(1);
|
||||
var _color = getInputData(2);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_i(uniform_rep, _replace);
|
||||
shader_set_uniform_f_array_safe(uniform_col, colToVec4(_color));
|
||||
surface_set_shader(_outSurf, sh_grey_alpha);
|
||||
shader_set_i("replace", _replace);
|
||||
shader_set_color("color", _color);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL;
|
||||
surface_reset_target();
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
} #endregion
|
||||
|
|
|
@ -431,6 +431,7 @@ function valueAnimator(_val, _prop, _sep_axis = false) constructor {
|
|||
case VALUE_TYPE.integer :
|
||||
case VALUE_TYPE.float : return _val;
|
||||
case VALUE_TYPE.text : return string_real(_val);
|
||||
case VALUE_TYPE.color : return is_real(_val)? cola(_val) : _val;
|
||||
case VALUE_TYPE.surface :
|
||||
if(is_string(_val))
|
||||
return get_asset(_val);
|
||||
|
|
|
@ -1,17 +1,6 @@
|
|||
function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Normal Light";
|
||||
|
||||
shader = sh_normal_light;
|
||||
uniform_map = shader_get_sampler_index(shader, "normalMap");
|
||||
uniform_hei = shader_get_uniform(shader, "normalHeight");
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
|
||||
uniform_amb = shader_get_uniform(shader, "ambiance");
|
||||
uniform_light_pos = shader_get_uniform(shader, "lightPosition");
|
||||
uniform_light_col = shader_get_uniform(shader, "lightColor");
|
||||
uniform_light_int = shader_get_uniform(shader, "lightIntensity");
|
||||
uniform_light_typ = shader_get_uniform(shader, "lightType");
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue("Normal map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
@ -65,19 +54,18 @@ function Node_Normal_Light(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var _light_col = _data[7];
|
||||
var _light_typ = _data[8];
|
||||
|
||||
surface_set_shader(_outSurf, shader);
|
||||
|
||||
texture_set_stage(uniform_map, surface_get_texture(_map));
|
||||
shader_set_uniform_f(uniform_hei, _hei);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ]);
|
||||
shader_set_uniform_f_array_safe(uniform_amb, [color_get_red(_amb) / 255, color_get_green(_amb) / 255, color_get_blue(_amb) / 255]);
|
||||
surface_set_shader(_outSurf, sh_normal_light);
|
||||
shader_set_surface("normalMap", _map);
|
||||
shader_set_f("normalHeight", _hei);
|
||||
shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||
shader_set_color("ambiance", _amb);
|
||||
|
||||
shader_set_uniform_f_array_safe(uniform_light_pos, [ _light_pos[0], _light_pos[1], _light_pos[2] / 100, _light_ran ] );
|
||||
shader_set_uniform_f_array_safe(uniform_light_col, [color_get_red(_light_col) / 255, color_get_green(_light_col) / 255, color_get_blue(_light_col) / 255]);
|
||||
shader_set_uniform_f(uniform_light_int, _light_int);
|
||||
shader_set_uniform_i(uniform_light_typ, _light_typ);
|
||||
shader_set_f("lightPosition", _light_pos[0], _light_pos[1], _light_pos[2] / 100, _light_ran );
|
||||
shader_set_color("lightColor", _light_col);
|
||||
shader_set_f("lightIntensity", _light_int);
|
||||
shader_set_i("lightType", _light_typ);
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -92,7 +92,7 @@ function Node_Padding(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
|||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
} else if(fill == 1)
|
||||
draw_clear_alpha(fillClr, 1);
|
||||
draw_clear(fillClr);
|
||||
|
||||
var sx = 0;
|
||||
var sy = 0;
|
||||
|
|
|
@ -71,7 +71,8 @@ function Node_Plot_Linear(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
|||
input_display_list = [ 0,
|
||||
["Data", true], 1, 12, 21, 14, 2, 3, 15, 16,
|
||||
["Plot", false], 11, 4, 10, 20, 5, 22, 23,
|
||||
["Render", false], 6, 13, 24, 25, 26, 7, 17, 18, 19, 8, 9,
|
||||
["Render", false], 6, 13, 24, 25, 26, 7, 17, 18, 19,
|
||||
["Background", true, 8], 9,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
|
|
@ -62,7 +62,8 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
["Output", false], 0,
|
||||
["Transform", false], 5, 6, 7,
|
||||
["Shape", false], 4, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||
["Render", true], 1, 2, 3,
|
||||
["Render", true], 3,
|
||||
["Background", true, 1], 2,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
@ -134,7 +135,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
};
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
if(_bg) draw_clear_alpha(_bgc, 1);
|
||||
if(_bg) draw_clear(_bgc);
|
||||
else DRAW_CLEAR
|
||||
|
||||
draw_set_color(_shc);
|
||||
|
@ -191,7 +192,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
mesh.triangles = [];
|
||||
for( var i = 0, n = array_length(shapes); i < n; i++ ) {
|
||||
var triangles = shapes[i];
|
||||
|
||||
|
||||
for( var j = 0; j < array_length(triangles); j++ ) {
|
||||
var tri = triangles[j];
|
||||
|
||||
|
@ -204,6 +205,7 @@ function Node_Shape_Polygon(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
|||
}
|
||||
}
|
||||
draw_primitive_end();
|
||||
draw_set_alpha(1);
|
||||
|
||||
surface_reset_target();
|
||||
|
||||
|
|
|
@ -52,12 +52,12 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
|||
if(_use_gra) {
|
||||
var _colors = array_create(array_length(_gra) * 4);
|
||||
for(var i = 0; i < array_length(_gra); i++) {
|
||||
_colors[i * 4 + 0] = color_get_red(_gra[i]) / 255;
|
||||
_colors[i * 4 + 1] = color_get_green(_gra[i]) / 255;
|
||||
_colors[i * 4 + 2] = color_get_blue(_gra[i]) / 255;
|
||||
_colors[i * 4 + 3] = 1;
|
||||
_colors[i * 4 + 0] = _color_get_red(_gra[i]);
|
||||
_colors[i * 4 + 1] = _color_get_green(_gra[i]);
|
||||
_colors[i * 4 + 2] = _color_get_blue(_gra[i]);
|
||||
_colors[i * 4 + 3] = _color_get_alpha(_gra[i]);
|
||||
}
|
||||
|
||||
|
||||
surface_set_shader(_outSurf, sh_posterize_palette);
|
||||
shader_set_f("palette", _colors);
|
||||
shader_set_i("keys", array_length(_gra));
|
||||
|
|
|
@ -39,7 +39,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
inputs[| 13] = nodeValue("Path shift", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0);
|
||||
|
||||
inputs[| 14] = nodeValue("Color over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(c_white) );
|
||||
inputs[| 14] = nodeValue("Color over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject(cola(c_white)) );
|
||||
|
||||
inputs[| 15] = nodeValue("Alpha over copy", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_11 );
|
||||
|
||||
|
@ -74,11 +74,13 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
inputs[| 26] = nodeValue("Stack", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0, "Place each copy next to each other, taking surface dimension into account.")
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "None", "X", "Y" ]);
|
||||
|
||||
inputs[| 27] = nodeValue("Animator blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
inputs[| 27] = nodeValue("Animator blend", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, cola(c_white));
|
||||
|
||||
inputs[| 28] = nodeValue("Animator alpha", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider);
|
||||
|
||||
|
||||
inputs[| 29] = nodeValue("Animator", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false)
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
|
@ -86,8 +88,8 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
["Pattern", false], 3, 9, 2, 18, 7, 8,
|
||||
["Path", true], 11, 12, 13,
|
||||
["Transform", false], 4, 26, 19, 5, 6, 10,
|
||||
["Render", false], 14, 15,
|
||||
["Animator", true], 20, 21, 25, 22, 23, 24, 27, 28,
|
||||
["Render", false], 14,
|
||||
["Animator", true, 29], 20, 21, 25, 22, 23, 24, 27,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
@ -144,7 +146,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _prsh = getInputData(13);
|
||||
|
||||
var _grad = getInputData(14);
|
||||
var _alph = getInputData(15);
|
||||
//var _alph = getInputData(15);
|
||||
|
||||
var _arr = getInputData(16);
|
||||
var _sed = getInputData(17);
|
||||
|
@ -152,6 +154,8 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _col = getInputData(18);
|
||||
var _cls = getInputData(19);
|
||||
|
||||
var _an_use = getInputData(29);
|
||||
|
||||
var _an_mid = getInputData(20);
|
||||
var _an_ran = getInputData(21);
|
||||
var _an_fal = getInputData(25);
|
||||
|
@ -160,7 +164,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
var _an_sca = getInputData(24);
|
||||
|
||||
var _an_bld = getInputData(27);
|
||||
var _an_alp = getInputData(28);
|
||||
var _an_alp = _color_get_alpha(_an_bld);
|
||||
|
||||
var _surf, runx, runy, posx, posy, scax, scay, rot;
|
||||
|
||||
|
@ -206,7 +210,7 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
var _an_dist = abs(i - _an_mid * (_amo - 1));
|
||||
var _inf = 0;
|
||||
if(_an_dist < _an_ran * _amo) {
|
||||
if(_an_use && _an_dist < _an_ran * _amo) {
|
||||
_inf = eval_curve_x(_an_fal, _an_dist / (_an_ran * _amo));
|
||||
posx += _an_pos[0] * _inf;
|
||||
posy += _an_pos[1] * _inf;
|
||||
|
@ -238,10 +242,13 @@ function Node_Repeat(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
|||
|
||||
var pos = point_rotate(-sw / 2, -sh / 2, 0, 0, rot);
|
||||
var cc = _grad.eval(i / (_amo - 1));
|
||||
var aa = eval_curve_x(_alph, i / (_amo - 1));
|
||||
var aa = _color_get_alpha(cc);
|
||||
|
||||
cc = merge_color(cc, colorMultiply(cc, _an_bld), _inf);
|
||||
aa += _an_alp * _inf;
|
||||
cc = colda(cc);
|
||||
if(_an_use) {
|
||||
cc = merge_color(cc, colorMultiply(cc, _an_bld), _inf);
|
||||
aa += _an_alp * _inf;
|
||||
}
|
||||
|
||||
draw_surface_ext_safe(_surf, posx + pos[0], posy + pos[1], scax, scay, rot, cc, aa);
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ function Node_Seperate_Shape(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
|||
|
||||
input_display_list = [
|
||||
["Shape", false], 0, 1, 4,
|
||||
["Render", false], 2, 3,
|
||||
["Override Color", true, 2], 3,
|
||||
]
|
||||
|
||||
attribute_surface_depth();
|
||||
|
|
|
@ -1,11 +1,6 @@
|
|||
function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Shadow";
|
||||
|
||||
shader = sh_outline_only;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_size = shader_get_uniform(shader, "borderSize");
|
||||
uniform_colr = shader_get_uniform(shader, "borderColor");
|
||||
|
||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_black);
|
||||
|
||||
|
@ -68,23 +63,18 @@ function Node_Shadow(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
|
||||
var pass1 = surface_create_valid(surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf), attrDepth());
|
||||
|
||||
surface_set_target(pass1);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf) ]);
|
||||
shader_set_uniform_f(uniform_size, _border);
|
||||
shader_set_uniform_f_array_safe(uniform_colr, [1., 1., 1., 1.0]);
|
||||
surface_set_shader(pass1, sh_outline_only);
|
||||
shader_set_f("dimension", [ surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf) ]);
|
||||
shader_set_f("borderSize", _border);
|
||||
shader_set_f("borderColor", [1., 1., 1., 1.0]);
|
||||
|
||||
draw_surface_safe(_data[0], _shf[0], _shf[1]);
|
||||
shader_reset();
|
||||
BLEND_NORMAL;
|
||||
surface_reset_target();
|
||||
draw_surface_safe(_data[0], _shf[0], _shf[1]);
|
||||
surface_reset_shader();
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
BLEND_OVERRIDE;
|
||||
draw_surface_ext_safe(surface_apply_gaussian(pass1, _size, false, cl), 0, 0, 1, 1, 0, cl, _stre);
|
||||
draw_surface_ext_safe(surface_apply_gaussian(pass1, _size, false, cl), 0, 0, 1, 1, 0, cl, _stre * _color_get_alpha(cl));
|
||||
BLEND_NORMAL;
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
surface_reset_target();
|
||||
|
|
|
@ -65,7 +65,8 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
["Output", false], 0, 6,
|
||||
["Transform", false], 15, 3, 16, 17,
|
||||
["Shape", false], 14, 2, 9, 4, 13, 5, 7, 8,
|
||||
["Render", true], 10, 1, 11, 12, 18
|
||||
["Render", true], 10, 12, 18,
|
||||
["Background", true, 1], 11,
|
||||
];
|
||||
|
||||
temp_surface = [ noone ];
|
||||
|
@ -295,7 +296,7 @@ function Node_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
shader_set_f("center", _center);
|
||||
shader_set_f("scale", _scale );
|
||||
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], _color, 1);
|
||||
draw_sprite_stretched_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], _color, _color_get_alpha(_color));
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -4,7 +4,7 @@ function Node_Solid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, cola(c_white));
|
||||
|
||||
inputs[| 2] = nodeValue("Empty", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
|
@ -44,7 +44,7 @@ function Node_Solid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
|||
|
||||
if(_maskUse) {
|
||||
surface_set_shader(_outSurf, sh_solid);
|
||||
draw_surface_stretched_ext(_msk, 0, 0, _dim[0], _dim[1], _col, 1);
|
||||
draw_surface_stretched_ext(_msk, 0, 0, _dim[0], _dim[1], _col, _color_get_alpha(_col));
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -42,7 +42,7 @@ function Node_Sprite_Stack(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
input_display_list = [
|
||||
["Surface", false], 0, 1, 12,
|
||||
["Stack", false], 2, 3, 8, 4, 5,
|
||||
["Render", false], 6, 7, 9, 10, 11,
|
||||
["Render", false], 6, 7, 9, 10,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
@ -206,7 +206,7 @@ function Node_Sprite_Stack(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
var _hig = _data[ 9];
|
||||
var _hiC = _data[10];
|
||||
var _hiA = _data[11];
|
||||
//var _hiA = _data[11];
|
||||
var _arr = _data[12];
|
||||
|
||||
_pos = [ _pos[0], _pos[1] ];
|
||||
|
@ -238,10 +238,10 @@ function Node_Sprite_Stack(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
shader_set_f("dimension", _ww, _hh);
|
||||
shader_set_f("shift", _shf[0] / _ww, _shf[1] / _hh);
|
||||
shader_set_f("angle", degtorad(_rot));
|
||||
draw_surface_ext_safe(_in, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _hiC, _hiA);
|
||||
draw_surface_ext_safe(_in, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _hiC, _color_get_alpha(_hiC));
|
||||
shader_reset();
|
||||
} else
|
||||
draw_surface_ext_safe(_in, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _col, aa);
|
||||
draw_surface_ext_safe(_in, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _col, _color_get_alpha(_col) * aa);
|
||||
_pos[0] -= _shf[0];
|
||||
_pos[1] -= _shf[1];
|
||||
|
||||
|
@ -259,7 +259,7 @@ function Node_Sprite_Stack(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var _hh = surface_get_height_safe(_surf);
|
||||
var _po = point_rotate(0, 0, _ww / 2, _hh / 2, _rot);
|
||||
|
||||
draw_surface_ext_safe(_surf, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _col, 1);
|
||||
draw_surface_ext_safe(_surf, _po[0] + _pos[0], _po[1] + _pos[1], 1, 1, _rot, _col, _color_get_alpha(_col));
|
||||
_pos[0] += _shf[0];
|
||||
_pos[1] += _shf[1];
|
||||
}
|
||||
|
|
|
@ -98,8 +98,8 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
|||
shader_set_f_map("randomAmount", _data[ 5], _data[13], inputs[| 5]);
|
||||
shader_set_f_map("ratio", _data[10], _data[14], inputs[| 10]);
|
||||
|
||||
shader_set_f("color0", colToVec4(_clr0));
|
||||
shader_set_f("color1", colToVec4(_clr1));
|
||||
shader_set_color("color0", _clr0);
|
||||
shader_set_color("color1", _clr1);
|
||||
|
||||
shader_set_i("gradient_use", _grad_use);
|
||||
_gra.shader_submit();
|
||||
|
|
|
@ -16,8 +16,11 @@ function Node_Surface_From_Color(_x, _y, _group = noone) : Node_Processor(_x, _y
|
|||
_outSurf = surface_verify(_outSurf, w, 1);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
for( var i = 0, n = array_length(_col); i < n; i++ )
|
||||
for( var i = 0, n = array_length(_col); i < n; i++ ) {
|
||||
draw_set_alpha(_color_get_alpha(_col[i]));
|
||||
draw_point_color(i, 0, _col[i]);
|
||||
}
|
||||
draw_set_alpha(1);
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
|
|
|
@ -64,7 +64,8 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
["Output", true], 9, 6, 10,
|
||||
["Text", false], 0, 13, 14, 7, 8,
|
||||
["Font", false], 1, 2, 15, 3, 11, 12,
|
||||
["Rendering", false], 5, 16, 17,
|
||||
["Rendering", false], 5,
|
||||
["Background", true, 16], 17,
|
||||
["Wave", true, 18], 22, 19, 20, 21,
|
||||
];
|
||||
|
||||
|
@ -75,7 +76,7 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
_font_current = "";
|
||||
_size_current = 0;
|
||||
_aa_current = false;
|
||||
seed = irandom_range(10000, 99999);
|
||||
seed = seed_random();
|
||||
|
||||
static generateFont = function(_path, _size, _aa) { #region
|
||||
if(PROJECT.animator.is_playing) return;
|
||||
|
@ -97,7 +98,6 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
static step = function() { #region
|
||||
var _dimt = getSingleValue(9);
|
||||
var _path = getSingleValue(13);
|
||||
var _ubg = getSingleValue(16);
|
||||
|
||||
var _use_path = _path != noone && struct_has(_path, "getPointDistance");
|
||||
|
||||
|
@ -107,7 +107,6 @@ function Node_Text(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
|||
inputs[| 9].setVisible(!_use_path);
|
||||
inputs[| 14].setVisible( _use_path);
|
||||
inputs[| 15].setVisible(_dimt == 0 && !_use_path);
|
||||
inputs[| 17].setVisible(_ubg);
|
||||
} #endregion
|
||||
|
||||
static waveGet = function(_ind) { #region
|
||||
|
|
|
@ -610,6 +610,7 @@ function NodeValue(_name, _node, _connect, _type, _value, _tooltip = "") constru
|
|||
|
||||
node.inputs_data[index] = _value;
|
||||
node.input_value_map[$ internalName] = _value;
|
||||
|
||||
#endregion
|
||||
|
||||
#region ---- draw ----
|
||||
|
|
|
@ -468,8 +468,9 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
} #endregion
|
||||
|
||||
var color_picker_selecting = noone;
|
||||
var color_picker_index = 0;
|
||||
var color_picker_index = 0;
|
||||
var pickers = [];
|
||||
var _colsp = false;
|
||||
|
||||
for(var i = 0; i < amo; i++) {
|
||||
var yy = hh + _y;
|
||||
|
@ -490,6 +491,10 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
continue;
|
||||
|
||||
} if(is_array(jun_disp)) { // LABEL
|
||||
var pad = i && _colsp == false? ui(4) : 0
|
||||
_colsp = false;
|
||||
yy += pad;
|
||||
|
||||
var txt = __txt(jun_disp[0]);
|
||||
var coll = jun_disp[1] && filter_text == "";
|
||||
var lbh = lineBreak? ui(32) : ui(26);
|
||||
|
@ -537,9 +542,10 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
draw_text_add(ltx, yy + lbh / 2, txt);
|
||||
draw_set_alpha(1);
|
||||
|
||||
hh += lbh + ui(lineBreak? 8 : 6);
|
||||
hh += lbh + ui(lineBreak? 8 : 6) + pad;
|
||||
|
||||
if(coll) { // skip
|
||||
_colsp = true;
|
||||
var j = i + 1;
|
||||
var _len = array_length(_inspecting.input_display_list);
|
||||
|
||||
|
|
|
@ -26,6 +26,10 @@ function irandom_range_seed(from, to, seed) { #region
|
|||
return irandom_range(from, to);
|
||||
} #endregion
|
||||
|
||||
function seed_random(digits = 6) { #region
|
||||
return irandom_range(power(10, digits - 1), power(10, digits) - 1);
|
||||
} #endregion
|
||||
|
||||
function random_seed(val, seed) { #region
|
||||
random_set_seed(floor(seed));
|
||||
var _s0 = random(val);
|
||||
|
|
|
@ -28,6 +28,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
handle_w = ui(20);
|
||||
|
||||
tb_value = new textBox(TEXTBOX_INPUT.number, onApply);
|
||||
font = noone;
|
||||
|
||||
static modifyValue = function(value) { #region
|
||||
value = clamp(value, curr_minn, curr_maxx);
|
||||
|
@ -39,7 +40,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
} #endregion
|
||||
|
||||
static setInteract = function(interactable = noone) { #region
|
||||
self.interactable = interactable;
|
||||
self.interactable = interactable;
|
||||
tb_value.interactable = interactable;
|
||||
} #endregion
|
||||
|
||||
|
@ -89,6 +90,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
if(tb_w > 0) {
|
||||
sw = _w - (tb_w + ui(16));
|
||||
|
||||
tb_value.font = font;
|
||||
tb_value.setFocusHover(active, hover);
|
||||
tb_value.draw(_x + sw + ui(16), _y, tb_w, _h, current_value, _m);
|
||||
tb_value.setRange(curr_minn, curr_maxx);
|
||||
|
@ -106,7 +108,7 @@ function slider(_min, _max, _step, _onModify = noone, _onRelease = noone) : widg
|
|||
|
||||
var _pg = clamp((current_value - curr_minn) / (curr_maxx - curr_minn), 0, 1) * sw;
|
||||
var _kx = _x + _pg;
|
||||
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, 1);
|
||||
draw_sprite_stretched_ext(spr, 1, _kx - handle_w / 2, _y, handle_w, _h, blend, interactable * 0.75 + 0.25);
|
||||
|
||||
if(dragging) {
|
||||
draw_sprite_stretched_ext(spr, 3, _kx - handle_w / 2, _y, handle_w, _h, COLORS._main_accent, 1);
|
||||
|
|
|
@ -32,15 +32,14 @@ function number_to_hex(val) {
|
|||
return ss;
|
||||
}
|
||||
|
||||
function color_get_hex(color, alpha = false) {
|
||||
function color_get_hex(color) {
|
||||
var arr = is_array(color) && array_length(color) == 4;
|
||||
var r = arr? round(color[0] * 256) : color_get_red(color);
|
||||
var g = arr? round(color[1] * 256) : color_get_green(color);
|
||||
var b = arr? round(color[2] * 256) : color_get_blue(color);
|
||||
var a = arr? round(color[3] * 256) : color_get_alpha(color);
|
||||
|
||||
var hex = number_to_hex(r) + number_to_hex(g) + number_to_hex(b) + (alpha? " " + number_to_hex(a) : "");
|
||||
return hex;
|
||||
return number_to_hex(r) + number_to_hex(g) + number_to_hex(b) + (is_int64(color)? number_to_hex(a) : "");
|
||||
}
|
||||
|
||||
function color_from_rgb(str) {
|
||||
|
|
|
@ -61,7 +61,9 @@ void main() {
|
|||
result.a = wgh;
|
||||
|
||||
gl_FragColor = result;
|
||||
if(overrideColor == 1)
|
||||
if(overrideColor == 1) {
|
||||
gl_FragColor.rgb = overColor.rgb;
|
||||
gl_FragColor.a *= overColor.a;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ void main() {
|
|||
clr /= totalWeight;
|
||||
|
||||
gl_FragColor = clr;
|
||||
if(overrideColor == 1)
|
||||
if(overrideColor == 1) {
|
||||
gl_FragColor.rgb = overColor.rgb;
|
||||
gl_FragColor.a *= overColor.a;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ void main() {
|
|||
float _a = 1. / amo;
|
||||
|
||||
if(mod(floor(_x / _a) + floor(_y / _a), 2.) > 0.5)
|
||||
gl_FragColor = vec4(col1.rgb, 1.);
|
||||
gl_FragColor = col1;
|
||||
else
|
||||
gl_FragColor = vec4(col2.rgb, 1.);
|
||||
gl_FragColor = col2;
|
||||
}
|
||||
|
|
|
@ -27,5 +27,5 @@ void main() {
|
|||
}
|
||||
}
|
||||
|
||||
gl_FragColor = vec4(colorTo[index].rgb, p.a);
|
||||
gl_FragColor = vec4(colorTo[index].rgb, p.a * colorTo[index].a);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) {
|
|||
return hsv2rgb(h);
|
||||
}
|
||||
|
||||
vec3 gradientEval(in float prog) {
|
||||
vec4 gradientEval(in float prog) {
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
|
@ -63,18 +63,21 @@ vec3 gradientEval(in float prog) {
|
|||
else if(gradient_blend == 1)
|
||||
col = gradient_color[i - 1];
|
||||
else if(gradient_blend == 2)
|
||||
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
|
||||
col = vec4(
|
||||
hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t),
|
||||
mix(gradient_color[i - 1].a, gradient_color[i].a, t)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(i >= gradient_keys - 1)
|
||||
return gradient_color[gradient_keys - 1].rgb;
|
||||
return gradient_color[gradient_keys - 1];
|
||||
}
|
||||
|
||||
return col.rgb;
|
||||
return col;
|
||||
}
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(gradientEval(v_vTexcoord.x), v_vColour.a);
|
||||
gl_FragColor = gradientEval(v_vTexcoord.x);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,84 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
#define TAU 6.283185307179586
|
||||
#define GRADIENT_LIMIT 128
|
||||
|
||||
uniform int gradient_blend;
|
||||
uniform vec4 gradient_color[GRADIENT_LIMIT];
|
||||
uniform float gradient_time[GRADIENT_LIMIT];
|
||||
uniform int gradient_keys;
|
||||
|
||||
vec3 rgb2hsv(vec3 c) { #region
|
||||
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||
|
||||
float d = q.x - min(q.w, q.y);
|
||||
float e = 0.0000000001;
|
||||
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||
} #endregion
|
||||
|
||||
vec3 hsv2rgb(vec3 c) { #region
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
} #endregion
|
||||
|
||||
float hueDist(float a0, float a1, float t) { #region
|
||||
float da = fract(a1 - a0);
|
||||
float ds = fract(2. * da) - da;
|
||||
return a0 + ds * t;
|
||||
} #endregion
|
||||
|
||||
vec3 hsvMix(vec3 c1, vec3 c2, float t) { #region
|
||||
vec3 h1 = rgb2hsv(c1);
|
||||
vec3 h2 = rgb2hsv(c2);
|
||||
|
||||
vec3 h = vec3(0.);
|
||||
h.x = h.x + hueDist(h1.x, h2.x, t);
|
||||
h.y = mix(h1.y, h2.y, t);
|
||||
h.z = mix(h1.z, h2.z, t);
|
||||
|
||||
return hsv2rgb(h);
|
||||
} #endregion
|
||||
|
||||
vec4 gradientEval(in float prog) { #region
|
||||
vec4 col = vec4(0.);
|
||||
|
||||
for(int i = 0; i < GRADIENT_LIMIT; i++) {
|
||||
if(gradient_time[i] == prog) {
|
||||
col = gradient_color[i];
|
||||
break;
|
||||
} else if(gradient_time[i] > prog) {
|
||||
if(i == 0)
|
||||
col = gradient_color[i];
|
||||
else {
|
||||
float t = (prog - gradient_time[i - 1]) / (gradient_time[i] - gradient_time[i - 1]);
|
||||
if(gradient_blend == 0)
|
||||
col = mix(gradient_color[i - 1], gradient_color[i], t);
|
||||
else if(gradient_blend == 1)
|
||||
col = gradient_color[i - 1];
|
||||
else if(gradient_blend == 2)
|
||||
col = vec4(
|
||||
hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t),
|
||||
mix(gradient_color[i - 1].a, gradient_color[i].a, t)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if(i >= gradient_keys - 1)
|
||||
return gradient_color[gradient_keys - 1];
|
||||
}
|
||||
|
||||
return col;
|
||||
} #endregion
|
||||
|
||||
void main() {
|
||||
float a = gradientEval(v_vTexcoord.x).a;
|
||||
gl_FragColor = vec4(a, a, a, 1.);
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
//
|
||||
// Simple passthrough vertex shader
|
||||
//
|
||||
attribute vec3 in_Position; // (x,y,z)
|
||||
//attribute vec3 in_Normal; // (x,y,z) unused in this shader.
|
||||
attribute vec4 in_Colour; // (r,g,b,a)
|
||||
attribute vec2 in_TextureCoord; // (u,v)
|
||||
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
void main()
|
||||
{
|
||||
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
|
||||
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
|
||||
|
||||
v_vColour = in_Colour;
|
||||
v_vTexcoord = in_TextureCoord;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"resourceType": "GMShader",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_gradient_display_alpha",
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/shader/generator.yy",
|
||||
},
|
||||
"type": 1,
|
||||
}
|
|
@ -1,6 +1,3 @@
|
|||
//
|
||||
// Simple passthrough fragment shader
|
||||
//
|
||||
varying vec2 v_vTexcoord;
|
||||
varying vec4 v_vColour;
|
||||
|
||||
|
@ -14,5 +11,5 @@ float bright(in vec4 col) {
|
|||
void main() {
|
||||
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||
if(replace == 0) gl_FragColor = vec4(col.rgb, bright(col));
|
||||
else gl_FragColor = vec4(color.rgb, bright(col));
|
||||
else gl_FragColor = vec4(color.rgb, bright(col) * color.a);
|
||||
}
|
||||
|
|
|
@ -89,7 +89,10 @@ vec4 gradientEval(in float prog) { #region
|
|||
else if(gradient_blend == 1)
|
||||
col = gradient_color[i - 1];
|
||||
else if(gradient_blend == 2)
|
||||
col = vec4(hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t), 1.);
|
||||
col = vec4(
|
||||
hsvMix(gradient_color[i - 1].rgb, gradient_color[i].rgb, t),
|
||||
mix(gradient_color[i - 1].a, gradient_color[i].a, t)
|
||||
);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -164,7 +167,7 @@ void main() { #region
|
|||
}
|
||||
|
||||
if(mode == 0) {
|
||||
colr = vec4(gradientEval(random(sqSt)).rgb, 1.);
|
||||
colr = gradientEval(random(sqSt));
|
||||
} else if(mode == 2) {
|
||||
vec2 uv = fract(_pos * sca);
|
||||
colr = texture2D( gm_BaseTexture, uv );
|
||||
|
|
|
@ -163,7 +163,7 @@ void main() { #region
|
|||
float tileY = floor(sca.y * 4. / 3.);
|
||||
uv.y = mod(floor(uv.y * (tileY + 1.)), tileY) / tileY;
|
||||
|
||||
colr = vec4(gradientEval(random(uv)).rgb, 1.);
|
||||
colr = gradientEval(random(uv));
|
||||
} else if(mode == 2) {
|
||||
vec2 uv = hc.xy;
|
||||
uv.x = (uv.x + PI / 2.) / PI;
|
||||
|
|
|
@ -154,7 +154,7 @@ void main() { #region
|
|||
|
||||
if(mode == 0) {
|
||||
vec2 uv = fract(tri.xy / sca);
|
||||
colr = vec4(gradientEval(random(uv)).rgb, 1.);
|
||||
colr = gradientEval(random(uv));
|
||||
} else if(mode == 2) {
|
||||
vec2 uv = fract((_pos * vec2(1., c30) - tri.xy) + vec2(0.5, 0.));
|
||||
colr = texture2D( gm_BaseTexture, uv );
|
||||
|
|
|
@ -15,7 +15,7 @@ uniform float normalHeight;
|
|||
uniform vec3 ambiance;
|
||||
uniform int lightType;
|
||||
uniform vec4 lightPosition;
|
||||
uniform vec3 lightColor;
|
||||
uniform vec4 lightColor;
|
||||
uniform float lightIntensity;
|
||||
|
||||
void main() {
|
||||
|
@ -39,7 +39,7 @@ void main() {
|
|||
}
|
||||
|
||||
float d = max(dot(normal, lightDir), 0.0);
|
||||
vec3 diffuse = d * lightColor * base_color.rgb * attenuation;
|
||||
vec3 diffuse = d * lightColor.rgb * lightColor.a * base_color.rgb * attenuation;
|
||||
result += diffuse;
|
||||
result.r = min(result.r, base_color.r);
|
||||
result.g = min(result.g, base_color.g);
|
||||
|
|
|
@ -162,25 +162,21 @@ void main() { #region
|
|||
} else {
|
||||
float alpha = point.a + outline_alpha * (1. - point.a);
|
||||
col = ((point * point.a) + (borderColor * outline_alpha * (1. - point.a))) / alpha;
|
||||
if(is_aa == 1)
|
||||
col.a = alpha;
|
||||
else
|
||||
col.a = 1.;
|
||||
if(is_aa == 1) col.a = borderColor.a * alpha;
|
||||
else col.a = borderColor.a;
|
||||
}
|
||||
} else {
|
||||
vec4 bcol;
|
||||
if(side == 0)
|
||||
bcol = point;
|
||||
else if(side == 1)
|
||||
bcol = closetColor;
|
||||
if(side == 0) bcol = point;
|
||||
else if(side == 1) bcol = closetColor;
|
||||
|
||||
float blend = bld * outline_alpha;
|
||||
if(is_aa == 0)
|
||||
blend = bld;
|
||||
|
||||
float alpha = bcol.a + blend * (1. - bcol.a);
|
||||
col = (borderColor * blend + bcol * bcol.a * ( 1. - blend )) / alpha;
|
||||
col.a = alpha;
|
||||
col = (borderColor * blend + bcol * bcol.a * ( 1. - blend )) / alpha;
|
||||
col.a = borderColor.a * alpha;
|
||||
}
|
||||
|
||||
gl_FragColor = col;
|
||||
|
|
|
@ -17,7 +17,7 @@ uniform int alphacmp;
|
|||
uniform int hardReplace;
|
||||
uniform float treshold;
|
||||
|
||||
vec3 rgb2xyz( vec3 c ) {
|
||||
vec3 rgb2xyz( vec3 c ) { #region
|
||||
vec3 tmp;
|
||||
tmp.x = ( c.r > 0.04045 ) ? pow( ( c.r + 0.055 ) / 1.055, 2.4 ) : c.r / 12.92;
|
||||
tmp.y = ( c.g > 0.04045 ) ? pow( ( c.g + 0.055 ) / 1.055, 2.4 ) : c.g / 12.92,
|
||||
|
@ -26,23 +26,23 @@ vec3 rgb2xyz( vec3 c ) {
|
|||
mat3( 0.4124, 0.3576, 0.1805,
|
||||
0.2126, 0.7152, 0.0722,
|
||||
0.0193, 0.1192, 0.9505 );
|
||||
}
|
||||
} #endregion
|
||||
|
||||
vec3 xyz2lab( vec3 c ) {
|
||||
vec3 xyz2lab( vec3 c ) { #region
|
||||
vec3 n = c / vec3( 95.047, 100, 108.883 );
|
||||
vec3 v;
|
||||
v.x = ( n.x > 0.008856 ) ? pow( n.x, 1.0 / 3.0 ) : ( 7.787 * n.x ) + ( 16.0 / 116.0 );
|
||||
v.y = ( n.y > 0.008856 ) ? pow( n.y, 1.0 / 3.0 ) : ( 7.787 * n.y ) + ( 16.0 / 116.0 );
|
||||
v.z = ( n.z > 0.008856 ) ? pow( n.z, 1.0 / 3.0 ) : ( 7.787 * n.z ) + ( 16.0 / 116.0 );
|
||||
return vec3(( 116.0 * v.y ) - 16.0, 500.0 * ( v.x - v.y ), 200.0 * ( v.y - v.z ));
|
||||
}
|
||||
} #endregion
|
||||
|
||||
vec3 rgb2lab(vec3 c) {
|
||||
vec3 rgb2lab(vec3 c) { #region
|
||||
vec3 lab = xyz2lab( rgb2xyz( c ) );
|
||||
return vec3( lab.x / 100.0, 0.5 + 0.5 * ( lab.y / 127.0 ), 0.5 + 0.5 * ( lab.z / 127.0 ));
|
||||
}
|
||||
} #endregion
|
||||
|
||||
vec3 rgb2hsv(vec3 c) {
|
||||
vec3 rgb2hsv(vec3 c) { #region
|
||||
vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
|
||||
vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g));
|
||||
vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r));
|
||||
|
@ -50,17 +50,15 @@ vec3 rgb2hsv(vec3 c) {
|
|||
float d = q.x - min(q.w, q.y);
|
||||
float e = 0.0000000001;
|
||||
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
vec3 hsv2rgb(vec3 c) {
|
||||
vec3 hsv2rgb(vec3 c) { #region
|
||||
vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
|
||||
vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
|
||||
return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
|
||||
}
|
||||
} #endregion
|
||||
|
||||
float round(float val) {
|
||||
return fract(val) >= 0.5? ceil(val) : floor(val);
|
||||
}
|
||||
float round(float val) { return fract(val) >= 0.5? ceil(val) : floor(val); }
|
||||
|
||||
void main() {
|
||||
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||
|
|
|
@ -5,5 +5,5 @@ varying vec2 v_vTexcoord;
|
|||
varying vec4 v_vColour;
|
||||
|
||||
void main() {
|
||||
gl_FragColor = vec4(v_vColour.rgb, texture2D( gm_BaseTexture, v_vTexcoord ).a);
|
||||
gl_FragColor = vec4(v_vColour.rgb, texture2D( gm_BaseTexture, v_vTexcoord ).a * v_vColour.a);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ void main() { #region
|
|||
if(blend == 0) gl_FragColor = _s > rat? color0 : color1;
|
||||
else gl_FragColor = vec4(vec3(sin(_s * 2. * PI) * 0.5 + 0.5), 1.);
|
||||
} else {
|
||||
if(_s > rat) gl_FragColor = vec4(gradientEval(random(vec2(slot))).rgb, 1.);
|
||||
else gl_FragColor = vec4(gradientEval(random(vec2(slot + 1.))).rgb, 1.);
|
||||
if(_s > rat) gl_FragColor = gradientEval(random(vec2(slot)));
|
||||
else gl_FragColor = gradientEval(random(vec2(slot + 1.)));
|
||||
}
|
||||
} #endregion
|
||||
|
|
|
@ -37,14 +37,14 @@ void main() {
|
|||
|
||||
if(blend == 0) {
|
||||
if(mod(_yind, 2.) == 1.) {
|
||||
if(_x > _y) gl_FragColor = vec4(col1.rgb, 1.);
|
||||
else gl_FragColor = vec4(col2.rgb, 1.);
|
||||
if(_x > _y) gl_FragColor = col1;
|
||||
else gl_FragColor = col2;
|
||||
} else {
|
||||
if(_x > _y) gl_FragColor = vec4(col2.rgb, 1.);
|
||||
else gl_FragColor = vec4(col1.rgb, 1.);
|
||||
if(_x > _y) gl_FragColor = col2;
|
||||
else gl_FragColor = col1;
|
||||
}
|
||||
} else {
|
||||
if(_x > _y) gl_FragColor = vec4(mix(col1.rgb, col2.rgb, _y + (1. - _x)), 1.);
|
||||
else gl_FragColor = vec4(mix(col1.rgb, col2.rgb, _y - _x), 1.);
|
||||
if(_x > _y) gl_FragColor = mix(col1, col2, _y + (1. - _x));
|
||||
else gl_FragColor = mix(col1, col2, _y - _x);
|
||||
}
|
||||
}
|
||||
|
|