From 5e26484472608c35cc7bdbb6b68367f1aba6c378 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Sun, 9 Feb 2025 07:55:52 +0700 Subject: [PATCH] [Posterize] Add option to use global color range for faster processing. --- datafiles/data/Nodes/Internal.zip | Bin 9101194 -> 9101194 bytes scripts/node_3d_material/node_3d_material.gml | 27 ++------ scripts/node_argument/node_argument.gml | 2 +- scripts/node_array_add/node_array_add.gml | 2 +- .../node_array_boolean_opr.gml | 2 +- .../node_array_composite.gml | 2 +- .../node_array_convolute.gml | 2 +- scripts/node_array_copy/node_array_copy.gml | 2 +- .../node_array_csv_parse.gml | 2 +- scripts/node_array_find/node_array_find.gml | 2 +- scripts/node_array_get/node_array_get.gml | 2 +- .../node_array_insert/node_array_insert.gml | 2 +- .../node_array_length/node_array_length.gml | 2 +- .../node_array_rearrange.gml | 2 +- .../node_array_remove/node_array_remove.gml | 2 +- .../node_array_reverse/node_array_reverse.gml | 2 +- .../node_array_sample/node_array_sample.gml | 2 +- scripts/node_array_set/node_array_set.gml | 2 +- scripts/node_array_shift/node_array_shift.gml | 2 +- scripts/node_array_zip/node_array_zip.gml | 2 +- scripts/node_assert/node_assert.gml | 2 +- .../node_cache_value_array.gml | 2 +- scripts/node_data/node_data.gml | 2 +- scripts/node_dll/node_dll.gml | 2 +- .../node_feedback_input.gml | 2 +- .../node_feedback_output.gml | 2 +- scripts/node_group_input/node_group_input.gml | 2 +- .../node_group_output/node_group_output.gml | 2 +- scripts/node_matrix/node_matrix.gml | 2 +- scripts/node_matrix_det/node_matrix_det.gml | 2 +- .../node_matrix_invert/node_matrix_invert.gml | 2 +- scripts/node_matrix_math/node_matrix_math.gml | 2 +- .../node_matrix_multiply_vector.gml | 2 +- scripts/node_matrix_set/node_matrix_set.gml | 2 +- .../node_matrix_to_array.gml | 2 +- .../node_matrix_tranpose.gml | 2 +- scripts/node_number/node_number.gml | 20 ++---- scripts/node_posterize/node_posterize.gml | 25 +++++--- scripts/node_print/node_print.gml | 2 +- .../node_random_shape/node_random_shape.gml | 59 +++++++----------- scripts/node_shell/node_shell.gml | 2 +- .../node_struct_json_parse.gml | 2 +- .../node_terminal_trigger.gml | 2 +- .../node_trigger_bool/node_trigger_bool.gml | 2 +- shaders/sh_dither/sh_dither.fsh | 5 +- shaders/sh_posterize/sh_posterize.fsh | 27 ++++---- shaders/sh_rsh_corner/sh_rsh_corner.fsh | 36 ++++------- 47 files changed, 115 insertions(+), 162 deletions(-) diff --git a/datafiles/data/Nodes/Internal.zip b/datafiles/data/Nodes/Internal.zip index 2545359f028bd603004d484e97afba6f996b952a..f0074aff2c1ff16e77caf1b53cda9c6e20b4f3fd 100644 GIT binary patch delta 1398 zcmZA0OH5N~7zSXqV4(`acyAG?H&7G>9Tl*EaJ(SuFr!Xe@KT+t$|!ilOHtI9cFv!S z3lsA%TtE|D8BH|Cx-fAvv49Kh(k5e&g$rjk8aK0;Fq!v!oO)~WB=7hA*K^vcM>jJR z^ zxZbUw2aG&v^N8=VQ^?D2IC5&&hZk;b`P;a~^6?vB_LnnqK6%zOh@anqJi1VXw&DvymII=uFp;7`nUj6&bXr^v| z8F8h@y!vf<^z+5CX=p%w-k&|fEkZHn(zzp%u?Jym#rwUY9U~En#yduSb-t1x&Fulx zqpvzU6dpEDp5>{j1$)&J8GZ|K! zWxSwUZIvaQ_{uA-?R{#U1iAj*K2;*si#}DKZa1Vm9(}%FEl9UL`j38lwybr=?5ZNB V8f6lLM_-Al()UZ^shGO!`yW!a4B`L) delta 1398 zcmZA0OH5Q}7zSWFTIEgt%{dHX?>aT z{E041%)f8}W0#F48soSyv1uH@h0fAR+8_%T+KtAI3xn}J-<-h<$&6IsZH3!h;Ma*&Iu$U{Cp#}}A}FEJf6FcSrE!-GQ1!fX_w7+%c5 zT+G9Ke1#H}VgVMS42!TB2pFXj@}Gp=dR7v-`d+}^o9DXql~>5t zFFtCGy=AMY)t<$RyLDk!pG&uV)OuLm=gMhmc4SPOVEx(mFO$RWw%Vu45!d{Y?1-z) zptZD)*3$;sNSmmcHq#c`O5acmeM{fbHrh_#(+}h$KLx0j+Gq#uq+PU|g0zR)X)o=g z{d9nSq@U<#`h^Zs2OXlrbc8yoi+-iw=qMedz@(-fi}Izwlvmwu-|=v>Uz zhRsJEfAT2@5~!ANIf3O?h&@W+j#FB_NtEfsA(f@?K1No0x<}7WA}_!3$cY{Ae{gFn zM-nwMsUe9vD@3>f^~HLV;a8b5bZjJCA%SmzSJ#h)ogX|kYmX+q_PZ!Ik!9n$DzhIPG1f$BOb4SCee}t{7@x3CQqhX4~I!DhtpUP)& zebDsi%lFN~)MqlxDskVOD^-^@mKQgRq^gXYt5WT_Stl>tjksAW;YHl6mryZi4{>RY zbh!Tt3C{-2Y6<}C>S4yX7Kza1-Av5(&b;Wt=n;~)-5GB~ty@uNu9$AzGhok_ cwa%zrRYX;jOk(ipOHoxiz9g26s+)E101Mt9yZ`_I diff --git a/scripts/node_3d_material/node_3d_material.gml b/scripts/node_3d_material/node_3d_material.gml index 8f194b5f0..c4c002665 100644 --- a/scripts/node_3d_material/node_3d_material.gml +++ b/scripts/node_3d_material/node_3d_material.gml @@ -1,5 +1,6 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { - name = "3D Material"; + name = "3D Material"; + is_3D = NODE_3D.none; solid_surf = noone; newInput(0, nodeValue_Surface("Texture", self)) @@ -31,7 +32,7 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons newOutput(0, nodeValue_Output("Material", self, VALUE_TYPE.d3Material, noone)); - input_display_list = [ + input_display_list = [ ["Texture", false], 0, 8, 9, 10, ["Properties", false], 1, 2, 3, 4, 7, ["Normal", false], 5, 6, @@ -71,24 +72,6 @@ function Node_3D_Material(_x, _y, _group = noone) : Node_3D(_x, _y, _group) cons return _mat; } - static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { - if(!previewable) return; - - var bbox = drawGetBbox(xx, yy, _s); - var _mat = outputs[0].getValue(); - - if(_mat == noone) return; - - if(is_array(_mat)) { - if(array_empty(_mat)) return; - _mat = _mat[0]; - } - - if(is_instanceof(_mat, __d3dMaterial) && is_surface(_mat.surface)) { - var aa = 0.5 + 0.5 * renderActive; - if(!isHighlightingInGraph()) aa *= 0.25; - - draw_surface_bbox(_mat.surface, bbox,, aa); - } - } + static getPreviewValues = function() /*=>*/ {return inputs[0].getValue()}; + static getGraphPreviewSurface = function() /*=>*/ {return getSingleValue(0)}; } \ No newline at end of file diff --git a/scripts/node_argument/node_argument.gml b/scripts/node_argument/node_argument.gml index 31fab8350..aa31f8529 100644 --- a/scripts/node_argument/node_argument.gml +++ b/scripts/node_argument/node_argument.gml @@ -1,6 +1,6 @@ function Node_Argument(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Argument"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); draw_padding = 8; diff --git a/scripts/node_array_add/node_array_add.gml b/scripts/node_array_add/node_array_add.gml index 4c1af9968..31debff47 100644 --- a/scripts/node_array_add/node_array_add.gml +++ b/scripts/node_array_add/node_array_add.gml @@ -1,6 +1,6 @@ function Node_Array_Add(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Add"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_boolean_opr/node_array_boolean_opr.gml b/scripts/node_array_boolean_opr/node_array_boolean_opr.gml index 62e75b345..d2310ce42 100644 --- a/scripts/node_array_boolean_opr/node_array_boolean_opr.gml +++ b/scripts/node_array_boolean_opr/node_array_boolean_opr.gml @@ -1,6 +1,6 @@ function Node_Array_Boolean_Opr(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Boolean Opr"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array 1", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_composite/node_array_composite.gml b/scripts/node_array_composite/node_array_composite.gml index ff68111bb..05295b57d 100644 --- a/scripts/node_array_composite/node_array_composite.gml +++ b/scripts/node_array_composite/node_array_composite.gml @@ -1,6 +1,6 @@ function Node_Array_Composite(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Composite"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Float("Array", self, [])) .setArrayDepth(1) diff --git a/scripts/node_array_convolute/node_array_convolute.gml b/scripts/node_array_convolute/node_array_convolute.gml index f9d0264fc..0ac018ea3 100644 --- a/scripts/node_array_convolute/node_array_convolute.gml +++ b/scripts/node_array_convolute/node_array_convolute.gml @@ -1,6 +1,6 @@ function Node_Array_Convolute(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Convolute"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Float("Array", self, [])) .setArrayDepth(1) diff --git a/scripts/node_array_copy/node_array_copy.gml b/scripts/node_array_copy/node_array_copy.gml index ba771641b..a46416f00 100644 --- a/scripts/node_array_copy/node_array_copy.gml +++ b/scripts/node_array_copy/node_array_copy.gml @@ -1,6 +1,6 @@ function Node_Array_Copy(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Copy"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setArrayDepth(1) diff --git a/scripts/node_array_csv_parse/node_array_csv_parse.gml b/scripts/node_array_csv_parse/node_array_csv_parse.gml index 8b042103e..91f82015d 100644 --- a/scripts/node_array_csv_parse/node_array_csv_parse.gml +++ b/scripts/node_array_csv_parse/node_array_csv_parse.gml @@ -1,6 +1,6 @@ function Node_Array_CSV_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "CSV Parse"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Text("CSV string", self, 0)) .setVisible(true, true); diff --git a/scripts/node_array_find/node_array_find.gml b/scripts/node_array_find/node_array_find.gml index e6897b65c..aa49fb232 100644 --- a/scripts/node_array_find/node_array_find.gml +++ b/scripts/node_array_find/node_array_find.gml @@ -1,6 +1,6 @@ function Node_Array_Find(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Find"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_get/node_array_get.gml b/scripts/node_array_get/node_array_get.gml index 38b95e67e..94225ae13 100644 --- a/scripts/node_array_get/node_array_get.gml +++ b/scripts/node_array_get/node_array_get.gml @@ -1,6 +1,6 @@ function Node_Array_Get(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Get"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_insert/node_array_insert.gml b/scripts/node_array_insert/node_array_insert.gml index 3152e0f2a..5684feb45 100644 --- a/scripts/node_array_insert/node_array_insert.gml +++ b/scripts/node_array_insert/node_array_insert.gml @@ -1,6 +1,6 @@ function Node_Array_Insert(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Insert"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_length/node_array_length.gml b/scripts/node_array_length/node_array_length.gml index 157112992..5a379435b 100644 --- a/scripts/node_array_length/node_array_length.gml +++ b/scripts/node_array_length/node_array_length.gml @@ -1,6 +1,6 @@ function Node_Array_Length(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Length"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_rearrange/node_array_rearrange.gml b/scripts/node_array_rearrange/node_array_rearrange.gml index 69deefec0..2cb47fc45 100644 --- a/scripts/node_array_rearrange/node_array_rearrange.gml +++ b/scripts/node_array_rearrange/node_array_rearrange.gml @@ -127,7 +127,7 @@ function Node_Array_Rearrange(_x, _y, _group = noone) : Node(_x, _y, _group) con if(type != _typ) { if(_typ == VALUE_TYPE.surface) setDimension(128, 128); - else setDimension(96, 32 + 24); + else setDimension(96, 48); type = _typ; } diff --git a/scripts/node_array_remove/node_array_remove.gml b/scripts/node_array_remove/node_array_remove.gml index 4b55d02dd..a78038f79 100644 --- a/scripts/node_array_remove/node_array_remove.gml +++ b/scripts/node_array_remove/node_array_remove.gml @@ -1,6 +1,6 @@ function Node_Array_Remove(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Remove"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_reverse/node_array_reverse.gml b/scripts/node_array_reverse/node_array_reverse.gml index 6aa837f6c..ae7d0c190 100644 --- a/scripts/node_array_reverse/node_array_reverse.gml +++ b/scripts/node_array_reverse/node_array_reverse.gml @@ -1,6 +1,6 @@ function Node_Array_Reverse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Reverse"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_sample/node_array_sample.gml b/scripts/node_array_sample/node_array_sample.gml index 2b84741a5..5c49928f3 100644 --- a/scripts/node_array_sample/node_array_sample.gml +++ b/scripts/node_array_sample/node_array_sample.gml @@ -1,6 +1,6 @@ function Node_Array_Sample(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Sample"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_set/node_array_set.gml b/scripts/node_array_set/node_array_set.gml index 773839551..5f48e096b 100644 --- a/scripts/node_array_set/node_array_set.gml +++ b/scripts/node_array_set/node_array_set.gml @@ -1,6 +1,6 @@ function Node_Array_Set(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Set"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_array_shift/node_array_shift.gml b/scripts/node_array_shift/node_array_shift.gml index b822261bc..52b94b56e 100644 --- a/scripts/node_array_shift/node_array_shift.gml +++ b/scripts/node_array_shift/node_array_shift.gml @@ -1,6 +1,6 @@ function Node_Array_Shift(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Array Shift"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setArrayDepth(99) diff --git a/scripts/node_array_zip/node_array_zip.gml b/scripts/node_array_zip/node_array_zip.gml index 203280133..f4949b971 100644 --- a/scripts/node_array_zip/node_array_zip.gml +++ b/scripts/node_array_zip/node_array_zip.gml @@ -1,6 +1,6 @@ function Node_Array_Zip(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Array Zip"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Array", self, CONNECT_TYPE.input, VALUE_TYPE.any, 0)) .setVisible(true, true); diff --git a/scripts/node_assert/node_assert.gml b/scripts/node_assert/node_assert.gml index 9a2a228d4..4834438b5 100644 --- a/scripts/node_assert/node_assert.gml +++ b/scripts/node_assert/node_assert.gml @@ -1,6 +1,6 @@ function Node_Assert(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Assert"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); draw_padding = 8; diff --git a/scripts/node_cache_value_array/node_cache_value_array.gml b/scripts/node_cache_value_array/node_cache_value_array.gml index 4af8627e9..30a5d0f8b 100644 --- a/scripts/node_cache_value_array/node_cache_value_array.gml +++ b/scripts/node_cache_value_array/node_cache_value_array.gml @@ -1,6 +1,6 @@ function Node_Cache_Value_Array(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Cache Value Array"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Value", self, CONNECT_TYPE.input, VALUE_TYPE.any, noone)) .setVisible(true, true); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 10c40ea6d..26f7a2c72 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -2293,7 +2293,7 @@ function Node(_x, _y, _group = noone) : __Node_Base(_x, _y) constructor { return noone; var val = outputs[preview_channel].getValue(); - if(is_struct(val) && is_instanceof(val, dynaSurf)) + if(is_struct(val) && is(val, dynaSurf)) val = array_safe_get_fast(val.surfaces, 0, noone); return val; diff --git a/scripts/node_dll/node_dll.gml b/scripts/node_dll/node_dll.gml index b698ff80f..bd13edd45 100644 --- a/scripts/node_dll/node_dll.gml +++ b/scripts/node_dll/node_dll.gml @@ -1,6 +1,6 @@ function Node_DLL(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "DLL"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); newInput(0, nodeValue_Path("DLL File", self, "")) .setDisplay(VALUE_DISPLAY.path_load, { filter: "Dynamic-link library (.dll)|*.dll" }) diff --git a/scripts/node_feedback_input/node_feedback_input.gml b/scripts/node_feedback_input/node_feedback_input.gml index 78c1f38e4..554f49b91 100644 --- a/scripts/node_feedback_input/node_feedback_input.gml +++ b/scripts/node_feedback_input/node_feedback_input.gml @@ -2,7 +2,7 @@ function Node_Feedback_Input(_x, _y, _group = noone) : Node_Group_Input(_x, _y, name = "Feedback Input"; color = COLORS.node_blend_feedback; is_group_io = true; - setDimension(96, 32 + 24 * 2); + setDimension(96, 48); feedbackOut = noone; diff --git a/scripts/node_feedback_output/node_feedback_output.gml b/scripts/node_feedback_output/node_feedback_output.gml index f03398c82..d9540656f 100644 --- a/scripts/node_feedback_output/node_feedback_output.gml +++ b/scripts/node_feedback_output/node_feedback_output.gml @@ -2,7 +2,7 @@ function Node_Feedback_Output(_x, _y, _group = noone) : Node_Group_Output(_x, _y name = "Feedback Output"; color = COLORS.node_blend_feedback; is_group_io = true; - setDimension(96, 32 + 24 * 2); + setDimension(96, 48); newInput(1, nodeValue("Feedback loop", self, CONNECT_TYPE.input, VALUE_TYPE.node, -1)) .setVisible(true, true); diff --git a/scripts/node_group_input/node_group_input.gml b/scripts/node_group_input/node_group_input.gml index 362886a40..1ce6e13ba 100644 --- a/scripts/node_group_input/node_group_input.gml +++ b/scripts/node_group_input/node_group_input.gml @@ -76,7 +76,7 @@ function Node_Group_Input(_x, _y, _group = noone) : Node(_x, _y, _group) constru destroy_when_upgroup = true; skipDefault(); - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Enum_Scroll("Display type", self, 0, { data: GROUP_IO_DISPLAY[11], update_hover: false })); diff --git a/scripts/node_group_output/node_group_output.gml b/scripts/node_group_output/node_group_output.gml index bc426ff06..85e6fbd02 100644 --- a/scripts/node_group_output/node_group_output.gml +++ b/scripts/node_group_output/node_group_output.gml @@ -5,7 +5,7 @@ function Node_Group_Output(_x, _y, _group = noone) : Node(_x, _y, _group) constr destroy_when_upgroup = true; skipDefault(); - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue("Value", self, CONNECT_TYPE.input, VALUE_TYPE.any, -1)) .uncache() diff --git a/scripts/node_matrix/node_matrix.gml b/scripts/node_matrix/node_matrix.gml index 8e10f7584..e7546e058 100644 --- a/scripts/node_matrix/node_matrix.gml +++ b/scripts/node_matrix/node_matrix.gml @@ -1,7 +1,7 @@ function Node_Matrix(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_IVec2("Size", self, [ 3, 3 ])); diff --git a/scripts/node_matrix_det/node_matrix_det.gml b/scripts/node_matrix_det/node_matrix_det.gml index 5b7d8513e..4636a931b 100644 --- a/scripts/node_matrix_det/node_matrix_det.gml +++ b/scripts/node_matrix_det/node_matrix_det.gml @@ -1,7 +1,7 @@ function Node_Matrix_Det(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Det"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_invert/node_matrix_invert.gml b/scripts/node_matrix_invert/node_matrix_invert.gml index 8198f2176..80ad0ff64 100644 --- a/scripts/node_matrix_invert/node_matrix_invert.gml +++ b/scripts/node_matrix_invert/node_matrix_invert.gml @@ -1,7 +1,7 @@ function Node_Matrix_Invert(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Invert"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_math/node_matrix_math.gml b/scripts/node_matrix_math/node_matrix_math.gml index 5ca9111e4..078b3bf8a 100644 --- a/scripts/node_matrix_math/node_matrix_math.gml +++ b/scripts/node_matrix_math/node_matrix_math.gml @@ -1,7 +1,7 @@ function Node_Matrix_Math(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Math"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix 1", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_multiply_vector/node_matrix_multiply_vector.gml b/scripts/node_matrix_multiply_vector/node_matrix_multiply_vector.gml index ac0c46160..c0c8da1c3 100644 --- a/scripts/node_matrix_multiply_vector/node_matrix_multiply_vector.gml +++ b/scripts/node_matrix_multiply_vector/node_matrix_multiply_vector.gml @@ -1,7 +1,7 @@ function Node_Matrix_Multiply_Vector(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Multiply Vector"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_set/node_matrix_set.gml b/scripts/node_matrix_set/node_matrix_set.gml index 33d0ef91e..04b3e143f 100644 --- a/scripts/node_matrix_set/node_matrix_set.gml +++ b/scripts/node_matrix_set/node_matrix_set.gml @@ -1,7 +1,7 @@ function Node_Matrix_Set(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Set"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_to_array/node_matrix_to_array.gml b/scripts/node_matrix_to_array/node_matrix_to_array.gml index f5bc58c6c..9506eca8b 100644 --- a/scripts/node_matrix_to_array/node_matrix_to_array.gml +++ b/scripts/node_matrix_to_array/node_matrix_to_array.gml @@ -1,7 +1,7 @@ function Node_Matrix_To_Array(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix to Array"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_matrix_tranpose/node_matrix_tranpose.gml b/scripts/node_matrix_tranpose/node_matrix_tranpose.gml index c856ec827..ad367f8b0 100644 --- a/scripts/node_matrix_tranpose/node_matrix_tranpose.gml +++ b/scripts/node_matrix_tranpose/node_matrix_tranpose.gml @@ -1,7 +1,7 @@ function Node_Matrix_Transpose(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "Matrix Transpose"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Matrix("Matrix", self, new Matrix(3))) .setVisible(true, true); diff --git a/scripts/node_number/node_number.gml b/scripts/node_number/node_number.gml index 35daee1e2..76603fd8a 100644 --- a/scripts/node_number/node_number.gml +++ b/scripts/node_number/node_number.gml @@ -2,7 +2,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor name = "Number"; color = COLORS.node_blend_number; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); // wd_slider = slider(0, 1, 0.01, function(val) { inputs[0].setValue(val); } ); @@ -157,7 +157,7 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor var disp = getInputData(2); var styl = getInputData(6); - var _ww = 96, _hh = 56; + var _ww = 96, _hh = 48; inputs[3].setVisible(disp > 0); inputs[4].setVisible(disp > 0); @@ -166,28 +166,18 @@ function Node_Number(_x, _y, _group = noone) : Node(_x, _y, _group) constructor inputs[7].setVisible(disp == 2); switch(disp) { - case 0 : - break; - case 1 : _ww = 160; if(styl == 0) _hh = 96; else if(styl == 1) _hh = 64; break; - case 2 : - _ww = 128; _hh = 128; - break; - - case 3 : - _ww = 160; _hh = 64; - break; - + case 2 : _ww = 128; _hh = 128; break; + case 3 : _ww = 160; _hh = 64; break; } setDimension(_ww, _hh); - - inputs[0].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); + inputs[0].setType( int? VALUE_TYPE.integer : VALUE_TYPE.float); outputs[0].setType(int? VALUE_TYPE.integer : VALUE_TYPE.float); } diff --git a/scripts/node_posterize/node_posterize.gml b/scripts/node_posterize/node_posterize.gml index 61a73493a..76f123280 100644 --- a/scripts/node_posterize/node_posterize.gml +++ b/scripts/node_posterize/node_posterize.gml @@ -34,8 +34,10 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) newInput(8, nodeValue_Enum_Button("Space", self, 0, [ "RGB", "LAB" ])); + newInput(9, nodeValue_Bool("Use Global Range", self, true)); + input_display_list = [ 5, 0, - ["Palette", false, 2], 1, 3, 4, 7, 8, + ["Palette", false, 2], 1, 9, 3, 4, 7, 8, ["Alpha", false], 6, ]; @@ -48,11 +50,13 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) static step = function() { var _use_pal = getInputData(2); - inputs[1].setVisible(_use_pal); + inputs[1].setVisible( _use_pal); inputs[3].setVisible(!_use_pal); inputs[4].setVisible(!_use_pal); inputs[4].mappableStep(); - inputs[8].setVisible(_use_pal); + + inputs[8].setVisible( _use_pal); + inputs[9].setVisible(!_use_pal); } static processData = function(_outSurf, _data, _output_index, _array_index) { @@ -61,6 +65,7 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _use_pal = _data[2]; var _alp = _data[6]; var _spce = _data[8]; + var _glob = _data[9]; if(_use_pal) { surface_set_shader(_outSurf, sh_posterize_palette); @@ -72,7 +77,11 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) surface_reset_shader(); } else { - #region get range + + var _max = [ 0, 0, 0 ]; + var _min = [ 1, 1, 1 ]; + + if(!_glob) { // get range var _sw = surface_get_width(_surf); var _sh = surface_get_height(_surf); var _itr = ceil(logn(4, _sw * _sh / 1024)); @@ -120,8 +129,6 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) var _sMin = temp_surface[(!_ind) * 2 + 1]; var _ssw = surface_get_width(_sMax); var _ssh = surface_get_height(_sMax); - var _max = [ 0, 0, 0 ]; - var _min = [ 1, 1, 1 ]; var _bMax = buffer_from_surface(_sMax, false); var _bMin = buffer_from_surface(_sMin, false); @@ -144,11 +151,11 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) buffer_delete(_bMax); buffer_delete(_bMin); - #endregion + } surface_set_shader(_outSurf, sh_posterize); - shader_set_f("cMax", _max); - shader_set_f("cMin", _min); + shader_set_f("cMax", _max); + shader_set_f("cMin", _min); shader_set_f("colors", _data[3]); shader_set_f_map("gamma", _data[4], _data[7], inputs[4]); shader_set_i("alpha", _alp); diff --git a/scripts/node_print/node_print.gml b/scripts/node_print/node_print.gml index b134167c9..0ad67dc7b 100644 --- a/scripts/node_print/node_print.gml +++ b/scripts/node_print/node_print.gml @@ -1,6 +1,6 @@ function Node_Print(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Print"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); draw_padding = 8; diff --git a/scripts/node_random_shape/node_random_shape.gml b/scripts/node_random_shape/node_random_shape.gml index a46cd6115..538bb3ba0 100644 --- a/scripts/node_random_shape/node_random_shape.gml +++ b/scripts/node_random_shape/node_random_shape.gml @@ -17,25 +17,6 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro temp_surface = [ noone ]; - function surfaceContentRatio(_surf) { - var s = 0; - var _sw = surface_get_width_safe(_surf); - var _sh = surface_get_height_safe(_surf); - var total = _sw * _sh; - var _buff = buffer_create(_sw * _sh * 4, buffer_fixed, 4); - buffer_get_surface(_buff, _surf, 0); - buffer_seek(_buff, buffer_seek_start, 0); - - repeat(total) { - var b = buffer_read(_buff, buffer_u32); - if(b) s++; - } - - buffer_delete(_buff); - - return s / total; - } - function generateShape(_dim, _aa = 1) { var _sw = _dim[0] * _aa; var _sh = _dim[1] * _aa; @@ -49,7 +30,7 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro repeat(_amou) { var _side = min(_dim[0], _dim[1]); - var _size = irandom_range(_side * 0.25, _side * 0.75); + var _size = irandom_range(_side * 0.25, _side * 0.5); var _shape = surface_create(_size * _aa, _size * _aa); surface_set_target(_shape); @@ -58,12 +39,12 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro var _x1 = _size * _aa; var _y1 = _size * _aa; - var _r = irandom(4) * 2 * _aa; - + switch(irandom(2)) { - case 0 : draw_roundrect_ext(0, 0, _x1, _y1, _r, _r, false); break; - case 1 : draw_ellipse(0, 0, _x1, _y1, false); break; - case 2 : draw_triangle(_x1 / 2, 0, 0, _y1, _x1, _y1, false); break; + case 0 : var _r = irandom(4) * 2 * _aa; + draw_roundrect_ext(0, 0, _x1, _y1, _r, _r, false); break; + case 1 : draw_ellipse(0, 0, _x1, _y1, false); break; + case 2 : draw_triangle(_x1 / 2, 0, 0, _y1, _x1, _y1, false); break; } surface_reset_target(); @@ -102,7 +83,7 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro if(random(1) < 0.5) { _prog = surface_create(_adim[0], _adim[1]); - var _size = [ _dim[0] * .75, _dim[1] * 0.75 ]; + var _size = [ _dim[0] * .6, _dim[1] * .6 ]; var _subs = generateShape(_size, _aa); var _sx = _adim[0] / 2; var _sy = _adim[1] / 2; @@ -122,32 +103,36 @@ function Node_Random_Shape(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro } else draw_surface_safe(_surf); - BLEND_SUBTRACT - draw_surface_safe(_subs, _sx, _sy); - BLEND_NORMAL + if(is_surface(_subs)) { + BLEND_SUBTRACT + draw_surface_ext(_subs, _sx, _sy, 1, 1, 0, c_white, 1); + var _mir = irandom(3); + if(_mir & 0b01) draw_surface_ext(_subs, _dim[0] - _sx, _sy, -1, 1, 0, c_white, 1); + if(_mir & 0b10) draw_surface_ext(_subs, _sx, _dim[1] - _sy, 1, -1, 0, c_white, 1); + if(_mir == 0b11) draw_surface_ext(_subs, _dim[0] - _sx, _dim[1] - _sy, -1, -1, 0, c_white, 1); + BLEND_NORMAL + } surface_reset_target(); surface_free(_subs); surface_free(_surf); } - // if(surfaceContentRatio(_prog) < 0.2) { - // surface_free(_prog); - // _prog = generateShape(_adim); - // } - var _corn = surface_create(_dim[0], _dim[1]); temp_surface[0] = surface_verify(temp_surface[0], _adim[0], _adim[1]); var _cPassAA = temp_surface[0]; surface_set_shader(_cPassAA, sh_rsh_corner, true, BLEND.add); - shader_set_f("dimension", _adim[0], _adim[1]); + shader_set_2("dimension", _adim); shader_set_i("type", choose(0, 0, 1, 1, 1)); draw_surface_safe(_prog); - if(_side == 1) draw_surface_ext_safe(_prog, 0, _adim[1], 1, -1, 0, c_white, 1); - if(_side == 2) draw_surface_ext_safe(_prog, _adim[0], 0, -1, 1, 0, c_white, 1); + switch(_side) { + case 1 : draw_surface_ext_safe(_prog, 0, _adim[1], 1, -1, 0, c_white, 1); break; + case 2 : draw_surface_ext_safe(_prog, _adim[0], 0, -1, 1, 0, c_white, 1); break; + } + surface_reset_shader(); surface_free(_prog); diff --git a/scripts/node_shell/node_shell.gml b/scripts/node_shell/node_shell.gml index e82708f53..ec74045c9 100644 --- a/scripts/node_shell/node_shell.gml +++ b/scripts/node_shell/node_shell.gml @@ -1,6 +1,6 @@ function Node_Shell(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Execute Shell"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); newInput(0, nodeValue_Path("Path", self, "")); diff --git a/scripts/node_struct_json_parse/node_struct_json_parse.gml b/scripts/node_struct_json_parse/node_struct_json_parse.gml index f6236ce4c..4eb269938 100644 --- a/scripts/node_struct_json_parse/node_struct_json_parse.gml +++ b/scripts/node_struct_json_parse/node_struct_json_parse.gml @@ -1,6 +1,6 @@ function Node_Struct_JSON_Parse(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "JSON Parse"; - setDimension(96, 32 + 24); + setDimension(96, 48); newInput(0, nodeValue_Text("JSON string", self, "")) .setVisible(true, true); diff --git a/scripts/node_terminal_trigger/node_terminal_trigger.gml b/scripts/node_terminal_trigger/node_terminal_trigger.gml index 3fe6965b0..ca5245e19 100644 --- a/scripts/node_terminal_trigger/node_terminal_trigger.gml +++ b/scripts/node_terminal_trigger/node_terminal_trigger.gml @@ -1,6 +1,6 @@ function Node_Terminal_Trigger(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Terminal Trigger"; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); draw_padding = 8; diff --git a/scripts/node_trigger_bool/node_trigger_bool.gml b/scripts/node_trigger_bool/node_trigger_bool.gml index c318627ac..49245017c 100644 --- a/scripts/node_trigger_bool/node_trigger_bool.gml +++ b/scripts/node_trigger_bool/node_trigger_bool.gml @@ -1,7 +1,7 @@ function Node_Trigger_Bool(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { name = "Boolean Trigger"; update_on_frame = true; - setDimension(96, 32 + 24 * 1); + setDimension(96, 48); newInput(0, nodeValue_Bool("Boolean", self, false)); diff --git a/shaders/sh_dither/sh_dither.fsh b/shaders/sh_dither/sh_dither.fsh index a3d36b9e6..0dea12bb1 100644 --- a/shaders/sh_dither/sh_dither.fsh +++ b/shaders/sh_dither/sh_dither.fsh @@ -64,7 +64,7 @@ float random (in vec2 st, float seed) { return fract(sin(dot(st.xy, vec2(1892.98 } #endregion #endregion -void main() { #region +void main() { vec4 _col = texture2D( gm_BaseTexture, v_vTexcoord ); bool exactColor = false; @@ -110,6 +110,7 @@ void main() { #region if(exactColor) { gl_FragColor = _col; + } else { float d1 = colorDifferent(_col, col1); float d2 = colorDifferent(_col, col2); @@ -156,4 +157,4 @@ void main() { #region } gl_FragColor.a *= _col.a; -} #endregion +} diff --git a/shaders/sh_posterize/sh_posterize.fsh b/shaders/sh_posterize/sh_posterize.fsh index 6d8fb7f44..08c47b751 100644 --- a/shaders/sh_posterize/sh_posterize.fsh +++ b/shaders/sh_posterize/sh_posterize.fsh @@ -10,7 +10,7 @@ uniform int gammaUseSurf; uniform sampler2D gammaSurf; #region =========================================== COLORS SPACES =========================================== - vec3 rgb2hsv(vec3 c) { #region + vec3 rgb2hsv(vec3 c) { 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)); @@ -18,15 +18,15 @@ uniform sampler2D gammaSurf; 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 + vec3 hsv2rgb(vec3 c) { 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 hue2rgb( in float m1, in float m2, in float hue) { #region + float hue2rgb( in float m1, in float m2, in float hue) { if (hue < 0.0) hue += 1.0; else if (hue > 1.0) @@ -40,9 +40,9 @@ uniform sampler2D gammaSurf; return m1 + (m2 - m1) * ((2.0 / 3.0) - hue) * 6.0; else return m1; - } #endregion + } - vec3 hsl2rgb( in vec3 hsl ) { #region + vec3 hsl2rgb( in vec3 hsl ) { float r, g, b; if(hsl.y == 0.) { r = hsl.z; @@ -62,9 +62,9 @@ uniform sampler2D gammaSurf; } return vec3( r, g, b ); - } #endregion + } - vec3 rgb2hsl( in vec3 c ) { #region + vec3 rgb2hsl( in vec3 c ) { float h = 0.0; float s = 0.0; float l = 0.0; @@ -92,7 +92,7 @@ uniform sampler2D gammaSurf; h = h / 6.0; } return vec3( h, s, l ); - } #endregion + } #endregion =========================================== COLORS SPACES =========================================== float round(float a) { return fract(a) >= 0.5? ceil(a) : floor(a); } @@ -113,10 +113,9 @@ void main() { _col.rgb = clamp((_col.rgb - cMin) / cRan, 0., 1.); vec3 c = _col.rgb; - - c = pow(c, vec3(gam)); - c = floor(c * colors) / (colors - 1.); - c = pow(c, vec3(1.0 / gam)); + c = pow(c, vec3(gam)); + c = floor(c * colors) / (colors - 1.); + c = pow(c, vec3(1.0 / gam)); _col = vec4(cMin + c * cRan, 1.); _col.a = alpha == 1? 1. : _col.a; diff --git a/shaders/sh_rsh_corner/sh_rsh_corner.fsh b/shaders/sh_rsh_corner/sh_rsh_corner.fsh index 9b8fc44e8..348a55e14 100644 --- a/shaders/sh_rsh_corner/sh_rsh_corner.fsh +++ b/shaders/sh_rsh_corner/sh_rsh_corner.fsh @@ -40,32 +40,20 @@ void main() { // 6 7 8 if(a.a == 0.) { - /**/ if(a0 && a1 && a2 && a3 && !a5 && a6 && !a7 && !a8) - gl_FragColor = vec4(1.); - else if(a0 && a1 && a2 && !a3 && a5 && !a6 && !a7 && a8) - gl_FragColor = vec4(1.); - else if(a0 && !a1 && !a2 && a3 && !a5 && a6 && a7 && a8) - gl_FragColor = vec4(1.); - else if(!a0 && !a1 && a2 && !a3 && a5 && a6 && a7 && a8) - gl_FragColor = vec4(1.); + /**/ if( a0 && a1 && a2 && a3 && !a5 && a6 && !a7 && !a8) gl_FragColor = vec4(1.); + else if( a0 && a1 && a2 && !a3 && a5 && !a6 && !a7 && a8) gl_FragColor = vec4(1.); + else if( a0 && !a1 && !a2 && a3 && !a5 && a6 && a7 && a8) gl_FragColor = vec4(1.); + else if(!a0 && !a1 && a2 && !a3 && a5 && a6 && a7 && a8) gl_FragColor = vec4(1.); - else if(a3 && a5) - gl_FragColor = vec4(1.); - else if(a1 && a7) - gl_FragColor = vec4(1.); + else if(a3 && a5) gl_FragColor = vec4(1.); + else if(a1 && a7) gl_FragColor = vec4(1.); } else { - /**/ if(a0 && a1 && !a2 && a3 && !a5 && !a6 && !a7 && !a8) - gl_FragColor = vec4(0.); - else if(!a0 && a1 && a2 && !a3 && a5 && !a6 && !a7 && !a8) - gl_FragColor = vec4(0.); - else if(!a0 && !a1 && !a2 && a3 && !a5 && a6 && a7 && !a8) - gl_FragColor = vec4(0.); - else if(!a0 && !a1 && !a2 && !a3 && a5 && !a6 && a7 && a8) - gl_FragColor = vec4(0.); + /**/ if( a0 && a1 && !a2 && a3 && !a5 && !a6 && !a7 && !a8) gl_FragColor = vec4(0.); + else if(!a0 && a1 && a2 && !a3 && a5 && !a6 && !a7 && !a8) gl_FragColor = vec4(0.); + else if(!a0 && !a1 && !a2 && a3 && !a5 && a6 && a7 && !a8) gl_FragColor = vec4(0.); + else if(!a0 && !a1 && !a2 && !a3 && a5 && !a6 && a7 && a8) gl_FragColor = vec4(0.); - else if(!a3 && !a5) - gl_FragColor = vec4(0.); - else if(!a1 && !a7) - gl_FragColor = vec4(0.); + else if(!a3 && !a5) gl_FragColor = vec4(0.); + else if(!a1 && !a7) gl_FragColor = vec4(0.); } }