Alpha, group toggle
|
@ -283,7 +283,7 @@
|
||||||
{"name":"node_hlsl","order":13,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
{"name":"node_hlsl","order":13,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
||||||
{"name":"sh_dither","order":28,"path":"shaders/sh_dither/sh_dither.yy",},
|
{"name":"sh_dither","order":28,"path":"shaders/sh_dither/sh_dither.yy",},
|
||||||
{"name":"__vec2","order":7,"path":"scripts/__vec2/__vec2.yy",},
|
{"name":"__vec2","order":7,"path":"scripts/__vec2/__vec2.yy",},
|
||||||
{"name":"node_region_fill","order":18,"path":"scripts/node_region_fill/node_region_fill.yy",},
|
{"name":"node_region_fill","order":1,"path":"scripts/node_region_fill/node_region_fill.yy",},
|
||||||
{"name":"sh_mk_tile55_edge_r","order":7,"path":"shaders/sh_mk_tile55_edge_r/sh_mk_tile55_edge_r.yy",},
|
{"name":"sh_mk_tile55_edge_r","order":7,"path":"shaders/sh_mk_tile55_edge_r/sh_mk_tile55_edge_r.yy",},
|
||||||
{"name":"sh_d3d_normal","order":18,"path":"shaders/sh_d3d_normal/sh_d3d_normal.yy",},
|
{"name":"sh_d3d_normal","order":18,"path":"shaders/sh_d3d_normal/sh_d3d_normal.yy",},
|
||||||
{"name":"s_node_text_file_read","order":13,"path":"sprites/s_node_text_file_read/s_node_text_file_read.yy",},
|
{"name":"s_node_text_file_read","order":13,"path":"sprites/s_node_text_file_read/s_node_text_file_read.yy",},
|
||||||
|
@ -346,7 +346,7 @@
|
||||||
{"name":"o_dialog_textbox_autocomplete","order":7,"path":"objects/o_dialog_textbox_autocomplete/o_dialog_textbox_autocomplete.yy",},
|
{"name":"o_dialog_textbox_autocomplete","order":7,"path":"objects/o_dialog_textbox_autocomplete/o_dialog_textbox_autocomplete.yy",},
|
||||||
{"name":"s_node_loop_input","order":14,"path":"sprites/s_node_loop_input/s_node_loop_input.yy",},
|
{"name":"s_node_loop_input","order":14,"path":"sprites/s_node_loop_input/s_node_loop_input.yy",},
|
||||||
{"name":"node_strand_length_adjust","order":11,"path":"scripts/node_strand_length_adjust/node_strand_length_adjust.yy",},
|
{"name":"node_strand_length_adjust","order":11,"path":"scripts/node_strand_length_adjust/node_strand_length_adjust.yy",},
|
||||||
{"name":"node_blinker","order":17,"path":"scripts/node_blinker/node_blinker.yy",},
|
{"name":"node_blinker","order":2,"path":"scripts/node_blinker/node_blinker.yy",},
|
||||||
{"name":"s_node_3d_transform_scene","order":22,"path":"sprites/s_node_3d_transform_scene/s_node_3d_transform_scene.yy",},
|
{"name":"s_node_3d_transform_scene","order":22,"path":"sprites/s_node_3d_transform_scene/s_node_3d_transform_scene.yy",},
|
||||||
{"name":"fd_rectangle_add_material_surface","order":25,"path":"scripts/fd_rectangle_add_material_surface/fd_rectangle_add_material_surface.yy",},
|
{"name":"fd_rectangle_add_material_surface","order":25,"path":"scripts/fd_rectangle_add_material_surface/fd_rectangle_add_material_surface.yy",},
|
||||||
{"name":"perlin_noise","order":5,"path":"scripts/perlin_noise/perlin_noise.yy",},
|
{"name":"perlin_noise","order":5,"path":"scripts/perlin_noise/perlin_noise.yy",},
|
||||||
|
@ -665,7 +665,7 @@
|
||||||
{"name":"s_node_pack_sprite","order":5,"path":"sprites/s_node_pack_sprite/s_node_pack_sprite.yy",},
|
{"name":"s_node_pack_sprite","order":5,"path":"sprites/s_node_pack_sprite/s_node_pack_sprite.yy",},
|
||||||
{"name":"surface_valid","order":6,"path":"scripts/surface_valid/surface_valid.yy",},
|
{"name":"surface_valid","order":6,"path":"scripts/surface_valid/surface_valid.yy",},
|
||||||
{"name":"sh_blur_zoom","order":5,"path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",},
|
{"name":"sh_blur_zoom","order":5,"path":"shaders/sh_blur_zoom/sh_blur_zoom.yy",},
|
||||||
{"name":"node_isosurf","order":4,"path":"scripts/node_isosurf/node_isosurf.yy",},
|
{"name":"node_isosurf","order":3,"path":"scripts/node_isosurf/node_isosurf.yy",},
|
||||||
{"name":"__add_node_item","order":13,"path":"scripts/__add_node_item/__add_node_item.yy",},
|
{"name":"__add_node_item","order":13,"path":"scripts/__add_node_item/__add_node_item.yy",},
|
||||||
{"name":"node_VFX_renderer","order":2,"path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},
|
{"name":"node_VFX_renderer","order":2,"path":"scripts/node_VFX_renderer/node_VFX_renderer.yy",},
|
||||||
{"name":"s_node_pb_fx_stack","order":2,"path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",},
|
{"name":"s_node_pb_fx_stack","order":2,"path":"sprites/s_node_pb_fx_stack/s_node_pb_fx_stack.yy",},
|
||||||
|
@ -710,6 +710,7 @@
|
||||||
{"name":"pack_bottom_left","order":2,"path":"scripts/pack_bottom_left/pack_bottom_left.yy",},
|
{"name":"pack_bottom_left","order":2,"path":"scripts/pack_bottom_left/pack_bottom_left.yy",},
|
||||||
{"name":"o_dialog_lua_reference","order":5,"path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",},
|
{"name":"o_dialog_lua_reference","order":5,"path":"objects/o_dialog_lua_reference/o_dialog_lua_reference.yy",},
|
||||||
{"name":"__node_custom","order":14,"path":"scripts/__node_custom/__node_custom.yy",},
|
{"name":"__node_custom","order":14,"path":"scripts/__node_custom/__node_custom.yy",},
|
||||||
|
{"name":"node_surface_data","order":5,"path":"scripts/node_surface_data/node_surface_data.yy",},
|
||||||
{"name":"s_node_note","order":35,"path":"sprites/s_node_note/s_node_note.yy",},
|
{"name":"s_node_note","order":35,"path":"sprites/s_node_note/s_node_note.yy",},
|
||||||
{"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",},
|
{"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",},
|
||||||
{"name":"palette_functions","order":3,"path":"scripts/palette_functions/palette_functions.yy",},
|
{"name":"palette_functions","order":3,"path":"scripts/palette_functions/palette_functions.yy",},
|
||||||
|
@ -949,7 +950,6 @@
|
||||||
{"name":"o_dialog_file_name","order":1,"path":"objects/o_dialog_file_name/o_dialog_file_name.yy",},
|
{"name":"o_dialog_file_name","order":1,"path":"objects/o_dialog_file_name/o_dialog_file_name.yy",},
|
||||||
{"name":"s_node_pb_layer","order":18,"path":"sprites/s_node_pb_layer/s_node_pb_layer.yy",},
|
{"name":"s_node_pb_layer","order":18,"path":"sprites/s_node_pb_layer/s_node_pb_layer.yy",},
|
||||||
{"name":"FirebaseREST_HTTP_Success_Firestore","order":19,"path":"scripts/FirebaseREST_HTTP_Success_Firestore/FirebaseREST_HTTP_Success_Firestore.yy",},
|
{"name":"FirebaseREST_HTTP_Success_Firestore","order":19,"path":"scripts/FirebaseREST_HTTP_Success_Firestore/FirebaseREST_HTTP_Success_Firestore.yy",},
|
||||||
{"name":"node_surface_from_color","order":1,"path":"scripts/node_surface_from_color/node_surface_from_color.yy",},
|
|
||||||
{"name":"s_node_pb_draw_rectangle","order":13,"path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",},
|
{"name":"s_node_pb_draw_rectangle","order":13,"path":"sprites/s_node_pb_draw_rectangle/s_node_pb_draw_rectangle.yy",},
|
||||||
{"name":"panel_animation","order":1,"path":"scripts/panel_animation/panel_animation.yy",},
|
{"name":"panel_animation","order":1,"path":"scripts/panel_animation/panel_animation.yy",},
|
||||||
{"name":"sh_pb_to_mask","order":7,"path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",},
|
{"name":"sh_pb_to_mask","order":7,"path":"shaders/sh_pb_to_mask/sh_pb_to_mask.yy",},
|
||||||
|
@ -1039,7 +1039,7 @@
|
||||||
{"name":"s_node_tunnel_in","order":21,"path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",},
|
{"name":"s_node_tunnel_in","order":21,"path":"sprites/s_node_tunnel_in/s_node_tunnel_in.yy",},
|
||||||
{"name":"s_node_pb_draw_trapezoid","order":10,"path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",},
|
{"name":"s_node_pb_draw_trapezoid","order":10,"path":"sprites/s_node_pb_draw_trapezoid/s_node_pb_draw_trapezoid.yy",},
|
||||||
{"name":"append_function","order":1,"path":"scripts/append_function/append_function.yy",},
|
{"name":"append_function","order":1,"path":"scripts/append_function/append_function.yy",},
|
||||||
{"name":"node_3dsurf","order":5,"path":"scripts/node_3dsurf/node_3dsurf.yy",},
|
{"name":"node_3dsurf","order":4,"path":"scripts/node_3dsurf/node_3dsurf.yy",},
|
||||||
{"name":"fd_rectangle_reset_target","order":17,"path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},
|
{"name":"fd_rectangle_reset_target","order":17,"path":"scripts/fd_rectangle_reset_target/fd_rectangle_reset_target.yy",},
|
||||||
{"name":"node_fluid_sim_inline","order":12,"path":"scripts/node_fluid_sim_inline/node_fluid_sim_inline.yy",},
|
{"name":"node_fluid_sim_inline","order":12,"path":"scripts/node_fluid_sim_inline/node_fluid_sim_inline.yy",},
|
||||||
{"name":"node_rate_remap","order":3,"path":"scripts/node_rate_remap/node_rate_remap.yy",},
|
{"name":"node_rate_remap","order":3,"path":"scripts/node_rate_remap/node_rate_remap.yy",},
|
||||||
|
@ -1476,7 +1476,7 @@
|
||||||
{"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",},
|
{"name":"node_array_composite","order":17,"path":"scripts/node_array_composite/node_array_composite.yy",},
|
||||||
{"name":"s_node_vfx_turb","order":5,"path":"sprites/s_node_vfx_turb/s_node_vfx_turb.yy",},
|
{"name":"s_node_vfx_turb","order":5,"path":"sprites/s_node_vfx_turb/s_node_vfx_turb.yy",},
|
||||||
{"name":"o_dialog_l_system","order":1,"path":"objects/o_dialog_l_system/o_dialog_l_system.yy",},
|
{"name":"o_dialog_l_system","order":1,"path":"objects/o_dialog_l_system/o_dialog_l_system.yy",},
|
||||||
{"name":"node_surface_to_color","order":2,"path":"scripts/node_surface_to_color/node_surface_to_color.yy",},
|
{"name":"node_surface_to_color","order":1,"path":"scripts/node_surface_to_color/node_surface_to_color.yy",},
|
||||||
{"name":"sh_shadow_cast_light_sep","order":1,"path":"shaders/sh_shadow_cast_light_sep/sh_shadow_cast_light_sep.yy",},
|
{"name":"sh_shadow_cast_light_sep","order":1,"path":"shaders/sh_shadow_cast_light_sep/sh_shadow_cast_light_sep.yy",},
|
||||||
{"name":"node_audio_loudness","order":1,"path":"scripts/node_audio_loudness/node_audio_loudness.yy",},
|
{"name":"node_audio_loudness","order":1,"path":"scripts/node_audio_loudness/node_audio_loudness.yy",},
|
||||||
{"name":"sh_FLIP_draw_droplet","order":1,"path":"shaders/sh_FLIP_draw_droplet/sh_FLIP_draw_droplet.yy",},
|
{"name":"sh_FLIP_draw_droplet","order":1,"path":"shaders/sh_FLIP_draw_droplet/sh_FLIP_draw_droplet.yy",},
|
||||||
|
@ -1513,7 +1513,7 @@
|
||||||
{"name":"s_node_rigidSim_deactivate","order":7,"path":"sprites/s_node_rigidSim_deactivate/s_node_rigidSim_deactivate.yy",},
|
{"name":"s_node_rigidSim_deactivate","order":7,"path":"sprites/s_node_rigidSim_deactivate/s_node_rigidSim_deactivate.yy",},
|
||||||
{"name":"sh_blend_contrast","order":16,"path":"shaders/sh_blend_contrast/sh_blend_contrast.yy",},
|
{"name":"sh_blend_contrast","order":16,"path":"shaders/sh_blend_contrast/sh_blend_contrast.yy",},
|
||||||
{"name":"__node_3d_prim_cube","order":1,"path":"scripts/__node_3d_prim_cube/__node_3d_prim_cube.yy",},
|
{"name":"__node_3d_prim_cube","order":1,"path":"scripts/__node_3d_prim_cube/__node_3d_prim_cube.yy",},
|
||||||
{"name":"node_surface_from_buffer","order":3,"path":"scripts/node_surface_from_buffer/node_surface_from_buffer.yy",},
|
{"name":"node_surface_from_buffer","order":2,"path":"scripts/node_surface_from_buffer/node_surface_from_buffer.yy",},
|
||||||
{"name":"Obj_FirebaseFirestore_Collection_Listener","order":1,"path":"objects/Obj_FirebaseFirestore_Collection_Listener/Obj_FirebaseFirestore_Collection_Listener.yy",},
|
{"name":"Obj_FirebaseFirestore_Collection_Listener","order":1,"path":"objects/Obj_FirebaseFirestore_Collection_Listener/Obj_FirebaseFirestore_Collection_Listener.yy",},
|
||||||
{"name":"s_node_fluidSim_add_collider","order":1,"path":"sprites/s_node_fluidSim_add_collider/s_node_fluidSim_add_collider.yy",},
|
{"name":"s_node_fluidSim_add_collider","order":1,"path":"sprites/s_node_fluidSim_add_collider/s_node_fluidSim_add_collider.yy",},
|
||||||
{"name":"__node_3d_plane","order":4,"path":"scripts/__node_3d_plane/__node_3d_plane.yy",},
|
{"name":"__node_3d_plane","order":4,"path":"scripts/__node_3d_plane/__node_3d_plane.yy",},
|
||||||
|
@ -1767,7 +1767,7 @@
|
||||||
{"name":"rangeBox","order":9,"path":"scripts/rangeBox/rangeBox.yy",},
|
{"name":"rangeBox","order":9,"path":"scripts/rangeBox/rangeBox.yy",},
|
||||||
{"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",},
|
{"name":"s_node_array_copy","order":14,"path":"sprites/s_node_array_copy/s_node_array_copy.yy",},
|
||||||
{"name":"node_VFX_effect_accelerate","order":1,"path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",},
|
{"name":"node_VFX_effect_accelerate","order":1,"path":"scripts/node_VFX_effect_accelerate/node_VFX_effect_accelerate.yy",},
|
||||||
{"name":"node_flood_fill","order":10,"path":"scripts/node_flood_fill/node_flood_fill.yy",},
|
{"name":"node_flood_fill","order":3,"path":"scripts/node_flood_fill/node_flood_fill.yy",},
|
||||||
{"name":"node_frame","order":1,"path":"scripts/node_frame/node_frame.yy",},
|
{"name":"node_frame","order":1,"path":"scripts/node_frame/node_frame.yy",},
|
||||||
{"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},
|
{"name":"s_node_scale_algo","order":7,"path":"sprites/s_node_scale_algo/s_node_scale_algo.yy",},
|
||||||
{"name":"sh_sdf_dist","order":4,"path":"shaders/sh_sdf_dist/sh_sdf_dist.yy",},
|
{"name":"sh_sdf_dist","order":4,"path":"shaders/sh_sdf_dist/sh_sdf_dist.yy",},
|
||||||
|
|
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 80 KiB After Width: | Height: | Size: 80 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
@ -14,6 +14,11 @@ event_inherited();
|
||||||
index_dragging = -1;
|
index_dragging = -1;
|
||||||
interactable = true;
|
interactable = true;
|
||||||
|
|
||||||
|
index_drag_x = 0; index_drag_x_to = 0;
|
||||||
|
index_drag_y = 0; index_drag_y_to = 0;
|
||||||
|
index_drag_w = 0; index_drag_w_to = 0;
|
||||||
|
index_drag_h = 0; index_drag_h_to = 0;
|
||||||
|
|
||||||
setColor = function(color) {
|
setColor = function(color) {
|
||||||
if(index_selecting == -1 || palette == 0) return;
|
if(index_selecting == -1 || palette == 0) return;
|
||||||
palette[index_selecting] = color;
|
palette[index_selecting] = color;
|
||||||
|
@ -84,6 +89,10 @@ event_inherited();
|
||||||
palette = array_create(array_length(pal.palette));
|
palette = array_create(array_length(pal.palette));
|
||||||
for( var j = 0; j < array_length(pal.palette); j++ )
|
for( var j = 0; j < array_length(pal.palette); j++ )
|
||||||
palette[j] = pal.palette[j];
|
palette[j] = pal.palette[j];
|
||||||
|
onApply(palette);
|
||||||
|
|
||||||
|
index_selecting = 0;
|
||||||
|
selector.setColor(palette[index_selecting], false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
|
if(i >= 0 && mouse_press(mb_right, interactable && sFOCUS)) {
|
||||||
|
|
|
@ -52,8 +52,9 @@ if palette == 0 exit;
|
||||||
var r = number_to_hex(color_get_red(cc));
|
var r = number_to_hex(color_get_red(cc));
|
||||||
var g = number_to_hex(color_get_green(cc));
|
var g = number_to_hex(color_get_green(cc));
|
||||||
var b = number_to_hex(color_get_blue(cc));
|
var b = number_to_hex(color_get_blue(cc));
|
||||||
|
var a = number_to_hex(color_get_alpha(cc));
|
||||||
|
|
||||||
file_text_write_string(file, $"{r}{g}{b}\n");
|
file_text_write_string(file, $"{r}{g}{b}{a}\n");
|
||||||
}
|
}
|
||||||
file_text_close(file);
|
file_text_close(file);
|
||||||
__initPalette();
|
__initPalette();
|
||||||
|
@ -114,15 +115,40 @@ if palette == 0 exit;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
var hover = -1, hvx, hvy;
|
var hover = -1, hvx, hvy;
|
||||||
|
var _pd = ui(5);
|
||||||
|
|
||||||
for(var i = 0; i < row; i++)
|
for(var i = 0; i < row; i++)
|
||||||
for(var j = 0; j < col; j++) {
|
for(var j = 0; j < col; j++) {
|
||||||
var index = i * col + j;
|
var index = i * col + j;
|
||||||
if(index >= array_length(palette)) break;
|
if(index >= array_length(palette)) break;
|
||||||
|
|
||||||
var _p = palette[index];
|
var _p = palette[index];
|
||||||
|
var _pa = _color_get_alpha(_p);
|
||||||
var _kx = pl_x + j * ww;
|
var _kx = pl_x + j * ww;
|
||||||
var _ky = pl_y + i * (pl_h + ui(6));
|
var _ky = pl_y + i * (pl_h + ui(6));
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.color_picker_sample, index == index_selecting, _kx + ui(2), _ky, ww - ui(4), pl_h, _p, 1);
|
var _px = _kx + ui(2);
|
||||||
|
var _py = _ky;
|
||||||
|
var _pw = ww - ui(4);
|
||||||
|
var _ph = pl_h;
|
||||||
|
|
||||||
|
if(index == index_dragging) {
|
||||||
|
index_drag_x_to = _px;
|
||||||
|
index_drag_y_to = _py;
|
||||||
|
index_drag_w_to = _pw;
|
||||||
|
index_drag_h_to = _ph;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_pa < 1) {
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py, _pw, _ph - ui(8), _p, 1);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py + _ph - ui(6), _pw, ui(6), c_black, 1);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py + _ph - ui(6), _pw * _pa, ui(6), c_white, 1);
|
||||||
|
} else
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py, _pw, _ph, _p, 1);
|
||||||
|
|
||||||
|
if(index == index_selecting)
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_selecting, 0, _px - _pd, _py - _pd, _pw + _pd * 2, _ph + _pd * 2, c_white, 1);
|
||||||
|
|
||||||
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx, _ky, _kx + ww, _ky + pl_h)) {
|
if(sHOVER && point_in_rectangle(mouse_mx, mouse_my, _kx, _ky, _kx + ww, _ky + pl_h)) {
|
||||||
hover = index;
|
hover = index;
|
||||||
|
@ -132,26 +158,48 @@ if palette == 0 exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(index_dragging > -1) {
|
if(index_dragging > -1) {
|
||||||
|
index_drag_x = index_drag_x == 0? index_drag_x_to : lerp_float(index_drag_x, index_drag_x_to, 5);
|
||||||
|
index_drag_y = index_drag_y == 0? index_drag_y_to : lerp_float(index_drag_y, index_drag_y_to, 5);
|
||||||
|
index_drag_w = index_drag_w == 0? index_drag_w_to : lerp_float(index_drag_w, index_drag_w_to, 5);
|
||||||
|
index_drag_h = index_drag_h == 0? index_drag_h_to : lerp_float(index_drag_h, index_drag_h_to, 5);
|
||||||
|
|
||||||
|
_px = index_drag_x;
|
||||||
|
_py = index_drag_y;
|
||||||
|
_pw = index_drag_w;
|
||||||
|
_ph = index_drag_h;
|
||||||
|
_p = palette[index_dragging];
|
||||||
|
_pa = _color_get_alpha(_p);
|
||||||
|
|
||||||
|
if(_pa < 1) {
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py, _pw, _ph - ui(8), _p, 1);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py + _ph - ui(6), _pw, ui(6), c_black, 1);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py + _ph - ui(6), _pw * _pa, ui(6), c_white, 1);
|
||||||
|
} else
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, _px, _py, _pw, _ph, _p, 1);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_selecting, 0, _px - _pd, _py - _pd, _pw + _pd * 2, _ph + _pd * 2, c_white, 1);
|
||||||
|
|
||||||
if(hover > -1 && hover != index_dragging) {
|
if(hover > -1 && hover != index_dragging) {
|
||||||
draw_set_color(COLORS.dialog_palette_divider);
|
draw_set_color(COLORS.dialog_palette_divider);
|
||||||
if(hover < index_dragging)
|
var sx = hvx;
|
||||||
draw_line_width(hvx - 1, hvy, hvx - 1, hvy + pl_h, 4);
|
if(hover >= index_dragging) sx += ww;
|
||||||
else
|
|
||||||
draw_line_width(hvx + ww - 1, hvy, hvx + ww - 1, hvy + pl_h, 4);
|
|
||||||
|
|
||||||
if(mouse_release(mb_left)) {
|
|
||||||
var tt = palette[index_dragging];
|
var tt = palette[index_dragging];
|
||||||
|
|
||||||
array_delete(palette, index_dragging, 1);
|
array_delete(palette, index_dragging, 1);
|
||||||
array_insert(palette, hover, tt);
|
array_insert(palette, hover, tt);
|
||||||
index_selecting = hover;
|
index_selecting = hover;
|
||||||
|
index_dragging = hover;
|
||||||
|
|
||||||
onApply(palette);
|
onApply(palette);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if(mouse_release(mb_left))
|
if(mouse_release(mb_left))
|
||||||
index_dragging = -1;
|
index_dragging = -1;
|
||||||
|
} else {
|
||||||
|
index_drag_x = 0;
|
||||||
|
index_drag_y = 0;
|
||||||
|
index_drag_w = 0;
|
||||||
|
index_drag_h = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mouse_press(mb_left, sFOCUS) && hover > -1) {
|
if(mouse_press(mb_left, sFOCUS) && hover > -1) {
|
||||||
|
@ -165,7 +213,7 @@ if palette == 0 exit;
|
||||||
var by = pl_y - ui(2);
|
var by = pl_y - ui(2);
|
||||||
|
|
||||||
if(array_length(palette) > 1) {
|
if(array_length(palette) > 1) {
|
||||||
if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.minus) == 2) {
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.minus) == 2) {
|
||||||
array_delete(palette, index_selecting, 1);
|
array_delete(palette, index_selecting, 1);
|
||||||
index_selecting = clamp(index_selecting - 1, 0, array_length(palette) - 1);
|
index_selecting = clamp(index_selecting - 1, 0, array_length(palette) - 1);
|
||||||
onApply(palette);
|
onApply(palette);
|
||||||
|
@ -175,14 +223,14 @@ if palette == 0 exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
bx -= ui(32);
|
bx -= ui(32);
|
||||||
if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.add) == 2) {
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, "", THEME.add) == 2) {
|
||||||
index_selecting = array_length(palette);
|
index_selecting = array_length(palette);
|
||||||
palette[array_length(palette)] = c_black;
|
palette[array_length(palette)] = c_black;
|
||||||
onApply(palette);
|
onApply(palette);
|
||||||
}
|
}
|
||||||
|
|
||||||
bx = content_x + ui(18);
|
bx = content_x + ui(18);
|
||||||
if(buttonInstant(THEME.button, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) {
|
if(buttonInstant(THEME.button_hide, bx, by, ui(28), ui(28), mouse_ui, interactable && sFOCUS, sHOVER, __txtx("palette_editor_load", "Load palette file") + " (.hex)", THEME.file) == 2) {
|
||||||
var path = get_open_filename("HEX palette|*.hex", "");
|
var path = get_open_filename("HEX palette|*.hex", "");
|
||||||
key_release();
|
key_release();
|
||||||
|
|
||||||
|
|
|
@ -309,7 +309,7 @@ function __part(_node) constructor {
|
||||||
|
|
||||||
var cc = (col == -1)? c_white : col.eval(lifeRat);
|
var cc = (col == -1)? c_white : col.eval(lifeRat);
|
||||||
if(blend != c_white) cc = colorMultiply(blend, cc);
|
if(blend != c_white) cc = colorMultiply(blend, cc);
|
||||||
alp_draw = alp * (alp_fade == noone? 1 : alp_fade.get(lifeRat));
|
alp_draw = alp * (alp_fade == noone? 1 : alp_fade.get(lifeRat)) * _color_get_alpha(cc);
|
||||||
|
|
||||||
draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw);
|
draw_surface_ext_safe(surface, _xx, _yy, scx, scy, drawrot, cc, alp_draw);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -148,9 +148,9 @@ function __Node_3D_Displace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
|
|
||||||
if(is_surface(_dspTex)) {
|
if(is_surface(_dspTex)) {
|
||||||
var c = surface_getpixel(_dspTex, v.textures[_texI][0] * surface_get_width_safe(_dspTex), v.textures[_texI][1] * surface_get_height_safe(_dspTex));
|
var c = surface_getpixel(_dspTex, v.textures[_texI][0] * surface_get_width_safe(_dspTex), v.textures[_texI][1] * surface_get_height_safe(_dspTex));
|
||||||
var r = color_get_red(c) / 255;
|
var r = _color_get_red(c);
|
||||||
var g = color_get_green(c) / 255;
|
var g = _color_get_green(c);
|
||||||
var b = color_get_blue(c) / 255;
|
var b = _color_get_blue(c);
|
||||||
str = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
str = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -157,7 +157,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
["Spawn", true], 27, 16, 44, 1, 2, 3, 4, 30, 24, 5,
|
["Spawn", true], 27, 16, 44, 1, 2, 3, 4, 30, 24, 5,
|
||||||
["Movement", true], 29, 6, 18,
|
["Movement", true], 29, 6, 18,
|
||||||
["Physics", true], 7, 19, 33, 34, 35, 36,
|
["Physics", true], 7, 19, 33, 34, 35, 36,
|
||||||
["Ground", true], 37, 38, 39, 40,
|
["Ground", true, 37], 38, 39, 40,
|
||||||
["Rotation", true], 15, 8, 9,
|
["Rotation", true], 15, 8, 9,
|
||||||
["Scale", true], 10, 17, 11,
|
["Scale", true], 10, 17, 11,
|
||||||
["Wiggles", true], 20, 41, 42, 43,
|
["Wiggles", true], 20, 41, 42, 43,
|
||||||
|
@ -455,7 +455,6 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
var _scatt = getInputData(24);
|
var _scatt = getInputData(24);
|
||||||
var _dirAng = getInputData(29);
|
var _dirAng = getInputData(29);
|
||||||
var _turn = getInputData(34);
|
var _turn = getInputData(34);
|
||||||
var _colGnd = getInputData(37);
|
|
||||||
var _spwTyp = getInputData(16);
|
var _spwTyp = getInputData(16);
|
||||||
|
|
||||||
inputs[| 6].setVisible(!_dirAng);
|
inputs[| 6].setVisible(!_dirAng);
|
||||||
|
@ -467,10 +466,6 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
inputs[| 35].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
inputs[| 35].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||||
inputs[| 36].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
inputs[| 36].setVisible(_turn[0] != 0 && _turn[1] != 0);
|
||||||
|
|
||||||
inputs[| 38].setVisible(_colGnd);
|
|
||||||
inputs[| 39].setVisible(_colGnd);
|
|
||||||
inputs[| 40].setVisible(_colGnd);
|
|
||||||
|
|
||||||
inputs[| 22].setVisible(false);
|
inputs[| 22].setVisible(false);
|
||||||
inputs[| 23].setVisible(false);
|
inputs[| 23].setVisible(false);
|
||||||
inputs[| 26].setVisible(false);
|
inputs[| 26].setVisible(false);
|
||||||
|
|
|
@ -96,18 +96,25 @@ function drawPalette(_pal, _x, _y, _w, _h, _a = 1) { #region
|
||||||
|
|
||||||
var ww = _w / aa;
|
var ww = _w / aa;
|
||||||
var _x0 = _x;
|
var _x0 = _x;
|
||||||
|
var _in;
|
||||||
|
|
||||||
for(var i = 0; i < aa; i++) {
|
for(var i = 0; i < aa; i++) {
|
||||||
if(!is_real(_pal[i])) continue;
|
if(!is_numeric(_pal[i])) continue;
|
||||||
|
|
||||||
var _in = 0;
|
if(i == 0) _in = 2;
|
||||||
|
else if(i == aa - 1) _in = 3;
|
||||||
|
else _in = 0;
|
||||||
|
|
||||||
if(i == 0)
|
var _ca = _color_get_alpha(_pal[i]);
|
||||||
_in = 2;
|
|
||||||
else if(i == aa - 1)
|
|
||||||
_in = 3;
|
|
||||||
|
|
||||||
|
if(_ca == 1) {
|
||||||
draw_sprite_stretched_ext(THEME.palette_mask, _in, floor(_x0), _y, ceil(ww), _h, _pal[i], _a);
|
draw_sprite_stretched_ext(THEME.palette_mask, _in, floor(_x0), _y, ceil(ww), _h, _pal[i], _a);
|
||||||
|
} else {
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, _in, floor(_x0), _y, ceil(ww), _h - ui(8), _pal[i], _a);
|
||||||
|
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, floor(_x0), _y + _h - ui(6), ceil(ww), ui(6), c_black, _a);
|
||||||
|
draw_sprite_stretched_ext(THEME.palette_mask, 1, floor(_x0), _y + _h - ui(6), ceil(ww) * _ca, ui(6), c_white, _a);
|
||||||
|
}
|
||||||
|
|
||||||
_x0 += ww;
|
_x0 += ww;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,17 +9,34 @@ function colorFromRGBArray(arr) { #region
|
||||||
return make_color_rgb(r, g, b);
|
return make_color_rgb(r, g, b);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
function color_get_alpha(color) { INLINE return (color & (0xFF << 24)) >> 24; }
|
function color_get_alpha(color) { INLINE return is_real(color)? 255 : (color & (0xFF << 24)) >> 24; }
|
||||||
function _color_get_alpha(color) { INLINE return is_real(color)? 1 : color_get_alpha(color) / 255; }
|
function _color_get_alpha(color) { INLINE return is_real(color)? 1 : color_get_alpha(color) / 255; }
|
||||||
|
|
||||||
function _color_get_red(color) { INLINE return color_get_red(color) / 255; }
|
function _color_get_red(color) { INLINE return color_get_red(color) / 255; }
|
||||||
function _color_get_green(color) { INLINE return color_get_green(color) / 255; }
|
function _color_get_green(color) { INLINE return color_get_green(color) / 255; }
|
||||||
function _color_get_blue(color) { INLINE return color_get_blue(color) / 255; }
|
function _color_get_blue(color) { INLINE return color_get_blue(color) / 255; }
|
||||||
|
|
||||||
|
function _color_get_hue(color) { INLINE return color_get_hue(color) / 255; }
|
||||||
|
function _color_get_saturation(color) { INLINE return color_get_saturation(color) / 255; }
|
||||||
|
function _color_get_value(color) { INLINE return color_get_value(color) / 255; }
|
||||||
|
|
||||||
function colorArrayFromReal(clr) { #region
|
function colorArrayFromReal(clr) { #region
|
||||||
INLINE
|
INLINE
|
||||||
return [ _color_get_red(clr), _color_get_green(clr), _color_get_blue(clr) ];
|
return [ _color_get_red(clr), _color_get_green(clr), _color_get_blue(clr) ];
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
|
function paletteToArray(_pal) { #region
|
||||||
|
var _colors = array_create(array_length(_pal) * 4);
|
||||||
|
for(var i = 0; i < array_length(_pal); i++) {
|
||||||
|
_colors[i * 4 + 0] = _color_get_red(_pal[i]);
|
||||||
|
_colors[i * 4 + 1] = _color_get_green(_pal[i]);
|
||||||
|
_colors[i * 4 + 2] = _color_get_blue(_pal[i]);
|
||||||
|
_colors[i * 4 + 3] = _color_get_alpha(_pal[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _colors;
|
||||||
|
} #endregion
|
||||||
|
|
||||||
function colorBrightness(clr, normalize = true) { #region
|
function colorBrightness(clr, normalize = true) { #region
|
||||||
INLINE
|
INLINE
|
||||||
var r2 = color_get_red(clr) / (normalize? 255 : 1);
|
var r2 = color_get_red(clr) / (normalize? 255 : 1);
|
||||||
|
|
|
@ -54,9 +54,9 @@ function get_points_from_dist(distMap, amount, seed = 0, attempt = 8) {
|
||||||
var cc = buffer_read(b, buffer_u32);
|
var cc = buffer_read(b, buffer_u32);
|
||||||
if(cc == 0) pos[i] = 0;
|
if(cc == 0) pos[i] = 0;
|
||||||
else {
|
else {
|
||||||
var _x = color_get_red(cc) / 255;
|
var _x = _color_get_red(cc);
|
||||||
var _y = color_get_green(cc) / 255;
|
var _y = _color_get_green(cc);
|
||||||
var _v = color_get_blue(cc) / 255;
|
var _v = _color_get_blue(cc);
|
||||||
pos[i] = [_x, _y, _v];
|
pos[i] = [_x, _y, _v];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ function getGradientData(gradient, data) {
|
||||||
var _grad_color = [];
|
var _grad_color = [];
|
||||||
var _grad_time = [];
|
var _grad_time = [];
|
||||||
for(var i = 0; i < ds_list_size(gradient); i++) {
|
for(var i = 0; i < ds_list_size(gradient); i++) {
|
||||||
_grad_color[i * 4 + 0] = color_get_red(gradient[| i].value) / 255;
|
_grad_color[i * 4 + 0] = _color_get_red(gradient[| i].value);
|
||||||
_grad_color[i * 4 + 1] = color_get_green(gradient[| i].value) / 255;
|
_grad_color[i * 4 + 1] = _color_get_green(gradient[| i].value);
|
||||||
_grad_color[i * 4 + 2] = color_get_blue(gradient[| i].value) / 255;
|
_grad_color[i * 4 + 2] = _color_get_blue(gradient[| i].value);
|
||||||
_grad_color[i * 4 + 3] = 1;
|
_grad_color[i * 4 + 3] = _color_get_alpha(gradient[| i].value);
|
||||||
_grad_time[i] = gradient[| i].time;
|
_grad_time[i] = gradient[| i].time;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,10 +25,10 @@
|
||||||
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
globalvar VERSION, SAVE_VERSION, VERSION_STRING, BUILD_NUMBER, LATEST_VERSION;
|
||||||
|
|
||||||
LATEST_VERSION = 11600;
|
LATEST_VERSION = 11600;
|
||||||
VERSION = 11620;
|
VERSION = 11630;
|
||||||
SAVE_VERSION = 11620;
|
SAVE_VERSION = 11630;
|
||||||
VERSION_STRING = "1.16.2.0";
|
VERSION_STRING = "1.16.3.0";
|
||||||
BUILD_NUMBER = 11620;
|
BUILD_NUMBER = 11630;
|
||||||
|
|
||||||
globalvar APPEND_MAP;
|
globalvar APPEND_MAP;
|
||||||
APPEND_MAP = ds_map_create();
|
APPEND_MAP = ds_map_create();
|
||||||
|
|
|
@ -162,7 +162,7 @@ function Node_2D_light(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
shader_set_uniform_f(uniform_intn, _inten * _color_get_alpha(_color));
|
shader_set_uniform_f(uniform_intn, _inten * _color_get_alpha(_color));
|
||||||
shader_set_uniform_f(uniform_band, _band);
|
shader_set_uniform_f(uniform_band, _band);
|
||||||
shader_set_uniform_f(uniform_attn, _attn);
|
shader_set_uniform_f(uniform_attn, _attn);
|
||||||
shader_set_uniform_f_array_safe(uniform_colr, [ color_get_red(_color) / 255, color_get_green(_color) / 255, color_get_blue(_color) / 255 ]);
|
shader_set_uniform_f_array_safe(uniform_colr, [ _color_get_red(_color), _color_get_green(_color), _color_get_blue(_color) ]);
|
||||||
|
|
||||||
switch(_shape) {
|
switch(_shape) {
|
||||||
case LIGHT_SHAPE_2D.point :
|
case LIGHT_SHAPE_2D.point :
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Pixel Expand";
|
name = "Pixel Expand";
|
||||||
|
|
||||||
uniform_dim = shader_get_uniform(sh_atlas, "dimension");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
inputs[| 1] = nodeValue("Active", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||||
|
@ -15,17 +13,11 @@ function Node_Atlas(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||||
surface_set_target(_outSurf);
|
|
||||||
DRAW_CLEAR
|
|
||||||
BLEND_OVERRIDE;
|
|
||||||
|
|
||||||
shader_set(sh_atlas);
|
surface_set_shader(_outSurf, sh_atlas);
|
||||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
draw_surface_safe(_data[0]);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "generator",
|
"name": "regions",
|
||||||
"path": "folders/nodes/data/generator.yy",
|
"path": "folders/nodes/data/generator/regions.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -1,13 +1,6 @@
|
||||||
function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Bloom";
|
name = "Bloom";
|
||||||
|
|
||||||
shader = sh_bloom_pass;
|
|
||||||
uniform_size = shader_get_uniform(shader, "size");
|
|
||||||
uniform_tole = shader_get_uniform(shader, "tolerance");
|
|
||||||
|
|
||||||
uniform_umsk = shader_get_uniform(shader, "useMask");
|
|
||||||
uniform_mask = shader_get_sampler_index(shader, "mask");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
inputs[| 1] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3, "Bloom blur radius.")
|
inputs[| 1] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3, "Bloom blur radius.")
|
||||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 1] });
|
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 1] });
|
||||||
|
@ -55,39 +48,26 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _mask = _data[4];
|
var _mask = _data[4];
|
||||||
var pass1 = surface_create_valid(surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf), attrDepth());
|
var pass1 = surface_create_valid(surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf), attrDepth());
|
||||||
|
|
||||||
surface_set_target(pass1);
|
surface_set_shader(pass1, sh_bloom_pass);
|
||||||
draw_clear_alpha(c_black, 1);
|
draw_clear_alpha(c_black, 1);
|
||||||
shader_set(shader);
|
shader_set_f("size", _size);
|
||||||
shader_set_uniform_f(uniform_size, _size);
|
shader_set_f("tolerance", _tole);
|
||||||
shader_set_uniform_f(uniform_tole, _tole);
|
|
||||||
|
|
||||||
shader_set_uniform_i(uniform_umsk, is_surface(_mask));
|
shader_set_i("useMask", is_surface(_mask));
|
||||||
texture_set_stage(uniform_mask, surface_get_texture(_mask));
|
shader_set_surface("mask", _mask);
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
draw_surface_safe(_data[0]);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
var pass1blur = surface_apply_gaussian(pass1, _size, true, c_black, 1);
|
var pass1blur = surface_apply_gaussian(pass1, _size, true, c_black, 1);
|
||||||
surface_free(pass1);
|
surface_free(pass1);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_blend_add_alpha_adj);
|
||||||
DRAW_CLEAR
|
shader_set_surface("fore", pass1blur);
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("opacity", _stre);
|
||||||
|
|
||||||
var uniform_foreground = shader_get_sampler_index(sh_blend_add_alpha_adj, "fore");
|
draw_surface_safe(_data[0]);
|
||||||
var uniform_opacity = shader_get_uniform(sh_blend_add_alpha_adj, "opacity");
|
surface_reset_shader();
|
||||||
|
|
||||||
shader_set(sh_blend_add_alpha_adj);
|
|
||||||
texture_set_stage(uniform_foreground, surface_get_texture(pass1blur));
|
|
||||||
shader_set_uniform_f(uniform_opacity, _stre);
|
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
|
||||||
|
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
|
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
|
||||||
|
|
|
@ -1,16 +1,6 @@
|
||||||
function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Simple blur";
|
name = "Simple blur";
|
||||||
|
|
||||||
shader = sh_blur_simple;
|
|
||||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
|
||||||
uniform_siz = shader_get_uniform(shader, "size");
|
|
||||||
uniform_sam = shader_get_uniform(shader, "sampleMode");
|
|
||||||
|
|
||||||
uniform_umk = shader_get_uniform(shader, "useMask");
|
|
||||||
uniform_msk = shader_get_sampler_index(shader, "mask");
|
|
||||||
uniform_ovr = shader_get_uniform(shader, "overrideColor");
|
|
||||||
uniform_ovc = shader_get_uniform(shader, "overColor");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
inputs[| 1] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
inputs[| 1] = nodeValue("Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
||||||
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 1] });
|
.setDisplay(VALUE_DISPLAY.slider, { range: [1, 32, 1] });
|
||||||
|
@ -63,27 +53,19 @@ function Node_Blur_Simple(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
inputs[| 5].setVisible(_isovr);
|
inputs[| 5].setVisible(_isovr);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_blur_simple);
|
||||||
DRAW_CLEAR
|
shader_set_f("dimension", surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("size", _size);
|
||||||
|
shader_set_i("sampleMode", _samp);
|
||||||
|
|
||||||
shader_set(shader);
|
shader_set_i("overrideColor", _isovr);
|
||||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]));
|
shader_set_color("overColor", _overc);
|
||||||
shader_set_uniform_f(uniform_siz, _size);
|
|
||||||
shader_set_uniform_i(uniform_sam, _samp);
|
|
||||||
|
|
||||||
shader_set_uniform_i(uniform_ovr, _isovr);
|
shader_set_i("useMask", is_surface(_mask));
|
||||||
shader_set_uniform_f_array_safe(uniform_ovc, colToVec4(_overc));
|
shader_set_surface("mask", _mask);
|
||||||
|
|
||||||
shader_set_uniform_i(uniform_umk, is_surface(_mask));
|
draw_surface_safe(_data[0]);
|
||||||
if(is_surface(_mask))
|
surface_reset_shader();
|
||||||
texture_set_stage(uniform_msk, surface_get_texture(_mask));
|
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _msk, _mix);
|
_outSurf = mask_apply(_data[0], _outSurf, _msk, _mix);
|
||||||
|
|
|
@ -28,7 +28,8 @@ function Node_Camera(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Background", true], 0, 4, 3,
|
["Background", true], 0, 4, 3,
|
||||||
["Camera", false], 1, 2, 5, 6, 8, 7,
|
["Camera", false], 1, 2,
|
||||||
|
["Depth Of Field", true, 5], 6, 8, 7,
|
||||||
["Elements", true],
|
["Elements", true],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,8 @@ function Node_HSV_Channel(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Hue", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Hue", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
outputs[| 1] = nodeValue("Saturation", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 1] = nodeValue("Saturation", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
outputs[| 2] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 2] = nodeValue("Value", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
outputs[| 3] = nodeValue("Alpha", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 3] = nodeValue("Alpha", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
|
@ -30,19 +30,19 @@ function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x,
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
attribute_interpolation();
|
attribute_interpolation();
|
||||||
|
|
||||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
||||||
var pos = getInputData(1);
|
var pos = getInputData(1);
|
||||||
var px = _x + pos[0] * _s;
|
var px = _x + pos[0] * _s;
|
||||||
var py = _y + pos[1] * _s;
|
var py = _y + pos[1] * _s;
|
||||||
|
|
||||||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
}
|
} #endregion
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
inputs[| 2].mappableStep();
|
inputs[| 2].mappableStep();
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) { #region
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_chromatic_aberration);
|
surface_set_shader(_outSurf, sh_chromatic_aberration);
|
||||||
shader_set_interpolation(_data[0]);
|
shader_set_interpolation(_data[0]);
|
||||||
|
@ -53,5 +53,5 @@ function Node_Chromatic_Aberration(_x, _y, _group = noone) : Node_Processor(_x,
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
} #endregion
|
||||||
}
|
}
|
|
@ -173,9 +173,9 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
||||||
for( var i = 0, n = array_length(_col); i < n; i++ ) {
|
for( var i = 0, n = array_length(_col); i < n; i++ ) {
|
||||||
var _c = _col[i];
|
var _c = _col[i];
|
||||||
|
|
||||||
var r = color_get_red(_c) / 255;
|
var r = _color_get_red(_c);
|
||||||
var g = color_get_green(_c) / 255;
|
var g = _color_get_green(_c);
|
||||||
var b = color_get_blue(_c) / 255;
|
var b = _color_get_blue(_c);
|
||||||
|
|
||||||
_c = make_color_rgb(
|
_c = make_color_rgb(
|
||||||
clamp((.5 + _con * 2 * (r - .5) + _bri) * _exp, 0, 1) * 255,
|
clamp((.5 + _con * 2 * (r - .5) + _bri) * _exp, 0, 1) * 255,
|
||||||
|
@ -183,9 +183,9 @@ function Node_Color_adjust(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
||||||
clamp((.5 + _con * 2 * (b - .5) + _bri) * _exp, 0, 1) * 255,
|
clamp((.5 + _con * 2 * (b - .5) + _bri) * _exp, 0, 1) * 255,
|
||||||
);
|
);
|
||||||
|
|
||||||
var h = color_get_hue(_c) / 255;
|
var h = _color_get_hue(_c);
|
||||||
var s = color_get_saturation(_c) / 255;
|
var s = _color_get_saturation(_c);
|
||||||
var v = color_get_value(_c) / 255;
|
var v = _color_get_value(_c);
|
||||||
|
|
||||||
h = clamp(frac(h + _hue), -1, 1);
|
h = clamp(frac(h + _hue), -1, 1);
|
||||||
if(h < 0) h = 1 + h;
|
if(h < 0) h = 1 + h;
|
||||||
|
|
|
@ -9,7 +9,7 @@ function Node_Color_Mix(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
inputs[| 2] = nodeValue("Mix", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
inputs[| 2] = nodeValue("Mix", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||||
.setDisplay(VALUE_DISPLAY.slider);
|
.setDisplay(VALUE_DISPLAY.slider);
|
||||||
|
|
||||||
inputs[| 3] = nodeValue("Mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 3] = nodeValue("Color space", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "RGB", "HSV" ]);
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "RGB", "HSV" ]);
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
outputs[| 0] = nodeValue("Color", self, JUNCTION_CONNECT.output, VALUE_TYPE.color, c_white);
|
||||||
|
|
|
@ -54,21 +54,8 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
var hrd = _data[6];
|
var hrd = _data[6];
|
||||||
var msk = _data[7];
|
var msk = _data[7];
|
||||||
|
|
||||||
var _colorFrom = array_create(array_length(fr) * 4);
|
var _colorFrom = paletteToArray(fr);
|
||||||
for(var i = 0; i < array_length(fr); i++) {
|
var _colorTo = paletteToArray(to);
|
||||||
_colorFrom[i * 4 + 0] = _color_get_red(fr[i]);
|
|
||||||
_colorFrom[i * 4 + 1] = _color_get_green(fr[i]);
|
|
||||||
_colorFrom[i * 4 + 2] = _color_get_blue(fr[i]);
|
|
||||||
_colorFrom[i * 4 + 3] = _color_get_alpha(fr[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
var _colorTo = array_create(array_length(to) * 4);
|
|
||||||
for(var i = 0; i < array_length(to); i++) {
|
|
||||||
_colorTo[i * 4 + 0] = _color_get_red(to[i]);
|
|
||||||
_colorTo[i * 4 + 1] = _color_get_green(to[i]);
|
|
||||||
_colorTo[i * 4 + 2] = _color_get_blue(to[i]);
|
|
||||||
_colorTo[i * 4 + 3] = _color_get_alpha(to[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_palette_replace);
|
surface_set_shader(_outSurf, sh_palette_replace);
|
||||||
shader_set_f("colorFrom", _colorFrom);
|
shader_set_f("colorFrom", _colorFrom);
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Convolution";
|
name = "Convolution";
|
||||||
|
|
||||||
shader = sh_convolution;
|
|
||||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
|
||||||
uniform_ker = shader_get_uniform(shader, "kernel");
|
|
||||||
uniform_sam = shader_get_uniform(shader, "sampleMode");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Kernel", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, array_create(9))
|
inputs[| 1] = nodeValue("Kernel", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, array_create(9))
|
||||||
|
@ -45,19 +40,13 @@ function Node_Convolution(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
var _ker = _data[1];
|
var _ker = _data[1];
|
||||||
var _sam = struct_try_get(attributes, "oversample");
|
var _sam = struct_try_get(attributes, "oversample");
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_convolution);
|
||||||
DRAW_CLEAR
|
shader_set_f("dimension", surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("kernel", _ker);
|
||||||
|
shader_set_i("sampleMode", _sam);
|
||||||
|
|
||||||
shader_set(shader);
|
draw_surface_safe(_data[0]);
|
||||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_outSurf), surface_get_height_safe(_outSurf));
|
surface_reset_shader();
|
||||||
shader_set_uniform_f_array_safe(uniform_ker, _ker);
|
|
||||||
shader_set_uniform_i(uniform_sam, _sam);
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
|
_outSurf = mask_apply(_data[0], _outSurf, _data[3], _data[4]);
|
||||||
|
|
|
@ -1,12 +1,6 @@
|
||||||
function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Round corner";
|
name = "Round corner";
|
||||||
|
|
||||||
uniform_er_dim = shader_get_uniform(sh_corner_erode, "dimension");
|
|
||||||
uniform_er_size = shader_get_uniform(sh_corner_erode, "size");
|
|
||||||
|
|
||||||
uniform_dim = shader_get_uniform(sh_corner, "dimension");
|
|
||||||
uniform_rad = shader_get_uniform(sh_corner, "rad");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 2)
|
inputs[| 1] = nodeValue("Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 2)
|
||||||
|
@ -43,32 +37,21 @@ function Node_Corner(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
|
|
||||||
var temp = surface_create_valid(surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]), attrDepth());
|
var temp = surface_create_valid(surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]), attrDepth());
|
||||||
|
|
||||||
surface_set_target(temp);
|
surface_set_shader(temp, sh_corner_erode);
|
||||||
DRAW_CLEAR
|
shader_set_f("dimension", [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("size", wd);
|
||||||
|
|
||||||
shader_set(sh_corner_erode);
|
draw_surface_safe(_data[0]);
|
||||||
shader_set_uniform_f_array_safe(uniform_er_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
surface_reset_shader();
|
||||||
shader_set_uniform_f(uniform_er_size, wd);
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
surface_set_shader(_outSurf, sh_corner);
|
||||||
shader_reset();
|
shader_set_f("dimension", [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
||||||
surface_reset_target();
|
shader_set_f("rad", wd);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
|
||||||
DRAW_CLEAR
|
|
||||||
BLEND_OVERRIDE;
|
|
||||||
|
|
||||||
shader_set(sh_corner);
|
|
||||||
shader_set_uniform_f_array_safe(uniform_dim, [surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0])]);
|
|
||||||
shader_set_uniform_f(uniform_rad, wd);
|
|
||||||
shader_set_surface("original", _data[0]);
|
shader_set_surface("original", _data[0]);
|
||||||
draw_surface_safe(temp, 0, 0);
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
draw_surface_safe(temp);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
surface_reset_target();
|
|
||||||
surface_free(temp);
|
surface_free(temp);
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
|
|
|
@ -1,19 +1,6 @@
|
||||||
function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Curve";
|
name = "Curve";
|
||||||
|
|
||||||
shader = sh_curve;
|
|
||||||
uniform_wcur = shader_get_uniform(shader, "w_curve");
|
|
||||||
uniform_wamo = shader_get_uniform(shader, "w_amount");
|
|
||||||
|
|
||||||
uniform_rcur = shader_get_uniform(shader, "r_curve");
|
|
||||||
uniform_ramo = shader_get_uniform(shader, "r_amount");
|
|
||||||
|
|
||||||
uniform_gcur = shader_get_uniform(shader, "g_curve");
|
|
||||||
uniform_gamo = shader_get_uniform(shader, "g_amount");
|
|
||||||
|
|
||||||
uniform_bcur = shader_get_uniform(shader, "b_curve");
|
|
||||||
uniform_bamo = shader_get_uniform(shader, "b_amount");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Brightness", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01);
|
inputs[| 1] = nodeValue("Brightness", self, JUNCTION_CONNECT.input, VALUE_TYPE.curve, CURVE_DEF_01);
|
||||||
|
@ -56,25 +43,21 @@ function Node_Curve(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _gcur = _data[3];
|
var _gcur = _data[3];
|
||||||
var _bcur = _data[4];
|
var _bcur = _data[4];
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_curve);
|
||||||
DRAW_CLEAR
|
shader_set_f("w_curve", _wcur);
|
||||||
BLEND_OVERRIDE;
|
shader_set_i("w_amount", array_length(_wcur));
|
||||||
|
|
||||||
shader_set(shader);
|
shader_set_f("r_curve", _rcur);
|
||||||
shader_set_uniform_f_array_safe(uniform_wcur, _wcur);
|
shader_set_i("r_amount", array_length(_rcur));
|
||||||
shader_set_uniform_i(uniform_wamo, array_length(_wcur));
|
|
||||||
shader_set_uniform_f_array_safe(uniform_rcur, _rcur);
|
|
||||||
shader_set_uniform_i(uniform_ramo, array_length(_rcur));
|
|
||||||
shader_set_uniform_f_array_safe(uniform_gcur, _gcur);
|
|
||||||
shader_set_uniform_i(uniform_gamo, array_length(_gcur));
|
|
||||||
shader_set_uniform_f_array_safe(uniform_bcur, _bcur);
|
|
||||||
shader_set_uniform_i(uniform_bamo, array_length(_bcur));
|
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
shader_set_f("g_curve", _gcur);
|
||||||
shader_reset();
|
shader_set_i("g_amount", array_length(_gcur));
|
||||||
|
|
||||||
BLEND_NORMAL;
|
shader_set_f("b_curve", _bcur);
|
||||||
surface_reset_target();
|
shader_set_i("b_amount", array_length(_bcur));
|
||||||
|
|
||||||
|
draw_surface_safe(_data[0]);
|
||||||
|
surface_reset_shader();
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
|
_outSurf = mask_apply(_data[0], _outSurf, _data[5], _data[6]);
|
||||||
|
|
|
@ -17,6 +17,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
name = "Dither";
|
name = "Dither";
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Palette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE )
|
inputs[| 1] = nodeValue("Palette", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, DEF_PALETTE )
|
||||||
.setDisplay(VALUE_DISPLAY.palette);
|
.setDisplay(VALUE_DISPLAY.palette);
|
||||||
|
|
||||||
|
@ -67,16 +68,9 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
var _map = _data[3];
|
var _map = _data[3];
|
||||||
var _con = _data[4];
|
var _con = _data[4];
|
||||||
var _conMap = _data[5];
|
var _conMap = _data[5];
|
||||||
|
|
||||||
var _mode = _data[6];
|
var _mode = _data[6];
|
||||||
|
|
||||||
var _colors = array_create(array_length(_pal) * 4);
|
var _colors = paletteToArray(_pal);
|
||||||
for(var i = 0; i < array_length(_pal); i++) {
|
|
||||||
_colors[i * 4 + 0] = color_get_red(_pal[i]) / 255;
|
|
||||||
_colors[i * 4 + 1] = color_get_green(_pal[i]) / 255;
|
|
||||||
_colors[i * 4 + 2] = color_get_blue(_pal[i]) / 255;
|
|
||||||
_colors[i * 4 + 3] = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
shader = _mode? sh_alpha_hash : sh_dither;
|
shader = _mode? sh_alpha_hash : sh_dither;
|
||||||
uniform_dither_size = shader_get_uniform(shader, "ditherSize");
|
uniform_dither_size = shader_get_uniform(shader, "ditherSize");
|
||||||
|
@ -100,12 +94,7 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
inputs[| 4].setVisible(_mode == 0);
|
inputs[| 4].setVisible(_mode == 0);
|
||||||
inputs[| 5].setVisible(_mode == 0);
|
inputs[| 5].setVisible(_mode == 0);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, shader);
|
||||||
DRAW_CLEAR
|
|
||||||
BLEND_OVERRIDE;
|
|
||||||
|
|
||||||
shader_set(shader);
|
|
||||||
|
|
||||||
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ] );
|
shader_set_uniform_f_array_safe(uniform_dim, [ surface_get_width_safe(_data[0]), surface_get_height_safe(_data[0]) ] );
|
||||||
|
|
||||||
switch(_typ) {
|
switch(_typ) {
|
||||||
|
@ -142,11 +131,8 @@ function Node_Dither(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
shader_set_uniform_i(uniform_key, array_length(_pal));
|
shader_set_uniform_i(uniform_key, array_length(_pal));
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
draw_surface_safe(_data[0]);
|
||||||
shader_reset();
|
surface_reset_shader();
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _data[7], _data[8]);
|
_outSurf = mask_apply(_data[0], _outSurf, _data[7], _data[8]);
|
||||||
|
|
|
@ -32,9 +32,9 @@ function Node_Find_Pixel(_x, _y, _group = noone) : Node_Processor(_x, _y, _group
|
||||||
buffer_seek(_buff, buffer_seek_start, 0);
|
buffer_seek(_buff, buffer_seek_start, 0);
|
||||||
|
|
||||||
var res = [];
|
var res = [];
|
||||||
var r = color_get_red(_col) / 255;
|
var r = _color_get_red(_col);
|
||||||
var g = color_get_green(_col) / 255;
|
var g = _color_get_green(_col);
|
||||||
var b = color_get_blue(_col) / 255;
|
var b = _color_get_blue(_col);
|
||||||
|
|
||||||
for( var i = 0; i < _sh; i++ )
|
for( var i = 0; i < _sh; i++ )
|
||||||
for( var j = 0; j < _sw; j++ ) {
|
for( var j = 0; j < _sw; j++ ) {
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "generator",
|
"name": "regions",
|
||||||
"path": "folders/nodes/data/generator.yy",
|
"path": "folders/nodes/data/generator/regions.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -4,7 +4,7 @@ function Node_Gradient(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF )
|
inputs[| 0] = nodeValue("Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, DEF_SURF )
|
||||||
.setDisplay(VALUE_DISPLAY.vector);
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ cola(c_black), cola(c_white) ]) );
|
inputs[| 1] = nodeValue("Gradient", self, JUNCTION_CONNECT.input, VALUE_TYPE.gradient, new gradientObject([ c_black, c_white ]) );
|
||||||
|
|
||||||
inputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
inputs[| 2] = nodeValue("Type", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Circular", "Radial" ]);
|
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Linear", "Circular", "Radial" ]);
|
||||||
|
|
|
@ -72,7 +72,8 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Image", false], 0, 1, 8,
|
["Image", false], 0, 1, 8,
|
||||||
["Animation", false], 5, 4, 6, 7, 2, 3,
|
["Animation", false], 5, 4, 2, 3,
|
||||||
|
["Custom Frame Order", false, 6], 7,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -152,7 +153,6 @@ function Node_Image_Animated(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
var str = getInputData(2);
|
var str = getInputData(2);
|
||||||
var _cus = getInputData(6);
|
var _cus = getInputData(6);
|
||||||
|
|
||||||
inputs[| 7].setVisible( _cus);
|
|
||||||
inputs[| 2].setVisible(!_cus);
|
inputs[| 2].setVisible(!_cus);
|
||||||
inputs[| 3].setVisible(!_cus && !str);
|
inputs[| 3].setVisible(!_cus && !str);
|
||||||
inputs[| 4].setVisible(!_cus && !str);
|
inputs[| 4].setVisible(!_cus && !str);
|
||||||
|
|
|
@ -60,7 +60,8 @@ function Node_Image_gif(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Image", false], 0,
|
["Image", false], 0,
|
||||||
["Output", false], 2,
|
["Output", false], 2,
|
||||||
["Animation", false], 1, 3, 5, 4, 6, 7,
|
["Animation", false], 1, 3, 4, 7,
|
||||||
|
["Custom Frame Order", false, 5], 6,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
|
@ -68,7 +68,8 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Sprite", false], 0, 1, 6,
|
["Sprite", false], 0, 1, 6,
|
||||||
["Sheet", false], 3, 10, 9, 4, 5,
|
["Sheet", false], 3, 10, 9, 4, 5,
|
||||||
["Output", false], 7, 8, 12, 13, 14, 11
|
["Output", false], 7, 8, 11,
|
||||||
|
["Filter Empty", true, 12], 13, 14,
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
@ -278,13 +279,11 @@ function Node_Image_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) constru
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
var _out = getInputData(7);
|
var _out = getInputData(7);
|
||||||
var _filt = getInputData(12);
|
|
||||||
var _flty = getInputData(13);
|
var _flty = getInputData(13);
|
||||||
|
|
||||||
inputs[| 11].setVisible(!_out);
|
inputs[| 11].setVisible(!_out);
|
||||||
inputs[| 8].setVisible(!_out);
|
inputs[| 8].setVisible(!_out);
|
||||||
inputs[| 13].setVisible(_filt);
|
inputs[| 14].setVisible(_flty);
|
||||||
inputs[| 14].setVisible(_filt && _flty);
|
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static spliceSprite = function() { #region
|
static spliceSprite = function() { #region
|
||||||
|
|
|
@ -1,18 +1,6 @@
|
||||||
function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Level";
|
name = "Level";
|
||||||
|
|
||||||
shader = sh_level;
|
|
||||||
uniform_wmin = shader_get_uniform(shader, "wmin");
|
|
||||||
uniform_wmax = shader_get_uniform(shader, "wmax");
|
|
||||||
uniform_rmin = shader_get_uniform(shader, "rmin");
|
|
||||||
uniform_rmax = shader_get_uniform(shader, "rmax");
|
|
||||||
uniform_gmin = shader_get_uniform(shader, "gmin");
|
|
||||||
uniform_gmax = shader_get_uniform(shader, "gmax");
|
|
||||||
uniform_bmin = shader_get_uniform(shader, "bmin");
|
|
||||||
uniform_bmax = shader_get_uniform(shader, "bmax");
|
|
||||||
uniform_amin = shader_get_uniform(shader, "amin");
|
|
||||||
uniform_amax = shader_get_uniform(shader, "amax");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("White", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 1])
|
inputs[| 1] = nodeValue("White", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [0, 1])
|
||||||
|
@ -117,27 +105,20 @@ function Node_Level(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _amin = min(_data[5][0], _data[5][1]);
|
var _amin = min(_data[5][0], _data[5][1]);
|
||||||
var _amax = max(_data[5][0], _data[5][1]);
|
var _amax = max(_data[5][0], _data[5][1]);
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_level);
|
||||||
DRAW_CLEAR
|
shader_set_f("wmin", _wmin);
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("wmax", _wmax);
|
||||||
|
shader_set_f("rmin", _rmin);
|
||||||
|
shader_set_f("rmax", _rmax);
|
||||||
|
shader_set_f("gmin", _gmin);
|
||||||
|
shader_set_f("gmax", _gmax);
|
||||||
|
shader_set_f("bmin", _bmin);
|
||||||
|
shader_set_f("bmax", _bmax);
|
||||||
|
shader_set_f("amin", _amin);
|
||||||
|
shader_set_f("amax", _amax);
|
||||||
|
|
||||||
shader_set(shader);
|
draw_surface_safe(_data[0]);
|
||||||
shader_set_uniform_f(uniform_wmin, _wmin);
|
surface_reset_shader();
|
||||||
shader_set_uniform_f(uniform_wmax, _wmax);
|
|
||||||
shader_set_uniform_f(uniform_rmin, _rmin);
|
|
||||||
shader_set_uniform_f(uniform_rmax, _rmax);
|
|
||||||
shader_set_uniform_f(uniform_gmin, _gmin);
|
|
||||||
shader_set_uniform_f(uniform_gmax, _gmax);
|
|
||||||
shader_set_uniform_f(uniform_bmin, _bmin);
|
|
||||||
shader_set_uniform_f(uniform_bmax, _bmax);
|
|
||||||
shader_set_uniform_f(uniform_amin, _amin);
|
|
||||||
shader_set_uniform_f(uniform_amax, _amax);
|
|
||||||
|
|
||||||
draw_surface_safe(_data[0], 0, 0);
|
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_data[0], _outSurf, _data[6], _data[7]);
|
_outSurf = mask_apply(_data[0], _outSurf, _data[6], _data[7]);
|
||||||
|
|
|
@ -305,14 +305,14 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
_pntData = points[pointAmo];
|
_pntData = points[pointAmo];
|
||||||
_pntData.x = _nx;
|
_pntData.x = _nx;
|
||||||
_pntData.y = _ny;
|
_pntData.y = _ny;
|
||||||
_pntData.prog = _prog_total / _pathEnd;
|
_pntData.prog = (_prog_total - _pathStr) / (_pathEnd - _pathStr);
|
||||||
_pntData.progCrop = _prog_curr / _pathLength;
|
_pntData.progCrop = _prog_curr / _pathLength;
|
||||||
_pntData.weight = wght;
|
_pntData.weight = wght;
|
||||||
} else {
|
} else {
|
||||||
_pntData = {
|
_pntData = {
|
||||||
x: _nx,
|
x: _nx,
|
||||||
y: _ny,
|
y: _ny,
|
||||||
prog: _prog_total / _pathEnd,
|
prog: (_prog_total - _pathStr) / (_pathEnd - _pathStr),
|
||||||
progCrop: _prog_curr / _pathLength,
|
progCrop: _prog_curr / _pathLength,
|
||||||
weight: wght
|
weight: wght
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,17 +54,16 @@ function Node_Outline(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) c
|
||||||
input_display_list = [ 11,
|
input_display_list = [ 11,
|
||||||
["Surfaces", true], 0, 9, 10, 13, 14,
|
["Surfaces", true], 0, 9, 10, 13, 14,
|
||||||
["Outline", false], 1, 15, 5, 8, 17, 12,
|
["Outline", false], 1, 15, 5, 8, 17, 12,
|
||||||
["Render", false], 2, 3, 4, 16, 6,
|
["Render", false], 2, 6,
|
||||||
|
["Blend", true, 3], 4, 16,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
attribute_oversample();
|
attribute_oversample();
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
var blend = getInputData(3);
|
|
||||||
var _side = getInputData(5);
|
var _side = getInputData(5);
|
||||||
|
|
||||||
inputs[| 4].setVisible(blend);
|
|
||||||
inputs[| 12].setVisible(_side == 0);
|
inputs[| 12].setVisible(_side == 0);
|
||||||
|
|
||||||
__step_mask_modifier();
|
__step_mask_modifier();
|
||||||
|
|
|
@ -35,28 +35,28 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
||||||
|
|
||||||
function sortPalette(pal) { #region
|
function sortPalette(pal) { #region
|
||||||
array_sort(pal, function(c0, c1) {
|
array_sort(pal, function(c0, c1) {
|
||||||
var r0 = color_get_red(c0) / 255;
|
var r0 = _color_get_red(c0);
|
||||||
var r1 = color_get_red(c1) / 255;
|
var r1 = _color_get_red(c1);
|
||||||
var g0 = color_get_green(c0) / 255;
|
var g0 = _color_get_green(c0);
|
||||||
var g1 = color_get_green(c1) / 255;
|
var g1 = _color_get_green(c1);
|
||||||
var b0 = color_get_blue(c0) / 255;
|
var b0 = _color_get_blue(c0);
|
||||||
var b1 = color_get_blue(c1) / 255;
|
var b1 = _color_get_blue(c1);
|
||||||
|
|
||||||
var l0 = sqrt( .241 * r0 + .691 * g0 + .068 * b0 );
|
var l0 = sqrt( .241 * r0 + .691 * g0 + .068 * b0 );
|
||||||
var l1 = sqrt( .241 * r1 + .691 * g1 + .068 * b1 );
|
var l1 = sqrt( .241 * r1 + .691 * g1 + .068 * b1 );
|
||||||
|
|
||||||
if(abs(l0 - l1) > 0.05) return l0 > l1;
|
if(abs(l0 - l1) > 0.05) return l0 > l1;
|
||||||
|
|
||||||
var h0 = color_get_hue(c0) / 255;
|
var h0 = _color_get_hue(c0);
|
||||||
var h1 = color_get_hue(c1) / 255;
|
var h1 = _color_get_hue(c1);
|
||||||
|
|
||||||
if(abs(h0 - h1) > 0.05) return h0 > h1;
|
if(abs(h0 - h1) > 0.05) return h0 > h1;
|
||||||
|
|
||||||
var s0 = color_get_saturation(c0) / 255;
|
var s0 = _color_get_saturation(c0);
|
||||||
var s1 = color_get_saturation(c1) / 255;
|
var s1 = _color_get_saturation(c1);
|
||||||
|
|
||||||
var v0 = color_get_value(c0) / 255;
|
var v0 = _color_get_value(c0);
|
||||||
var v1 = color_get_value(c1) / 255;
|
var v1 = _color_get_value(c1);
|
||||||
|
|
||||||
return s0 * v0 > s1 * v1;
|
return s0 * v0 > s1 * v1;
|
||||||
})
|
})
|
||||||
|
@ -91,9 +91,9 @@ function Node_Palette_Extract(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
||||||
if(a == 0) continue;
|
if(a == 0) continue;
|
||||||
|
|
||||||
switch(_space) {
|
switch(_space) {
|
||||||
case 0 : col = [ color_get_red(c) / 255, color_get_green(c) / 255, color_get_blue(c) / 255, 0 ]; break;
|
case 0 : col = [ _color_get_red(c), _color_get_green(c), _color_get_blue(c), 0 ]; break;
|
||||||
case 1 : col = [ color_get_hue(c) / 255, color_get_saturation(c) / 255, color_get_value(c) / 255, 0 ]; break;
|
case 1 : col = [ _color_get_hue(c), _color_get_saturation(c), _color_get_value(c), 0 ]; break;
|
||||||
case 2 : col = [ color_get_hue(c) / 255, color_get_saturation(c) / 255, color_get_value(c) / 255, 0 ]; break;
|
case 2 : col = [ _color_get_hue(c), _color_get_saturation(c), _color_get_value(c), 0 ]; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
array_push(colors, col);
|
array_push(colors, col);
|
||||||
|
|
|
@ -26,9 +26,9 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
input_display_list = [ 5,
|
input_display_list = [ 5, 0,
|
||||||
["Effect settings", false], 0, 2, 1, 6,
|
["Palette", false, 2], 1, 3, 4, 7,
|
||||||
["Auto color", false], 3, 4, 7,
|
["Alpha", false, 6],
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||||
|
@ -50,13 +50,7 @@ function Node_Posterize(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
var _alp = _data[6];
|
var _alp = _data[6];
|
||||||
|
|
||||||
if(_use_gra) {
|
if(_use_gra) {
|
||||||
var _colors = array_create(array_length(_gra) * 4);
|
var _colors = paletteToArray(_gra);
|
||||||
for(var i = 0; i < array_length(_gra); i++) {
|
|
||||||
_colors[i * 4 + 0] = _color_get_red(_gra[i]);
|
|
||||||
_colors[i * 4 + 1] = _color_get_green(_gra[i]);
|
|
||||||
_colors[i * 4 + 2] = _color_get_blue(_gra[i]);
|
|
||||||
_colors[i * 4 + 3] = _color_get_alpha(_gra[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_posterize_palette);
|
surface_set_shader(_outSurf, sh_posterize_palette);
|
||||||
shader_set_f("palette", _colors);
|
shader_set_f("palette", _colors);
|
||||||
|
|
|
@ -16,17 +16,12 @@ function Node_Region_Fill(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Surfaces", false], 0, 1,
|
["Surfaces", false], 0, 1,
|
||||||
["Fill", false], 3, 4, 2,
|
["Fill", false, 3], 4, 2,
|
||||||
];
|
];
|
||||||
|
|
||||||
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
|
temp_surface = [ surface_create(1, 1), surface_create(1, 1) ];
|
||||||
|
|
||||||
static step = function() {
|
static step = function() {}
|
||||||
var _fill = getInputData(3);
|
|
||||||
|
|
||||||
inputs[| 2].setVisible(_fill);
|
|
||||||
inputs[| 4].setVisible(_fill);
|
|
||||||
}
|
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||||
var _surf = _data[0];
|
var _surf = _data[0];
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "generator",
|
"name": "regions",
|
||||||
"path": "folders/nodes/data/generator.yy",
|
"path": "folders/nodes/data/generator/regions.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -42,7 +42,7 @@ function Node_Scatter_Points(_x, _y, _group = noone) : Node(_x, _y, _group) cons
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Base", false], 5, 6, 7,
|
["Base", false], 5, 6, 7,
|
||||||
["Scatter", false], 0, 1, 4, 2, 3,
|
["Scatter", false], 0, 1, 4, 2, 3,
|
||||||
["3D", true], 9, 10, 11
|
["3D", true, 9], 10, 11
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs[| 0] = nodeValue("Points", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [ ])
|
outputs[| 0] = nodeValue("Points", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, [ ])
|
||||||
|
|
|
@ -1,31 +1,6 @@
|
||||||
function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||||
name = "Cast Shadow";
|
name = "Cast Shadow";
|
||||||
|
|
||||||
shader = sh_shadow_cast;
|
|
||||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
|
||||||
uniform_lpos = shader_get_uniform(shader, "lightPos");
|
|
||||||
uniform_prad = shader_get_uniform(shader, "pointLightRadius");
|
|
||||||
uniform_lrad = shader_get_uniform(shader, "lightRadius");
|
|
||||||
uniform_lden = shader_get_uniform(shader, "lightDensity");
|
|
||||||
uniform_ltyp = shader_get_uniform(shader, "lightType");
|
|
||||||
uniform_lamb = shader_get_uniform(shader, "lightAmb");
|
|
||||||
uniform_lclr = shader_get_uniform(shader, "lightClr");
|
|
||||||
uniform_lint = shader_get_uniform(shader, "lightInt");
|
|
||||||
uniform_sol = shader_get_uniform(shader, "renderSolid");
|
|
||||||
|
|
||||||
uniform_band = shader_get_uniform(shader, "lightBand");
|
|
||||||
uniform_attn = shader_get_uniform(shader, "lightAttn");
|
|
||||||
|
|
||||||
uniform_ao = shader_get_uniform(shader, "ao");
|
|
||||||
uniform_ao_str = shader_get_uniform(shader, "aoStr");
|
|
||||||
|
|
||||||
uniform_bg_use = shader_get_uniform(shader, "bgUse");
|
|
||||||
uniform_bg_thr = shader_get_uniform(shader, "bgThres");
|
|
||||||
uniform_mask = shader_get_uniform(shader, "mask");
|
|
||||||
|
|
||||||
uniform_sld_use = shader_get_uniform(shader, "useSolid");
|
|
||||||
uniform_solid = shader_get_sampler_index(shader, "solid");
|
|
||||||
|
|
||||||
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 0] = nodeValue("Background", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
|
||||||
inputs[| 1] = nodeValue("Solid", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
inputs[| 1] = nodeValue("Solid", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||||
|
@ -93,8 +68,9 @@ function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
input_display_list = [ 17,
|
input_display_list = [ 17,
|
||||||
["Surfaces", true], 0, 1,
|
["Surfaces", true], 0, 1,
|
||||||
["Light", false], 5, 12, 8, 2, 3, 4,
|
["Light", false], 5, 12, 8, 2, 3, 4,
|
||||||
["Shadow caster", false], 10, 11,
|
["BG Shadow Caster", true, 10], 11,
|
||||||
["Render", false], 13, 14, 7, 6, 9, 15, 16,
|
["Render", false], 13, 14, 7, 6, 9,
|
||||||
|
["Ambient Occlusion", false], 15, 16,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -138,39 +114,31 @@ function Node_Shadow_Cast(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
if(!is_surface(_bg)) return _outSurf;
|
if(!is_surface(_bg)) return _outSurf;
|
||||||
|
|
||||||
surface_set_target(_outSurf);
|
surface_set_shader(_outSurf, sh_shadow_cast);
|
||||||
DRAW_CLEAR
|
shader_set_f("dimension", surface_get_width_safe(_bg), surface_get_height_safe(_bg));
|
||||||
BLEND_OVERRIDE;
|
shader_set_f("lightPos", _pos);
|
||||||
|
shader_set_color("lightAmb", _lamb);
|
||||||
|
shader_set_color("lightClr", _lclr);
|
||||||
|
shader_set_f("lightRadius", _rad);
|
||||||
|
shader_set_f("pointLightRadius", _lrad);
|
||||||
|
shader_set_f("lightDensity", _den);
|
||||||
|
shader_set_i("lightType", _type);
|
||||||
|
shader_set_i("renderSolid", _sol);
|
||||||
|
shader_set_f("lightInt", _int);
|
||||||
|
shader_set_f("lightBand", _band);
|
||||||
|
shader_set_f("lightAttn", _attn);
|
||||||
|
shader_set_f("ao", _ao);
|
||||||
|
shader_set_f("aoStr", _ao_str);
|
||||||
|
|
||||||
shader_set(shader);
|
shader_set_i("mask", _output_index);
|
||||||
shader_set_uniform_f(uniform_dim, surface_get_width_safe(_bg), surface_get_height_safe(_bg));
|
shader_set_i("bgUse", _bg_use);
|
||||||
shader_set_uniform_f_array_safe(uniform_lpos, _pos);
|
shader_set_f("bgThres", _bg_thr);
|
||||||
shader_set_uniform_f_array_safe(uniform_lamb, colToVec4(_lamb));
|
|
||||||
shader_set_uniform_f_array_safe(uniform_lclr, colToVec4(_lclr));
|
|
||||||
shader_set_uniform_f(uniform_lrad, _rad);
|
|
||||||
shader_set_uniform_f(uniform_prad, _lrad);
|
|
||||||
shader_set_uniform_f(uniform_lden, _den);
|
|
||||||
shader_set_uniform_i(uniform_ltyp, _type);
|
|
||||||
shader_set_uniform_i(uniform_sol, _sol);
|
|
||||||
shader_set_uniform_f(uniform_lint, _int);
|
|
||||||
shader_set_uniform_f(uniform_band, _band);
|
|
||||||
shader_set_uniform_f(uniform_attn, _attn);
|
|
||||||
shader_set_uniform_f(uniform_ao, _ao);
|
|
||||||
shader_set_uniform_f(uniform_ao_str, _ao_str);
|
|
||||||
|
|
||||||
shader_set_uniform_i(uniform_mask, _output_index);
|
shader_set_i("useSolid", is_surface(_solid));
|
||||||
shader_set_uniform_i(uniform_bg_use, _bg_use);
|
shader_set_surface("solid", _solid);
|
||||||
shader_set_uniform_f(uniform_bg_thr, _bg_thr);
|
|
||||||
|
|
||||||
shader_set_uniform_i(uniform_sld_use, is_surface(_solid));
|
draw_surface_safe(_bg);
|
||||||
if(is_surface(_solid))
|
surface_reset_shader();
|
||||||
texture_set_stage(uniform_solid, surface_get_texture(_solid));
|
|
||||||
|
|
||||||
draw_surface_safe(_bg, 0, 0);
|
|
||||||
shader_reset();
|
|
||||||
|
|
||||||
BLEND_NORMAL;
|
|
||||||
surface_reset_target();
|
|
||||||
|
|
||||||
return _outSurf;
|
return _outSurf;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,8 @@ function Node_Stripe(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", true], 0,
|
["Output", true], 0,
|
||||||
["Pattern", false], 1, 11, 10, 14, 2, 12, 4, 5, 13,
|
["Pattern", false], 1, 11, 10, 14, 2, 12, 4, 5, 13,
|
||||||
["Render", false], 6, 7, 8, 9, 3
|
["Render", false], 3,
|
||||||
|
["Random Colors", false, 6], 7, 8, 9,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
"isCompatibility": false,
|
"isCompatibility": false,
|
||||||
"isDnD": false,
|
"isDnD": false,
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "value",
|
"name": "surface",
|
||||||
"path": "folders/nodes/data/value.yy",
|
"path": "folders/nodes/data/value/surface.yy",
|
||||||
},
|
},
|
||||||
}
|
}
|
|
@ -46,20 +46,13 @@ function Node_Threshold(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
input_display_list = [ 6, 10,
|
input_display_list = [ 6, 10,
|
||||||
["Surfaces", true], 0, 4, 5, 11, 12,
|
["Surfaces", true], 0, 4, 5, 11, 12,
|
||||||
["Threshold", false], 1, 2, 13, 3, 7, 8, 14, 9,
|
["Brightness", true, 1], 2, 13, 3,
|
||||||
|
["Alpha", true, 7], 8, 14, 9,
|
||||||
];
|
];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() { #region
|
||||||
var _bright = getInputData(1);
|
|
||||||
inputs[| 2].setVisible(_bright);
|
|
||||||
inputs[| 3].setVisible(_bright);
|
|
||||||
|
|
||||||
var _alpha = getInputData(7);
|
|
||||||
inputs[| 8].setVisible(_alpha);
|
|
||||||
inputs[| 9].setVisible(_alpha);
|
|
||||||
|
|
||||||
__step_mask_modifier();
|
__step_mask_modifier();
|
||||||
|
|
||||||
inputs[| 2].mappableStep();
|
inputs[| 2].mappableStep();
|
||||||
|
|
|
@ -122,13 +122,13 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
shader_set_f("alphaPrev", a0);
|
shader_set_f("alphaPrev", a0);
|
||||||
shader_set_f("alphaCurr", a1);
|
shader_set_f("alphaCurr", a1);
|
||||||
|
|
||||||
shader_set_i("mode", 1);
|
|
||||||
surface_set_target(temp_surface[0]);
|
surface_set_target(temp_surface[0]);
|
||||||
|
shader_set_i("mode", 1);
|
||||||
draw_surface_safe(_currFrame);
|
draw_surface_safe(_currFrame);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
shader_set_i("mode", 0);
|
|
||||||
surface_set_target(temp_surface[2]);
|
surface_set_target(temp_surface[2]);
|
||||||
|
shader_set_i("mode", 0);
|
||||||
draw_surface_safe(_currFrame);
|
draw_surface_safe(_currFrame);
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
|
@ -138,16 +138,16 @@ function Node_Trail(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
surface_set_target(temp_surface[1]);
|
surface_set_target(temp_surface[1]);
|
||||||
shader_set(sh_trail_filler_pass2);
|
shader_set(sh_trail_filler_pass2);
|
||||||
shader_set_dim("dimension", _surf);
|
shader_set_dim("dimension", _surf);
|
||||||
draw_surface_safe(temp_surface[0], 0, 0);
|
draw_surface_safe(temp_surface[0]);
|
||||||
shader_reset();
|
shader_reset();
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
surface_set_shader(_outUV);
|
surface_set_shader(_outUV);
|
||||||
draw_surface_safe(temp_surface[1], 0, 0);
|
draw_surface_safe(temp_surface[1]);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
surface_set_shader(_outSurf);
|
surface_set_shader(_outSurf);
|
||||||
draw_surface_safe(temp_surface[2], 0, 0);
|
draw_surface_safe(temp_surface[2]);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,8 @@ function loadPalette(path) { #region
|
||||||
|
|
||||||
while(!file_text_eof(_t)) {
|
while(!file_text_eof(_t)) {
|
||||||
var _w = file_text_readln(_t);
|
var _w = file_text_readln(_t);
|
||||||
|
_w = string_trim(_w);
|
||||||
|
_w = string_replace_all(_w, "\t", " ");
|
||||||
if(_w == "") continue;
|
if(_w == "") continue;
|
||||||
|
|
||||||
switch(ext) {
|
switch(ext) {
|
||||||
|
@ -53,14 +55,22 @@ function loadPalette(path) { #region
|
||||||
var _g = string_hexadecimal(string_copy(_w, 3, 2));
|
var _g = string_hexadecimal(string_copy(_w, 3, 2));
|
||||||
var _b = string_hexadecimal(string_copy(_w, 5, 2));
|
var _b = string_hexadecimal(string_copy(_w, 5, 2));
|
||||||
|
|
||||||
|
if(string_length(_w) > 6) {
|
||||||
|
var _a = string_hexadecimal(string_copy(_w, 7, 2));
|
||||||
|
pal[_index++] = make_color_rgba(_r, _g, _b, _a);
|
||||||
|
} else
|
||||||
pal[_index++] = make_color_rgb(_r, _g, _b);
|
pal[_index++] = make_color_rgb(_r, _g, _b);
|
||||||
break;
|
break;
|
||||||
case ".gpl" :
|
case ".gpl" :
|
||||||
case ".pal" :
|
case ".pal" :
|
||||||
if(string_char_at(_w, 1) == "#") break;
|
if(string_char_at(_w, 1) == "#") break;
|
||||||
var _c = string_splice(_w, " ");
|
var _c = string_splice(_w, " ", false);
|
||||||
if(array_length(_c) >= 3)
|
_c = array_filter(_c, function(s) { return s != ""; });
|
||||||
|
|
||||||
|
if(array_length(_c) == 3)
|
||||||
pal[_index++] = make_color_rgb(toNumber(_c[0]), toNumber(_c[1]), toNumber(_c[2]));
|
pal[_index++] = make_color_rgb(toNumber(_c[0]), toNumber(_c[1]), toNumber(_c[2]));
|
||||||
|
else if(array_length(_c) >= 4)
|
||||||
|
pal[_index++] = make_color_rgba(toNumber(_c[0]), toNumber(_c[1]), toNumber(_c[2]), toNumber(_c[3]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
function string_splice(str, delim = " ", keep = false) {
|
function string_splice(str, delim = " ", keep = false, empty = true) {
|
||||||
var st = [];
|
var st = [];
|
||||||
var ss = str;
|
var ss = str;
|
||||||
var sp;
|
var sp;
|
||||||
|
@ -16,11 +16,11 @@ function string_splice(str, delim = " ", keep = false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!found) { //no delim left
|
if(!found) { //no delim left
|
||||||
array_push(st, ss);
|
if(empty || string_length(ss)) array_push(st, ss);
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
var _ss = string_copy(ss, 1, keep? sp : sp - 1);
|
var _ss = string_copy(ss, 1, keep? sp : sp - 1);
|
||||||
array_push(st, _ss);
|
if(empty || string_length(ss)) array_push(st, _ss);
|
||||||
}
|
}
|
||||||
|
|
||||||
ss = string_copy(ss, sp + 1, string_length(ss) - sp);
|
ss = string_copy(ss, sp + 1, string_length(ss) - sp);
|
||||||
|
|
|
@ -159,6 +159,5 @@ void main() {
|
||||||
}
|
}
|
||||||
|
|
||||||
vec4 col = gradientEval(prog);
|
vec4 col = gradientEval(prog);
|
||||||
|
gl_FragColor = vec4(col.rgb, col.a * texture2D( gm_BaseTexture, v_vTexcoord ).a);
|
||||||
gl_FragColor = vec4(col.rgb, texture2D( gm_BaseTexture, v_vTexcoord ).a);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,5 +79,6 @@ vec4 gradientEval(in float prog) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
gl_FragColor = gradientEval(v_vTexcoord.x);
|
vec4 col = gradientEval(v_vTexcoord.x);
|
||||||
|
gl_FragColor = vec4(col.rgb, 1.);
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,10 +89,9 @@ void main() {
|
||||||
|
|
||||||
gl_FragColor = vec4(0.);
|
gl_FragColor = vec4(0.);
|
||||||
|
|
||||||
if(mode == 0) {
|
if(mode == 0)
|
||||||
gl_FragColor = vec4(vec3(grey), 1.);
|
gl_FragColor = vec4(vec3(grey), 1.);
|
||||||
} else if(mode == 1) {
|
else if(mode == 1)
|
||||||
vec4 color = gradientEval(grey);
|
gl_FragColor = gradientEval(grey);
|
||||||
gl_FragColor = color;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,8 +197,9 @@ void main() {
|
||||||
|
|
||||||
if(_new_pos.x >= 0. && _new_pos.x <= 1. && _new_pos.y >= 0. && _new_pos.y <= 1.) {
|
if(_new_pos.x >= 0. && _new_pos.x <= 1. && _new_pos.y >= 0. && _new_pos.y <= 1.) {
|
||||||
_col = texture2D( gm_BaseTexture, _new_pos );
|
_col = texture2D( gm_BaseTexture, _new_pos );
|
||||||
_col.rgb *= gradientEval(str + frandom(_pos, 1.235) * randomAmount).rgb;
|
vec4 cc = gradientEval(str + frandom(_pos, 1.235) * randomAmount);
|
||||||
_col.a *= curveEval(str + frandom(_pos, 2.984) * randomAmount);
|
_col.rgb *= cc.rgb;
|
||||||
|
_col.a *= cc.a * curveEval(str + frandom(_pos, 2.984) * randomAmount);
|
||||||
}
|
}
|
||||||
|
|
||||||
gl_FragColor = _col;
|
gl_FragColor = _col;
|
||||||
|
|