1.0.8
|
@ -4,6 +4,7 @@
|
|||
"name": "Pixels Composer",
|
||||
"resources": [
|
||||
{"id":{"name":"s_node_corner","path":"sprites/s_node_corner/s_node_corner.yy",},"order":14,},
|
||||
{"id":{"name":"sh_cell_noise_crystal","path":"shaders/sh_cell_noise_crystal/sh_cell_noise_crystal.yy",},"order":23,},
|
||||
{"id":{"name":"panel_function","path":"scripts/panel_function/panel_function.yy",},"order":5,},
|
||||
{"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},"order":33,},
|
||||
{"id":{"name":"sh_perlin","path":"shaders/sh_perlin/sh_perlin.yy",},"order":1,},
|
||||
|
@ -16,6 +17,7 @@
|
|||
{"id":{"name":"sh_dither","path":"shaders/sh_dither/sh_dither.yy",},"order":30,},
|
||||
{"id":{"name":"control_function","path":"scripts/control_function/control_function.yy",},"order":0,},
|
||||
{"id":{"name":"panel_data","path":"scripts/panel_data/panel_data.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_text_trim","path":"sprites/s_node_text_trim/s_node_text_trim.yy",},"order":18,},
|
||||
{"id":{"name":"node_3d_obj","path":"scripts/node_3d_obj/node_3d_obj.yy",},"order":8,},
|
||||
{"id":{"name":"o_dialog_menubox","path":"objects/o_dialog_menubox/o_dialog_menubox.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_blend","path":"sprites/s_node_blend/s_node_blend.yy",},"order":5,},
|
||||
|
@ -47,6 +49,7 @@
|
|||
{"id":{"name":"panel_preview","path":"scripts/panel_preview/panel_preview.yy",},"order":3,},
|
||||
{"id":{"name":"s_node_sepearte_shape","path":"sprites/s_node_sepearte_shape/s_node_sepearte_shape.yy",},"order":33,},
|
||||
{"id":{"name":"s_node_polar","path":"sprites/s_node_polar/s_node_polar.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_noise_simplex","path":"sprites/s_node_noise_simplex/s_node_noise_simplex.yy",},"order":20,},
|
||||
{"id":{"name":"o_dialog_notifications","path":"objects/o_dialog_notifications/o_dialog_notifications.yy",},"order":28,},
|
||||
{"id":{"name":"sh_flip","path":"shaders/sh_flip/sh_flip.yy",},"order":7,},
|
||||
{"id":{"name":"s_node_alpha_grey","path":"sprites/s_node_alpha_grey/s_node_alpha_grey.yy",},"order":2,},
|
||||
|
@ -72,7 +75,9 @@
|
|||
{"id":{"name":"colToVec4","path":"scripts/colToVec4/colToVec4.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_vfx","path":"sprites/s_node_vfx/s_node_vfx.yy",},"order":9,},
|
||||
{"id":{"name":"draw_surface_blend","path":"scripts/draw_surface_blend/draw_surface_blend.yy",},"order":1,},
|
||||
{"id":{"name":"sh_simplex","path":"shaders/sh_simplex/sh_simplex.yy",},"order":22,},
|
||||
{"id":{"name":"blurSurface","path":"scripts/blurSurface/blurSurface.yy",},"order":0,},
|
||||
{"id":{"name":"node_threshold","path":"scripts/node_threshold/node_threshold.yy",},"order":51,},
|
||||
{"id":{"name":"sh_cell_noise_edge","path":"shaders/sh_cell_noise_edge/sh_cell_noise_edge.yy",},"order":5,},
|
||||
{"id":{"name":"node_stripe","path":"scripts/node_stripe/node_stripe.yy",},"order":11,},
|
||||
{"id":{"name":"sh_texture_atlas","path":"shaders/sh_texture_atlas/sh_texture_atlas.yy",},"order":45,},
|
||||
|
@ -116,6 +121,7 @@
|
|||
{"id":{"name":"font_loader","path":"scripts/font_loader/font_loader.yy",},"order":8,},
|
||||
{"id":{"name":"point_rotate","path":"scripts/point_rotate/point_rotate.yy",},"order":1,},
|
||||
{"id":{"name":"node_displacement","path":"scripts/node_displacement/node_displacement.yy",},"order":8,},
|
||||
{"id":{"name":"text_file","path":"scripts/text_file/text_file.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_vfx_wind","path":"sprites/s_node_vfx_wind/s_node_vfx_wind.yy",},"order":3,},
|
||||
{"id":{"name":"s_node_vec4","path":"sprites/s_node_vec4/s_node_vec4.yy",},"order":8,},
|
||||
{"id":{"name":"buttonGroup","path":"scripts/buttonGroup/buttonGroup.yy",},"order":5,},
|
||||
|
@ -187,6 +193,7 @@
|
|||
{"id":{"name":"string_function","path":"scripts/string_function/string_function.yy",},"order":8,},
|
||||
{"id":{"name":"o_dialog_palette","path":"objects/o_dialog_palette/o_dialog_palette.yy",},"order":2,},
|
||||
{"id":{"name":"_f_p0","path":"fonts/_f_p0/_f_p0.yy",},"order":0,},
|
||||
{"id":{"name":"s_node_threshold","path":"sprites/s_node_threshold/s_node_threshold.yy",},"order":45,},
|
||||
{"id":{"name":"node_condition","path":"scripts/node_condition/node_condition.yy",},"order":0,},
|
||||
{"id":{"name":"sh_draw_normal","path":"shaders/sh_draw_normal/sh_draw_normal.yy",},"order":12,},
|
||||
{"id":{"name":"sh_seperate_shape_index","path":"shaders/sh_seperate_shape_index/sh_seperate_shape_index.yy",},"order":0,},
|
||||
|
@ -220,6 +227,7 @@
|
|||
{"id":{"name":"s_node_area","path":"sprites/s_node_area/s_node_area.yy",},"order":0,},
|
||||
{"id":{"name":"type_conversion","path":"scripts/type_conversion/type_conversion.yy",},"order":8,},
|
||||
{"id":{"name":"node_keyframe","path":"scripts/node_keyframe/node_keyframe.yy",},"order":4,},
|
||||
{"id":{"name":"sh_threshold","path":"shaders/sh_threshold/sh_threshold.yy",},"order":48,},
|
||||
{"id":{"name":"ac_flash","path":"animcurves/ac_flash/ac_flash.yy",},"order":0,},
|
||||
{"id":{"name":"o_dialog_drag_folder","path":"objects/o_dialog_drag_folder/o_dialog_drag_folder.yy",},"order":2,},
|
||||
{"id":{"name":"node_VFX_effect_repel","path":"scripts/node_VFX_effect_repel/node_VFX_effect_repel.yy",},"order":11,},
|
||||
|
@ -227,12 +235,14 @@
|
|||
{"id":{"name":"node_VFX_effect_attract","path":"scripts/node_VFX_effect_attract/node_VFX_effect_attract.yy",},"order":10,},
|
||||
{"id":{"name":"s_node_text_splice","path":"sprites/s_node_text_splice/s_node_text_splice.yy",},"order":17,},
|
||||
{"id":{"name":"sh_blend_multiply_alpha","path":"shaders/sh_blend_multiply_alpha/sh_blend_multiply_alpha.yy",},"order":4,},
|
||||
{"id":{"name":"node_3d_object_transform","path":"scripts/node_3d_object_transform/node_3d_object_transform.yy",},"order":11,},
|
||||
{"id":{"name":"draw_sprite_ext_override","path":"scripts/draw_sprite_ext_override/draw_sprite_ext_override.yy",},"order":9,},
|
||||
{"id":{"name":"node_array_add","path":"scripts/node_array_add/node_array_add.yy",},"order":9,},
|
||||
{"id":{"name":"node_noise_cell","path":"scripts/node_noise_cell/node_noise_cell.yy",},"order":2,},
|
||||
{"id":{"name":"sh_combine_hsv","path":"shaders/sh_combine_hsv/sh_combine_hsv.yy",},"order":47,},
|
||||
{"id":{"name":"node_noise","path":"scripts/node_noise/node_noise.yy",},"order":17,},
|
||||
{"id":{"name":"mtl_reader","path":"scripts/mtl_reader/mtl_reader.yy",},"order":6,},
|
||||
{"id":{"name":"s_node_3d_array","path":"sprites/s_node_3d_array/s_node_3d_array.yy",},"order":7,},
|
||||
{"id":{"name":"sh_scale2x","path":"shaders/sh_scale2x/sh_scale2x.yy",},"order":29,},
|
||||
{"id":{"name":"ds_priority","path":"scripts/ds_priority/ds_priority.yy",},"order":3,},
|
||||
{"id":{"name":"node_vector","path":"scripts/node_vector/node_vector.yy",},"order":0,},
|
||||
|
@ -267,12 +277,14 @@
|
|||
{"id":{"name":"sh_pixel_sort","path":"shaders/sh_pixel_sort/sh_pixel_sort.yy",},"order":38,},
|
||||
{"id":{"name":"s_node_vfx_destroy","path":"sprites/s_node_vfx_destroy/s_node_vfx_destroy.yy",},"order":7,},
|
||||
{"id":{"name":"sh_texture_remap","path":"shaders/sh_texture_remap/sh_texture_remap.yy",},"order":26,},
|
||||
{"id":{"name":"node_noise_simplex","path":"scripts/node_noise_simplex/node_noise_simplex.yy",},"order":23,},
|
||||
{"id":{"name":"ds_list","path":"scripts/ds_list/ds_list.yy",},"order":1,},
|
||||
{"id":{"name":"o_dialog_gradient","path":"objects/o_dialog_gradient/o_dialog_gradient.yy",},"order":1,},
|
||||
{"id":{"name":"sh_blend_subtract","path":"shaders/sh_blend_subtract/sh_blend_subtract.yy",},"order":5,},
|
||||
{"id":{"name":"o_dialog_file_name","path":"objects/o_dialog_file_name/o_dialog_file_name.yy",},"order":0,},
|
||||
{"id":{"name":"panel_animation","path":"scripts/panel_animation/panel_animation.yy",},"order":4,},
|
||||
{"id":{"name":"sh_gradient","path":"shaders/sh_gradient/sh_gradient.yy",},"order":17,},
|
||||
{"id":{"name":"node_json_file_read","path":"scripts/node_json_file_read/node_json_file_read.yy",},"order":8,},
|
||||
{"id":{"name":"s_node_zigzag","path":"sprites/s_node_zigzag/s_node_zigzag.yy",},"order":18,},
|
||||
{"id":{"name":"sh_glow","path":"shaders/sh_glow/sh_glow.yy",},"order":36,},
|
||||
{"id":{"name":"sh_clean_shape","path":"shaders/sh_clean_shape/sh_clean_shape.yy",},"order":39,},
|
||||
|
@ -285,6 +297,7 @@
|
|||
{"id":{"name":"rotator","path":"scripts/rotator/rotator.yy",},"order":11,},
|
||||
{"id":{"name":"s_node_edge_detect","path":"sprites/s_node_edge_detect/s_node_edge_detect.yy",},"order":20,},
|
||||
{"id":{"name":"node_grid_hex","path":"scripts/node_grid_hex/node_grid_hex.yy",},"order":22,},
|
||||
{"id":{"name":"s_node_text_display","path":"sprites/s_node_text_display/s_node_text_display.yy",},"order":19,},
|
||||
{"id":{"name":"node_blur_radial","path":"scripts/node_blur_radial/node_blur_radial.yy",},"order":29,},
|
||||
{"id":{"name":"node_bloom","path":"scripts/node_bloom/node_bloom.yy",},"order":15,},
|
||||
{"id":{"name":"sh_bevel","path":"shaders/sh_bevel/sh_bevel.yy",},"order":3,},
|
||||
|
@ -326,7 +339,7 @@
|
|||
{"id":{"name":"display_refresh","path":"scripts/display_refresh/display_refresh.yy",},"order":17,},
|
||||
{"id":{"name":"s_node_grey_alpha","path":"sprites/s_node_grey_alpha/s_node_grey_alpha.yy",},"order":23,},
|
||||
{"id":{"name":"o_dialog_color_selector","path":"objects/o_dialog_color_selector/o_dialog_color_selector.yy",},"order":0,},
|
||||
{"id":{"name":"sh_bloom_pass1","path":"shaders/sh_bloom_pass1/sh_bloom_pass1.yy",},"order":0,},
|
||||
{"id":{"name":"sh_bloom_pass","path":"shaders/sh_bloom_pass/sh_bloom_pass.yy",},"order":0,},
|
||||
{"id":{"name":"node_seperate_shapes","path":"scripts/node_seperate_shapes/node_seperate_shapes.yy",},"order":9,},
|
||||
{"id":{"name":"node_sequence_to_anim","path":"scripts/node_sequence_to_anim/node_sequence_to_anim.yy",},"order":3,},
|
||||
{"id":{"name":"node_image_sheet","path":"scripts/node_image_sheet/node_image_sheet.yy",},"order":4,},
|
||||
|
@ -361,6 +374,7 @@
|
|||
{"id":{"name":"sh_seperate_shape_ite","path":"shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.yy",},"order":2,},
|
||||
{"id":{"name":"o_main","path":"objects/o_main/o_main.yy",},"order":1,},
|
||||
{"id":{"name":"area_function","path":"scripts/area_function/area_function.yy",},"order":2,},
|
||||
{"id":{"name":"sh_sharpen","path":"shaders/sh_sharpen/sh_sharpen.yy",},"order":50,},
|
||||
{"id":{"name":"s_node_statistic","path":"sprites/s_node_statistic/s_node_statistic.yy",},"order":4,},
|
||||
{"id":{"name":"sh_blend_alpha_addition","path":"shaders/sh_blend_alpha_addition/sh_blend_alpha_addition.yy",},"order":13,},
|
||||
{"id":{"name":"node_VFX_effect_vortex","path":"scripts/node_VFX_effect_vortex/node_VFX_effect_vortex.yy",},"order":12,},
|
||||
|
@ -372,6 +386,7 @@
|
|||
{"id":{"name":"sh_alpha_grey","path":"shaders/sh_alpha_grey/sh_alpha_grey.yy",},"order":9,},
|
||||
{"id":{"name":"s_transparent","path":"sprites/s_transparent/s_transparent.yy",},"order":1,},
|
||||
{"id":{"name":"o_dialog_animation","path":"objects/o_dialog_animation/o_dialog_animation.yy",},"order":1,},
|
||||
{"id":{"name":"s_node_3d_plane","path":"sprites/s_node_3d_plane/s_node_3d_plane.yy",},"order":6,},
|
||||
{"id":{"name":"s_node_grid_tri","path":"sprites/s_node_grid_tri/s_node_grid_tri.yy",},"order":6,},
|
||||
{"id":{"name":"_f_p0b","path":"fonts/_f_p0b/_f_p0b.yy",},"order":5,},
|
||||
{"id":{"name":"o_dialog_keyframe_curve","path":"objects/o_dialog_keyframe_curve/o_dialog_keyframe_curve.yy",},"order":2,},
|
||||
|
@ -383,9 +398,11 @@
|
|||
{"id":{"name":"sh_blend_add_alpha_adj","path":"shaders/sh_blend_add_alpha_adj/sh_blend_add_alpha_adj.yy",},"order":2,},
|
||||
{"id":{"name":"node_text","path":"scripts/node_text/node_text.yy",},"order":10,},
|
||||
{"id":{"name":"panel_collection","path":"scripts/panel_collection/panel_collection.yy",},"order":7,},
|
||||
{"id":{"name":"node_string_trim","path":"scripts/node_string_trim/node_string_trim.yy",},"order":15,},
|
||||
{"id":{"name":"lerp_float","path":"scripts/lerp_float/lerp_float.yy",},"order":1,},
|
||||
{"id":{"name":"vectorRangeBox","path":"scripts/vectorRangeBox/vectorRangeBox.yy",},"order":19,},
|
||||
{"id":{"name":"sh_draw_vertex_aa","path":"shaders/sh_draw_vertex_aa/sh_draw_vertex_aa.yy",},"order":0,},
|
||||
{"id":{"name":"node_sharpen","path":"scripts/node_sharpen/node_sharpen.yy",},"order":53,},
|
||||
{"id":{"name":"sh_outline_only","path":"shaders/sh_outline_only/sh_outline_only.yy",},"order":37,},
|
||||
{"id":{"name":"s_node_destray","path":"sprites/s_node_destray/s_node_destray.yy",},"order":16,},
|
||||
{"id":{"name":"node_color_sampler","path":"scripts/node_color_sampler/node_color_sampler.yy",},"order":1,},
|
||||
|
@ -420,6 +437,7 @@
|
|||
{"id":{"name":"s_node_greyscale","path":"sprites/s_node_greyscale/s_node_greyscale.yy",},"order":24,},
|
||||
{"id":{"name":"sh_dilate","path":"shaders/sh_dilate/sh_dilate.yy",},"order":4,},
|
||||
{"id":{"name":"node_image_sequence","path":"scripts/node_image_sequence/node_image_sequence.yy",},"order":1,},
|
||||
{"id":{"name":"node_text_file_read","path":"scripts/node_text_file_read/node_text_file_read.yy",},"order":7,},
|
||||
{"id":{"name":"s_menu_transparent","path":"sprites/s_menu_transparent/s_menu_transparent.yy",},"order":0,},
|
||||
{"id":{"name":"key_press","path":"scripts/key_press/key_press.yy",},"order":0,},
|
||||
{"id":{"name":"curve_power_function","path":"scripts/curve_power_function/curve_power_function.yy",},"order":3,},
|
||||
|
@ -434,6 +452,7 @@
|
|||
{"id":{"name":"node_array_length","path":"scripts/node_array_length/node_array_length.yy",},"order":11,},
|
||||
{"id":{"name":"node_erode","path":"scripts/node_erode/node_erode.yy",},"order":31,},
|
||||
{"id":{"name":"node_wrap_mesh","path":"scripts/node_wrap_mesh/node_wrap_mesh.yy",},"order":7,},
|
||||
{"id":{"name":"sh_alpha_hash","path":"shaders/sh_alpha_hash/sh_alpha_hash.yy",},"order":49,},
|
||||
{"id":{"name":"sh_blur_alpha","path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",},"order":1,},
|
||||
{"id":{"name":"node_sprite_sheet","path":"scripts/node_sprite_sheet/node_sprite_sheet.yy",},"order":0,},
|
||||
{"id":{"name":"value_snap","path":"scripts/value_snap/value_snap.yy",},"order":10,},
|
||||
|
@ -443,6 +462,7 @@
|
|||
{"id":{"name":"sh_vertex_pt","path":"shaders/sh_vertex_pt/sh_vertex_pt.yy",},"order":2,},
|
||||
{"id":{"name":"node_color_replacement","path":"scripts/node_color_replacement/node_color_replacement.yy",},"order":4,},
|
||||
{"id":{"name":"path_reader","path":"scripts/path_reader/path_reader.yy",},"order":5,},
|
||||
{"id":{"name":"node_3d_repeat","path":"scripts/node_3d_repeat/node_3d_repeat.yy",},"order":12,},
|
||||
{"id":{"name":"node_blur_contrast","path":"scripts/node_blur_contrast/node_blur_contrast.yy",},"order":36,},
|
||||
{"id":{"name":"s_fx_pixel","path":"sprites/s_fx_pixel/s_fx_pixel.yy",},"order":0,},
|
||||
{"id":{"name":"gradients_function","path":"scripts/gradients_function/gradients_function.yy",},"order":0,},
|
||||
|
@ -454,6 +474,7 @@
|
|||
{"id":{"name":"s_node_text_render","path":"sprites/s_node_text_render/s_node_text_render.yy",},"order":17,},
|
||||
{"id":{"name":"s_node_color_from_rgb","path":"sprites/s_node_color_from_rgb/s_node_color_from_rgb.yy",},"order":4,},
|
||||
{"id":{"name":"node_scale_algo","path":"scripts/node_scale_algo/node_scale_algo.yy",},"order":13,},
|
||||
{"id":{"name":"node_alpha_hash","path":"scripts/node_alpha_hash/node_alpha_hash.yy",},"order":52,},
|
||||
{"id":{"name":"mouse_input","path":"scripts/mouse_input/mouse_input.yy",},"order":1,},
|
||||
{"id":{"name":"string_cut","path":"scripts/string_cut/string_cut.yy",},"order":4,},
|
||||
{"id":{"name":"node_3d_prim_cylinder","path":"scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.yy",},"order":7,},
|
||||
|
@ -470,9 +491,10 @@
|
|||
{"id":{"name":"sh_stripe","path":"shaders/sh_stripe/sh_stripe.yy",},"order":10,},
|
||||
{"id":{"name":"sh_blend_contrast","path":"shaders/sh_blend_contrast/sh_blend_contrast.yy",},"order":16,},
|
||||
{"id":{"name":"node_3d_prim_cube","path":"scripts/node_3d_prim_cube/node_3d_prim_cube.yy",},"order":5,},
|
||||
{"id":{"name":"node_3d_transform","path":"scripts/node_3d_transform/node_3d_transform.yy",},"order":2,},
|
||||
{"id":{"name":"node_3d_plane","path":"scripts/node_3d_plane/node_3d_plane.yy",},"order":2,},
|
||||
{"id":{"name":"node_display_text","path":"scripts/node_display_text/node_display_text.yy",},"order":3,},
|
||||
{"id":{"name":"s_kenney","path":"sprites/s_kenney/s_kenney.yy",},"order":0,},
|
||||
{"id":{"name":"testing_script","path":"scripts/testing_script/testing_script.yy",},"order":0,},
|
||||
{"id":{"name":"node_feedback","path":"scripts/node_feedback/node_feedback.yy",},"order":0,},
|
||||
{"id":{"name":"sh_grid_noise","path":"shaders/sh_grid_noise/sh_grid_noise.yy",},"order":8,},
|
||||
{"id":{"name":"s_node_line","path":"sprites/s_node_line/s_node_line.yy",},"order":7,},
|
||||
|
@ -529,6 +551,7 @@
|
|||
{"id":{"name":"node_de_stray","path":"scripts/node_de_stray/node_de_stray.yy",},"order":27,},
|
||||
{"id":{"name":"sh_channel_G","path":"shaders/sh_channel_G/sh_channel_G.yy",},"order":2,},
|
||||
{"id":{"name":"s_node_dilate","path":"sprites/s_node_dilate/s_node_dilate.yy",},"order":17,},
|
||||
{"id":{"name":"s_node_text_file_read","path":"sprites/s_node_text_file_read/s_node_text_file_read.yy",},"order":11,},
|
||||
{"id":{"name":"node_collection","path":"scripts/node_collection/node_collection.yy",},"order":0,},
|
||||
{"id":{"name":"node_value","path":"scripts/node_value/node_value.yy",},"order":6,},
|
||||
{"id":{"name":"draw_line_curve","path":"scripts/draw_line_curve/draw_line_curve.yy",},"order":5,},
|
||||
|
@ -548,6 +571,7 @@
|
|||
{"id":{"name":"sh_blur_simple","path":"shaders/sh_blur_simple/sh_blur_simple.yy",},"order":6,},
|
||||
{"id":{"name":"s_node_image_animation","path":"sprites/s_node_image_animation/s_node_image_animation.yy",},"order":5,},
|
||||
{"id":{"name":"s_node_feedback_output","path":"sprites/s_node_feedback_output/s_node_feedback_output.yy",},"order":9,},
|
||||
{"id":{"name":"node_3d_combine","path":"scripts/node_3d_combine/node_3d_combine.yy",},"order":10,},
|
||||
{"id":{"name":"draw_line_dashed","path":"scripts/draw_line_dashed/draw_line_dashed.yy",},"order":7,},
|
||||
{"id":{"name":"regex","path":"scripts/regex/regex.yy",},"order":0,},
|
||||
{"id":{"name":"node_invert","path":"scripts/node_invert/node_invert.yy",},"order":41,},
|
||||
|
@ -602,6 +626,7 @@
|
|||
{"id":{"name":"node_solid","path":"scripts/node_solid/node_solid.yy",},"order":14,},
|
||||
{"id":{"name":"node_iterator_output","path":"scripts/node_iterator_output/node_iterator_output.yy",},"order":3,},
|
||||
{"id":{"name":"debug","path":"scripts/debug/debug.yy",},"order":9,},
|
||||
{"id":{"name":"s_node_3d_obj_combine","path":"sprites/s_node_3d_obj_combine/s_node_3d_obj_combine.yy",},"order":5,},
|
||||
{"id":{"name":"o_dialog_assetbox","path":"objects/o_dialog_assetbox/o_dialog_assetbox.yy",},"order":3,},
|
||||
{"id":{"name":"node_lerp","path":"scripts/node_lerp/node_lerp.yy",},"order":6,},
|
||||
{"id":{"name":"s_node_pixel_sort","path":"sprites/s_node_pixel_sort/s_node_pixel_sort.yy",},"order":40,},
|
||||
|
@ -627,7 +652,9 @@
|
|||
"isEcma": false,
|
||||
"configs": {
|
||||
"name": "Default",
|
||||
"children": [],
|
||||
"children": [
|
||||
{"name":"Tester","children":[],},
|
||||
],
|
||||
},
|
||||
"RoomOrderNodes": [
|
||||
{"roomId":{"name":"rm_main","path":"rooms/rm_main/rm_main.yy",},},
|
||||
|
@ -662,6 +689,7 @@
|
|||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"shader","folderPath":"folders/functions/shader.yy","order":16,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"string","folderPath":"folders/functions/string.yy","order":4,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"surface","folderPath":"folders/functions/surface.yy","order":8,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"test","folderPath":"folders/functions/test.yy","order":23,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/functions/value.yy","order":1,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"vector","folderPath":"folders/functions/vector.yy","order":3,},
|
||||
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"main","folderPath":"folders/main.yy","order":2,},
|
||||
|
@ -901,7 +929,6 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_color_picker_sample2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_folder_content_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_toolbar_shadow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/UI",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_error.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_pin_active.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_color_picker_sample1.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_icon_accept_24.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
|
@ -966,24 +993,25 @@
|
|||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_circle.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_path_tools_rectangle.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/tool",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array_hover.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_array.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_vfx.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphics.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"anchor_arrow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/preview",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_noti_icon_tick.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Assets.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_resize.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_feedback_16.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_unit_ref.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"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_padding_link_strip2.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/icon",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_new_badge.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"s_node_junctions_single.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic x2.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"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_node_glow.png","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"default.zip","CopyToMask":-1,"filePath":"datafiles/data/themes",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"graphic.ai","CopyToMask":-1,"filePath":"datafiles/data/themes/default/graphics/node",},
|
||||
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"Collections.zip","CopyToMask":-1,"filePath":"datafiles/data",},
|
||||
],
|
||||
"MetaData": {
|
||||
|
|
|
@ -607,8 +607,8 @@
|
|||
"bottom": 7
|
||||
}
|
||||
},
|
||||
"node_error": {
|
||||
"path": "./node/s_node_error.png",
|
||||
"node_glow": {
|
||||
"path": "./node/s_node_glow.png",
|
||||
"subimages": 1,
|
||||
"xorigin": 15,
|
||||
"yorigin": 15,
|
||||
|
|
Before Width: | Height: | Size: 813 B |
BIN
datafiles/data/themes/default/graphics/node/s_node_glow.png
Normal file
After Width: | Height: | Size: 796 B |
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.8 KiB |
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.5 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.8 KiB |
|
@ -17,6 +17,7 @@ event_inherited();
|
|||
[ "gif importer\nWindow commands\nExecute shell simple", "YellowAfterLife" ],
|
||||
[ "Triangle grid", "Farini" ],
|
||||
[ "Pixel sort", "Ciphrd" ],
|
||||
[ "Simplex noise", "Ian McEwan" ],
|
||||
]
|
||||
|
||||
sc_thank = new scrollPane(dialog_w - ui(64), thank_h, function(_y, _m) {
|
||||
|
|
|
@ -153,47 +153,69 @@ event_inherited();
|
|||
var col = floor(content_pane.surface_w / (grid_width + grid_space));
|
||||
var row = ceil(node_count / col);
|
||||
var yy = _y + grid_space;
|
||||
var name_height = 0;
|
||||
var curr_height = 0;
|
||||
var cProg = 0;
|
||||
hh += grid_space;
|
||||
|
||||
for(var i = 0; i < row; i++) {
|
||||
name_height = 0;
|
||||
for(var j = 0; j < col; j++) {
|
||||
var index = i * col + j;
|
||||
if(index < node_count) {
|
||||
var _node = node_list[| index];
|
||||
if(!_node) continue;
|
||||
|
||||
for(var index = 0; index < node_count; index++) {
|
||||
var _node = node_list[| index];
|
||||
if(is_string(_node)) {
|
||||
hh += curr_height;
|
||||
yy += curr_height;
|
||||
|
||||
var _nx = grid_space + (grid_width + grid_space) * j;
|
||||
var _boxx = _nx + (grid_width - grid_size) / 2;
|
||||
|
||||
BLEND_OVER
|
||||
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node);
|
||||
}
|
||||
|
||||
var spr_x = _boxx + grid_size / 2;
|
||||
var spr_y = yy + grid_size / 2;
|
||||
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr))
|
||||
draw_sprite_ui_uniform(_node.spr, 0, spr_x, spr_y);
|
||||
|
||||
if(_node.new_node)
|
||||
draw_sprite_ui_uniform(THEME.node_new_badge, 0, _boxx + grid_size - ui(12), yy + ui(6));
|
||||
|
||||
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
|
||||
name_height = max(name_height, string_height_ext(_node.name, -1, grid_width) + 8);
|
||||
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
|
||||
}
|
||||
cProg = 0;
|
||||
curr_height = 0;
|
||||
|
||||
BLEND_OVER
|
||||
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(16), yy, content_pane.surface_w - ui(32), ui(24), COLORS._main_icon, 1);
|
||||
BLEND_NORMAL
|
||||
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(ui(16 + 16), yy + ui(12), _node);
|
||||
|
||||
hh += ui(24 + 12);
|
||||
yy += ui(24 + 12);
|
||||
continue;
|
||||
}
|
||||
var hght = grid_size + grid_space + name_height;
|
||||
hh += hght;
|
||||
yy += hght;
|
||||
}
|
||||
|
||||
var _nx = grid_space + (grid_width + grid_space) * cProg;
|
||||
var _boxx = _nx + (grid_width - grid_size) / 2;
|
||||
|
||||
BLEND_OVER
|
||||
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
|
||||
BLEND_NORMAL
|
||||
|
||||
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
|
||||
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
|
||||
if(mouse_press(mb_left, sFOCUS))
|
||||
buildNode(_node);
|
||||
}
|
||||
|
||||
var spr_x = _boxx + grid_size / 2;
|
||||
var spr_y = yy + grid_size / 2;
|
||||
if(variable_struct_exists(_node, "spr") && sprite_exists(_node.spr))
|
||||
draw_sprite_ui_uniform(_node.spr, 0, spr_x, spr_y);
|
||||
|
||||
if(_node.new_node)
|
||||
draw_sprite_ui_uniform(THEME.node_new_badge, 0, _boxx + grid_size - ui(12), yy + ui(6));
|
||||
|
||||
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
|
||||
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.name, -1, grid_width);
|
||||
|
||||
var name_height = string_height_ext(_node.name, -1, grid_width) + 8;
|
||||
curr_height = max(curr_height, grid_size + grid_space + name_height);
|
||||
|
||||
if(++cProg >= col) {
|
||||
hh += curr_height;
|
||||
yy += curr_height;
|
||||
|
||||
cProg = 0;
|
||||
curr_height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
hh += curr_height;
|
||||
yy += curr_height;
|
||||
} else if(ADD_NODE_MODE == 1) {
|
||||
var list_width = content_pane.surface_w;
|
||||
var list_height = ui(28);
|
||||
|
@ -202,7 +224,22 @@ event_inherited();
|
|||
|
||||
for(var i = 0; i < node_count; i++) {
|
||||
var _node = node_list[| i];
|
||||
if(!_node) continue;
|
||||
|
||||
if(is_string(_node)) {
|
||||
hh += ui(8);
|
||||
yy += ui(8);
|
||||
|
||||
BLEND_OVER
|
||||
draw_sprite_stretched_ext(THEME.node_bg, 0, ui(8), yy, content_pane.surface_w - ui(24), ui(24), COLORS._main_icon, 1);
|
||||
BLEND_NORMAL
|
||||
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_text);
|
||||
draw_text(ui(24), yy + ui(12), _node);
|
||||
|
||||
hh += ui(32);
|
||||
yy += ui(32);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(i % 2) {
|
||||
BLEND_OVER
|
||||
|
@ -291,7 +328,7 @@ event_inherited();
|
|||
for(var j = 0; j < ds_list_size(_content); j++) {
|
||||
var _node = _content[| j];
|
||||
|
||||
if(!_node) continue;
|
||||
if(is_string(_node)) continue;
|
||||
if(ds_map_exists(search_map, _node.node)) continue;
|
||||
|
||||
var match = string_pos(search_lower, string_lower(_node.name)) > 0;
|
||||
|
|
|
@ -3,7 +3,7 @@ event_inherited();
|
|||
|
||||
#region data
|
||||
dialog_w = ui(720);
|
||||
dialog_h = ui(360);
|
||||
dialog_h = ui(480);
|
||||
|
||||
dialog_resizable = true;
|
||||
destroy_on_click_out = true;
|
||||
|
|
|
@ -15,8 +15,11 @@ event_inherited();
|
|||
setColor = function(color) {
|
||||
if(index_selecting == -1 || palette == 0) return;
|
||||
palette[index_selecting] = color;
|
||||
|
||||
if(onApply != noone) onApply(palette);
|
||||
}
|
||||
|
||||
onApply = noone;
|
||||
selector = new colorSelector(setColor);
|
||||
selector.dropper_close = false;
|
||||
|
||||
|
|
|
@ -75,6 +75,12 @@
|
|||
var node = noone;
|
||||
|
||||
switch(ext) {
|
||||
case ".txt" :
|
||||
node = Node_create_Text_File_Read_path(PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y, path);
|
||||
break;
|
||||
case ".json" :
|
||||
node = Node_create_Json_File_Read_path(PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y, path);
|
||||
break;
|
||||
case ".png" :
|
||||
case ".jpg" :
|
||||
case ".jpeg" :
|
||||
|
@ -86,7 +92,6 @@
|
|||
case ".obj" :
|
||||
node = Node_create_3D_Obj_path(PANEL_GRAPH.mouse_grid_x, PANEL_GRAPH.mouse_grid_y, path);
|
||||
break;
|
||||
case ".json" :
|
||||
case ".pxc" :
|
||||
LOAD_PATH(path);
|
||||
break;
|
||||
|
|
11
objects/o_main/KeyPress_1.gml
Normal file
|
@ -0,0 +1,11 @@
|
|||
/// @description
|
||||
kb_hkey = keyboard_key;
|
||||
kb_time = 0;
|
||||
kb_hold = false;
|
||||
|
||||
KEYBOARD_PRESSED = kb_hkey;
|
||||
|
||||
if(keyboard_check(vk_backspace))
|
||||
KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
else
|
||||
KEYBOARD_STRING += keyboard_lastchar;
|
|
@ -1,5 +1,7 @@
|
|||
/// @description
|
||||
kb_time = 0;
|
||||
kb_hold = false;
|
||||
kb_hkey = "";
|
||||
keyboard_lastchar = "";
|
||||
keyboard_lastchar = "";
|
||||
|
||||
kb_hkey = vk_nokey;
|
||||
KEYBOARD_PRESSED = vk_nokey;
|
|
@ -1,24 +1,22 @@
|
|||
/// @description
|
||||
var trigger = false;
|
||||
kb_time += DELTA_TIME;
|
||||
if(kb_hkey == keyboard_lastchar && kb_hkey != "") {
|
||||
if(kb_hold && kb_time >= PREF_MAP[? "keyboard_repeat_speed"]) {
|
||||
trigger = true;
|
||||
kb_time = 0;
|
||||
} else if(!kb_hold && kb_time >= PREF_MAP[? "keyboard_repeat_start"]) {
|
||||
trigger = true;
|
||||
kb_time = 0;
|
||||
kb_hold = true;
|
||||
}
|
||||
} else
|
||||
trigger = true;
|
||||
|
||||
kb_hkey = keyboard_lastchar;
|
||||
KEYBOARD_PRESSED = vk_nokey;
|
||||
kb_time += DELTA_TIME;
|
||||
if(kb_hold && kb_time >= PREF_MAP[? "keyboard_repeat_speed"]) {
|
||||
trigger = true;
|
||||
kb_time = 0;
|
||||
} else if(!kb_hold && kb_time >= PREF_MAP[? "keyboard_repeat_start"]) {
|
||||
trigger = true;
|
||||
kb_time = 0;
|
||||
kb_hold = true;
|
||||
}
|
||||
|
||||
if(!trigger) exit;
|
||||
|
||||
if(keyboard_check(vk_backspace)) {
|
||||
KEYBOARD_PRESSED = kb_hkey;
|
||||
|
||||
if(keyboard_check(vk_backspace))
|
||||
KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
} else {
|
||||
KEYBOARD_STRING += keyboard_lastchar;
|
||||
}
|
||||
else
|
||||
KEYBOARD_STRING += keyboard_lastchar;
|
|
@ -10,9 +10,13 @@
|
|||
|
||||
#region animation
|
||||
if(ANIMATOR.is_playing) {
|
||||
var fr = ANIMATOR.real_frame + ANIMATOR.framerate * (delta_time / 1000000);
|
||||
if(fr <= ANIMATOR.real_frame + 1)
|
||||
ANIMATOR.real_frame = fr;
|
||||
ANIMATOR.time_since_last_frame += ANIMATOR.framerate * (delta_time / 1000000);
|
||||
|
||||
if(ANIMATOR.time_since_last_frame >= 1) {
|
||||
ANIMATOR.real_frame += 1;
|
||||
ANIMATOR.time_since_last_frame = 0;
|
||||
}
|
||||
|
||||
if(round(ANIMATOR.real_frame) >= ANIMATOR.frames_total) {
|
||||
if(ANIMATOR.playback == ANIMATOR_END.stop || ANIMATOR.rendering) {
|
||||
ANIMATOR.setFrame(ANIMATOR.frames_total - 1);
|
||||
|
@ -23,6 +27,7 @@
|
|||
}
|
||||
} else {
|
||||
ANIMATOR.setFrame(ANIMATOR.real_frame);
|
||||
ANIMATOR.time_since_last_frame = 0;
|
||||
}
|
||||
|
||||
var _c = ANIMATOR.current_frame;
|
||||
|
|
|
@ -123,4 +123,6 @@
|
|||
}
|
||||
}
|
||||
MOUSE_WRAP = false;
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
//if(KEYBOARD_PRESSED) print(string(KEYBOARD_PRESSED) + " | " + string(irandom_range(10000, 99999)))
|
|
@ -38,6 +38,7 @@
|
|||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":1,"eventType":5,"collisionObjectId":null,},
|
||||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":1,"eventType":10,"collisionObjectId":null,},
|
||||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":75,"eventType":7,"collisionObjectId":null,},
|
||||
{"resourceType":"GMEvent","resourceVersion":"1.0","name":"","isDnD":false,"eventNum":1,"eventType":9,"collisionObjectId":null,},
|
||||
],
|
||||
"properties": [],
|
||||
"overriddenProperties": [],
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
"resourceType": "GMWindowsOptions",
|
||||
"resourceVersion": "1.1",
|
||||
"name": "Windows",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.8",
|
||||
"option_windows_executable_name": "${project_name} 1.0.8.exe",
|
||||
"option_windows_version": "1.0.8.0",
|
||||
"option_windows_display_name": "Pixel Composer 1.0.9",
|
||||
"option_windows_executable_name": "${project_name} 1.0.9.exe",
|
||||
"option_windows_version": "1.0.9.0",
|
||||
"option_windows_company_info": "MakhamDev",
|
||||
"option_windows_product_info": "Pixel Composer",
|
||||
"option_windows_copyright_info": "",
|
||||
|
|
|
@ -20,14 +20,14 @@
|
|||
|
||||
var VB = vertex_create_buffer();
|
||||
vertex_begin(VB, FORMAT_PT);
|
||||
|
||||
vertex_add_pt(VB, [_1, _0, 0], [1, 0]);
|
||||
vertex_add_pt(VB, [_0, _0, 0], [0, 0]);
|
||||
vertex_add_pt(VB, [_1, _1, 0], [1, 1]);
|
||||
|
||||
vertex_add_pt(VB, [_1, _1, 0], [1, 1]);
|
||||
vertex_add_pt(VB, [_0, _0, 0], [0, 0]);
|
||||
vertex_add_pt(VB, [_0, _1, 0], [0, 1]);
|
||||
|
||||
vertex_add_pt(VB, [_1, _0, 0], [ 1, 0]);
|
||||
vertex_add_pt(VB, [_0, _0, 0], [ 0, 0]);
|
||||
vertex_add_pt(VB, [_1, _1, 0], [ 1, 1]);
|
||||
|
||||
vertex_add_pt(VB, [_1, _1, 0], [ 1, 1]);
|
||||
vertex_add_pt(VB, [_0, _0, 0], [ 0, 0]);
|
||||
vertex_add_pt(VB, [_0, _1, 0], [ 0, 1]);
|
||||
|
||||
vertex_end(VB);
|
||||
vertex_freeze(VB);
|
||||
|
@ -106,4 +106,174 @@
|
|||
vertex_end(VB);
|
||||
vertex_freeze(VB);
|
||||
PRIMITIVES[? "cube"] = VB;
|
||||
#endregion
|
||||
|
||||
#region helper
|
||||
function _3d_node_init(iDim, iPos, iRot, iSca) {
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
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");
|
||||
|
||||
VB = [];
|
||||
use_normal = true;
|
||||
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
input_dim = iDim;
|
||||
input_pos = iPos;
|
||||
input_rot = iRot;
|
||||
input_sca = iSca;
|
||||
}
|
||||
|
||||
function _3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny, inv = false) {
|
||||
if(inputs[| input_pos].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
|
||||
var _dim = inputs[| input_dim].getValue();
|
||||
var _pos = inputs[| input_pos].getValue();
|
||||
var _rot = inputs[| input_rot].getValue();
|
||||
var cx = _x + _pos[0] * _s;
|
||||
var cy = _y + _pos[1] * _s;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * -6;
|
||||
_rot[1] = drag_sv - dx * (inv? -1 : 1);
|
||||
|
||||
if(inputs[| input_rot].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * 6;
|
||||
_rot[0] = drag_sv - dy * (inv? -1 : 1);
|
||||
|
||||
if(inputs[| input_rot].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var dz = point_direction(cx, cy, _mx, _my) - point_direction(cx, cy, drag_mx, drag_my);
|
||||
_rot[2] = drag_sv + dz;
|
||||
|
||||
if(inputs[| input_rot].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(active && distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inputs[| input_pos].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
function _3d_local_transform(_lpos, _lrot, _lsca) {
|
||||
matrix_stack_push(matrix_build(_lpos[0], _lpos[1], _lpos[2], 0, 0, 0, 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0, 0, _lrot[0], _lrot[1], _lrot[2], 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0, 0, 0, 0, 0, _lsca[0], _lsca[1], _lsca[2]));
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
}
|
||||
|
||||
function _3d_clear_local_transform() {
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
}
|
||||
|
||||
function _3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, _applyLocal = true) {
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
var cam_proj = matrix_build_projection_ortho(_dim[0], _dim[1], 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
|
||||
shader_set(sh_vertex_pnt_light);
|
||||
shader_set_uniform_f_array(uniVertex_lightFor, lightFor);
|
||||
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);
|
||||
|
||||
matrix_stack_push(matrix_build(_pos[0], _pos[1], 0, 0, 0, 0, _dim[0] * _sca[0], _dim[1] * _sca[1], 1));
|
||||
if(_applyLocal) _3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
}
|
||||
|
||||
function _3d_post_setup() {
|
||||
shader_reset();
|
||||
|
||||
matrix_stack_clear();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
|
||||
gpu_set_ztestenable(false);
|
||||
camera_apply(0);
|
||||
|
||||
surface_reset_target();
|
||||
}
|
||||
#endregion
|
|
@ -363,6 +363,5 @@ function Node_VFX(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
static update = function() {
|
||||
reset();
|
||||
}
|
||||
doUpdate();
|
||||
render();
|
||||
}
|
|
@ -3,6 +3,7 @@
|
|||
frames_total = 30;
|
||||
current_frame = 0;
|
||||
real_frame = 0;
|
||||
time_since_last_frame = 0;
|
||||
framerate = 30;
|
||||
is_playing = false;
|
||||
frame_progress = false;
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
function APPEND(_path) {
|
||||
APPENDING = true;
|
||||
|
||||
var log = false;
|
||||
if(_path == "") return;
|
||||
var log = true;
|
||||
if(_path == "") return noone;
|
||||
var _map = json_load(_path);
|
||||
|
||||
if(_map == -1) {
|
||||
printlog("Decode error");
|
||||
return
|
||||
return noone;
|
||||
}
|
||||
|
||||
if(ds_map_exists(_map, "version")) {
|
||||
|
@ -34,8 +34,7 @@ function APPEND(_path) {
|
|||
var _node = nodeLoad(_node_list[| i], true);
|
||||
if(_node) ds_list_add(appended_list, _node);
|
||||
}
|
||||
printlog("Load time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Load time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++) {
|
||||
|
@ -48,8 +47,7 @@ function APPEND(_path) {
|
|||
} catch(e) {
|
||||
log_warning("APPEND, node", exception_print(e));
|
||||
}
|
||||
printlog("Load group time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Load group time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
|
@ -57,8 +55,7 @@ function APPEND(_path) {
|
|||
} catch(e) {
|
||||
log_warning("APPEND, deserialize", exception_print(e));
|
||||
}
|
||||
printlog("Deserialize time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Deserialize time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
|
@ -66,6 +63,7 @@ function APPEND(_path) {
|
|||
} catch(e) {
|
||||
log_warning("LOAD, apply deserialize", exception_print(e));
|
||||
}
|
||||
printlog("Apply deserialize time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
|
@ -77,8 +75,7 @@ function APPEND(_path) {
|
|||
} catch(e) {
|
||||
log_warning("APPEND, connect", exception_print(e));
|
||||
}
|
||||
printlog("Connect time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Connect time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
try {
|
||||
for(var i = 0; i < ds_list_size(appended_list); i++)
|
||||
|
@ -86,8 +83,7 @@ function APPEND(_path) {
|
|||
} catch(e) {
|
||||
log_warning("APPEND, update", exception_print(e));
|
||||
}
|
||||
printlog("Update time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Update time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
ds_list_destroy(appended_list);
|
||||
|
||||
|
@ -115,11 +111,11 @@ function APPEND(_path) {
|
|||
log_warning("APPEND, Conflict solver error : ", exception_print(e));
|
||||
}
|
||||
}
|
||||
printlog("Conflict time: " + string(current_time - t));
|
||||
t = current_time;
|
||||
printlog("Conflict time: " + string(current_time - t)); t = current_time;
|
||||
|
||||
APPENDING = false;
|
||||
PANEL_ANIMATION.updatePropertyList();
|
||||
UPDATE = RENDER_TYPE.full;
|
||||
|
||||
log_message("FILE", "append file " + _path, THEME.noti_icon_file_load);
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
function button(_onClick) {
|
||||
return new buttonClass(_onClick);
|
||||
function button(_onClick, _icon = noone) {
|
||||
return new buttonClass(_onClick, _icon);
|
||||
}
|
||||
|
||||
function buttonClass(_onClick) constructor {
|
||||
function buttonClass(_onClick, _icon = noone) constructor {
|
||||
active = false;
|
||||
hover = false;
|
||||
|
||||
icon = noone;
|
||||
icon = _icon;
|
||||
icon_blend = c_white;
|
||||
icon_index = 0;
|
||||
|
||||
|
|
|
@ -45,9 +45,9 @@ function searchCollection(_list, _search_str, _claer_list = true) {
|
|||
var _nd = _st.content[| i];
|
||||
|
||||
var match = string_pos(search_lower, string_lower(_nd.name)) > 0;
|
||||
if(match) {
|
||||
ds_list_add(_list, _nd);
|
||||
}
|
||||
if(!match) continue;
|
||||
|
||||
ds_list_add(_list, _nd);
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_st.subDir); i++ ) {
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
up
|
||||
}
|
||||
|
||||
globalvar KEYBOARD_STRING, KEYBOARD_PRESSED;
|
||||
globalvar CTRL, ALT, SHIFT;
|
||||
|
||||
KEYBOARD_PRESSED = vk_nokey;
|
||||
CTRL = KEYBOARD_STATUS.idle;
|
||||
ALT = KEYBOARD_STATUS.idle;
|
||||
SHIFT = KEYBOARD_STATUS.idle;
|
||||
|
|
|
@ -10,8 +10,6 @@ function __log(title, str, fname = "log.txt") {
|
|||
var t = _log_template();
|
||||
file_text_write_string(f, string(title) + t + string(str) + "\n");
|
||||
file_text_close(f);
|
||||
|
||||
show_debug_message(str);
|
||||
}
|
||||
|
||||
function log_message(title, str, icon = noone) {
|
||||
|
@ -46,12 +44,15 @@ function log_clear() {
|
|||
}
|
||||
|
||||
function exception_print(e) {
|
||||
var str = exception_print(e) + "\n\n\n=== Stack trace ===\n";
|
||||
var str = "\n\n========== Crash log ==========\n\n" + e.longMessage;
|
||||
str += "\n\n========== Stack trace ==========\n\n";
|
||||
|
||||
for( var i = 0; i < array_length(e.stacktrace); i++ ) {
|
||||
str += e.stacktrace[i] + "\n"
|
||||
}
|
||||
|
||||
str += "\n\n========= Crash log end =========\n";
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
COLOR_KEYS = [];
|
||||
|
||||
globalvar VERSION, SAVEFILE_VERSION, VERSION_STRING;
|
||||
VERSION = 1080;
|
||||
SAVEFILE_VERSION = 1070;
|
||||
VERSION_STRING = "1.0.8";
|
||||
VERSION = 1090;
|
||||
SAVEFILE_VERSION = 1090;
|
||||
VERSION_STRING = "1.0.9";
|
||||
|
||||
globalvar NODES, NODE_MAP, APPEND_MAP, HOTKEYS, HOTKEY_CONTEXT;
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
HOTKEY_CONTEXT = ds_list_create();
|
||||
HOTKEY_CONTEXT[| 0] = "";
|
||||
|
||||
globalvar CURSOR, TOOLTIP, DIALOG_DEPTH_HOVER, KEYBOARD_STRING;
|
||||
globalvar CURSOR, TOOLTIP, DIALOG_DEPTH_HOVER;
|
||||
globalvar UPDATE, RENDER_STACK;
|
||||
#endregion
|
||||
|
||||
|
@ -74,7 +74,10 @@
|
|||
#macro sFOCUS FOCUS == self
|
||||
#macro sHOVER HOVER == self
|
||||
|
||||
#macro DELTA_TIME delta_time / 1000000
|
||||
#macro DELTA_TIME delta_time / 1_000_000
|
||||
|
||||
#macro TESTING false
|
||||
#macro Tester:TESTING true
|
||||
|
||||
#region color
|
||||
#macro c_ui_blue_dkblack $251919
|
||||
|
|
|
@ -15,11 +15,4 @@ function json_save(path, struct) {
|
|||
var f = file_text_open_write(path);
|
||||
file_text_write_string(f, s);
|
||||
file_text_close(f);
|
||||
}
|
||||
|
||||
function file_text_read_all(file) {
|
||||
var s = "";
|
||||
while(!file_text_eof(file))
|
||||
s += file_text_readln(file);
|
||||
return s;
|
||||
}
|
|
@ -9,6 +9,13 @@ function MTLmaterial(name) constructor {
|
|||
self.spec_path = "";
|
||||
}
|
||||
|
||||
function str_strip_nr(str) {
|
||||
str = string_replace_all(str, "\n", "");
|
||||
str = string_replace_all(str, "\r", "");
|
||||
str = string_replace_all(str, "\\", "/");
|
||||
return str;
|
||||
}
|
||||
|
||||
function readMtl(path) {
|
||||
if(!file_exists(path)) return [];
|
||||
|
||||
|
@ -25,15 +32,15 @@ function readMtl(path) {
|
|||
|
||||
switch(sep[0]) {
|
||||
case "newmtl" :
|
||||
cur_mat = new MTLmaterial(sep[1]);
|
||||
cur_mat = new MTLmaterial(str_strip_nr(sep[1]));
|
||||
array_push(mat, cur_mat);
|
||||
break;
|
||||
case "Ka" : cur_mat.refc = colorFromRGBArray([sep[1], sep[2], sep[3]]); break;
|
||||
case "Kd" : cur_mat.diff = colorFromRGBArray([sep[1], sep[2], sep[3]]); break;
|
||||
case "Ks" : cur_mat.spec = colorFromRGBArray([sep[1], sep[2], sep[3]]); break;
|
||||
case "map_Ka": cur_mat.refc_path = filename_dir(path) + "/" + sep[1]; break;
|
||||
case "map_Kd": cur_mat.diff_path = filename_dir(path) + "/" + sep[1]; break;
|
||||
case "map_Ks": cur_mat.spec_path = filename_dir(path) + "/" + sep[1]; break;
|
||||
case "map_Ka": cur_mat.refc_path = filename_dir(path) + "/" + str_strip_nr(sep[1]); break;
|
||||
case "map_Kd": cur_mat.diff_path = filename_dir(path) + "/" + str_strip_nr(sep[1]); break;
|
||||
case "map_Ks": cur_mat.spec_path = filename_dir(path) + "/" + str_strip_nr(sep[1]); break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,12 +46,18 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 11] = nodeValue(11, "Attenuation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, ["Quadratic", "Invert quadratic", "Linear"]);
|
||||
|
||||
inputs[| 12] = nodeValue(12, "Radial banding", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 16, 1]);
|
||||
|
||||
inputs[| 13] = nodeValue(13, "Radial start", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "Light only", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Shape", false], 1, 2, 6, 7, 8, 9,
|
||||
["Light", false], 3, 4, 5,
|
||||
["Light", false], 3, 4, 5, 12, 13,
|
||||
["Render", false], 11, 10
|
||||
];
|
||||
|
||||
|
@ -77,7 +83,7 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
}
|
||||
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _shape = _data[1];
|
||||
|
||||
switch(_shape) {
|
||||
|
@ -88,6 +94,9 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 7].setVisible(false);
|
||||
inputs[| 8].setVisible(false);
|
||||
inputs[| 9].setVisible(false);
|
||||
|
||||
inputs[| 12].setVisible(true);
|
||||
inputs[| 13].setVisible(true);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.line :
|
||||
case LIGHT_SHAPE_2D.line_asym :
|
||||
|
@ -97,6 +106,9 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 7].setVisible(true);
|
||||
inputs[| 8].setVisible(true);
|
||||
inputs[| 9].setVisible(_shape == LIGHT_SHAPE_2D.line_asym);
|
||||
|
||||
inputs[| 12].setVisible(false);
|
||||
inputs[| 13].setVisible(false);
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.spot :
|
||||
inputs[| 2].setVisible(false);
|
||||
|
@ -105,6 +117,9 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
inputs[| 7].setVisible(true);
|
||||
inputs[| 8].setVisible(true);
|
||||
inputs[| 9].setVisible(false);
|
||||
|
||||
inputs[| 12].setVisible(false);
|
||||
inputs[| 13].setVisible(false);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -139,7 +154,38 @@ function Node_2D_light(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) con
|
|||
|
||||
switch(_shape) {
|
||||
case LIGHT_SHAPE_2D.point :
|
||||
draw_circle_color(_pos[0], _pos[1], _range, c_white, c_black, 0);
|
||||
var _rbnd = _data[12];
|
||||
var _rbns = _data[13];
|
||||
|
||||
if(_rbnd < 2)
|
||||
draw_circle_color(_pos[0], _pos[1], _range, c_white, c_black, 0);
|
||||
else {
|
||||
_rbnd *= 2;
|
||||
var bnd_amo = ceil(64 / _rbnd);
|
||||
var step = bnd_amo * _rbnd;
|
||||
var astp = 360 / step;
|
||||
var ox, oy, nx, ny;
|
||||
var banding = false;
|
||||
|
||||
draw_primitive_begin(pr_trianglelist);
|
||||
|
||||
for( var i = 0; i < step; i++ ) {
|
||||
var dir = _rbns + i * astp;
|
||||
nx = _pos[0] + lengthdir_x(_range, dir);
|
||||
ny = _pos[1] + lengthdir_y(_range, dir);
|
||||
|
||||
if(floor(i / bnd_amo) % 2 && i) {
|
||||
draw_vertex_color(_pos[0], _pos[1], c_white, 1);
|
||||
draw_vertex_color(ox, oy, c_black, 1);
|
||||
draw_vertex_color(nx, ny, c_black, 1);
|
||||
}
|
||||
|
||||
ox = nx;
|
||||
oy = ny;
|
||||
}
|
||||
|
||||
draw_primitive_end();
|
||||
}
|
||||
break;
|
||||
case LIGHT_SHAPE_2D.line :
|
||||
case LIGHT_SHAPE_2D.line_asym :
|
||||
|
|
|
@ -2,21 +2,13 @@ function Node_create_3D_Obj_path(_x, _y, path) {
|
|||
if(!file_exists(path)) return noone;
|
||||
|
||||
var node = new Node_3D_Obj(_x, _y);
|
||||
node.inputs[| 0].setValue(path);
|
||||
node.updateObj();
|
||||
node.doUpdate();
|
||||
return node;
|
||||
node.setPath(path);
|
||||
return node;
|
||||
}
|
||||
|
||||
function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Obj";
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
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", "" ]);
|
||||
|
||||
|
@ -29,11 +21,11 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
inputs[| 2] = nodeValue(2, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
inputs[| 3] = nodeValue(3, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef( function() { return inputs[| 2].getValue(); });
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 180 ])
|
||||
inputs[| 4] = nodeValue(4, "Render rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
|
@ -49,21 +41,34 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
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 ])
|
||||
inputs[| 11] = nodeValue(11, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 12] = nodeValue(12, "Flip UV", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 13] = nodeValue(13, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 180 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 14] = nodeValue(14, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [ 2,
|
||||
["Geometry", false], 0, 1,
|
||||
["Transform", false], 3, 4, 5, 11,
|
||||
["Light", false], 6, 7, 8, 9, 10,
|
||||
["Textures", true],
|
||||
["Geometry", false], 0, 1,
|
||||
["Object transform", false], 14, 13, 11,
|
||||
["Render", false], 3, 5,
|
||||
["Light", false], 6, 7, 8, 9, 10,
|
||||
["Textures", true], 12,
|
||||
];
|
||||
input_length = ds_list_size(inputs);
|
||||
input_display_len = array_length(input_display_list);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(2, /*Transform*/ 3, 13, 5);
|
||||
|
||||
function reset_tex() {
|
||||
tex_surface = PIXEL_SURFACE;
|
||||
|
@ -73,6 +78,16 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
reset_tex();
|
||||
|
||||
static onValueUpdate = function(index) {
|
||||
if(index == 12) updateObj();
|
||||
}
|
||||
|
||||
function setPath(path) {
|
||||
inputs[| 0].setValue(path);
|
||||
updateObj();
|
||||
doUpdate();
|
||||
}
|
||||
|
||||
function createMaterial(m_index) {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index] = nodeValue( index, materialNames[m_index] + " texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, tex_surface);
|
||||
|
@ -84,6 +99,7 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
var matY = y - (array_length(materials) - 1) / 2 * (128 + 32);
|
||||
var mat = materials[m_index];
|
||||
|
||||
if(file_exists(mat.diff_path)) {
|
||||
var sol = Node_create_Image_path(x - (w + 64), matY + m_index * (128 + 32), mat.diff_path);
|
||||
sol.name = mat.name + " texture";
|
||||
|
@ -98,17 +114,16 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
}
|
||||
}
|
||||
|
||||
VB = [];
|
||||
materialNames = [];
|
||||
materialIndex = [];
|
||||
materials = [];
|
||||
use_normal = true;
|
||||
|
||||
|
||||
static updateObj = function() {
|
||||
var _path = inputs[| 0].getValue();
|
||||
var _path = inputs[| 0].getValue();
|
||||
var _flip = inputs[| 12].getValue();
|
||||
var _pathMtl = string_copy(_path, 1, string_length(_path) - 4) + ".mtl";
|
||||
|
||||
var _v = readObj(_path);
|
||||
var _v = readObj(_path, _flip);
|
||||
if(_v != noone) {
|
||||
VB = _v[0];
|
||||
materialNames = _v[1];
|
||||
|
@ -121,111 +136,36 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
else {
|
||||
materialNames = ["Material"];
|
||||
materialIndex = [0];
|
||||
materials = [new MTLmaterial("Material")];
|
||||
materials = [ new MTLmaterial("Material") ];
|
||||
}
|
||||
|
||||
do_reset_material = true;
|
||||
}
|
||||
do_reset_material = false;
|
||||
|
||||
#region 3D setup
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
#endregion
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) active = false;
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny, true);
|
||||
}
|
||||
|
||||
static submit_vertex = function() {
|
||||
var _lpos = inputs[| 14].getValue();
|
||||
var _lrot = inputs[| 13].getValue();
|
||||
var _lsca = inputs[| 11].getValue();
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
var _rot = inputs[| 4].getValue();
|
||||
var cx = _x + _pos[0] * _s;
|
||||
var cy = _y + _pos[1] * _s;
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * -6;
|
||||
_rot[1] = drag_sv + dx;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * 6;
|
||||
_rot[0] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var dy = point_direction(cx, cy, _mx, _my) - point_direction(cx, cy, drag_mx, drag_my);
|
||||
_rot[2] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(active && distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
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();
|
||||
|
||||
if(!is_surface(tex)) continue;
|
||||
vertex_submit(VB[i], pr_trianglelist, surface_get_texture(tex));
|
||||
}
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
|
@ -242,63 +182,26 @@ function Node_3D_Obj(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
do_reset_material = false;
|
||||
}
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
var _rot = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
//var _rot = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
|
||||
var _ldir = inputs[| 6].getValue();
|
||||
var _lhgt = inputs[| 7].getValue();
|
||||
var _lint = inputs[| 8].getValue();
|
||||
var _lclr = inputs[| 9].getValue();
|
||||
var _ldir = inputs[| 6].getValue();
|
||||
var _lhgt = inputs[| 7].getValue();
|
||||
var _lint = inputs[| 8].getValue();
|
||||
var _lclr = inputs[| 9].getValue();
|
||||
var _aclr = inputs[| 10].getValue();
|
||||
var _lsc = inputs[| 11].getValue();
|
||||
|
||||
var _lpos = inputs[| 14].getValue();
|
||||
var _lrot = inputs[| 13].getValue();
|
||||
var _lsca = inputs[| 11].getValue();
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
outputs[| 0].setValue(_outSurf);
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
|
||||
var TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _dim[0] * _sca[0], _dim[1] * _sca[1], 1);
|
||||
var cam_proj = matrix_build_projection_ortho(_dim[0], _dim[1], 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(sh_vertex_pnt_light);
|
||||
shader_set_uniform_f_array(uniVertex_lightFor, lightFor);
|
||||
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();
|
||||
|
||||
if(!is_surface(tex)) continue;
|
||||
vertex_submit(VB[i], pr_trianglelist, surface_get_texture(tex));
|
||||
}
|
||||
shader_reset();
|
||||
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
surface_reset_target();
|
||||
|
||||
gpu_set_ztestenable(false);
|
||||
camera_apply(0);
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, false);
|
||||
submit_vertex();
|
||||
_3d_post_setup();
|
||||
}
|
||||
}
|
137
scripts/node_3d_combine/node_3d_combine.gml
Normal file
|
@ -0,0 +1,137 @@
|
|||
function Node_3D_Combine(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Combine";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef( function() { return inputs[| 2].getValue(); });
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 6] = nodeValue(6, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01]);
|
||||
|
||||
inputs[| 8] = nodeValue(8, "Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
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);
|
||||
|
||||
input_display_list = [ 0,
|
||||
["Object transform", false], 1, 2, 3,
|
||||
["Render", false], 4, 5,
|
||||
["Light", false], 6, 7, 8, 9, 10,
|
||||
["Objects", true],
|
||||
];
|
||||
input_fix_len = ds_list_size(inputs);
|
||||
input_display_len = array_length(input_display_list);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D objects", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(1, /*Transform*/ 4, 2, 5);
|
||||
|
||||
static createNewInput = function() {
|
||||
var index = ds_list_size(inputs);
|
||||
inputs[| index] = nodeValue( index, "3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone )
|
||||
.setVisible(true, true);
|
||||
|
||||
array_push(input_display_list, index);
|
||||
}
|
||||
if(!LOADING && !APPENDING) createNewInput();
|
||||
|
||||
static updateValueFrom = function(index) {
|
||||
if(index < input_fix_len) return;
|
||||
if(LOADING || APPENDING) return;
|
||||
|
||||
var _l = ds_list_create();
|
||||
for( var i = 0; i < ds_list_size(inputs); i++ ) {
|
||||
if(i < input_fix_len || inputs[| i].value_from)
|
||||
ds_list_add(_l, inputs[| i]);
|
||||
else
|
||||
delete inputs[| i];
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_l); i++ )
|
||||
_l[| i].index = i;
|
||||
|
||||
ds_list_destroy(inputs);
|
||||
inputs = _l;
|
||||
|
||||
var _d = [];
|
||||
for( var i = 0; i < array_length(input_display_list); i++ ) {
|
||||
var ind = input_display_list[i];
|
||||
|
||||
if(i < input_display_len || ind < ds_list_size(inputs))
|
||||
array_push(_d, input_display_list[i]);
|
||||
}
|
||||
input_display_list = _d;
|
||||
|
||||
createNewInput();
|
||||
}
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static submit_vertex = function() {
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
for( var i = input_fix_len; i < ds_list_size(inputs) - 1; i++ ) {
|
||||
var sv = inputs[| i].getValue();
|
||||
|
||||
if(is_array(sv)) {
|
||||
for( var j = 0; j < array_length(sv); j++ ) {
|
||||
var _sv = sv[j];
|
||||
_sv(j);
|
||||
}
|
||||
} else
|
||||
sv();
|
||||
}
|
||||
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _dim = inputs[| 0].getValue();
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
var _pos = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
|
||||
var _ldir = inputs[| 6].getValue();
|
||||
var _lhgt = inputs[| 7].getValue();
|
||||
var _lint = inputs[| 8].getValue();
|
||||
var _lclr = inputs[| 9].getValue();
|
||||
var _aclr = inputs[| 10].getValue();
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
outputs[| 0].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, false);
|
||||
submit_vertex();
|
||||
_3d_post_setup();
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_transform",
|
||||
"name": "node_3d_combine",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
12
scripts/node_3d_combine/node_3d_prim_cube.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_prim_cube",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -1,61 +1,69 @@
|
|||
function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
function Node_3D_Extrude(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Extrude";
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
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).rejectArray();
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
inputs[| 2] = nodeValue(2, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 0.1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef( function() { return inputs[| 1].getValue(); });
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 0.1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
inputs[| 6] = nodeValue(6, "Render rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 6] = nodeValue(6, "Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
inputs[| 7] = nodeValue(7, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 8] = nodeValue(8, "Manual generate", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.button, [ function() {
|
||||
generateMesh();
|
||||
update();
|
||||
}, "Generate"] );
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
inputs[| 9] = nodeValue(9, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 8] = nodeValue(8, "Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
inputs[| 10] = nodeValue(10, "Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01]);
|
||||
|
||||
inputs[| 9] = nodeValue(9, "Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
inputs[| 11] = nodeValue(11, "Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
inputs[| 10] = nodeValue(10, "Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
inputs[| 11] = nodeValue(11, "Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey);
|
||||
inputs[| 12] = nodeValue(12, "Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
inputs[| 13] = nodeValue(13, "Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey);
|
||||
|
||||
inputs[| 12] = nodeValue(12, "Height map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
inputs[| 14] = nodeValue(14, "Height map", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 15] = nodeValue(15, "Always update", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
input_display_list = [1,
|
||||
["Geometry", false], 0, 12, 6,
|
||||
["Transform", false], 2, 3, 4, 5,
|
||||
["Light", false], 7, 8, 9, 10, 11
|
||||
["Geometry", false], 0, 12, 8, 14,
|
||||
["Object transform", false], 2, 3, 4,
|
||||
["Render", false], 5, 7, 15,
|
||||
["Light", false], 9, 10, 11, 12, 13,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
VB = vertex_create_buffer();
|
||||
vertex_begin(VB, FORMAT_PT);
|
||||
vertex_end(VB);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
|
||||
_3d_node_init(1, /*Transform*/ 5, 3, 7);
|
||||
|
||||
VB = [];
|
||||
VB[0] = vertex_create_buffer();
|
||||
vertex_begin(VB[0], FORMAT_PT);
|
||||
vertex_end(VB[0]);
|
||||
|
||||
static onValueUpdate = function(index) {
|
||||
if(index == 0 || index == 12)
|
||||
|
@ -74,7 +82,16 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
static generateMesh = function() {
|
||||
var _ins = inputs[| 0].getValue();
|
||||
var _hei = inputs[| 12].getValue();
|
||||
if(!is_array(_ins)) _ins = [ _ins ];
|
||||
|
||||
for( var i = 0; i < array_length(_ins); i++ ) {
|
||||
VB[i] = generateMeshIndex(i);
|
||||
}
|
||||
}
|
||||
|
||||
static generateMeshIndex = function(index) {
|
||||
var _ins = getSingleValue( 0, index);
|
||||
var _hei = getSingleValue(12, index);
|
||||
if(!is_surface(_ins)) return;
|
||||
|
||||
var ww = surface_get_width(_ins);
|
||||
|
@ -111,6 +128,7 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
buffer_get_surface(surface_buffer, _ins, 0);
|
||||
buffer_seek(surface_buffer, buffer_seek_start, 0);
|
||||
|
||||
var VB = vertex_create_buffer();
|
||||
vertex_begin(VB, FORMAT_PNT);
|
||||
var ap = array_create(ww, hh);
|
||||
|
||||
|
@ -191,164 +209,53 @@ function Node_3D_Extrude(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
}
|
||||
}
|
||||
vertex_end(VB);
|
||||
return VB;
|
||||
}
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _pos = inputs[| 2].getValue();
|
||||
var _rot = inputs[| 3].getValue();
|
||||
var cx = _x + _pos[0] * _s;
|
||||
var cy = _y + _pos[1] * _s;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * 6;
|
||||
_rot[1] = drag_sv + dx;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * -6;
|
||||
_rot[0] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var da = point_direction(cx, cy, _mx, _my);
|
||||
_rot[2] = da;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
#region 3D setup
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
static submit_vertex = function(index) {
|
||||
var _ins = getSingleValue(0, index);
|
||||
if(!is_surface(_ins)) return;
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
#endregion
|
||||
var _lpos = getSingleValue(2, index);
|
||||
var _lrot = getSingleValue(3, index);
|
||||
var _lsca = getSingleValue(4, index);
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
vertex_submit(VB[index], pr_trianglelist, surface_get_texture(_ins));
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _ins = inputs[| 0].getValue();
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _pos = inputs[| 2].getValue();
|
||||
var _rot = inputs[| 3].getValue();
|
||||
var _lsc = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _ins = _data[ 0];
|
||||
var _dim = _data[ 1];
|
||||
var _lpos = _data[ 2];
|
||||
var _lrot = _data[ 3];
|
||||
var _lsca = _data[ 4];
|
||||
|
||||
var _ldir = inputs[| 7].getValue();
|
||||
var _lhgt = inputs[| 8].getValue();
|
||||
var _lint = inputs[| 9].getValue();
|
||||
var _lclr = inputs[| 10].getValue();
|
||||
var _aclr = inputs[| 11].getValue();
|
||||
var _pos = _data[ 5];
|
||||
var _sca = _data[ 7];
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
outputs[| 0].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
var _ldir = _data[ 9];
|
||||
var _lhgt = _data[10];
|
||||
var _lint = _data[11];
|
||||
var _lclr = _data[12];
|
||||
var _aclr = _data[13];
|
||||
|
||||
var _upda = _data[15];
|
||||
|
||||
surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
if(!is_surface(_ins)) return _outSurf;
|
||||
|
||||
if(ANIMATOR.frame_progress)
|
||||
if(_upda && ANIMATOR.frame_progress)
|
||||
generateMesh();
|
||||
|
||||
var TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _dim[0] * _sca[0], _dim[1] * _sca[1], 1);
|
||||
var cam_proj = matrix_build_projection_ortho(_dim[0], _dim[1], 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(sh_vertex_pnt_light);
|
||||
shader_set_uniform_f_array(uniVertex_lightFor, lightFor);
|
||||
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);
|
||||
|
||||
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());
|
||||
vertex_submit(VB, pr_trianglelist, surface_get_texture(_ins));
|
||||
|
||||
shader_reset();
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
surface_reset_target();
|
||||
|
||||
gpu_set_ztestenable(false);
|
||||
camera_apply(0);
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, false);
|
||||
submit_vertex(_array_index);
|
||||
_3d_post_setup();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
function Node_3D_Transform(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Transform";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef( function() { return inputs[| 2].getValue(); });
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 6] = nodeValue(6, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01]);
|
||||
|
||||
inputs[| 8] = nodeValue(8, "Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
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, "3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
input_display_list = [ 0, 11,
|
||||
["Object transform", false], 1, 2, 3,
|
||||
["Render", false], 4, 5,
|
||||
["Light", true], 6, 7, 8, 9, 10,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(1, /*Transform*/ 4, 2, 5);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static submit_vertex = function() {
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
var sv = inputs[| 11].getValue();
|
||||
if(sv == noone) return;
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
if(is_array(sv)) {
|
||||
for( var i = 0; i < array_length(sv); i++ ) {
|
||||
var _sv = sv[i];
|
||||
_sv(i);
|
||||
}
|
||||
} else
|
||||
sv();
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _dim = inputs[| 0].getValue();
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
var _pos = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
|
||||
var _ldir = inputs[| 6].getValue();
|
||||
var _lhgt = inputs[| 7].getValue();
|
||||
var _lint = inputs[| 8].getValue();
|
||||
var _lclr = inputs[| 9].getValue();
|
||||
var _aclr = inputs[| 10].getValue();
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
outputs[| 0].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, false);
|
||||
submit_vertex();
|
||||
_3d_post_setup();
|
||||
}
|
||||
}
|
11
scripts/node_3d_object_transform/node_3d_object_transform.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_object_transform",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
}
|
12
scripts/node_3d_object_transform/node_3d_prim_cube.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_prim_cube",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
126
scripts/node_3d_plane/node_3d_plane.gml
Normal file
|
@ -0,0 +1,126 @@
|
|||
function Node_3D_Plane(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Plane";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0.5, 0.5 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); }, VALUE_UNIT.reference);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, OUTPUT_SCALING.same_as_input)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Same as input", "Constant", "Relative to input" ]);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Constant dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 6] = nodeValue(6, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [0,
|
||||
["Outputs", true], 4, 5,
|
||||
["Object transform", false], 6, 2, 7,
|
||||
["Render", false], 1, 3,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(0, /*Transform*/ 1, 2, 3);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
var _out = outputs[| 0].getValue();
|
||||
if(!is_surface(_out) || !surface_exists(_out)) return;
|
||||
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static submit_vertex = function(index = 0) {
|
||||
var _lpos = getSingleValue( 6, index);
|
||||
var _lrot = getSingleValue( 2, index);
|
||||
var _lsca = getSingleValue( 7, index);
|
||||
|
||||
var _inSurf = getSingleValue(0, index);
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
vertex_submit(PRIMITIVES[? "plane"], pr_trianglelist, surface_get_texture(_inSurf));
|
||||
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
if(!is_surface(_data[0])) return _outSurf;
|
||||
|
||||
var _out_type = _data[4];
|
||||
var _out = _data[5];
|
||||
|
||||
var _ww, _hh;
|
||||
|
||||
switch(_out_type) {
|
||||
case OUTPUT_SCALING.same_as_input :
|
||||
inputs[| 5].setVisible(false);
|
||||
_ww = surface_get_width(_data[0]);
|
||||
_hh = surface_get_height(_data[0]);
|
||||
break;
|
||||
case OUTPUT_SCALING.constant :
|
||||
inputs[| 5].setVisible(true);
|
||||
_ww = _out[0];
|
||||
_hh = _out[1];
|
||||
break;
|
||||
case OUTPUT_SCALING.relative :
|
||||
inputs[| 5].setVisible(true);
|
||||
_ww = surface_get_width(_data[0]) * _out[0];
|
||||
_hh = surface_get_height(_data[0]) * _out[1];
|
||||
break;
|
||||
}
|
||||
|
||||
if(_ww <= 0 || _hh <= 0) return;
|
||||
_outSurf = surface_verify(_outSurf, _ww, _hh);
|
||||
|
||||
var _pos = _data[1];
|
||||
var _sca = _data[3];
|
||||
|
||||
var _lpos = _data[6];
|
||||
var _lrot = _data[2];
|
||||
var _lsca = _data[7];
|
||||
|
||||
var cam_proj = matrix_build_projection_ortho(_ww, _hh, 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _ww, _hh);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
||||
shader_set(sh_vertex_pt);
|
||||
camera_apply(cam);
|
||||
|
||||
matrix_stack_push(matrix_build(_pos[0], _pos[1], 0, 0, 0, 0, _ww * _sca[0], _hh * _sca[1], 1));
|
||||
matrix_stack_push(matrix_build(_lpos[0], _lpos[1], _lpos[2], 0, 0, 0, 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0, 0, _lrot[0], _lrot[1], _lrot[2], 1, 1, 1));
|
||||
matrix_stack_push(matrix_build(0, 0, 0, 0, 0, 0, _lsca[0], _lsca[1], _lsca[2]));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
|
||||
vertex_submit(PRIMITIVES[? "plane"], pr_trianglelist, surface_get_texture(_data[0]));
|
||||
shader_reset();
|
||||
|
||||
matrix_stack_clear();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
11
scripts/node_3d_plane/node_3d_plane.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_plane",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
}
|
|
@ -2,21 +2,16 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
name = "3D Cube";
|
||||
dimension_index = 1;
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
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)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
inputs[| 2] = nodeValue(2, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
inputs[| 3] = nodeValue(3, "Render rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
|
@ -31,7 +26,7 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
inputs[| 10] = nodeValue(10, "Textures 4", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0).setVisible(false);
|
||||
inputs[| 11] = nodeValue(11, "Textures 5", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0).setVisible(false);
|
||||
|
||||
inputs[| 12] = nodeValue(12, "Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
inputs[| 12] = nodeValue(12, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 13] = nodeValue(13, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -44,124 +39,73 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
inputs[| 16] = nodeValue(16, "Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
|
||||
inputs[| 17] = nodeValue(17, "Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey);
|
||||
|
||||
input_display_list = [
|
||||
["Transform", false], 0, 1, 2, 3, 12, 4,
|
||||
["Texture", true], 5, 6, 7, 8, 9, 10, 11,
|
||||
["Light", false], 13, 14, 15, 16, 17,
|
||||
inputs[| 18] = nodeValue(18, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 19] = nodeValue(19, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [1,
|
||||
["Object transform",false], 19, 18, 12,
|
||||
["Render", false], 2, 4,
|
||||
["Texture", true], 0, 5, 6, 7, 8, 9, 10, 11,
|
||||
["Light", false], 13, 14, 15, 16, 17,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function(index) { return submit_vertex(index); });
|
||||
|
||||
#region 3D setup
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
#endregion
|
||||
_3d_node_init(1, /*Transform*/ 2, 18, 4);
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
cube_faces = [
|
||||
matrix_build(0, 0, 0.5, 0, 0, 0, 1, 1, 1),
|
||||
matrix_build(0, 0, -0.5, 0, 180, 0, 1, 1, 1),
|
||||
matrix_build(0, 0.5, 0, -90, 0, 0, 1, 1, 1),
|
||||
matrix_build(0, -0.5, 0, 90, 0, 0, 1, 1, 1),
|
||||
matrix_build( 0.5, 0, 0, 0, -90, 0, 1, 1, 1),
|
||||
matrix_build(-0.5, 0, 0, 0, 90, 0, 1, 1, 1),
|
||||
]
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 1].getValue();
|
||||
var _pos = inputs[| 2].getValue();
|
||||
var _rot = inputs[| 3].getValue();
|
||||
var cx = _x + _pos[0] * _s;
|
||||
var cy = _y + _pos[1] * _s;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, drag_index == 0? 3 : 1);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, drag_index == 1? 3 : 1);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * 6;
|
||||
_rot[1] = drag_sv + dx;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * -6;
|
||||
_rot[0] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var da = point_direction(cx, cy, _mx, _my);
|
||||
_rot[2] = da;
|
||||
|
||||
if(inputs[| 3].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(active && distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(active && abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static submit_vertex = function(index = 0) {
|
||||
var _lpos = getSingleValue(19, index);
|
||||
var _lrot = getSingleValue(18, index);
|
||||
var _lsca = getSingleValue(12, index);
|
||||
var _usetex = getSingleValue(5, index);
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
if(_usetex) {
|
||||
for(var i = 0; i < 6; i++) {
|
||||
matrix_stack_push(cube_faces[i]);
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(getSingleValue(6 + i, index)));
|
||||
matrix_stack_pop();
|
||||
}
|
||||
} else {
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "cube"], pr_trianglelist, surface_get_texture(getSingleValue(0, index)));
|
||||
}
|
||||
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _inSurf = _data[0];
|
||||
var _dim = _data[1];
|
||||
var _pos = _data[2];
|
||||
var _rot = _data[3];
|
||||
//var _rot = _data[3];
|
||||
var _sca = _data[4];
|
||||
var _lsc = _data[12];
|
||||
|
||||
var _lpos = _data[19];
|
||||
var _lrot = _data[18];
|
||||
var _lsca = _data[12];
|
||||
|
||||
var _ldir = _data[13];
|
||||
var _lhgt = _data[14];
|
||||
|
@ -170,82 +114,25 @@ function Node_3D_Cube(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
var _aclr = _data[17];
|
||||
|
||||
var _usetex = _data[5];
|
||||
var _ww = _usetex? _dim[0] : surface_get_width(_inSurf);
|
||||
var _hh = _usetex? _dim[1] : surface_get_height(_inSurf);
|
||||
|
||||
for(var i = 6; i <= 11; i++) inputs[| i].setVisible(_usetex);
|
||||
inputs[| 0].setVisible(true, !_usetex);
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca);
|
||||
|
||||
TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _ww * _sca[0], _hh * _sca[1], 1);
|
||||
cam_proj = matrix_build_projection_ortho(_ww, _hh, 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(sh_vertex_pnt_light);
|
||||
shader_set_uniform_f_array(uniVertex_lightFor, lightFor);
|
||||
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);
|
||||
|
||||
matrix_stack_push(TM);
|
||||
matrix_stack_push(matrix_build(0, 0, 0, 0, 0, 0, _lsc[0], _lsc[1], _lsc[2]));
|
||||
|
||||
if(_usetex) {
|
||||
var face = [];
|
||||
for(var i = 0; i < 6; i++) face[i] = _data[6 + i];
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0, 0.5, 0, 0, 0, 1, 1, 1));
|
||||
if(_usetex) {
|
||||
for(var i = 0; i < 6; i++) {
|
||||
matrix_stack_push(cube_faces[i]);
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[0]));
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(_data[6 + i]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0, -0.5, 0, 180, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[1]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0, 0.5, 0, -90, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[2]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0, -0.5, 0, 90, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[3]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(0.5, 0, 0, 0, -90, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[4]));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_stack_push(matrix_build(-0.5, 0, 0, 0, 90, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "plane_normal"], pr_trianglelist, surface_get_texture(face[5]));
|
||||
matrix_stack_pop();
|
||||
} else {
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "cube"], pr_trianglelist, surface_get_texture(_inSurf));
|
||||
}
|
||||
|
||||
shader_reset();
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
surface_reset_target();
|
||||
} else {
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(PRIMITIVES[? "cube"], pr_trianglelist, surface_get_texture(_inSurf));
|
||||
}
|
||||
|
||||
gpu_set_ztestenable(false);
|
||||
camera_apply(0);
|
||||
_3d_post_setup();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
|
|
|
@ -2,12 +2,6 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
name = "3D Cylinder";
|
||||
dimension_index = 2;
|
||||
|
||||
uniVertex_lightFor = shader_get_uniform(sh_vertex_pnt_light, "u_LightForward");
|
||||
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);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Thickness", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2);
|
||||
|
@ -15,11 +9,11 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 2] = nodeValue(2, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
inputs[| 3] = nodeValue(3, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
inputs[| 4] = nodeValue(4, "Render rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
|
@ -29,7 +23,7 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 7] = nodeValue(7, "Textures bottom", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 8] = nodeValue(8, "Textures side", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 9] = nodeValue(9, "Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
inputs[| 9] = nodeValue(9, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 10] = nodeValue(10, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
|
@ -44,14 +38,24 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 13] = nodeValue(13, "Light color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white);
|
||||
inputs[| 14] = nodeValue(14, "Ambient color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_grey);
|
||||
|
||||
inputs[| 15] = nodeValue(15, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 16] = nodeValue(16, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [2,
|
||||
["Geometry", false], 0, 1,
|
||||
["Transform", false], 3, 4, 9, 5,
|
||||
["Texture", true], 6, 7, 8,
|
||||
["Light", false], 10, 11, 12, 13, 14,
|
||||
["Geometry", false], 0, 1,
|
||||
["Object transform", false], 16, 15, 9,
|
||||
["Render", false], 3, 5,
|
||||
["Texture", true], 6, 7, 8,
|
||||
["Light", false], 10, 11, 12, 13, 14,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D object", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(2, /*Transform*/ 3, 15, 5);
|
||||
|
||||
sides = 16;
|
||||
thick = 0.5;
|
||||
|
@ -102,108 +106,36 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
}
|
||||
generate_vb();
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
|
||||
var _dim = inputs[| 2].getValue();
|
||||
var _pos = inputs[| 3].getValue();
|
||||
var _rot = inputs[| 4].getValue();
|
||||
var cx = _x + _pos[0] * _s;
|
||||
var cy = _y + _pos[1] * _s;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * 6;
|
||||
_rot[1] = drag_sv + dx;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * -6;
|
||||
_rot[0] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var da = point_direction(cx, cy, _mx, _my);
|
||||
_rot[2] = da;
|
||||
|
||||
if(inputs[| 4].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inputs[| 3].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
#region 3D setup
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
static submit_vertex = function(index = 0) {
|
||||
var _lpos = getSingleValue(16, index);
|
||||
var _lrot = getSingleValue(15, index);
|
||||
var _lsca = getSingleValue( 9, index);
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
#endregion
|
||||
var face_top = getSingleValue(6, index);
|
||||
var face_bot = getSingleValue(7, index);
|
||||
var face_sid = getSingleValue(8, index);
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_top));
|
||||
|
||||
matrix_stack_push(matrix_build(0, -thick, 0, 0, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_bot));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_sid, pr_trianglelist, surface_get_texture(face_sid));
|
||||
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _sides = _data[0];
|
||||
var _thick = _data[1];
|
||||
|
||||
|
@ -215,12 +147,15 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
var _dim = _data[2];
|
||||
var _pos = _data[3];
|
||||
var _rot = _data[4];
|
||||
//var _rot = _data[4];
|
||||
var _sca = _data[5];
|
||||
var face_top = _data[6];
|
||||
var face_bot = _data[7];
|
||||
var face_sid = _data[8];
|
||||
var _lsc = _data[9];
|
||||
|
||||
var _lpos = _data[16];
|
||||
var _lrot = _data[15];
|
||||
var _lsca = _data[ 9];
|
||||
|
||||
var _ldir = _data[10];
|
||||
var _lhgt = _data[11];
|
||||
|
@ -228,49 +163,20 @@ function Node_3D_Cylinder(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
var _lclr = _data[13];
|
||||
var _aclr = _data[14];
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1]);
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca);
|
||||
|
||||
TM = matrix_build(_pos[0], _pos[1], 0, _rot[0], _rot[1], _rot[2], _dim[0] * _sca[0], _dim[1] * _sca[1], 1);
|
||||
cam_proj = matrix_build_projection_ortho(_dim[0], _dim[1], 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _dim[0], _dim[1]);
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_top));
|
||||
|
||||
matrix_stack_push(matrix_build(0, -thick, 0, 0, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_bot));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_sid, pr_trianglelist, surface_get_texture(face_sid));
|
||||
|
||||
var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ];
|
||||
|
||||
gpu_set_ztestenable(true);
|
||||
surface_set_target(_outSurf);
|
||||
shader_set(sh_vertex_pnt_light);
|
||||
shader_set_uniform_f_array(uniVertex_lightFor, lightFor);
|
||||
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);
|
||||
|
||||
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());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_top));
|
||||
|
||||
matrix_stack_push(matrix_build(0, -thick, 0, 0, 0, 0, 1, 1, 1));
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_top, pr_trianglelist, surface_get_texture(face_bot));
|
||||
matrix_stack_pop();
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
vertex_submit(VB_sid, pr_trianglelist, surface_get_texture(face_sid));
|
||||
|
||||
shader_reset();
|
||||
matrix_stack_pop();
|
||||
matrix_stack_pop();
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
surface_reset_target();
|
||||
|
||||
gpu_set_ztestenable(false);
|
||||
camera_apply(0);
|
||||
_3d_post_setup();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
|
|
12
scripts/node_3d_repeat/node_3d_prim_cube.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_prim_cube",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
171
scripts/node_3d_repeat/node_3d_repeat.gml
Normal file
|
@ -0,0 +1,171 @@
|
|||
function Node_3D_Repeat(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
||||
name = "3D Repeat";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Object position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Object rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Object scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Render position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ def_surf_size / 2, def_surf_size / 2 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef( function() { return inputs[| 2].getValue(); });
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Render scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 6] = nodeValue(6, "Light direction", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
inputs[| 7] = nodeValue(7, "Light height", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.5)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [-1, 1, 0.01]);
|
||||
|
||||
inputs[| 8] = nodeValue(8, "Light intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 1, 0.01]);
|
||||
|
||||
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, "3D object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3object, noone)
|
||||
.setVisible(true, true);
|
||||
|
||||
inputs[| 12] = nodeValue(12, "Repeat", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
||||
|
||||
inputs[| 13] = nodeValue(13, "Repeat position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 14] = nodeValue(14, "Repeat rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 15] = nodeValue(15, "Repeat scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 16] = nodeValue(16, "Repeat pattern", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "Linear", "Radial" ]);
|
||||
|
||||
inputs[| 17] = nodeValue(17, "Axis", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_button, [ "x", "y", "z" ]);
|
||||
|
||||
inputs[| 18] = nodeValue(18, "Radius", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1);
|
||||
|
||||
inputs[| 19] = nodeValue(19, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, [ 0, 360 ])
|
||||
.setDisplay(VALUE_DISPLAY.rotation_range);
|
||||
|
||||
input_display_list = [ 0, 11,
|
||||
["Object transform", true], 1, 2, 3,
|
||||
["Render", true], 4, 5,
|
||||
["Light", true], 6, 7, 8, 9, 10,
|
||||
["Repeat", false], 12, 16, 13, 14, 15, 17, 18, 19
|
||||
];
|
||||
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
outputs[| 1] = nodeValue(1, "3D objects", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3object, function() { return submit_vertex(); });
|
||||
|
||||
_3d_node_init(1, /*Transform*/ 4, 2, 5);
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
_3d_gizmo(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static submit_vertex = function() {
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
var sv = inputs[| 11].getValue();
|
||||
if(sv == noone) return;
|
||||
|
||||
var _samo = inputs[| 12].getValue();
|
||||
var _patt = inputs[| 16].getValue();
|
||||
|
||||
var _srot = inputs[| 14].getValue();
|
||||
var _ssca = inputs[| 15].getValue();
|
||||
|
||||
var _spos = inputs[| 13].getValue();
|
||||
|
||||
var _raxs = inputs[| 17].getValue();
|
||||
var _rrad = inputs[| 18].getValue();
|
||||
var _rrot = inputs[| 19].getValue();
|
||||
|
||||
_3d_local_transform(_lpos, _lrot, _lsca);
|
||||
for( var i = 0; i < _samo; i++ ) {
|
||||
if(_patt == 0) {
|
||||
matrix_stack_push(matrix_build( _spos[0] * i, _spos[1] * i, _spos[2] * i,
|
||||
_srot[0] * i, _srot[1] * i, _srot[2] * i,
|
||||
power(_ssca[0], i), power(_ssca[1], i), power(_ssca[2], i)));
|
||||
} else if(_patt == 1) {
|
||||
var angle = _rrot[0] + i * (_rrot[1] - _rrot[0]) / _samo;
|
||||
var ldx = lengthdir_x(_rrad, angle);
|
||||
var ldy = lengthdir_y(_rrad, angle);
|
||||
|
||||
switch(_raxs) {
|
||||
case 0 :
|
||||
matrix_stack_push(matrix_build( 0, ldx, ldy,
|
||||
_srot[0] * i, _srot[1] * i, _srot[2] * i,
|
||||
power(_ssca[0], i), power(_ssca[1], i), power(_ssca[2], i)));
|
||||
break;
|
||||
case 1 :
|
||||
matrix_stack_push(matrix_build( ldy, 0, ldx,
|
||||
_srot[0] * i, _srot[1] * i, _srot[2] * i,
|
||||
power(_ssca[0], i), power(_ssca[1], i), power(_ssca[2], i)));
|
||||
break;
|
||||
case 2 :
|
||||
matrix_stack_push(matrix_build( ldx, ldy, 0,
|
||||
_srot[0] * i, _srot[1] * i, _srot[2] * i,
|
||||
power(_ssca[0], i), power(_ssca[1], i), power(_ssca[2], i)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
matrix_set(matrix_world, matrix_stack_top());
|
||||
|
||||
if(is_array(sv)) {
|
||||
var index = i % array_length(sv);
|
||||
var _sv = sv[index];
|
||||
_sv(index);
|
||||
} else
|
||||
sv();
|
||||
|
||||
matrix_stack_pop();
|
||||
}
|
||||
_3d_clear_local_transform();
|
||||
}
|
||||
|
||||
static update = function() {
|
||||
var _dim = inputs[| 0].getValue();
|
||||
var _lpos = inputs[| 1].getValue();
|
||||
var _lrot = inputs[| 2].getValue();
|
||||
var _lsca = inputs[| 3].getValue();
|
||||
|
||||
var _pos = inputs[| 4].getValue();
|
||||
var _sca = inputs[| 5].getValue();
|
||||
|
||||
var _ldir = inputs[| 6].getValue();
|
||||
var _lhgt = inputs[| 7].getValue();
|
||||
var _lint = inputs[| 8].getValue();
|
||||
var _lclr = inputs[| 9].getValue();
|
||||
var _aclr = inputs[| 10].getValue();
|
||||
|
||||
var _patt = inputs[| 16].getValue();
|
||||
inputs[| 13].setVisible(_patt == 0);
|
||||
|
||||
inputs[| 17].setVisible(_patt == 1);
|
||||
inputs[| 18].setVisible(_patt == 1);
|
||||
inputs[| 19].setVisible(_patt == 1);
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
outputs[| 0].setValue(surface_verify(_outSurf, _dim[0], _dim[1]));
|
||||
|
||||
_3d_pre_setup(_outSurf, _dim, _pos, _sca, _ldir, _lhgt, _lint, _lclr, _aclr, _lpos, _lrot, _lsca, false);
|
||||
submit_vertex();
|
||||
_3d_post_setup();
|
||||
}
|
||||
}
|
11
scripts/node_3d_repeat/node_3d_repeat.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_3d_repeat",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "3D",
|
||||
"path": "folders/nodes/data/3D.yy",
|
||||
},
|
||||
}
|
|
@ -1,185 +0,0 @@
|
|||
function Node_3D_Transform(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "3D Transform";
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setUnitRef(function(index) { return getDimension(index); });
|
||||
|
||||
inputs[| 2] = nodeValue(2, "Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 3] = nodeValue(3, "Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Output dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, OUTPUT_SCALING.same_as_input)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Same as input", "Constant", "Relative to input" ]);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Constant dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
input_display_list = [0,
|
||||
["Outputs", true], 4, 5,
|
||||
["Transform", false], 1, 2, 3
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
#region 3D setup
|
||||
TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1);
|
||||
cam = camera_create();
|
||||
cam_view = matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0);
|
||||
cam_proj = matrix_build_projection_ortho(1, 1, 1, 100);
|
||||
|
||||
camera_set_proj_mat(cam, cam_view);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
|
||||
//camera_set_view_size(cam, cam_w, cam_h);
|
||||
//camera_set_view_pos(cam, 0, 0);
|
||||
#endregion
|
||||
|
||||
drag_index = -1;
|
||||
drag_sv = 0;
|
||||
drag_mx = 0;
|
||||
drag_my = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
active = false;
|
||||
var _out = outputs[| 0].getValue();
|
||||
if(!is_surface(_out) || !surface_exists(_out)) return;
|
||||
|
||||
var _rot = inputs[| 2].getValue();
|
||||
var cx = _x + surface_get_width(_out) * _s / 2;
|
||||
var cy = _y + surface_get_height(_out) * _s / 2;
|
||||
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line(cx - 64, cy, cx + 64, cy);
|
||||
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line(cx, cy - 64, cx, cy + 64);
|
||||
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle(cx, cy, 64, true);
|
||||
|
||||
if(drag_index == 0) {
|
||||
var dx = (_mx - drag_mx) / _s * 6;
|
||||
_rot[1] = drag_sv + dx;
|
||||
|
||||
if(inputs[| 2].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 1) {
|
||||
var dy = (_my - drag_my) / _s * -6;
|
||||
_rot[0] = drag_sv + dy;
|
||||
|
||||
if(inputs[| 2].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else if(drag_index == 2) {
|
||||
var da = point_direction(cx, cy, _mx, _my);
|
||||
_rot[2] = da;
|
||||
|
||||
if(inputs[| 2].setValue(_rot))
|
||||
UNDO_HOLDING = true;
|
||||
|
||||
if(mouse_release(mb_left)) {
|
||||
drag_index = -1;
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
} else {
|
||||
if(distance_to_line(_mx, _my, cx - 64, cy, cx + 64, cy) < 16) {
|
||||
draw_set_color(COLORS.axis[0]);
|
||||
draw_line_width(cx - 64, cy, cx + 64, cy, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 0;
|
||||
drag_sv = _rot[1];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(distance_to_line(_mx, _my, cx, cy - 64, cx, cy + 64) < 16) {
|
||||
draw_set_color(COLORS.axis[1]);
|
||||
draw_line_width(cx, cy - 64, cx, cy + 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 1;
|
||||
drag_sv = _rot[0];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
} else if(abs(point_distance(_mx, _my, cx, cy) - 64) < 8) {
|
||||
draw_set_color(COLORS.axis[2]);
|
||||
draw_circle_border(cx, cy, 64, 3);
|
||||
if(mouse_press(mb_left, active)) {
|
||||
drag_index = 2;
|
||||
drag_sv = _rot[2];
|
||||
drag_mx = _mx;
|
||||
drag_my = _my;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
var _out_type = inputs[| 4].getValue();
|
||||
var _out = inputs[| 5].getValue();
|
||||
|
||||
var _ww, _hh;
|
||||
|
||||
switch(_out_type) {
|
||||
case OUTPUT_SCALING.same_as_input :
|
||||
inputs[| 5].setVisible(false);
|
||||
_ww = surface_get_width(_data[0]);
|
||||
_hh = surface_get_height(_data[0]);
|
||||
break;
|
||||
case OUTPUT_SCALING.constant :
|
||||
inputs[| 5].setVisible(true);
|
||||
_ww = _out[0];
|
||||
_hh = _out[1];
|
||||
break;
|
||||
case OUTPUT_SCALING.relative :
|
||||
inputs[| 5].setVisible(true);
|
||||
_ww = surface_get_width(_data[0]) * _out[0];
|
||||
_hh = surface_get_height(_data[0]) * _out[1];
|
||||
break;
|
||||
}
|
||||
|
||||
if(_ww <= 0 || _hh <= 0) return;
|
||||
_outSurf = surface_verify(_outSurf, _ww, _hh);
|
||||
|
||||
var _pos = _data[1];
|
||||
var _rot = _data[2];
|
||||
var _sca = _data[3];
|
||||
|
||||
TM = matrix_build(_ww / 2 + _pos[0], _hh / 2 + _pos[1], 0, _rot[0], _rot[1], _rot[2], _ww * _sca[0], _hh * _sca[1], 1);
|
||||
cam_proj = matrix_build_projection_ortho(_ww, _hh, 1, 100);
|
||||
camera_set_view_mat(cam, cam_proj);
|
||||
camera_set_view_size(cam, _ww, _hh);
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
||||
shader_set(sh_vertex_pt);
|
||||
camera_apply(cam);
|
||||
|
||||
matrix_set(matrix_world, TM);
|
||||
vertex_submit(PRIMITIVES[? "plane"], pr_trianglelist, surface_get_texture(_data[0]));
|
||||
shader_reset();
|
||||
|
||||
matrix_set(matrix_world, MATRIX_IDENTITY);
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
|
@ -69,7 +69,8 @@ function Node_9Slice(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
}
|
||||
}
|
||||
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny)) return;
|
||||
if(inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny))
|
||||
return;
|
||||
|
||||
if(distance_to_line_infinite(_mx, _my, sp_r, -hh, sp_r, hh) < 12) {
|
||||
draw_line_width(sp_r, -hh, sp_r, hh, 3);
|
||||
|
@ -106,7 +107,7 @@ function Node_9Slice(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
}
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _inSurf = _data[0];
|
||||
var _dim = _data[1];
|
||||
var _splice = _data[2];
|
||||
|
|
|
@ -7,7 +7,7 @@ function Node_Alpha_Cutoff(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
|
37
scripts/node_alpha_hash/node_alpha_hash.gml
Normal file
|
@ -0,0 +1,37 @@
|
|||
function Node_Alpha_Hash(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Alpha hash";
|
||||
|
||||
shader = sh_alpha_hash;
|
||||
uniform_dim = shader_get_uniform(shader, "dimension");
|
||||
uniform_dit = shader_get_uniform(shader, "dither");
|
||||
|
||||
static dither8 = [ 0, 32, 8, 40, 2, 34, 10, 42,
|
||||
48, 16, 56, 24, 50, 18, 58, 26,
|
||||
12, 44, 4, 36, 14, 46, 6, 38,
|
||||
60, 28, 52, 20, 62, 30, 54, 22,
|
||||
3, 35, 11, 43, 1, 33, 9, 41,
|
||||
51, 19, 59, 27, 49, 17, 57, 25,
|
||||
15, 47, 7, 39, 13, 45, 5, 37,
|
||||
63, 31, 55, 23, 61, 29, 53, 21];
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_dim, surface_get_width(_data[0]), surface_get_height(_data[0]));
|
||||
shader_set_uniform_f_array(uniform_dit, dither8);
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
||||
BLEND_NORMAL
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
11
scripts/node_alpha_hash/node_alpha_hash.yy
Normal file
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"resourceType": "GMScript",
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_alpha_hash",
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "filter",
|
||||
"path": "folders/nodes/data/filter.yy",
|
||||
},
|
||||
}
|
12
scripts/node_alpha_hash/node_color_adjustment.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "filter",
|
||||
"path": "folders/nodes/data/filter.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_color_adjustment",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_alpha_hash/node_color_replacement.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "process",
|
||||
"path": "folders/nodes/data/process.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_color_replacement",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_alpha_hash/node_greyscale.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "filter",
|
||||
"path": "folders/nodes/data/filter.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_greyscale",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
12
scripts/node_alpha_hash/node_outline.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "process",
|
||||
"path": "folders/nodes/data/process.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_outline",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -5,7 +5,7 @@ function Node_Alpha_Grey(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
|
|
@ -24,7 +24,6 @@ function Node_Anim_Curve(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
|
||||
return val;
|
||||
}
|
||||
doUpdate();
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
draw_sprite_ext(s_node_curve, 0, xx + w / 2 * _s, yy + 10 + h / 2 * _s, _s / 2, _s / 2, 0, c_white, 1);
|
||||
|
|
|
@ -46,8 +46,6 @@ function Node_Area(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
return [_data[0][0], _data[0][1], _data[1][0], _data[1][1], _data[2]];
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
draw_sprite_ui_uniform(THEME.node_draw_area, 0, xx + w * _s / 2, yy + 10 + (h - 10) * _s / 2, _s, c_white);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ function Node_Array(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
|
||||
outputs[| 0].setValue(res);
|
||||
}
|
||||
doUpdate();
|
||||
|
||||
static postDeserialize = function() {
|
||||
var _inputs = load_map[? "inputs"];
|
||||
|
|
|
@ -44,6 +44,4 @@ function Node_Array_Add(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
outputs[| 0].setValue(_out);
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
}
|
|
@ -42,6 +42,4 @@ function Node_Array_Get(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
|
||||
outputs[| 0].setValue(_arr[index]);
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
}
|
|
@ -17,6 +17,4 @@ function Node_Array_Length(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
return array_length(_arr);
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
}
|
|
@ -7,7 +7,7 @@ function Node_Atlas(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
|
|
@ -18,7 +18,7 @@ function Node_Bevel(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _hei = _data[1];
|
||||
var _shf = _data[2];
|
||||
var _sca = _data[3];
|
||||
|
|
|
@ -33,7 +33,7 @@ function Node_Blend(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _fore = _data[1];
|
||||
var _type = _data[2];
|
||||
var _opacity = _data[3];
|
||||
|
|
|
@ -1,10 +1,13 @@
|
|||
function Node_Bloom(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Bloom";
|
||||
|
||||
shader = sh_bloom_pass1;
|
||||
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(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
inputs[| 1] = nodeValue(1, "Size", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 3)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [1, 32, 1]);
|
||||
|
@ -14,21 +17,32 @@ function Node_Bloom(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constr
|
|||
|
||||
inputs[| 3] = nodeValue(3, "Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, .25)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [ 0, 2, 0.01]);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", true], 0, 4,
|
||||
["Bloom", false], 1, 2, 3,
|
||||
]
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _size = _data[1];
|
||||
var _tole = _data[2];
|
||||
var _stre = _data[3];
|
||||
var _mask = _data[4];
|
||||
var pass1 = surface_create_valid(surface_get_width(_outSurf), surface_get_height(_outSurf));
|
||||
|
||||
surface_set_target(pass1);
|
||||
draw_clear_alpha(c_black, 1);
|
||||
shader_set(sh_bloom_pass1);
|
||||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_size, _size);
|
||||
shader_set_uniform_f(uniform_tole, _tole);
|
||||
|
||||
shader_set_uniform_i(uniform_umsk, is_surface(_mask));
|
||||
texture_set_stage(uniform_mask, surface_get_texture(_mask));
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
surface_reset_target();
|
||||
|
|
|
@ -11,7 +11,7 @@ function Node_Blur(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) constru
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _size = _data[1];
|
||||
var _clamp = _data[2];
|
||||
//var _mask = _data[3];
|
||||
|
|
|
@ -18,7 +18,7 @@ function Node_Blur_Contrast(_x, _y, _group = -1) : Node_Processor(_x, _y, _group
|
|||
|
||||
pass = PIXEL_SURFACE;
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _surf = _data[0];
|
||||
var _size = _data[1];
|
||||
var _tres = _data[2];
|
||||
|
|
|
@ -27,7 +27,7 @@ function Node_Blur_Directional(_x, _y, _group = -1) : Node_Processor(_x, _y, _gr
|
|||
inputs[| 2].drawOverlay(active, _x + ww / 2 * _s, _y + hh / 2 * _s, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _str = _data[1];
|
||||
var _dir = _data[2];
|
||||
surface_set_target(_outSurf);
|
||||
|
|
|
@ -4,8 +4,12 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
shader = sh_blur_radial;
|
||||
uniform_str = shader_get_uniform(shader, "strength");
|
||||
uniform_cen = shader_get_uniform(shader, "center");
|
||||
uniform_blr = shader_get_uniform(shader, "blurMode");
|
||||
uniform_sam = shader_get_uniform(shader, "sampleMode");
|
||||
|
||||
uniform_umk = shader_get_uniform(shader, "useMask");
|
||||
uniform_msk = shader_get_sampler_index(shader, "mask");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Surface in", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
inputs[| 1] = nodeValue(1, "Strength", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.2);
|
||||
|
@ -16,12 +20,17 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
inputs[| 3] = nodeValue(3, "Oversample mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Empty", "Clamp", "Repeat" ]);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Radial mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1)
|
||||
.setDisplay(VALUE_DISPLAY.enum_scroll, [ "Start", "Middle", "End" ]);
|
||||
|
||||
inputs[| 5] = nodeValue(5, "Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, 0);
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
input_display_list = [
|
||||
["Surface", false], 0, 3,
|
||||
["Effect", false], 1, 2,
|
||||
["Blur", false], 1, 2, 4, 5
|
||||
];
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
|
@ -33,10 +42,12 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
inputs[| 2].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _str = _data[1];
|
||||
var _cen = _data[2];
|
||||
var _sam = _data[3];
|
||||
var _blr = _data[4];
|
||||
var _msk = _data[5];
|
||||
_cen[0] /= surface_get_width(_outSurf);
|
||||
_cen[1] /= surface_get_height(_outSurf);
|
||||
|
||||
|
@ -47,7 +58,13 @@ function Node_Blur_Radial(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
shader_set(shader);
|
||||
shader_set_uniform_f(uniform_str, _str);
|
||||
shader_set_uniform_f_array(uniform_cen, _cen);
|
||||
shader_set_uniform_i(uniform_blr, _blr);
|
||||
shader_set_uniform_i(uniform_sam, _sam);
|
||||
|
||||
shader_set_uniform_i(uniform_umk, is_surface(_msk));
|
||||
if(is_surface(_msk))
|
||||
texture_set_stage(uniform_msk, surface_get_texture(_msk));
|
||||
|
||||
draw_surface_safe(_data[0], 0, 0);
|
||||
shader_reset();
|
||||
|
||||
|
|
|
@ -20,12 +20,12 @@ function Node_Blur_Simple(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
input_display_list = [
|
||||
["Surface", false], 0, 3, 2,
|
||||
["Effect", false], 1,
|
||||
["Blur", false], 1,
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
if(!is_surface(_data[0])) return _outSurf;
|
||||
var _size = _data[1];
|
||||
var _samp = _data[2];
|
||||
|
|
|
@ -14,7 +14,7 @@ function Node_BW(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) construct
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _exp = _data[1];
|
||||
var _con = _data[2];
|
||||
surface_set_target(_outSurf);
|
||||
|
|
|
@ -23,7 +23,7 @@ function Node_Camera(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) const
|
|||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _area = _data[1];
|
||||
|
||||
var _dw = surface_valid_size(_area[2]) * 2;
|
||||
|
|
|
@ -41,8 +41,6 @@ function Node_Canvas(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
[ "Fill", THEME.canvas_tools_bucket ],
|
||||
];
|
||||
|
||||
display_reset(0, 1);
|
||||
|
||||
mouse_cur_x = 0;
|
||||
mouse_cur_y = 0;
|
||||
mouse_pre_x = 0;
|
||||
|
@ -518,7 +516,6 @@ function Node_Canvas(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
} else
|
||||
surface_size_to(_outSurf, _dim[0], _dim[1]);
|
||||
}
|
||||
doUpdate();
|
||||
|
||||
static doSerialize = function(_map) {
|
||||
_map[? "surface"] = buffer_base64_encode(surface_buffer, 0, buffer_get_size(surface_buffer));
|
||||
|
|
|
@ -43,7 +43,7 @@ function Node_Checker(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
inputs[| 2].drawOverlay(active, px, py, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _dim = _data[0];
|
||||
var _amo = _data[1];
|
||||
var _ang = _data[2];
|
||||
|
@ -68,5 +68,4 @@ function Node_Checker(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) cons
|
|||
|
||||
return _outSurf;
|
||||
}
|
||||
doUpdate();
|
||||
}
|
|
@ -24,7 +24,7 @@ function Node_Chromatic_Aberration(_x, _y, _group = -1) : Node_Processor(_x, _y,
|
|||
inputs[| 1].drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear_alpha(0, 0);
|
||||
BLEND_OVER
|
||||
|
|
|
@ -10,6 +10,16 @@ function Node_Collection(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
custom_input_index = 0;
|
||||
custom_output_index = 0;
|
||||
|
||||
static drawOverlay = function(active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i];
|
||||
var _show = _in.from.inputs[| 6].getValue();
|
||||
|
||||
if(!_show) continue;
|
||||
_in.drawOverlay(active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||
}
|
||||
}
|
||||
|
||||
static getNextNodes = function() {
|
||||
for(var i = custom_input_index; i < ds_list_size(inputs); i++) {
|
||||
var _in = inputs[| i].from;
|
||||
|
|
|
@ -19,11 +19,9 @@ function Node_Color(_x, _y, _group = -1) : Node(_x, _y, _group) constructor {
|
|||
var y0 = yy + 20 + 8 * _s;
|
||||
var y1 = yy + (h - 8) * _s;
|
||||
|
||||
if(y1 > y0) {
|
||||
draw_set_color(inputs[| 0].getValue());
|
||||
draw_rectangle(x0, y0, x1, y1, 0);
|
||||
}
|
||||
if(y1 <= y0) return;
|
||||
|
||||
draw_set_color(inputs[| 0].getValue());
|
||||
draw_rectangle(x0, y0, x1, y1, 0);
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
}
|
|
@ -54,7 +54,7 @@ function Node_Color_adjust(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
["Color blend", false], 6, 7, 9
|
||||
];
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _bri = _data[1];
|
||||
var _con = _data[2];
|
||||
var _hue = _data[3];
|
||||
|
|
|
@ -36,6 +36,4 @@ function Node_Color_Data(_x, _y, _group = -1) : Node_Processor(_x, _y, _group) c
|
|||
return 0.299 * r + 0.587 * g + 0.224 * b;
|
||||
}
|
||||
}
|
||||
|
||||
doUpdate();
|
||||
}
|
|
@ -22,7 +22,6 @@ function Node_Color_HSV(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
static update = function() {
|
||||
outputs[| 0].setValue(make_color_hsv(inputs[| 0].getValue() * 255, inputs[| 1].getValue() * 255, inputs[| 2].getValue() * 255));
|
||||
}
|
||||
doUpdate();
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var x0 = xx + 8 * _s;
|
||||
|
|
|
@ -22,7 +22,6 @@ function Node_Color_RGB(_x, _y, _group = -1) : Node(_x, _y, _group) constructor
|
|||
static update = function() {
|
||||
outputs[| 0].setValue(make_color_rgb(inputs[| 0].getValue() * 255, inputs[| 1].getValue() * 255, inputs[| 2].getValue() * 255));
|
||||
}
|
||||
doUpdate();
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s) {
|
||||
var x0 = xx + 8 * _s;
|
||||
|
|
|
@ -16,7 +16,7 @@ function Node_Color_Remove(_x, _y, _group = -1) : Node_Processor(_x, _y, _group)
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, PIXEL_SURFACE);
|
||||
|
||||
static process_data = function(_outSurf, _data, _output_index) {
|
||||
static process_data = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var fr = _data[1];
|
||||
var tr = _data[2];
|
||||
|
||||
|
|