From 04e17c30f5aa846e8cc375bac7a7e8fbfb9ac26c Mon Sep 17 00:00:00 2001 From: Tanasart <22589759+Ttanasart-pt@users.noreply.github.com> Date: Sun, 18 Dec 2022 09:20:38 +0700 Subject: [PATCH] Obj material fix --- Pixels Composer.yyp | 2 +- datafiles/data/Collections.zip | Bin 202142 -> 202150 bytes objects/o_dialog_release_note/Create_0.gml | 21 +- objects/o_dialog_release_note/Other_62.gml | 2 +- objects/o_main/Create_0.gml | 2 - scripts/gif_reader/gif_reader.gml | 2 +- scripts/node_3D_obj/node_3D_obj.gml | 36 +- scripts/node_3d_extrude/node_3d_extrude.gml | 3 + .../node_3d_prim_cube/node_3d_prim_cube.gml | 3 + .../node_3d_prim_cylinder.gml | 3 + scripts/node_9slice/node_9slice.gml | 7 +- .../node_VFX_renderer/node_VFX_renderer.gml | 6 +- scripts/node_canvas/node_canvas.gml | 2 +- scripts/node_data/node_data.gml | 17 + scripts/node_pixel_sort/node_pixel_sort.gml | 5 +- scripts/node_processor/node_processor.gml | 3 + scripts/node_registry/node_registry.gml | 7 +- scripts/node_value/node_value.gml | 4 +- .../node_value_processor.gml | 9 +- scripts/obj_reader/obj_reader.gml | 15 +- scripts/panel_animation/panel_animation.gml | 660 +++++++++--------- scripts/panel_graph/panel_graph.gml | 2 + scripts/render_data/render_data.gml | 20 +- scripts/sprite_loader/sprite_loader.gml | 4 +- scripts/string_decimal/string_decimal.gml | 2 +- scripts/string_eval/string_eval.gml | 3 +- .../surface_functions/surface_functions.gml | 2 +- scripts/textBox/textBox.gml | 30 +- .../sh_vertex_pnt_light.fsh | 16 +- 29 files changed, 488 insertions(+), 400 deletions(-) diff --git a/Pixels Composer.yyp b/Pixels Composer.yyp index cca11c83c..be4205a4d 100644 --- a/Pixels Composer.yyp +++ b/Pixels Composer.yyp @@ -948,8 +948,8 @@ {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_vfx.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",}, - {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",}, {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",}, + {"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",}, ], "MetaData": { "IDEVersion": "2022.11.1.56", diff --git a/datafiles/data/Collections.zip b/datafiles/data/Collections.zip index e7c20a7c9c5db6883840b662c789f7d44b58553f..5e12782a6fdd7b3bb6f25259cc9fbe30409182e9 100644 GIT binary patch delta 4802 zcmZWs2{=@5+jq_}c4Hfq$i9p%C9-8#WDRBhMfOT$$(}SX*+LTW{E=NEJ0bg$rAS0% zNit#!eu9$jcO zlUlULP*MFp3qI9BJj65`k6a~O#6Clhuf>=h(^{#jaLL8-hwtP3JQB`#D86Mfhw1cd zt1j$shce@7tl!d$T;wb~fnf?%nj_DU?_G0b>zoj{{OPdN*D=B!!>>B#i>zUCLXTh8 z&UX>iIL{_0->gjcyu29L;lnqf6UHB%pmVpe`{T*aM`mndkkYS2!J*%3X~QwX!cjfF zY!j1|x_()T`C{H)OIL1-D)r*)Xsbd+?eil`sy$1jv(tM4``vPk`(sI`I@~ft!rv-!;y7X7BZFEC9c;%5MPx58rfJnrr_VacK!0lj6y8R@*SKBQIKYa#CT4uSdiwqErjlio%S z$}es>YiVv!G))5=X#Xvj1oR=!4Or zZ>I~>#k{9n8N(WbX6J@JxW$CWStgJM2~OtH3irvPHzcS_6XGukF8ROlx78A$PT?ME zD$<^B7sty!@VyYlM#yTkjK-Xgy4XGEO}5PvVC`dS{~dqU8eBa6=FPg6#YdYND9kr0 z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556ghnn36k~qW=K9#t+Dhz0= zFdhUa!~Z$ea>-kkPjH9|ydP{a>^z7n#18a$kOOdkE+FxswaDf{Q7Z;?9<*^S0hSkS z+;CvXi)eBc+=DSzj=nxbV=wgC8Vtee|MJpN1zLE~$U(y<#0i?~k7va(1gTP}v+N2B}ptngVAc7C=*s)<4kUpWw^zxx)Py!G?3Qh_j b^COy20tn|vM7Sa_5g02e3`U6oqaFD_eML2u diff --git a/objects/o_dialog_release_note/Create_0.gml b/objects/o_dialog_release_note/Create_0.gml index face07f33..30d8011f0 100644 --- a/objects/o_dialog_release_note/Create_0.gml +++ b/objects/o_dialog_release_note/Create_0.gml @@ -2,17 +2,18 @@ event_inherited(); #region data - dialog_w = ui(600); - dialog_h = ui(360); + dialog_w = ui(720); + dialog_h = ui(480); destroy_on_click_out = true; note = ""; - var link = "https://gist.githubusercontent.com/Ttanasart-pt/e7ab670299ce6b00cfd632646f3ac9a8/raw/0.9.0"; - node_get = http_get(link); + var link = "https://gist.githubusercontent.com/Ttanasart-pt/e7ab670299ce6b00cfd632646f3ac9a8/raw/1.0.0"; + note_get = http_get(link); sp_note = new scrollPane(dialog_w - ui(80), dialog_h - ui(88), function(_y, _m) { draw_clear_alpha(COLORS.panel_bg_clear, 0); + BLEND_ADD var yy = 0; var txt = note; @@ -37,7 +38,7 @@ event_inherited(); switch(md) { case "#" : - draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title); + draw_set_text(f_h3, fa_left, fa_top, COLORS._main_text_title); line = string_copy(line, sp + 1, string_length(line) - sp); yy += ui(16); draw_text_ext(xx, _y + yy, line, -1, ww); @@ -45,7 +46,14 @@ event_inherited(); yy += ui(4); break; case "##" : - draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_text_title); + draw_set_text(f_h5, fa_left, fa_top, COLORS._main_text_title); + line = string_copy(line, sp + 1, string_length(line) - sp); + yy += ui(8); + draw_text_ext(xx + ui(16), _y + yy, line, -1, ww); + yy += ui(4); + break; + case "###" : + draw_set_text(f_p0b, fa_left, fa_top, COLORS._main_accent); line = string_copy(line, sp + 1, string_length(line) - sp); yy += ui(8); draw_text_ext(xx + ui(16), _y + yy, line, -1, ww); @@ -72,6 +80,7 @@ event_inherited(); yy += string_height_ext(line, -1, ww); } + BLEND_NORMAL return yy + ui(64); }) #endregion \ No newline at end of file diff --git a/objects/o_dialog_release_note/Other_62.gml b/objects/o_dialog_release_note/Other_62.gml index 0e14e0a40..102974497 100644 --- a/objects/o_dialog_release_note/Other_62.gml +++ b/objects/o_dialog_release_note/Other_62.gml @@ -1,5 +1,5 @@ /// @description init -if (ds_map_find_value(async_load, "id") == node_get) { +if (ds_map_find_value(async_load, "id") == note_get) { if (ds_map_find_value(async_load, "status") == 0) { note = ds_map_find_value(async_load, "result"); alarm[0] = 1; diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index 910d1c281..aabe34f13 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -8,8 +8,6 @@ file_text_close(f); #endregion -//display_reset(8, 1); - #region window depth = 0; win_wp = WIN_W; diff --git a/scripts/gif_reader/gif_reader.gml b/scripts/gif_reader/gif_reader.gml index 0b5d502f5..e12f0eb43 100644 --- a/scripts/gif_reader/gif_reader.gml +++ b/scripts/gif_reader/gif_reader.gml @@ -656,7 +656,7 @@ function gif_std_enum_getIndex() { return _s + ")"; } if (is_real(_value)) { - _s = string_format(_value, 0, 16); + _s = string(_value); if (os_browser != -1) { _n = string_length(_s); _i = _n; diff --git a/scripts/node_3D_obj/node_3D_obj.gml b/scripts/node_3D_obj/node_3D_obj.gml index 0f5104684..60d008662 100644 --- a/scripts/node_3D_obj/node_3D_obj.gml +++ b/scripts/node_3D_obj/node_3D_obj.gml @@ -1,12 +1,10 @@ -function Node_create_3D_Obj_path(_x, _y, _group = -1, path) { +function Node_create_3D_Obj_path(_x, _y, path) { if(!file_exists(path)) return noone; - var node = new Node_3D_Obj(_x, _y, _group); + var node = new Node_3D_Obj(_x, _y); node.inputs[| 0].setValue(path); node.updateObj(); node.doUpdate(); - - //ds_list_add(PANEL_GRAPH.nodes_list, node); return node; } @@ -17,6 +15,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { uniLightAmb = shader_get_uniform(sh_vertex_pnt_light, "u_AmbientLight"); uniLightClr = shader_get_uniform(sh_vertex_pnt_light, "u_LightColor"); uniLightInt = shader_get_uniform(sh_vertex_pnt_light, "u_LightIntensity"); + uniLightNrm = shader_get_uniform(sh_vertex_pnt_light, "useNormal"); inputs[| 0] = nodeValue(0, "Path", self, JUNCTION_CONNECT.input, VALUE_TYPE.path, "") .setDisplay(VALUE_DISPLAY.path_load, [ "*.obj", "" ]); @@ -50,12 +49,15 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { inputs[| 9] = nodeValue(9, "Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); inputs[| 10] = nodeValue(10, "Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey); - + + inputs[| 11] = nodeValue(11, "Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ]) + .setDisplay(VALUE_DISPLAY.vector); + input_display_list = [ 2, ["Geometry", false], 0, 1, - ["Transform", false], 3, 4, 5, - ["Textures", true], + ["Transform", false], 3, 4, 5, 11, ["Light", false], 6, 7, 8, 9, 10, + ["Textures", true], ]; input_length = ds_list_size(inputs); input_display_len = array_length(input_display_list); @@ -99,6 +101,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { materialNames = []; materialIndex = []; materials = []; + use_normal = true; static updateObj = function() { var _path = inputs[| 0].getValue(); @@ -109,9 +112,16 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { VB = _v[0]; materialNames = _v[1]; materialIndex = _v[2]; + use_normal = _v[3]; } - materials = readMtl(_pathMtl); + if(array_length(materialNames)) + materials = readMtl(_pathMtl); + else { + materialNames = ["Material"]; + materialIndex = [0]; + materials = [new MTLmaterial("Material")]; + } do_reset_material = true; } @@ -241,6 +251,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { var _lint = inputs[| 8].getValue(); var _lclr = inputs[| 9].getValue(); var _aclr = inputs[| 10].getValue(); + var _lsc = inputs[| 11].getValue(); var _outSurf = outputs[| 0].getValue(); if(!is_surface(_outSurf)) { @@ -263,15 +274,19 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { shader_set_uniform_f_array(uniLightAmb, colorArrayFromReal(_aclr)); shader_set_uniform_f_array(uniLightClr, colorArrayFromReal(_lclr)); shader_set_uniform_f(uniLightInt, _lint); + shader_set_uniform_i(uniLightNrm, use_normal); camera_apply(cam); - + draw_clear_alpha(0, 0); matrix_stack_push(TM); - + matrix_stack_push(matrix_build(0, 0, 0, 0, 0, 0, _lsc[0], _lsc[1], _lsc[2])); + matrix_set(matrix_world, matrix_stack_top()); for(var i = 0; i < array_length(VB); i++) { if(i >= ds_list_size(inputs)) break; + if(i >= array_length(materialIndex)) continue; + var mIndex = materialIndex[i]; var tex = inputs[| input_length + mIndex].getValue(); @@ -280,6 +295,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { } shader_reset(); + matrix_stack_pop(); matrix_stack_pop(); matrix_set(matrix_world, MATRIX_IDENTITY); surface_reset_target(); diff --git a/scripts/node_3d_extrude/node_3d_extrude.gml b/scripts/node_3d_extrude/node_3d_extrude.gml index 41207ccb5..868015803 100644 --- a/scripts/node_3d_extrude/node_3d_extrude.gml +++ b/scripts/node_3d_extrude/node_3d_extrude.gml @@ -5,6 +5,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor uniLightAmb = shader_get_uniform(sh_vertex_pnt_light, "u_AmbientLight"); uniLightClr = shader_get_uniform(sh_vertex_pnt_light, "u_LightColor"); uniLightInt = shader_get_uniform(sh_vertex_pnt_light, "u_LightIntensity"); + uniLightNrm = shader_get_uniform(sh_vertex_pnt_light, "useNormal"); inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone); @@ -314,6 +315,8 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor shader_set_uniform_f_array(uniLightAmb, colorArrayFromReal(_aclr)); shader_set_uniform_f_array(uniLightClr, colorArrayFromReal(_lclr)); shader_set_uniform_f(uniLightInt, _lint); + shader_set_uniform_i(uniLightNrm, 1); + camera_apply(cam); draw_clear_alpha(0, 0); diff --git a/scripts/node_3d_prim_cube/node_3d_prim_cube.gml b/scripts/node_3d_prim_cube/node_3d_prim_cube.gml index 18d0e298c..80bba2b38 100644 --- a/scripts/node_3d_prim_cube/node_3d_prim_cube.gml +++ b/scripts/node_3d_prim_cube/node_3d_prim_cube.gml @@ -5,6 +5,7 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { uniLightAmb = shader_get_uniform(sh_vertex_pnt_light, "u_AmbientLight"); uniLightClr = shader_get_uniform(sh_vertex_pnt_light, "u_LightColor"); uniLightInt = shader_get_uniform(sh_vertex_pnt_light, "u_LightIntensity"); + uniLightNrm = shader_get_uniform(sh_vertex_pnt_light, "useNormal"); inputs[| 0] = nodeValue(0, "Main texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, DEF_SURFACE); inputs[| 1] = nodeValue(1, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2) @@ -194,6 +195,8 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { shader_set_uniform_f_array(uniLightAmb, colorArrayFromReal(_aclr)); shader_set_uniform_f_array(uniLightClr, colorArrayFromReal(_lclr)); shader_set_uniform_f(uniLightInt, _lint); + shader_set_uniform_i(uniLightNrm, 1); + camera_apply(cam); draw_clear_alpha(0, 0); diff --git a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml index 826bef055..0bc269cef 100644 --- a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml +++ b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.gml @@ -5,6 +5,7 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo uniLightAmb = shader_get_uniform(sh_vertex_pnt_light, "u_AmbientLight"); uniLightClr = shader_get_uniform(sh_vertex_pnt_light, "u_LightColor"); uniLightInt = shader_get_uniform(sh_vertex_pnt_light, "u_LightIntensity"); + uniLightNrm = shader_get_uniform(sh_vertex_pnt_light, "useNormal"); inputs[| 0] = nodeValue(0, "Sides", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 16); @@ -246,6 +247,8 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node(_x, _y, _group) constructo shader_set_uniform_f_array(uniLightAmb, colorArrayFromReal(_aclr)); shader_set_uniform_f_array(uniLightClr, colorArrayFromReal(_lclr)); shader_set_uniform_f(uniLightInt, _lint); + shader_set_uniform_i(uniLightNrm, 1); + camera_apply(cam); draw_clear_alpha(0, 0); diff --git a/scripts/node_9slice/node_9slice.gml b/scripts/node_9slice/node_9slice.gml index a74a70292..f8e325ba3 100644 --- a/scripts/node_9slice/node_9slice.gml +++ b/scripts/node_9slice/node_9slice.gml @@ -27,8 +27,11 @@ function Node_9Slice(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const } static drawOverlay = function(active, _x, _y, _s, _mx, _my) { - var _dim = inputs[| 1].getValue(); - var _splice = inputs[| 2].getValue(); + if(process_multiple) return; + if(array_length(current_data) < 1) return; + + var _dim = current_data[1]; + var _splice = current_data[2]; var sp_r = _x + (_dim[0] - _splice[0]) * _s; var sp_l = _x + _splice[2] * _s; diff --git a/scripts/node_VFX_renderer/node_VFX_renderer.gml b/scripts/node_VFX_renderer/node_VFX_renderer.gml index 14ae79501..fc0b70dee 100644 --- a/scripts/node_VFX_renderer/node_VFX_renderer.gml +++ b/scripts/node_VFX_renderer/node_VFX_renderer.gml @@ -65,8 +65,12 @@ function Node_VFX_Renderer(_x, _y, _group = -1) : Node(_x, _y, _group) construct for( var i = input_index; i < ds_list_size(inputs) - 1; i++ ) { var parts = inputs[| i].getValue(_time); - for(var j = 0; j < PREF_MAP[? "part_max_amount"]; j++) + if(!ds_exists(parts, ds_type_list)) continue; + + for(var j = 0; j < ds_list_size(parts); j++) { + if(!parts[| j].active) continue; parts[| j].draw(_exact); + } } gpu_set_blendmode(bm_normal); diff --git a/scripts/node_canvas/node_canvas.gml b/scripts/node_canvas/node_canvas.gml index e17be3ce4..d8bce1bd8 100644 --- a/scripts/node_canvas/node_canvas.gml +++ b/scripts/node_canvas/node_canvas.gml @@ -445,7 +445,7 @@ function Node_Canvas(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { surface_set_target(_surf_prev); draw_clear_alpha(0, 0); - draw_surface(_surf, 0, 0); + draw_surface_safe(_surf, 0, 0); draw_set_color(_col); diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 06fdb1c80..4c9b184f0 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -537,6 +537,21 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor { static onDestroy = function() {} + static isRenderable = function(trigger = false) { + var _startNode = true; + for(var j = 0; j < ds_list_size(inputs); j++) { + var _in = inputs[| j]; + if(_in.type == VALUE_TYPE.node) continue; + + if(trigger) + triggerRender(); + + if(_in.value_from != noone && !_in.value_from.node.rendered) + _startNode = false; + } + return _startNode; + } + static getNextNodes = function() { for(var i = 0; i < ds_list_size(outputs); i++) { var _ot = outputs[| i]; @@ -664,6 +679,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) constructor { var _data = serialize(); _node.deserialize(ds_map_clone(_data)); _node.node_id = generateUUID(); + + NODE_MAP[? node_id] = self; NODE_MAP[? _node.node_id] = _node; return _node; diff --git a/scripts/node_pixel_sort/node_pixel_sort.gml b/scripts/node_pixel_sort/node_pixel_sort.gml index d9fa66f9b..bd77c5619 100644 --- a/scripts/node_pixel_sort/node_pixel_sort.gml +++ b/scripts/node_pixel_sort/node_pixel_sort.gml @@ -18,6 +18,7 @@ function Node_Pixel_Sort(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c static process_data = function(_outSurf, _data, _output_index) { var _in = _data[0]; + var _it = _data[1]; var _tr = _data[2]; var _dr = floor(_data[3] / 90) % 4; @@ -33,7 +34,7 @@ function Node_Pixel_Sort(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c surface_set_target(pp[1]); draw_clear_alpha(0, 0); BLEND_ADD - draw_surface(_in, 0, 0); + draw_surface_safe(_in, 0, 0); BLEND_NORMAL surface_reset_target(); @@ -60,7 +61,7 @@ function Node_Pixel_Sort(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c surface_set_target(_outSurf); BLEND_ADD - draw_surface(sBase, 0, 0); + draw_surface_safe(sBase, 0, 0); BLEND_NORMAL surface_reset_target(); diff --git a/scripts/node_processor/node_processor.gml b/scripts/node_processor/node_processor.gml index 211d76178..02cf694c8 100644 --- a/scripts/node_processor/node_processor.gml +++ b/scripts/node_processor/node_processor.gml @@ -6,6 +6,7 @@ enum ARRAY_PROCESS { function Node_Processor(_x, _y, _group = -1) : Node(_x, _y, _group) constructor { array_process = ARRAY_PROCESS.loop; current_data = []; + process_multiple = false; icon = THEME.node_processor; @@ -19,6 +20,8 @@ function Node_Processor(_x, _y, _group = -1) : Node(_x, _y, _group) constructor len = max(len, array_length(_in)); } + process_multiple = len > 0; + for(var _oi = 0; _oi < ds_list_size(outputs); _oi++) { if(outputs[| _oi].type != VALUE_TYPE.surface) continue; var outSurfs = outputs[| _oi].getValue(); diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 7bf0922f0..203481dc7 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -18,6 +18,11 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { NODE_CATEGORY = ds_list_create(); function nodeBuild(_name, _x, _y, _group = PANEL_GRAPH.getCurrentContext()) { + if(!ds_map_exists(ALL_NODES, _name)) { + log_warning("LOAD", "Node type " + _name + " not found"); + return noone; + } + var _node = ALL_NODES[? _name]; return _node.build(_x, _y, _group); } @@ -220,7 +225,7 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { addNodeObject(node, "Group", s_node_group, "Node_Group", [1, Node_Group]); addNodeObject(node, "Feedback", s_node_feedback, "Node_Feedback", [1, Node_Feedback]); addNodeObject(node, "Loop", s_node_loop, "Node_Iterate", [1, Node_Iterate]); - addNodeObject(node, "Pin", s_node_pin, "Nodee_Pin", [1, Node_Pin]); + addNodeObject(node, "Pin", s_node_pin, "Node_Pin", [1, Node_Pin]); addNodeObject(node, "Frame", s_node_frame, "Node_Frame", [1, Node_Frame]); addNodeObject(node, "Display text", s_node_text, "Node_Display_Text", [1, Node_Display_Text]); addNodeObject(node, "Display image", s_node_image, "Node_Display_Image", [0, Node_create_Display_Image]); diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index a3c54ee19..276232dcf 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -216,8 +216,8 @@ function NodeValue(_index, _name, _node, _connect, _type, _value, _tag = VALUE_T var _txt = type == VALUE_TYPE.float? TEXTBOX_INPUT.float : TEXTBOX_INPUT.number; switch(display_type) { case VALUE_DISPLAY._default : - editWidget = new textBox(_txt, function(str) { - if(str != "") setValue(toNumber(str)); + editWidget = new textBox(_txt, function(val) { + setValue(val); } ); editWidget.slidable = true; if(display_data != -1) editWidget.slide_speed = display_data; diff --git a/scripts/node_value_processor/node_value_processor.gml b/scripts/node_value_processor/node_value_processor.gml index ca5d44c05..dc276961a 100644 --- a/scripts/node_value_processor/node_value_processor.gml +++ b/scripts/node_value_processor/node_value_processor.gml @@ -3,8 +3,9 @@ function Node_Value_Processor(_x, _y, _group = -1) : Node(_x, _y, _group) constr function process_value(_outindex) { var _data = array_create(ds_list_size(inputs)); - for(var i = 0; i < array_length(_data); i++) + for(var i = 0; i < array_length(_data); i++) { _data[i] = inputs[| i].getValue(); + } return process_value_data(_data, _outindex); } @@ -59,9 +60,9 @@ function Node_Value_Processor(_x, _y, _group = -1) : Node(_x, _y, _group) constr _out[l] = process_value_data(_data, _outindex); } return _out; - } else { - return process_value(_outindex); - } + } + + return process_value(_outindex); } static update = function() { diff --git a/scripts/obj_reader/obj_reader.gml b/scripts/obj_reader/obj_reader.gml index edebc15f8..211c78f97 100644 --- a/scripts/obj_reader/obj_reader.gml +++ b/scripts/obj_reader/obj_reader.gml @@ -6,6 +6,7 @@ function readObj(path) { var _VBN = []; var mats = []; var matIndex = []; + var use_normal = true; var v = ds_list_create(); var vt = ds_list_create(); var vn = ds_list_create(); @@ -38,7 +39,11 @@ function readObj(path) { ds_list_add(f, [f1[0], f2[0], f3[0]]); ds_list_add(ft, [f1[1], f2[1], f3[1]]); - ds_list_add(fn, [f1[2], f2[2], f3[2]]); + if(array_length(f1) > 2) ds_list_add(fn, [f1[2], f2[2], f3[2]]); + else { + ds_list_add(fn, [0, 0, 0]); + use_normal = false; + } break; case "usemtl" : array_push_unique(mats, sep[1]); @@ -102,9 +107,9 @@ function readObj(path) { var _ft3 = vt[| _ft[2] - 1]; var _fn = facen[| j]; - var _fn1 = vn[| _fn[0] - 1]; - var _fn2 = vn[| _fn[1] - 1]; - var _fn3 = vn[| _fn[2] - 1]; + var _fn1 = _fn[0]? vn[| _fn[0] - 1] : [0, 0, 0]; + var _fn2 = _fn[1]? vn[| _fn[1] - 1] : [0, 0, 0]; + var _fn3 = _fn[2]? vn[| _fn[2] - 1] : [0, 0, 0]; vertex_add_pnt(VB, _f1, _fn1, _ft1 ); vertex_add_pnt(VB, _f2, _fn2, _ft2 ); @@ -126,5 +131,5 @@ function readObj(path) { ds_list_destroy(ft); ds_list_destroy(fn); - return [ VBS, mats, matIndex ]; + return [ VBS, mats, matIndex, use_normal ]; } \ No newline at end of file diff --git a/scripts/panel_animation/panel_animation.gml b/scripts/panel_animation/panel_animation.gml index 47d409f15..22f63a964 100644 --- a/scripts/panel_animation/panel_animation.gml +++ b/scripts/panel_animation/panel_animation.gml @@ -130,14 +130,19 @@ function Panel_Animation() : PanelContent() constructor { function arrangeKeys() { var l = ds_list_create(); for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; + var node = anim_properties[| i]; + if(!show_node_outside_context && node.group != PANEL_GRAPH.getCurrentContext()) continue; - for(var k = 0; k < ds_list_size(prop.animator.values); k++) { - var keyframe = prop.animator.values[| k]; + for( var j = 0; j < ds_list_size(node.inputs); j++ ) { + var prop = node.inputs[| j]; + if(!prop.animator.is_anim) continue; - if(ds_list_exist(keyframe_selecting, keyframe)) - ds_list_add(l, keyframe); + for(var k = 0; k < ds_list_size(prop.animator.values); k++) { + var keyframe = prop.animator.values[| k]; + + if(ds_list_exist(keyframe_selecting, keyframe)) + ds_list_add(l, keyframe); + } } } @@ -280,11 +285,14 @@ function Panel_Animation() : PanelContent() constructor { if(!_node.active) continue; + var is_anim = false; for(var j = 0; j < ds_list_size(_node.inputs); j++) { var jun = _node.inputs[| j]; - if(jun.animator.is_anim) - ds_priority_add(pr, jun, _node.anim_priority); + is_anim |= jun.animator.is_anim; } + + if(!is_anim) continue; + ds_priority_add(pr, _node, _node.anim_priority); } anim_properties = ds_priority_to_list(pr); @@ -350,12 +358,16 @@ function Panel_Animation() : PanelContent() constructor { var index = 0, key_y = timeline_h / 2; for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; + var node = anim_properties[| i]; + if(!show_node_outside_context && node.group != PANEL_GRAPH.getCurrentContext()) continue; - for(var k = 0; k < ds_list_size(prop.animator.values); k++) { - var t = (prop.animator.values[| k].time + 1) * ui(timeline_scale) + timeline_shift; - draw_sprite_ui_uniform(THEME.timeline_keyframe, 1, t, key_y, 1, COLORS.panel_animation_keyframe_hide); + for( var j = 0; j < ds_list_size(node.inputs); j++ ) { + var prop = node.inputs[| j]; + + for(var k = 0; k < ds_list_size(prop.animator.values); k++) { + var t = (prop.animator.values[| k].time + 1) * ui(timeline_scale) + timeline_shift; + draw_sprite_ui_uniform(THEME.timeline_keyframe, 1, t, key_y, 1, COLORS.panel_animation_keyframe_hide); + } } } #endregion @@ -462,7 +474,7 @@ function Panel_Animation() : PanelContent() constructor { for(var k = 0; k < amo; k++) { var key = prop.animator.values[| k]; var t = (key.time + 1) * ui(timeline_scale) + timeline_shift; - + #region easing line if(key.ease_in > 0) { draw_set_color(COLORS.panel_animation_keyframe_ease_line); @@ -502,66 +514,67 @@ function Panel_Animation() : PanelContent() constructor { draw_sprite_ui_uniform(THEME.timeline_keyframe, 3, _tx, key_y, 1, COLORS.panel_animation_keyframe_unselected); } #endregion - - if(prop.animator.show_graph && k < amo - 1) { //graph - var key_next = prop.animator.values[| k + 1]; - var a = key.ease_out; - var b = key_next.ease_in; - var dx = key_next.time - key.time; - var tott = a + b; - var ox = 0, oy = 0, nx = 0, ny = 0, oly = 0, nly = 0; + + if(!prop.animator.show_graph) continue; + if(k >= amo - 1) continue; + + var key_next = prop.animator.values[| k + 1]; + var a = key.ease_out; + var b = key_next.ease_in; + var dx = key_next.time - key.time; + var tott = a + b; + var ox = 0, oy = 0, nx = 0, ny = 0, oly = 0, nly = 0; - if(tott == 0) { - nx = (key_next.time + 1) * ui(timeline_scale) + timeline_shift; - if(is_array(key.value)) { - for( var ki = 0; ki < array_length(key.value); ki++ ) { - draw_set_color(COLORS.axis[ki]); - oy = value_map(key.value[ki], _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); - ny = value_map(key_next.value[ki], _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); - draw_line(t, oy, nx, ny); - } - } else { - draw_set_color(COLORS.panel_animation_graph_line); - var oy = value_map(key.value, _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); - var ny = value_map(key_next.value, _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + if(tott == 0) { + nx = (key_next.time + 1) * ui(timeline_scale) + timeline_shift; + if(is_array(key.value)) { + for( var ki = 0; ki < array_length(key.value); ki++ ) { + draw_set_color(COLORS.axis[ki]); + oy = value_map(key.value[ki], _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + ny = value_map(key_next.value[ki], _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); draw_line(t, oy, nx, ny); } } else { - a = a; - b = 1 - b; + draw_set_color(COLORS.panel_animation_graph_line); + var oy = value_map(key.value, _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + var ny = value_map(key_next.value, _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + draw_line(t, oy, nx, ny); + } + } else { + a = a; + b = 1 - b; - var _step = 1 / 20; - for( var _r = 0; _r <= 1; _r += _step ) { - nx = t + _r * dx * ui(timeline_scale); - var nly = prop.animator.interpolate(key, key_next, _r); + var _step = 1 / 20; + for( var _r = 0; _r <= 1; _r += _step ) { + nx = t + _r * dx * ui(timeline_scale); + var nly = prop.animator.interpolate(key, key_next, _r); - if(is_array(key.value)) { - for( var ki = 0; ki < array_length(key.value); ki++ ) { - ny = value_map(lerp(key.value[ki], key_next.value[ki], nly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + if(is_array(key.value)) { + for( var ki = 0; ki < array_length(key.value); ki++ ) { + ny = value_map(lerp(key.value[ki], key_next.value[ki], nly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); - if(_r > 0) { - draw_set_color(COLORS.axis[ki]); - oy = value_map(lerp(key.value[ki], key_next.value[ki], oly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); - draw_line(ox, oy, nx, ny); - } - } - } else { - draw_set_color(COLORS.panel_animation_graph_line); - ny = value_map(lerp(key.value, key_next.value, nly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); if(_r > 0) { - oy = value_map(lerp(key.value, key_next.value, oly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + draw_set_color(COLORS.axis[ki]); + oy = value_map(lerp(key.value[ki], key_next.value[ki], oly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); draw_line(ox, oy, nx, ny); } } - - ox = nx; - oly = nly; + } else { + draw_set_color(COLORS.panel_animation_graph_line); + ny = value_map(lerp(key.value, key_next.value, nly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + if(_r > 0) { + oy = value_map(lerp(key.value, key_next.value, oly), _gy_val_min, _gy_val_max, _gy_bottom, _gy_top); + draw_line(ox, oy, nx, ny); + } } + + ox = nx; + oly = nly; } } } - if(prop.animator.show_graph && ds_list_size(prop.animator.values) > 0) { + if(prop.animator.show_graph && ds_list_size(prop.animator.values) > 0) { // var key_first = prop.animator.values[| 0]; var t_first = (key_first.time + 1) * ui(timeline_scale) + timeline_shift; @@ -608,175 +621,180 @@ function Panel_Animation() : PanelContent() constructor { var hoverIndex = 0; for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; - var aa = prop.node.group == PANEL_GRAPH.getCurrentContext()? 1 : 0.9; + _node = anim_properties[| i]; + if(!show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; - if(_node != prop.node) { - key_y += dope_sheet_node_padding; - - var _ky = key_y - ui(10); - if(_node != noone && pHOVER && point_in_rectangle(msx, msy, 0, i <= 1? -ui(64) : _node_y, lable_w, _ky - ui(2))) - hovering = _node; - _node_y = _ky; - _node = prop.node; - - if(pHOVER && point_in_rectangle(msx, msy, ui(20), key_y - ui(10), lable_w, key_y + ui(10))) { - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg_hover, aa); - if(mouse_press(mb_left, pFOCUS)) - node_ordering = _node; - } else - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg, aa); - - if(_node == PANEL_INSPECTOR.inspecting) - draw_sprite_stretched_ext(THEME.node_active, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS._main_accent, 1); - - var tx = tool_width - ui(76 + 16 * 0); - if(pHOVER && point_in_circle(msx, msy, tx, key_y - 1, ui(10))) { - draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, key_y - 1, 1, COLORS._main_icon_light, 1); - TOOLTIP = "Go to node"; - - if(mouse_press(mb_left, pFOCUS)) { - PANEL_INSPECTOR.inspecting = _node; - ds_list_clear(PANEL_GRAPH.nodes_select_list); - PANEL_GRAPH.node_focus = _node; - PANEL_GRAPH.fullView(); - } - } else - draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, key_y - 1, 1, COLORS._main_icon, 0.75); - - if(pHOVER && point_in_rectangle(msx, msy, 0, key_y - ui(10), ui(20), key_y + ui(10))) { - draw_sprite_ui_uniform(THEME.arrow, _node.anim_show? 3 : 0, ui(10), key_y, 1, COLORS._main_icon_light, 1); - if(mouse_press(mb_left, pFOCUS)) - _node.anim_show = !_node.anim_show; - } else - draw_sprite_ui_uniform(THEME.arrow, _node.anim_show? 3 : 0, ui(10), key_y, 1, COLORS._main_icon, 0.75); - - draw_set_color(node_ordering == _node? COLORS._main_text_accent : COLORS._main_text_sub); - draw_set_alpha(aa); - draw_text(ui(20), key_y - ui(2), _node.name); - draw_set_alpha(1); - - key_y += ui(22); - } - - if(!prop.node.anim_show) continue; - - var tx = tool_width - ui(72 + 16 * 3); - var ty = key_y - 1; + var aa = _node.group == PANEL_GRAPH.getCurrentContext()? 1 : 0.9; - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { - draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 1); + key_y += dope_sheet_node_padding; + _node_y = key_y - ui(10); + var _node_y_start = _node_y; + + if(pHOVER && point_in_rectangle(msx, msy, ui(20), key_y - ui(10), lable_w, key_y + ui(10))) { + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg_hover, aa); + if(mouse_press(mb_left, pFOCUS)) + node_ordering = _node; + } else + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS.panel_animation_dope_bg, aa); + + if(_node == PANEL_INSPECTOR.inspecting) + draw_sprite_stretched_ext(THEME.node_active, 0, 0, key_y - ui(10), lable_w, ui(20), COLORS._main_accent, 1); - if(mouse_press(mb_left, pFOCUS)) { - var _t = -1; - for(var j = 0; j < ds_list_size(prop.animator.values); j++) { - var _key = prop.animator.values[| j]; - if(_key.time < ANIMATOR.current_frame) { - _t = _key.time; - } - } - if(_t > -1) ANIMATOR.setFrame(_t); - } - } else - draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 0.75); - - var tx = tool_width - ui(72 + 16 * 1); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { - draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 1); - - if(mouse_press(mb_left, pFOCUS)) { - for(var j = 0; j < ds_list_size(prop.animator.values); j++) { - var _key = prop.animator.values[| j]; - if(_key.time > ANIMATOR.current_frame) { - ANIMATOR.setFrame(_key.time); - break; - } - } - } - } else - draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 0.75); - - var tx = tool_width - ui(72 + 16 * 2); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { - draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 1); - - if(mouse_press(mb_left, pFOCUS)) { - var _add = false; - for(var j = 0; j < ds_list_size(prop.animator.values); j++) { - var _key = prop.animator.values[| j]; - if(_key.time == ANIMATOR.current_frame) { - if(ds_list_size(prop.animator.values) > 1) - ds_list_delete(prop.animator.values, j); - _add = true; - break; - } else if(_key.time > ANIMATOR.current_frame) { - ds_list_insert(prop.animator.values, j, new valueKey(ANIMATOR.current_frame, prop.getValue(), prop.animator)); - _add = true; - break; - } - } - if(!_add) ds_list_add(prop.animator.values, new valueKey(ANIMATOR.current_frame, prop.getValue(), prop.animator)); - } - } else - draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 0.75); - - if(isGraphable(prop.type)) { - var tx = tool_width - ui(68 + 16 * 0); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) { - draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, COLORS._main_icon, prop.animator.show_graph? 1 : 0.75); - TOOLTIP = "Show graph"; + var tx = tool_width - ui(76 + 16 * 0); + if(pHOVER && point_in_circle(msx, msy, tx, key_y - 1, ui(10))) { + draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, key_y - 1, 1, COLORS._main_icon_light, 1); + TOOLTIP = "Go to node"; - if(mouse_press(mb_left, pFOCUS)) { - prop.animator.show_graph = !prop.animator.show_graph; - } - } else - draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, prop.animator.show_graph? COLORS._main_accent : COLORS._main_icon); - } - - var tx = tool_width - ui(72 + 16 * 4.5); - if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { - draw_sprite_ui_uniform(THEME.prop_on_end, prop.on_end, tx, ty, 1, COLORS._main_icon, 1); - TOOLTIP = "Looping mode " + ON_END_NAME[prop.on_end]; - if(mouse_press(mb_left, pFOCUS)) { - prop.on_end = safe_mod(prop.on_end + 1, sprite_get_number(THEME.prop_on_end)); + PANEL_INSPECTOR.inspecting = _node; + ds_list_clear(PANEL_GRAPH.nodes_select_list); + PANEL_GRAPH.node_focus = _node; + PANEL_GRAPH.fullView(); } } else - draw_sprite_ui_uniform(THEME.prop_on_end, prop.on_end, tx, ty, 1, COLORS._main_icon, 0.75); - - if(pHOVER && point_in_circle(msx, msy, ui(22), key_y - 1, ui(10))) { - draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), key_y - 1, 1, COLORS._main_icon, 1); - - if(mouse_press(mb_left, pFOCUS)) { - prop.animator.is_anim = !prop.animator.is_anim; - updatePropertyList(); - } + draw_sprite_ui_uniform(THEME.animate_node_go, 0, tx, key_y - 1, 1, COLORS._main_icon, 0.75); + + if(pHOVER && point_in_rectangle(msx, msy, 0, key_y - ui(10), ui(20), key_y + ui(10))) { + draw_sprite_ui_uniform(THEME.arrow, _node.anim_show? 3 : 0, ui(10), key_y, 1, COLORS._main_icon_light, 1); + if(mouse_press(mb_left, pFOCUS)) + _node.anim_show = !_node.anim_show; } else - draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), key_y - 1, 1, COLORS._main_icon, 0.75); - - draw_set_color(COLORS._main_text); + draw_sprite_ui_uniform(THEME.arrow, _node.anim_show? 3 : 0, ui(10), key_y, 1, COLORS._main_icon, 0.75); + + draw_set_color(node_ordering == _node? COLORS._main_text_accent : COLORS._main_text_sub); draw_set_alpha(aa); - draw_text(ui(32), key_y - 2, prop.name); + draw_text(ui(20), key_y - ui(2), _node.name); draw_set_alpha(1); - if(prop.animator.show_graph) - key_y += graph_h + ui(8); + key_y += ui(22); + + if(!_node.anim_show) { + if(pHOVER && point_in_rectangle(msx, msy, 0, _node_y_start, lable_w, key_y)) + hovering = _node; + continue; + } + + for( var j = 0; j < ds_list_size(_node.inputs); j++ ) { + var prop = _node.inputs[| j]; + if(!prop.animator.is_anim) continue; + + var tx = tool_width - ui(72 + 16 * 3); + var ty = key_y - 1; + + if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { + draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 1); - key_y += ui(18); - } + if(mouse_press(mb_left, pFOCUS)) { + var _t = -1; + for(var j = 0; j < ds_list_size(prop.animator.values); j++) { + var _key = prop.animator.values[| j]; + if(_key.time < ANIMATOR.current_frame) { + _t = _key.time; + } + } + if(_t > -1) ANIMATOR.setFrame(_t); + } + } else + draw_sprite_ui_uniform(THEME.prop_keyframe, 0, tx, ty, 1, COLORS._main_icon, 0.75); + + var tx = tool_width - ui(72 + 16 * 1); + if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { + draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 1); + + if(mouse_press(mb_left, pFOCUS)) { + for(var j = 0; j < ds_list_size(prop.animator.values); j++) { + var _key = prop.animator.values[| j]; + if(_key.time > ANIMATOR.current_frame) { + ANIMATOR.setFrame(_key.time); + break; + } + } + } + } else + draw_sprite_ui_uniform(THEME.prop_keyframe, 2, tx, ty, 1, COLORS._main_icon, 0.75); + + var tx = tool_width - ui(72 + 16 * 2); + if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { + draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 1); + + if(mouse_press(mb_left, pFOCUS)) { + var _add = false; + for(var j = 0; j < ds_list_size(prop.animator.values); j++) { + var _key = prop.animator.values[| j]; + if(_key.time == ANIMATOR.current_frame) { + if(ds_list_size(prop.animator.values) > 1) + ds_list_delete(prop.animator.values, j); + _add = true; + break; + } else if(_key.time > ANIMATOR.current_frame) { + ds_list_insert(prop.animator.values, j, new valueKey(ANIMATOR.current_frame, prop.getValue(), prop.animator)); + _add = true; + break; + } + } + if(!_add) ds_list_add(prop.animator.values, new valueKey(ANIMATOR.current_frame, prop.getValue(), prop.animator)); + } + } else + draw_sprite_ui_uniform(THEME.prop_keyframe, 1, tx, ty, 1, COLORS._main_accent, 0.75); + + if(isGraphable(prop.type)) { + var tx = tool_width - ui(68 + 16 * 0); + if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(8))) { + draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, COLORS._main_icon, prop.animator.show_graph? 1 : 0.75); + TOOLTIP = "Show graph"; + + if(mouse_press(mb_left, pFOCUS)) { + prop.animator.show_graph = !prop.animator.show_graph; + } + } else + draw_sprite_ui_uniform(THEME.timeline_graph, 1, tx, ty, 1, prop.animator.show_graph? COLORS._main_accent : COLORS._main_icon); + } + + var tx = tool_width - ui(72 + 16 * 4.5); + if(pHOVER && point_in_circle(msx, msy, tx, ty, ui(6))) { + draw_sprite_ui_uniform(THEME.prop_on_end, prop.on_end, tx, ty, 1, COLORS._main_icon, 1); + TOOLTIP = "Looping mode: " + ON_END_NAME[prop.on_end]; + + if(mouse_press(mb_left, pFOCUS)) + prop.on_end = safe_mod(prop.on_end + 1, sprite_get_number(THEME.prop_on_end)); + } else + draw_sprite_ui_uniform(THEME.prop_on_end, prop.on_end, tx, ty, 1, COLORS._main_icon, 0.75); + + if(pHOVER && point_in_circle(msx, msy, ui(22), key_y - 1, ui(10))) { + draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), key_y - 1, 1, COLORS._main_icon, 1); + + if(mouse_press(mb_left, pFOCUS)) { + prop.animator.is_anim = !prop.animator.is_anim; + updatePropertyList(); + } + } else + draw_sprite_ui_uniform(THEME.timeline_clock, 1, ui(22), key_y - 1, 1, COLORS._main_icon, 0.75); + + draw_set_color(COLORS._main_text); + draw_set_alpha(aa); + draw_text(ui(32), key_y - 2, prop.name); + draw_set_alpha(1); + + if(prop.animator.show_graph) + key_y += graph_h + ui(8); + + key_y += ui(18); + } //end prop loop + + if(pHOVER && point_in_rectangle(msx, msy, 0, _node_y_start, lable_w, key_y)) + hovering = _node; + + } //end node loop if(hovering == noone && _node != noone) hovering = _node; - if(hovering != noone) { + if(hovering != noone && node_ordering != noone) { hoverIndex = hovering.anim_priority; - if(node_ordering != noone) { - rearrange_priority(node_ordering, hoverIndex); + rearrange_priority(node_ordering, hoverIndex); - if(mouse_release(mb_left)) - node_ordering = noone; - } + if(mouse_release(mb_left)) + node_ordering = noone; } surface_reset_target(); @@ -844,23 +862,24 @@ function Panel_Animation() : PanelContent() constructor { draw_sprite_stretched_ext(THEME.ui_panel_bg, 1, timeline_shift, 0, bar_total_w, dope_sheet_h, COLORS.panel_animation_timeline_blend, 1); dope_sheet_y_max = 0; - var key_y = ui(24) + dope_sheet_y, key_y_node, _node = noone; + var key_y = ui(24) + dope_sheet_y, key_y_node; + for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; - - if(_node != prop.node) { - _node = prop.node; - - key_y += dope_sheet_node_padding; - key_y_node = key_y; - - draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), bar_total_w, ui(20), COLORS.panel_animation_node_bg, 1); - key_y += ui(22); - dope_sheet_y_max += ui(28); - } - - if(prop.node.anim_show) { + var _node = anim_properties[| i]; + if(!show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; + + key_y += dope_sheet_node_padding; + key_y_node = key_y; + + draw_sprite_stretched_ext(THEME.ui_panel_bg, 0, 0, key_y - ui(10), bar_total_w, ui(20), COLORS.panel_animation_node_bg, 1); + key_y += ui(22); + dope_sheet_y_max += ui(28); + + if(!_node.anim_show) continue; + for( var j = 0; j < ds_list_size(_node.inputs); j++ ) { + var prop = _node.inputs[| j]; + if(!prop.animator.is_anim) continue; + key_y += ui(18); dope_sheet_y_max += ui(18); @@ -871,7 +890,7 @@ function Panel_Animation() : PanelContent() constructor { } } } - + dope_sheet_y_max = max(0, dope_sheet_y_max - dope_sheet_h + ui(48)); for(var i = 10; i <= ANIMATOR.frames_total; i += 10) { @@ -949,52 +968,54 @@ function Panel_Animation() : PanelContent() constructor { #endregion var key_sy = ui(24) + dope_sheet_y; - var key_y, key_y_node, _node = noone; + var key_y, key_y_node; draw_set_text(f_p2, fa_left, fa_top); var key_hover = noone; - - key_y = key_sy; - for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; - - if(_node != prop.node) { - _node = prop.node; + + #region draw graph + key_y = key_sy; + for( var i = 0; i < ds_list_size(anim_properties); i++ ) { + var _node = anim_properties[| i]; + if(!show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; + key_y += ui(22) + dope_sheet_node_padding; - } - if(!prop.node.anim_show) continue; - - var key_list = prop.animator.values; - if(prop.node.anim_show && prop.on_end != KEYFRAME_END.hold && ds_list_size(key_list) > 1) { - var keyframe_s = key_list[| 0].time; - var keyframe_e = key_list[| ds_list_size(key_list) - 1].time; + if(!_node.anim_show) continue; + for( var j = 0; j < ds_list_size(_node.inputs); j++ ) { + var prop = _node.inputs[| j]; + if(!prop.animator.is_anim) continue; + + var key_list = prop.animator.values; + if(prop.on_end != KEYFRAME_END.hold && ds_list_size(key_list) > 1) { + var keyframe_s = key_list[| 0].time; + var keyframe_e = key_list[| ds_list_size(key_list) - 1].time; - var ks_x = keyframe_s * ui(timeline_scale) + timeline_shift; - var ke_x = keyframe_e * ui(timeline_scale) + timeline_shift; + var ks_x = (keyframe_s + 1) * ui(timeline_scale) + timeline_shift; + var ke_x = (keyframe_e + 1) * ui(timeline_scale) + timeline_shift; - draw_set_color(COLORS.panel_animation_loop_line); - draw_set_alpha(0.2); - draw_line_width(ks_x, key_y - 1, ke_x, key_y - 1, 4); - draw_set_alpha(1); - } - - if(!isGraphable(prop.type)) { - key_y += ui(18); - continue; - } - - var _key = drawDopesheetGraph(prop, key_y, msx, msy); - if(_key) key_hover = _key; + draw_set_color(COLORS.panel_animation_loop_line); + draw_set_alpha(0.2); + draw_line_width(ks_x, key_y - 1, ke_x, key_y - 1, 4); + draw_set_alpha(1); + } + + if(!isGraphable(prop.type)) { + key_y += ui(18); + continue; + } + + var _key = drawDopesheetGraph(prop, key_y, msx, msy); + if(_key) key_hover = _key; - if(prop.animator.show_graph && ds_list_size(prop.animator.values) > 0) - key_y += graph_h + ui(8); + if(prop.animator.show_graph && ds_list_size(prop.animator.values) > 0) + key_y += graph_h + ui(8); - key_y += ui(18); - } + key_y += ui(18); + } + } + #endregion key_y = key_sy; - _node = noone; if(keyframe_boxing) { draw_set_color(COLORS._main_accent); @@ -1006,71 +1027,72 @@ function Panel_Animation() : PanelContent() constructor { if(mouse_release(mb_left)) keyframe_boxing = false; } - - for( var i = 0; i < ds_list_size(anim_properties); i++ ) { - var prop = anim_properties[| i]; - if(!show_node_outside_context && prop.node.group != PANEL_GRAPH.getCurrentContext()) continue; - - if(_node != prop.node) { - _node = prop.node; - + + #region draw keys + for( var i = 0; i < ds_list_size(anim_properties); i++ ) { + var _node = anim_properties[| i]; + if(!show_node_outside_context && _node.group != PANEL_GRAPH.getCurrentContext()) continue; + key_y += dope_sheet_node_padding; key_y_node = key_y; key_y += ui(22); - } - - for(var k = 0; k < ds_list_size(prop.animator.values); k++) { - var t = (prop.animator.values[| k].time + 1) * ui(timeline_scale) + timeline_shift; - var keyframe = prop.animator.values[| k]; - - if(!prop.node.anim_show) { - draw_sprite_ui_uniform(THEME.timeline_keyframe, 0, t, key_y_node, 1, COLORS.panel_animation_keyframe_hide); - continue; - } - - var cc = COLORS.panel_animation_keyframe_unselected; - if(pHOVER && point_in_circle(msx, msy, t, key_y, ui(8))) { - cc = COLORS.panel_animation_keyframe_selected; - key_hover = keyframe; + + for( var j = 0; j < ds_list_size(_node.inputs); j++ ) { + var prop = _node.inputs[| j]; + if(!prop.animator.is_anim) continue; + + for(var k = 0; k < ds_list_size(prop.animator.values); k++) { + var t = (prop.animator.values[| k].time + 1) * ui(timeline_scale) + timeline_shift; + var keyframe = prop.animator.values[| k]; + + draw_sprite_ui_uniform(THEME.timeline_keyframe, 0, t, key_y_node, 1, COLORS._main_icon); + + if(!_node.anim_show) continue; + var cc = COLORS.panel_animation_keyframe_unselected; + if(pHOVER && point_in_circle(msx, msy, t, key_y, ui(8))) { + cc = COLORS.panel_animation_keyframe_selected; + key_hover = keyframe; - if(pFOCUS) { - if(DOUBLE_CLICK) { - keyframe_dragging = keyframe; - keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_both; - } else if(mouse_press(mb_left)) { - keyframe_dragging = keyframe; - keyframe_drag_type = KEYFRAME_DRAG_TYPE.move; + if(pFOCUS) { + if(DOUBLE_CLICK) { + keyframe_dragging = keyframe; + keyframe_drag_type = KEYFRAME_DRAG_TYPE.ease_both; + } else if(mouse_press(mb_left)) { + keyframe_dragging = keyframe; + keyframe_drag_type = KEYFRAME_DRAG_TYPE.move; + } + } + } + + if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) + cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent; + + draw_sprite_ui_uniform(THEME.timeline_keyframe, 1, t, key_y, 1, cc); + if(ds_list_exist(keyframe_selecting, keyframe)) + draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, 0, t, key_y, 1, COLORS._main_accent); + + if(keyframe_boxing) { + var box_x0 = min(keyframe_box_sx, msx); + var box_x1 = max(keyframe_box_sx, msx); + var box_y0 = min(keyframe_box_sy, msy); + var box_y1 = max(keyframe_box_sy, msy); + + if(pHOVER && !point_in_rectangle(t, key_y, box_x0, box_y0, box_x1, box_y1) && ds_list_exist(keyframe_selecting, keyframe)) + ds_list_remove(keyframe_selecting, keyframe); + if(pHOVER && point_in_rectangle(t, key_y, box_x0, box_y0, box_x1, box_y1) && !ds_list_exist(keyframe_selecting, keyframe)) + ds_list_add(keyframe_selecting, keyframe); } } - } - - if(stagger_mode == 1 && ds_list_exist(keyframe_selecting, keyframe)) - cc = key_hover == keyframe? COLORS.panel_animation_keyframe_selected : COLORS._main_accent; - - draw_sprite_ui_uniform(THEME.timeline_keyframe, 1, t, key_y, 1, cc); - if(ds_list_exist(keyframe_selecting, keyframe)) - draw_sprite_ui_uniform(THEME.timeline_keyframe_selecting, 0, t, key_y, 1, COLORS._main_accent); - - if(keyframe_boxing) { - var box_x0 = min(keyframe_box_sx, msx); - var box_x1 = max(keyframe_box_sx, msx); - var box_y0 = min(keyframe_box_sy, msy); - var box_y1 = max(keyframe_box_sy, msy); - - if(pHOVER && !point_in_rectangle(t, key_y, box_x0, box_y0, box_x1, box_y1) && ds_list_exist(keyframe_selecting, keyframe)) - ds_list_remove(keyframe_selecting, keyframe); - if(pHOVER && point_in_rectangle(t, key_y, box_x0, box_y0, box_x1, box_y1) && !ds_list_exist(keyframe_selecting, keyframe)) - ds_list_add(keyframe_selecting, keyframe); + + if(_node.anim_show) { + if(prop.animator.show_graph) + key_y += graph_h + ui(8); + + key_y += 18; + } } } - - if(prop.node.anim_show) { - if(prop.animator.show_graph) - key_y += graph_h + ui(8); - - key_y += 18; - } - } + #endregion if(pHOVER && point_in_rectangle(msx, msy, 0, ui(16), dope_sheet_w, dope_sheet_h)) { if(mouse_press(mb_left, pFOCUS) || mouse_press(mb_right, pFOCUS)) { diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index b4dd39aeb..a394ed1b4 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -690,6 +690,8 @@ function Panel_Graph() : PanelContent() constructor { node_drag_my = 0; node_drag_sx = 0; node_drag_sy = 0; + + PANEL_ANIMATION.updatePropertyList(); } function doBlend() { diff --git a/scripts/render_data/render_data.gml b/scripts/render_data/render_data.gml index c12913de5..adfca52a3 100644 --- a/scripts/render_data/render_data.gml +++ b/scripts/render_data/render_data.gml @@ -11,16 +11,7 @@ function __nodeLeafList(_list, _stack) { var _node = _list[| i]; if(!_node.active) continue; - var _startNode = true; - for(var j = 0; j < ds_list_size(_node.inputs); j++) { - var _in = _node.inputs[| j]; - if(_in.type == VALUE_TYPE.node) continue; - - _node.triggerRender(); - - if(_in.value_from != noone && !_in.value_from.node.rendered) - _startNode = false; - } + var _startNode = _node.isRenderable(true); if(_startNode) { ds_stack_push(_stack, _node); printIf(global.RENDER_LOG, "Push node " + _node.name + " to stack"); @@ -71,14 +62,7 @@ function Render(partial = false) { if(_node.rendered) continue; if(__nodeInLoop(_node)) continue; - var _startNode = true; - for(var j = 0; j < ds_list_size(_node.inputs); j++) { - var _in = _node.inputs[| j]; - if(_in.type == VALUE_TYPE.node) continue; - - if(_in.value_from != noone && !_in.value_from.node.rendered) - _startNode = false; - } + var _startNode = _node.isRenderable(); if(_startNode) { ds_stack_push(RENDER_STACK, _node); printIf(global.RENDER_LOG, " > Push " + _node.name + " node to stack"); diff --git a/scripts/sprite_loader/sprite_loader.gml b/scripts/sprite_loader/sprite_loader.gml index 40f1c053b..fe86ab0c4 100644 --- a/scripts/sprite_loader/sprite_loader.gml +++ b/scripts/sprite_loader/sprite_loader.gml @@ -4,8 +4,8 @@ function __init_theme() { directory_create(root); var _l = root + "\\_theme" + string(VERSION); - //if(file_exists(_l)) return; - //log_message("THEME", "unzipping default theme to DIRECTORY."); + if(file_exists(_l)) return; + log_message("THEME", "unzipping default theme to DIRECTORY."); var f = file_text_open_write(_l); file_text_write_real(f, 0); file_text_close(f); diff --git a/scripts/string_decimal/string_decimal.gml b/scripts/string_decimal/string_decimal.gml index e20cd12b5..c5433bf3c 100644 --- a/scripts/string_decimal/string_decimal.gml +++ b/scripts/string_decimal/string_decimal.gml @@ -60,6 +60,6 @@ function toNumber(str) { str = string_decimal(str); if(str == "") return 0; if(str == ".") return 0; - if(str == "-") return 0; + if(str == "-") return 0; return real(str); } \ No newline at end of file diff --git a/scripts/string_eval/string_eval.gml b/scripts/string_eval/string_eval.gml index 581b6cdd2..1a2d2eb88 100644 --- a/scripts/string_eval/string_eval.gml +++ b/scripts/string_eval/string_eval.gml @@ -182,7 +182,8 @@ case "t": ds_stack_push(vl, _x); break; case "pi": ds_stack_push(vl, pi); break; - default : ds_stack_push(vl, toNumber(vsl)); + default : + ds_stack_push(vl, toNumber(vsl)); break; } } diff --git a/scripts/surface_functions/surface_functions.gml b/scripts/surface_functions/surface_functions.gml index 6aead22ca..7a4dd1571 100644 --- a/scripts/surface_functions/surface_functions.gml +++ b/scripts/surface_functions/surface_functions.gml @@ -35,7 +35,7 @@ function surface_copy_add(dst, src, _x = 0, _y = 0) { surface_set_target(dst); draw_clear_alpha(0, 0); BLEND_ADD - draw_surface(src, _x, _y); + draw_surface_safe(src, _x, _y); BLEND_NORMAL surface_reset_target(); } diff --git a/scripts/textBox/textBox.gml b/scripts/textBox/textBox.gml index 3cb214559..1eae7ba4e 100644 --- a/scripts/textBox/textBox.gml +++ b/scripts/textBox/textBox.gml @@ -27,7 +27,7 @@ function textBox(_input, _onModify) constructor { onModify = _onModify; _input_text = ""; - _last_value = ""; + _last_text = ""; cursor = 0; cursor_pos = 0; @@ -53,7 +53,7 @@ function textBox(_input, _onModify) constructor { } if(no_empty && _input_text_current == "") - _input_text_current = _last_value; + _input_text_current = _last_text; if(onModify) onModify(_input_text_current); } @@ -63,6 +63,11 @@ function textBox(_input, _onModify) constructor { cursor = safe_mod(cursor + delta + ll, ll); } + static getDisplayText = function(val) { + if(input == TEXTBOX_INPUT.text) return val; + return string(val); + } + static editText = function() { #region text editor if(keyboard_check(vk_control) && keyboard_check_pressed(ord("A"))) { @@ -144,7 +149,7 @@ function textBox(_input, _onModify) constructor { #endregion if(keyboard_check_pressed(vk_escape)) { - _input_text = _last_value; + _input_text = _last_text; apply(); TEXTBOX_ACTIVE = noone; } else if(keyboard_check_pressed(vk_enter)) { @@ -273,10 +278,8 @@ function textBox(_input, _onModify) constructor { _input_text = slide_sx + spd; switch(input) { - case TEXTBOX_INPUT.number : - _input_text = round(_input_text); - break; - } + case TEXTBOX_INPUT.number : _input_text = round(_input_text); break; + } apply(); UNDO_HOLDING = true; @@ -346,7 +349,8 @@ function textBox(_input, _onModify) constructor { #endregion #region draw - var ss = string_cut(_input_text, _w - ui(16)); + var disp_text = getDisplayText(_input_text); + var ss = string_cut(disp_text, _w - ui(16)); draw_set_text(font == noone? f_p0 : font, fa_left, fa_top); var ww = string_width(ss); @@ -366,7 +370,7 @@ function textBox(_input, _onModify) constructor { if(cursor_select > -1) { draw_set_color(COLORS.widget_text_highlight); - var x1 = tx + string_width(string_copy(_input_text, 1, cursor_select)); + var x1 = tx + string_width(string_copy(disp_text, 1, cursor_select)); draw_roundrect_ext(cursor_pos, c_y0, x1, c_y1, ui(8), ui(8), 0); } @@ -388,7 +392,7 @@ function textBox(_input, _onModify) constructor { TEXTBOX_ACTIVE = noone; } } else { - var ss = string_cut(string(_text), _w - 16); + var ss = string_cut(getDisplayText(_text), _w - 16); draw_set_text(font == noone? f_p0 : font, fa_left, fa_center); var ww = string_width(ss); @@ -409,8 +413,8 @@ function textBox(_input, _onModify) constructor { KEYBOARD_STRING = ""; keyboard_lastkey = -1; - _input_text = _text; - _last_value = _text; + _input_text = _text; + _last_text = _text; } } else if(!hide) { draw_sprite_stretched(THEME.textbox, 0, _x, _y, _w, hh); @@ -425,7 +429,7 @@ function textBox(_input, _onModify) constructor { if(mouse_press(mb_left, active)) { sliding = 1; slide_mx = _m[0]; - slide_sx = _last_value; + slide_sx = toNumber(_text); } } } diff --git a/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.fsh b/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.fsh index 090be1bd3..a3e42e47c 100644 --- a/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.fsh +++ b/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.fsh @@ -7,13 +7,17 @@ varying float v_vNormalLight; uniform vec3 u_AmbientLight; uniform vec3 u_LightColor; uniform float u_LightIntensity; +uniform int useNormal; void main() { vec4 dif = texture2D( gm_BaseTexture, v_vTexcoord ); - vec4 lig = dif * (u_LightIntensity * vec4(u_LightColor, 1.)); - vec4 amb = dif * vec4(u_AmbientLight, 1.); - float intensity = min(v_vNormalLight * u_LightIntensity, 1.); - vec4 clr = mix(amb, lig, intensity); - clr.a = dif.a; - gl_FragColor = clr; + if(useNormal == 1) { + vec4 lig = dif * (u_LightIntensity * vec4(u_LightColor, 1.)); + vec4 amb = dif * vec4(u_AmbientLight, 1.); + float intensity = min(v_vNormalLight * u_LightIntensity, 1.); + vec4 clr = mix(amb, lig, intensity); + clr.a = dif.a; + gl_FragColor = clr; + } else + gl_FragColor = dif; }