diff --git a/PixelComposer.yyp b/PixelComposer.yyp index bc254bf73..e6080c8db 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -39,10 +39,10 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"CRUD","folderPath":"folders/_extensions/FireBase/Firebase Firestore/Testing/CRUD.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Query","folderPath":"folders/_extensions/FireBase/Firebase Firestore/Testing/Query.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"Firebase Utils","folderPath":"folders/_extensions/FireBase/Firebase Utils.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"WinMan","folderPath":"folders/_extensions/WinMan.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"GMD3D11","folderPath":"folders/_extensions/GMD3D11.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"MAC","folderPath":"folders/_extensions/MAC.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"patreon","folderPath":"folders/_extensions/patreon.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"WinMan","folderPath":"folders/_extensions/WinMan.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"addons","folderPath":"folders/addons.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"custom","folderPath":"folders/addons/custom.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"key displayer","folderPath":"folders/addons/key displayer.yy",}, diff --git a/scripts/gradients_function/gradients_function.gml b/scripts/gradients_function/gradients_function.gml index 654303c98..a80b9f9f4 100644 --- a/scripts/gradients_function/gradients_function.gml +++ b/scripts/gradients_function/gradients_function.gml @@ -242,7 +242,7 @@ function loadGradient(path) { #region globalvar GRADIENTS; GRADIENTS = []; -function __initGradient() { +function __initGradient() { #region GRADIENTS = []; var path = DIRECTORY + "Gradients/" @@ -256,4 +256,4 @@ function __initGradient() { file = file_find_next(); } file_find_close(); -} \ No newline at end of file +} #endregion \ No newline at end of file diff --git a/scripts/node_3d_material/node_3d_material.gml b/scripts/node_3d_material/node_3d_material.gml index 3f1295203..5a84e52ae 100644 --- a/scripts/node_3d_material/node_3d_material.gml +++ b/scripts/node_3d_material/node_3d_material.gml @@ -23,10 +23,12 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons inputs[| 7] = nodeValue("Roughness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1 ) .setDisplay(VALUE_DISPLAY.slider); + inputs[| 8] = nodeValue("Anti aliasing", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false ); + outputs[| 0] = nodeValue("Material", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3Material, noone); - input_display_list = [ 0, - ["Properties", false], 1, 2, 3, 4, 7, + input_display_list = [ 0, 8, + ["Properties", false], 1, 2, 3, 4, 7, ["Normal", false], 5, 6, ]; @@ -39,6 +41,7 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons var _nor = _data[5]; var _norS = _data[6]; var _roug = _data[7]; + var _aa = _data[8]; if(!is_surface(_surf)) { solid_surf = surface_verify(solid_surf, 1, 1); @@ -50,6 +53,7 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons _mat.specular = _spec; _mat.shine = _shin; _mat.metalic = _metl; + _mat.texFilter = _aa; _mat.normal = _nor; _mat.normalStr = _norS; diff --git a/scripts/node_combine_rgb/node_combine_rgb.gml b/scripts/node_combine_rgb/node_combine_rgb.gml index b6494c14d..312bb6bda 100644 --- a/scripts/node_combine_rgb/node_combine_rgb.gml +++ b/scripts/node_combine_rgb/node_combine_rgb.gml @@ -1,5 +1,6 @@ function Node_Combine_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "RGB Combine"; + dimension_index = -1; inputs[| 0] = nodeValue("Red", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); inputs[| 1] = nodeValue("Green", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); @@ -29,6 +30,13 @@ function Node_Combine_RGB(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou var _mode = _data[4]; var _base = _data[5]; + var _baseS = _r; + if(!is_surface(_baseS)) _baseS = _g; + if(!is_surface(_baseS)) _baseS = _b; + if(!is_surface(_baseS)) return _outSurf; + + _outSurf = surface_verify(_outSurf, surface_get_width_safe(_baseS), surface_get_height_safe(_baseS)); + surface_set_shader(_outSurf, sh_combine_rgb); shader_set_surface("samplerR", _r); shader_set_surface("samplerG", _g); diff --git a/scripts/node_grid/node_grid.gml b/scripts/node_grid/node_grid.gml index dafee3634..75205cc19 100644 --- a/scripts/node_grid/node_grid.gml +++ b/scripts/node_grid/node_grid.gml @@ -1,23 +1,6 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Grid"; - shader = sh_grid; - uniform_pos = shader_get_uniform(shader, "position"); - uniform_dim = shader_get_uniform(shader, "dimension"); - uniform_sca = shader_get_uniform(shader, "scale"); - uniform_wid = shader_get_uniform(shader, "width"); - uniform_ang = shader_get_uniform(shader, "angle"); - uniform_shf = shader_get_uniform(shader, "shift"); - uniform_shx = shader_get_uniform(shader, "shiftAxis"); - uniform_mod = shader_get_uniform(shader, "mode"); - uniform_sed = shader_get_uniform(shader, "seed"); - - uniform_grad_blend = shader_get_uniform(shader, "gradient_blend"); - uniform_grad = shader_get_uniform(shader, "gradient_color"); - uniform_grad_time = shader_get_uniform(shader, "gradient_time"); - uniform_grad_key = shader_get_uniform(shader, "gradient_keys"); - uniform_col_gap = shader_get_uniform(shader, "gapCol"); - inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) .setDisplay(VALUE_DISPLAY.vector); @@ -51,10 +34,12 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons inputs[| 11] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom_range(10000, 99999)); + inputs[| 12] = nodeValue("Anti aliasing", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + input_display_list = [ ["Output", false], 0, ["Pattern", false], 1, 4, 2, 3, 9, 8, - ["Render", false], 10, 11, 5, 6, 7 + ["Render", false], 10, 11, 5, 6, 7, 12, ]; outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -76,6 +61,7 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons var _shx = _data[9]; var _mode = _data[10]; var _sed = _data[11]; + var _aa = _data[12]; var _col_gap = _data[6]; var _gra = _data[5]; @@ -90,32 +76,24 @@ function Node_Grid(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); - surface_set_target(_outSurf); - DRAW_CLEAR - shader_set(shader); - shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]); - shader_set_uniform_f(uniform_dim, _dim[0], _dim[1]); - shader_set_uniform_f_array_safe(uniform_sca, _sca); - shader_set_uniform_f(uniform_wid, _wid); - shader_set_uniform_f(uniform_ang, degtorad(_ang)); - shader_set_uniform_f(uniform_shf, _shx? _shf / _sca[1] : _shf / _sca[0]); - shader_set_uniform_f(uniform_sed, _sed); - shader_set_uniform_i(uniform_shx, _shx); - shader_set_uniform_i(uniform_mod, _mode); + surface_set_shader(_outSurf, sh_grid); + shader_set_f("position", _pos[0] / _dim[0], _pos[1] / _dim[1]); + shader_set_f("dimension", _dim[0], _dim[1]); + shader_set_f("scale", _sca); + shader_set_f("width", _wid); + shader_set_f("angle", degtorad(_ang)); + shader_set_f("shift", _shx? _shf / _sca[1] : _shf / _sca[0]); + shader_set_f("seed", _sed); + shader_set_i("shiftAxis", _shx); + shader_set_i("mode", _mode); + shader_set_i("aa", _aa); + shader_set_color("gapCol", _col_gap); - shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap)); + _gra.shader_submit(); - shader_set_uniform_i(uniform_grad_blend, _gra.type); - shader_set_uniform_f_array_safe(uniform_grad, _grad_color); - shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time); - shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys)); - - if(is_surface(_sam)) - draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); - else - draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); - shader_reset(); - surface_reset_target(); + if(is_surface(_sam)) draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); + else draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); + surface_reset_shader(); return _outSurf; } diff --git a/scripts/node_grid_hex/node_grid_hex.gml b/scripts/node_grid_hex/node_grid_hex.gml index 3f2a3c258..5326558b0 100644 --- a/scripts/node_grid_hex/node_grid_hex.gml +++ b/scripts/node_grid_hex/node_grid_hex.gml @@ -1,21 +1,6 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Hexagonal Grid"; - shader = sh_grid_hex; - uniform_dim = shader_get_uniform(shader, "dimension"); - uniform_pos = shader_get_uniform(shader, "position"); - uniform_sca = shader_get_uniform(shader, "scale"); - uniform_rot = shader_get_uniform(shader, "angle"); - uniform_thk = shader_get_uniform(shader, "thick"); - uniform_mod = shader_get_uniform(shader, "mode"); - uniform_sed = shader_get_uniform(shader, "seed"); - - uniform_grad_blend = shader_get_uniform(shader, "gradient_blend"); - uniform_grad = shader_get_uniform(shader, "gradient_color"); - uniform_grad_time = shader_get_uniform(shader, "gradient_time"); - uniform_grad_key = shader_get_uniform(shader, "gradient_keys"); - uniform_col_gap = shader_get_uniform(shader, "gapCol"); - inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) .setDisplay(VALUE_DISPLAY.vector); @@ -43,10 +28,12 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 9] = nodeValue("Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); + inputs[| 10] = nodeValue("Anti aliasing", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + input_display_list = [ ["Output", false], 0, ["Pattern", false], 1, 3, 2, 4, - ["Render", false], 7, 8, 5, 6, 9, + ["Render", false], 7, 8, 5, 6, 9, 10, ]; outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -66,6 +53,7 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _mode = _data[7]; var _sed = _data[8]; var _sam = _data[9]; + var _aa = _data[10]; var _col_gap = _data[6]; var _gra = _data[5]; @@ -80,30 +68,22 @@ function Node_Grid_Hex(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); - surface_set_target(_outSurf); - DRAW_CLEAR - shader_set(shader); - shader_set_uniform_f(uniform_dim, _dim[0], _dim[1]); - shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]); - shader_set_uniform_f(uniform_sca, _sca[0], _sca[1]); - shader_set_uniform_f(uniform_rot, degtorad(_rot)); - shader_set_uniform_f(uniform_thk, _thk); - shader_set_uniform_f(uniform_sed, _sed); - shader_set_uniform_i(uniform_mod, _mode); + surface_set_shader(_outSurf, sh_grid_hex); + shader_set_f("dimension", _dim[0], _dim[1]); + shader_set_f("position", _pos[0] / _dim[0], _pos[1] / _dim[1]); + shader_set_f("scale", _sca[0], _sca[1]); + shader_set_f("angle", degtorad(_rot)); + shader_set_f("thick", _thk); + shader_set_f("seed", _sed); + shader_set_i("mode", _mode); + shader_set_i("aa", _aa); + shader_set_color("gapCol",_col_gap); - shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap)); + _gra.shader_submit(); - shader_set_uniform_i(uniform_grad_blend, _gra.type); - shader_set_uniform_f_array_safe(uniform_grad, _grad_color); - shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time); - shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys)); - - if(is_surface(_sam)) - draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); - else - draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); - shader_reset(); - surface_reset_target(); + if(is_surface(_sam)) draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); + else draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); + surface_reset_shader(); return _outSurf; } diff --git a/scripts/node_grid_tri/node_grid_tri.gml b/scripts/node_grid_tri/node_grid_tri.gml index ed852a2cc..f68761d15 100644 --- a/scripts/node_grid_tri/node_grid_tri.gml +++ b/scripts/node_grid_tri/node_grid_tri.gml @@ -1,21 +1,6 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Triangle Grid"; - shader = sh_grid_tri; - uniform_pos = shader_get_uniform(shader, "position"); - uniform_dim = shader_get_uniform(shader, "dimension"); - uniform_sca = shader_get_uniform(shader, "scale"); - uniform_wid = shader_get_uniform(shader, "width"); - uniform_ang = shader_get_uniform(shader, "angle"); - uniform_mod = shader_get_uniform(shader, "mode"); - uniform_sed = shader_get_uniform(shader, "seed"); - - uniform_grad_blend = shader_get_uniform(shader, "gradient_blend"); - uniform_grad = shader_get_uniform(shader, "gradient_color"); - uniform_grad_time = shader_get_uniform(shader, "gradient_time"); - uniform_grad_key = shader_get_uniform(shader, "gradient_keys"); - uniform_col_gap = shader_get_uniform(shader, "gapCol"); - inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF ) .setDisplay(VALUE_DISPLAY.vector); @@ -43,10 +28,12 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) inputs[| 9] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, irandom_range(10000, 99999)); + inputs[| 10] = nodeValue("Anti aliasing", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); + input_display_list = [ ["Output", false], 0, ["Pattern", false], 1, 4, 2, 3, - ["Render", false], 8, 9, 5, 6, 7 + ["Render", false], 8, 9, 5, 6, 7, 10, ]; outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone); @@ -66,6 +53,7 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _sam = _data[7]; var _mode = _data[8]; var _sed = _data[9]; + var _aa = _data[10]; var _col_gap = _data[6]; var _gra = _data[5]; @@ -80,30 +68,22 @@ function Node_Grid_Tri(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) _outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth()); - surface_set_target(_outSurf); - DRAW_CLEAR - shader_set(shader); - shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]); - shader_set_uniform_f(uniform_dim, _dim[0], _dim[1]); - shader_set_uniform_f_array_safe(uniform_sca, _sca); - shader_set_uniform_f(uniform_wid, _wid); - shader_set_uniform_f(uniform_ang, degtorad(_ang)); - shader_set_uniform_f(uniform_sed, _sed); - shader_set_uniform_i(uniform_mod, _mode); + surface_set_shader(_outSurf, sh_grid_tri); + shader_set_f("position", _pos[0] / _dim[0], _pos[1] / _dim[1]); + shader_set_f("dimension", _dim[0], _dim[1]); + shader_set_f("scale", _sca); + shader_set_f("width", _wid); + shader_set_f("angle", degtorad(_ang)); + shader_set_f("seed", _sed); + shader_set_i("mode", _mode); + shader_set_i("aa", _aa); + shader_set_color("gapCol",_col_gap); - shader_set_uniform_f_array_safe(uniform_col_gap, colToVec4(_col_gap)); + _gra.shader_submit(); - shader_set_uniform_i(uniform_grad_blend, _gra.type); - shader_set_uniform_f_array_safe(uniform_grad, _grad_color); - shader_set_uniform_f_array_safe(uniform_grad_time, _grad_time); - shader_set_uniform_i(uniform_grad_key, array_length(_gra.keys)); - - if(is_surface(_sam)) - draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); - else - draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); - shader_reset(); - surface_reset_target(); + if(is_surface(_sam)) draw_surface_stretched_safe(_sam, 0, 0, _dim[0], _dim[1]); + else draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1); + surface_reset_shader(); return _outSurf; } diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 408d3aa73..673ab25bb 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1721,27 +1721,18 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { function doBlend() { #region if(array_length(nodes_selecting) != 2) return; - - var cx = nodes_selecting[0].x; - var cy = 0; - for(var i = 0; i < array_length(nodes_selecting); i++) { - var _node = nodes_selecting[i]; - cx = max(cx, _node.x); - cy += _node.y; - } - cx = cx + 160; - cy = round(cy / array_length(nodes_selecting) / 32) * 32; + + var _n0 = nodes_selecting[0].y < nodes_selecting[1].y? nodes_selecting[0] : nodes_selecting[1]; + var _n1 = nodes_selecting[0].y < nodes_selecting[1].y? nodes_selecting[1] : nodes_selecting[0]; + + if(_n0.outputs[| 0].type != VALUE_TYPE.surface || _n1.outputs[| 0].type != VALUE_TYPE.surface) return; + + var cx = max(_n0.x, _n1.x) + 160; + var cy = round((_n0.y + _n1.y) / 2 / 32) * 32; var _blend = new Node_Blend(cx, cy, getCurrentContext()); - var index = 0; - for( var i = 0; i < array_length(nodes_selecting); i++ ) { - var _node = nodes_selecting[i]; - if(ds_list_size(_node.outputs) == 0) continue; - if(_node.outputs[| 0].type == VALUE_TYPE.surface) { - _blend.inputs[| index].setFrom(_node.outputs[| 0]); - index++; - } - } + _blend.inputs[| 0].setFrom(_n0.outputs[| 0]); + _blend.inputs[| 1].setFrom(_n1.outputs[| 0]); nodes_selecting = []; } #endregion @@ -1751,26 +1742,34 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { var cx = nodes_selecting[0].x; var cy = 0; - - for(var i = 0; i < array_length(nodes_selecting); i++) { - var _node = nodes_selecting[i]; - cx = max(cx, _node.x); - cy += _node.y; - } - cx = cx + 160; - cy = round(cy / array_length(nodes_selecting) / 32) * 32; - - var _compose = nodeBuild("Node_Composite", cx, cy); - - for( var i = 0; i < array_length(nodes_selecting); i++ ) { + var pr = ds_priority_create(); + var amo = array_length(nodes_selecting); + var len = 0; + + for(var i = 0; i < amo; i++) { var _node = nodes_selecting[i]; if(ds_list_size(_node.outputs) == 0) continue; - if(_node.outputs[| 0].type == VALUE_TYPE.surface) { - _compose.addInput(_node.outputs[| 0]); - } + if(_node.outputs[| 0].type != VALUE_TYPE.surface) continue; + + cx = max(cx, _node.x); + cy += _node.y; + + ds_priority_add(pr, _node, _node.y); + len++; + } + + cx = cx + 160; + cy = round(cy / len / 32) * 32; + + var _compose = nodeBuild("Node_Composite", cx, cy); + + repeat(len) { + var _node = ds_priority_delete_min(pr); + _compose.addInput(_node.outputs[| 0]); } nodes_selecting = []; + ds_priority_destroy(pr); } #endregion function doArray() { #region diff --git a/scripts/preferences/preferences.gml b/scripts/preferences/preferences.gml index 3a58a7007..c7a48b9a8 100644 --- a/scripts/preferences/preferences.gml +++ b/scripts/preferences/preferences.gml @@ -223,6 +223,7 @@ window_set_position(display_get_width() / 2 - ww / 2, display_get_height() / 2 - hh / 2); window_set_size(ww, hh); + gameframe_set_shadow(true); } } diff --git a/scripts/windowManager/windowManager.gml b/scripts/windowManager/windowManager.gml index 47e9f616c..8893a05b0 100644 --- a/scripts/windowManager/windowManager.gml +++ b/scripts/windowManager/windowManager.gml @@ -136,7 +136,7 @@ function winManStep() { #region if(window_drag_hold == 0 && window_is_maximized) { if(point_distance(mx, my, _mx, _my) > 8) window_drag_hold = 1; - } else if(window_drag_hold == 1) { + } else { if(window_is_maximized) { winMan_Unmaximize(); window_drag_sw = window_minimize_size[0]; diff --git a/shaders/sh_combine_rgb/sh_combine_rgb.fsh b/shaders/sh_combine_rgb/sh_combine_rgb.fsh index 3f65c6844..141a6443f 100644 --- a/shaders/sh_combine_rgb/sh_combine_rgb.fsh +++ b/shaders/sh_combine_rgb/sh_combine_rgb.fsh @@ -17,7 +17,7 @@ uniform int useB; uniform int useA; float sample(vec4 col, int ch) { - if(mode == 0) return (col[0] + col[1] + col[2]) / 3.; + if(mode == 0) return (col[0] + col[1] + col[2]) / 3. * col[3]; return col[ch]; } diff --git a/shaders/sh_grid/sh_grid.fsh b/shaders/sh_grid/sh_grid.fsh index aa788f2c6..bec376bd5 100644 --- a/shaders/sh_grid/sh_grid.fsh +++ b/shaders/sh_grid/sh_grid.fsh @@ -13,20 +13,20 @@ uniform float angle; uniform float width; uniform float shift; uniform float seed; -uniform int shiftAxis; +uniform int shiftAxis; +uniform int mode; +uniform int aa; -uniform int mode; - -uniform vec4 gapCol; -uniform int gradient_use; -uniform int gradient_blend; -uniform vec4 gradient_color[GRADIENT_LIMIT]; +uniform vec4 gapCol; +uniform int gradient_use; +uniform int gradient_blend; +uniform vec4 gradient_color[GRADIENT_LIMIT]; uniform float gradient_time[GRADIENT_LIMIT]; -uniform int gradient_keys; +uniform int gradient_keys; float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(85.456034, 64.54065), vec2(12.9898, 78.233))) * (43758.5453123 + seed) ); } -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)); @@ -34,21 +34,21 @@ 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 hueDist(float a0, float a1, float t) { +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) { +vec3 hsvMix(vec3 c1, vec3 c2, float t) { #region vec3 h1 = rgb2hsv(c1); vec3 h2 = rgb2hsv(c2); @@ -58,9 +58,9 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) { h.z = mix(h1.z, h2.z, t); return hsv2rgb(h); -} +} #endregion -vec4 gradientEval(in float prog) { +vec4 gradientEval(in float prog) { #region vec4 col = vec4(0.); for(int i = 0; i < GRADIENT_LIMIT; i++) { @@ -88,9 +88,9 @@ vec4 gradientEval(in float prog) { } return col; -} +} #endregion -void main() { +void main() { #region vec2 pos = v_vTexcoord - position, _pos; float ratio = dimension.x / dimension.y; _pos.x = pos.x * ratio * cos(angle) - pos.y * sin(angle); @@ -108,22 +108,28 @@ void main() { _pos.y += shiftY; } - vec2 sqSt = floor(_pos * scale) / scale; - vec2 dist = _pos - sqSt; - float ww = width / 2.; - bool isGap = dist != clamp(dist, vec2(ww), vec2(1. / scale - ww)); + vec2 sqSt = floor(_pos * scale) / scale; + vec2 _dist = _pos - sqSt; + vec2 nPos = abs(_dist * scale - vec2(0.5)) * 2.; //distance in x, y axis + float dist = 1. - max(nPos.x, nPos.y); + + vec4 colr; + + if(mode == 1) { + gl_FragColor = vec4(vec3(dist), 1.); + return; + } if(mode == 0) { - gl_FragColor = isGap? gapCol : vec4(gradientEval(random(sqSt)).rgb, 1.); - } else if(mode == 1) { - vec2 nPos = abs(dist * scale - vec2(0.5)) * 2.; //distance in x, y axis - float d = 1. - max(nPos.x, nPos.y); - gl_FragColor = vec4(vec3(d), 1.); + colr = vec4(gradientEval(random(sqSt)).rgb, 1.); } else if(mode == 2) { vec2 uv = fract(_pos * scale); - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + colr = texture2D( gm_BaseTexture, uv ); } else if(mode == 3) { vec2 uv = fract(sqSt); - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + colr = texture2D( gm_BaseTexture, uv ); } -} + + float _aa = 4. / max(dimension.x, dimension.y); + gl_FragColor = mix(gapCol, colr, aa == 1? smoothstep(width - _aa, width, dist) : step(width, dist)); +} #endregion diff --git a/shaders/sh_grid_hex/sh_grid_hex.fsh b/shaders/sh_grid_hex/sh_grid_hex.fsh index 66a09be4e..e1eecc295 100644 --- a/shaders/sh_grid_hex/sh_grid_hex.fsh +++ b/shaders/sh_grid_hex/sh_grid_hex.fsh @@ -9,21 +9,21 @@ uniform vec2 scale; uniform float angle; uniform float thick; uniform float seed; +uniform int mode; +uniform int aa; -uniform int mode; - -uniform vec4 gapCol; -uniform int gradient_use; -uniform int gradient_blend; -uniform vec4 gradient_color[GRADIENT_LIMIT]; +uniform vec4 gapCol; +uniform int gradient_use; +uniform int gradient_blend; +uniform vec4 gradient_color[GRADIENT_LIMIT]; uniform float gradient_time[GRADIENT_LIMIT]; -uniform int gradient_keys; +uniform int gradient_keys; #define PI 3.14159265359 float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(85.456034, 64.54065), vec2(12.9898, 78.233))) * (43758.5453123 + seed) ); } -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)); @@ -31,21 +31,21 @@ 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 hueDist(float a0, float a1, float t) { +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) { +vec3 hsvMix(vec3 c1, vec3 c2, float t) { #region vec3 h1 = rgb2hsv(c1); vec3 h2 = rgb2hsv(c2); @@ -55,9 +55,9 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) { h.z = mix(h1.z, h2.z, t); return hsv2rgb(h); -} +} #endregion -vec4 gradientEval(in float prog) { +vec4 gradientEval(in float prog) { #region vec4 col = vec4(0.); for(int i = 0; i < GRADIENT_LIMIT; i++) { @@ -85,18 +85,18 @@ vec4 gradientEval(in float prog) { } return col; -} +} #endregion -float HexDist(vec2 p) { +float HexDist(vec2 p) { #region p = abs(p); float c = dot(p, normalize(vec2(1, 1.73))); c = max(c, p.x); return c; -} +} #endregion -vec4 HexCoords(vec2 uv) { +vec4 HexCoords(vec2 uv) { #region vec2 r = vec2(1, sqrt(3.)); vec2 h = r * .5; @@ -109,16 +109,21 @@ vec4 HexCoords(vec2 uv) { float y = max(0., .5 - HexDist(gv)); vec2 id = uv - gv; return vec4(x, y, id.x, id.y); -} +} #endregion -void main() { +void main() { #region vec2 pos = (v_vTexcoord - position) * scale, _pos; float ratio = dimension.x / dimension.y; _pos.x = pos.x * ratio * cos(angle) - pos.y * sin(angle); _pos.y = pos.x * ratio * sin(angle) + pos.y * cos(angle); vec4 hc = HexCoords(_pos); - bool isGap = hc.y < thick; + vec4 colr; + + if(mode == 1) { + gl_FragColor = vec4(vec3(hc.y), 1.0); + return; + } if(mode == 0) { vec2 uv = abs(hc.zw) / scale; @@ -128,15 +133,17 @@ void main() { float tileY = floor(scale.y * 4. / 3.); uv.y = mod(floor(uv.y * (tileY + 1.)), tileY) / tileY; - gl_FragColor = isGap? gapCol : vec4(gradientEval(random(uv)).rgb, 1.); - } else if(mode == 1) { - gl_FragColor = vec4(vec3(hc.y), 1.0); + colr = vec4(gradientEval(random(uv)).rgb, 1.); } else if(mode == 2) { vec2 uv = hc.xy; uv.x = (uv.x + PI / 2.) / PI; - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + + colr = texture2D( gm_BaseTexture, uv ); } else if(mode == 3) { vec2 uv = clamp(abs(hc.zw) / scale, 0., 1.); - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + colr = texture2D( gm_BaseTexture, uv ); } -} \ No newline at end of file + + float _aa = 3. / max(dimension.x, dimension.y); + gl_FragColor = mix(gapCol, colr, aa == 1? smoothstep(thick - _aa, thick, hc.y) : step(thick, hc.y)); +} #endregion \ No newline at end of file diff --git a/shaders/sh_grid_tri/sh_grid_tri.fsh b/shaders/sh_grid_tri/sh_grid_tri.fsh index 8ae26475d..fce632103 100644 --- a/shaders/sh_grid_tri/sh_grid_tri.fsh +++ b/shaders/sh_grid_tri/sh_grid_tri.fsh @@ -14,19 +14,20 @@ uniform vec2 scale; uniform float angle; uniform float width; uniform float seed; +uniform int aa; uniform int mode; -uniform vec4 gapCol; -uniform int gradient_use; -uniform int gradient_blend; -uniform vec4 gradient_color[GRADIENT_LIMIT]; +uniform vec4 gapCol; +uniform int gradient_use; +uniform int gradient_blend; +uniform vec4 gradient_color[GRADIENT_LIMIT]; uniform float gradient_time[GRADIENT_LIMIT]; -uniform int gradient_keys; +uniform int gradient_keys; float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(85.456034, 64.54065), vec2(12.9898, 78.233))) * (43758.5453123 + seed) ); } -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)); @@ -34,21 +35,21 @@ 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 hueDist(float a0, float a1, float t) { +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) { +vec3 hsvMix(vec3 c1, vec3 c2, float t) { #region vec3 h1 = rgb2hsv(c1); vec3 h2 = rgb2hsv(c2); @@ -58,9 +59,9 @@ vec3 hsvMix(vec3 c1, vec3 c2, float t) { h.z = mix(h1.z, h2.z, t); return hsv2rgb(h); -} +} #endregion -vec4 gradientEval(in float prog) { +vec4 gradientEval(in float prog) { #region vec4 col = vec4(0.); for(int i = 0; i < GRADIENT_LIMIT; i++) { @@ -88,9 +89,9 @@ vec4 gradientEval(in float prog) { } return col; -} +} #endregion -vec3 triGrid(vec2 p){ +vec3 triGrid(vec2 p){ #region float _stx = (p.x + c30 / 2.0 * p.y); float stx = abs(fract(_stx) - 0.5); @@ -105,9 +106,9 @@ vec3 triGrid(vec2 p){ n = (n - .16) / (.35 - .16); return vec3((floor(_stx) + floor(_sty) + 1.) / 2., floor(p.y * c30), n); -} +} #endregion -void main() { +void main() { #region vec2 pos = (v_vTexcoord - position) * scale, _pos; float ratio = dimension.x / dimension.y; _pos.x = pos.x * ratio * cos(angle) - pos.y * sin(angle); @@ -115,18 +116,24 @@ void main() { vec3 tri = triGrid(_pos); float dist = max(0., tri.z); - bool isGap = dist < width * 2.; + vec4 colr; + + if(mode == 1) { + gl_FragColor = vec4(vec3(dist), 1.); + return; + } if(mode == 0) { vec2 uv = fract(tri.xy / scale); - gl_FragColor = isGap? gapCol : vec4(gradientEval(random(uv)).rgb, 1.); - } else if(mode == 1) { - gl_FragColor = vec4(vec3(dist), 1.); + colr = vec4(gradientEval(random(uv)).rgb, 1.); } else if(mode == 2) { vec2 uv = fract((_pos * vec2(1., c30) - tri.xy) + vec2(0.5, 0.)); - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + colr = texture2D( gm_BaseTexture, uv ); } else if(mode == 3) { vec2 uv = clamp(tri.xy / scale, 0., 1.); - gl_FragColor = isGap? gapCol : texture2D( gm_BaseTexture, uv ); + colr = texture2D( gm_BaseTexture, uv ); } -} \ No newline at end of file + + float _aa = 3. / max(dimension.x, dimension.y); + gl_FragColor = mix(gapCol, colr, aa == 1? smoothstep(width * 2. - _aa, width * 2., dist) : step(width * 2., dist)); +} #endregion \ No newline at end of file