diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 08b3f5e81..91311bc03 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -21,6 +21,7 @@ {"name":"widget","order":9,"path":"folders/dialog/widget.yy",}, {"name":"font","order":7,"path":"folders/font.yy",}, {"name":"functions","order":6,"path":"folders/functions.yy",}, + {"name":"misc","order":1,"path":"folders/functions/3d/misc.yy",}, {"name":"action","order":40,"path":"folders/functions/action.yy",}, {"name":"animation","order":19,"path":"folders/functions/animation.yy",}, {"name":"async","order":36,"path":"folders/functions/async.yy",}, @@ -70,7 +71,11 @@ {"name":"nodes","order":3,"path":"folders/nodes.yy",}, {"name":"data","order":1,"path":"folders/nodes/data.yy",}, {"name":"3D","order":8,"path":"folders/nodes/data/3D.yy",}, - {"name":"primitive","order":19,"path":"folders/nodes/data/3D/primitive.yy",}, + {"name":"__legacy","order":5,"path":"folders/nodes/data/3D/__legacy.yy",}, + {"name":"primitive","order":9,"path":"folders/nodes/data/3D/__legacy/primitive.yy",}, + {"name":"2d effects","order":7,"path":"folders/nodes/data/3D/2d effects.yy",}, + {"name":"d3d light","order":14,"path":"folders/nodes/data/3D/d3d light.yy",}, + {"name":"d3d mesh","order":12,"path":"folders/nodes/data/3D/d3d mesh.yy",}, {"name":"animation","order":6,"path":"folders/nodes/data/animation.yy",}, {"name":"audio","order":19,"path":"folders/nodes/data/audio.yy",}, {"name":"compose","order":14,"path":"folders/nodes/data/compose.yy",}, @@ -147,6 +152,8 @@ {"name":"shader","order":8,"path":"folders/shader.yy",}, {"name":"_helper","order":49,"path":"folders/shader/_helper.yy",}, {"name":"3d","order":29,"path":"folders/shader/3d.yy",}, + {"name":"2d effect","order":14,"path":"folders/shader/3d/2d effect.yy",}, + {"name":"legacy","order":13,"path":"folders/shader/3d/legacy.yy",}, {"name":"blend","order":18,"path":"folders/shader/blend.yy",}, {"name":"blur","order":38,"path":"folders/shader/blur.yy",}, {"name":"channels","order":42,"path":"folders/shader/channels.yy",}, @@ -187,10 +194,13 @@ {"name":"panel_function","order":2,"path":"scripts/panel_function/panel_function.yy",}, {"name":"node_time_remap","order":3,"path":"scripts/node_time_remap/node_time_remap.yy",}, {"name":"sh_perlin","order":4,"path":"shaders/sh_perlin/sh_perlin.yy",}, + {"name":"sh_normal_light","order":1,"path":"shaders/sh_normal_light/sh_normal_light.yy",}, {"name":"node_tool","order":9,"path":"scripts/node_tool/node_tool.yy",}, {"name":"sh_find_pixel","order":3,"path":"shaders/sh_find_pixel/sh_find_pixel.yy",}, + {"name":"__node_3d_camera","order":10,"path":"scripts/__node_3d_camera/__node_3d_camera.yy",}, {"name":"panel_preview_window","order":1,"path":"scripts/panel_preview_window/panel_preview_window.yy",}, {"name":"sh_scale3x","order":29,"path":"shaders/sh_scale3x/sh_scale3x.yy",}, + {"name":"__node_3d","order":8,"path":"scripts/__node_3d/__node_3d.yy",}, {"name":"node_csv_file_write","order":13,"path":"scripts/node_csv_file_write/node_csv_file_write.yy",}, {"name":"surface_functions","order":5,"path":"scripts/surface_functions/surface_functions.yy",}, {"name":"sh_fd_add_velocity_glsl","order":1,"path":"shaders/sh_fd_add_velocity_glsl/sh_fd_add_velocity_glsl.yy",}, @@ -202,7 +212,7 @@ {"name":"s_node_text_trim","order":7,"path":"sprites/s_node_text_trim/s_node_text_trim.yy",}, {"name":"s_node_pb_fx_shading","order":3,"path":"sprites/s_node_pb_fx_shading/s_node_pb_fx_shading.yy",}, {"name":"sh_noise_grid_hex","order":2,"path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",}, - {"name":"node_3d_obj","order":8,"path":"scripts/node_3d_obj/node_3d_obj.yy",}, + {"name":"node_3d_obj","order":4,"path":"scripts/node_3d_obj/node_3d_obj.yy",}, {"name":"__path","order":1,"path":"scripts/__path/__path.yy",}, {"name":"draw_text_path","order":25,"path":"scripts/draw_text_path/draw_text_path.yy",}, {"name":"sh_brush_outline","order":7,"path":"shaders/sh_brush_outline/sh_brush_outline.yy",}, @@ -297,7 +307,7 @@ {"name":"sh_blend_max","order":8,"path":"shaders/sh_blend_max/sh_blend_max.yy",}, {"name":"s_node_color_out","order":6,"path":"sprites/s_node_color_out/s_node_color_out.yy",}, {"name":"bbmod_lerp_delta_time","order":1,"path":"scripts/bbmod_lerp_delta_time/bbmod_lerp_delta_time.yy",}, - {"name":"_3D","order":6,"path":"scripts/_3D/_3D.yy",}, + {"name":"_3D","order":8,"path":"scripts/_3D/_3D.yy",}, {"name":"node_vector_cross2D","order":11,"path":"scripts/node_vector_cross2D/node_vector_cross2D.yy",}, {"name":"o_dialog_preview_onion_skin","order":2,"path":"objects/o_dialog_preview_onion_skin/o_dialog_preview_onion_skin.yy",}, {"name":"sh_corner_erode","order":48,"path":"shaders/sh_corner_erode/sh_corner_erode.yy",}, @@ -318,6 +328,7 @@ {"name":"_f_code","order":9,"path":"fonts/_f_code/_f_code.yy",}, {"name":"sh_combine_rgb","order":11,"path":"shaders/sh_combine_rgb/sh_combine_rgb.yy",}, {"name":"node_armature_to_path","order":4,"path":"scripts/node_armature_to_path/node_armature_to_path.yy",}, + {"name":"d3d_object","order":2,"path":"scripts/d3d_object/d3d_object.yy",}, {"name":"s_node_strandSim","order":3,"path":"sprites/s_node_strandSim/s_node_strandSim.yy",}, {"name":"o_dialog_panel","order":13,"path":"objects/o_dialog_panel/o_dialog_panel.yy",}, {"name":"s_node_vfx","order":9,"path":"sprites/s_node_vfx/s_node_vfx.yy",}, @@ -342,11 +353,13 @@ {"name":"node_pb_fx_strip","order":11,"path":"scripts/node_pb_fx_strip/node_pb_fx_strip.yy",}, {"name":"node_stripe","order":4,"path":"scripts/node_stripe/node_stripe.yy",}, {"name":"sh_texture_atlas","order":39,"path":"shaders/sh_texture_atlas/sh_texture_atlas.yy",}, + {"name":"d3d_vec4","order":12,"path":"scripts/d3d_vec4/d3d_vec4.yy",}, {"name":"s_node_fluidSim_domain","order":6,"path":"sprites/s_node_fluidSim_domain/s_node_fluidSim_domain.yy",}, {"name":"s_node_displace","order":20,"path":"sprites/s_node_displace/s_node_displace.yy",}, {"name":"sh_polar","order":1,"path":"shaders/sh_polar/sh_polar.yy",}, {"name":"s_node_warp_mesh","order":10,"path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",}, {"name":"sh_pixel_cloud","order":13,"path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",}, + {"name":"sh_d3d_wireframe","order":17,"path":"shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy",}, {"name":"s_biterator_b_grey_short","order":8,"path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",}, {"name":"printer","order":2,"path":"scripts/printer/printer.yy",}, {"name":"sh_de_stray","order":16,"path":"shaders/sh_de_stray/sh_de_stray.yy",}, @@ -382,11 +395,13 @@ {"name":"byte_writer","order":8,"path":"scripts/byte_writer/byte_writer.yy",}, {"name":"checkboxGroup","order":28,"path":"scripts/checkboxGroup/checkboxGroup.yy",}, {"name":"node_FXAA","order":8,"path":"scripts/node_FXAA/node_FXAA.yy",}, + {"name":"__node_3d_object","order":13,"path":"scripts/__node_3d_object/__node_3d_object.yy",}, {"name":"s_node_pixel_find","order":13,"path":"sprites/s_node_pixel_find/s_node_pixel_find.yy",}, {"name":"s_biterator_canvas_cover","order":16,"path":"sprites/s_biterator_canvas_cover/s_biterator_canvas_cover.yy",}, {"name":"sh_noise_grid_tri","order":3,"path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",}, {"name":"globals","order":2,"path":"scripts/globals/globals.yy",}, {"name":"s_node_noise_perlin","order":11,"path":"sprites/s_node_noise_perlin/s_node_noise_perlin.yy",}, + {"name":"sh_d3d_default","order":11,"path":"shaders/sh_d3d_default/sh_d3d_default.yy",}, {"name":"s_node_dithering","order":21,"path":"sprites/s_node_dithering/s_node_dithering.yy",}, {"name":"s_workshop_badge","order":1,"path":"sprites/s_workshop_badge/s_workshop_badge.yy",}, {"name":"node_pb_fx_brick","order":12,"path":"scripts/node_pb_fx_brick/node_pb_fx_brick.yy",}, @@ -395,6 +410,7 @@ {"name":"panel_console","order":8,"path":"scripts/panel_console/panel_console.yy",}, {"name":"s_node_HSV_combine","order":44,"path":"sprites/s_node_HSV_combine/s_node_HSV_combine.yy",}, {"name":"s_node_pb_box_contract","order":25,"path":"sprites/s_node_pb_box_contract/s_node_pb_box_contract.yy",}, + {"name":"node_normal_light","order":2,"path":"scripts/node_normal_light/node_normal_light.yy",}, {"name":"o_dialog_release_note","order":8,"path":"objects/o_dialog_release_note/o_dialog_release_note.yy",}, {"name":"sh_fd_advect_material_rgba_16_glsl","order":4,"path":"shaders/sh_fd_advect_material_rgba_16_glsl/sh_fd_advect_material_rgba_16_glsl.yy",}, {"name":"node_padding","order":9,"path":"scripts/node_padding/node_padding.yy",}, @@ -415,8 +431,7 @@ {"name":"s_node_crop","order":2,"path":"sprites/s_node_crop/s_node_crop.yy",}, {"name":"__VFX","order":2,"path":"scripts/__VFX/__VFX.yy",}, {"name":"s_menu_black","order":2,"path":"sprites/s_menu_black/s_menu_black.yy",}, - {"name":"node_3d_export","order":17,"path":"scripts/node_3d_export/node_3d_export.yy",}, - {"name":"node_bevel","order":3,"path":"scripts/node_bevel/node_bevel.yy",}, + {"name":"node_3d_export","order":2,"path":"scripts/node_3d_export/node_3d_export.yy",}, {"name":"s_node_vfx_override","order":11,"path":"sprites/s_node_vfx_override/s_node_vfx_override.yy",}, {"name":"rotatorRange","order":12,"path":"scripts/rotatorRange/rotatorRange.yy",}, {"name":"font_loader","order":8,"path":"scripts/font_loader/font_loader.yy",}, @@ -502,7 +517,7 @@ {"name":"s_node_vec3","order":8,"path":"sprites/s_node_vec3/s_node_vec3.yy",}, {"name":"s_node_strandSim_create","order":2,"path":"sprites/s_node_strandSim_create/s_node_strandSim_create.yy",}, {"name":"node_gradient_shift","order":10,"path":"scripts/node_gradient_shift/node_gradient_shift.yy",}, - {"name":"sh_vertex_normal_pass","order":5,"path":"shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy",}, + {"name":"sh_vertex_normal_pass","order":3,"path":"shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy",}, {"name":"node_vector_cross3D","order":10,"path":"scripts/node_vector_cross3D/node_vector_cross3D.yy",}, {"name":"s_node_pack_sprite","order":5,"path":"sprites/s_node_pack_sprite/s_node_pack_sprite.yy",}, {"name":"surface_valid","order":6,"path":"scripts/surface_valid/surface_valid.yy",}, @@ -549,6 +564,7 @@ {"name":"node_strand_gravity","order":4,"path":"scripts/node_strand_gravity/node_strand_gravity.yy",}, {"name":"load_palette","order":3,"path":"scripts/load_palette/load_palette.yy",}, {"name":"luaHighlight","order":1,"path":"scripts/luaHighlight/luaHighlight.yy",}, + {"name":"d3d_rot3","order":8,"path":"scripts/d3d_rot3/d3d_rot3.yy",}, {"name":"sh_sample_points","order":26,"path":"shaders/sh_sample_points/sh_sample_points.yy",}, {"name":"node_combine_rgb","order":1,"path":"scripts/node_combine_rgb/node_combine_rgb.yy",}, {"name":"fd_rectangle_draw_part","order":10,"path":"scripts/fd_rectangle_draw_part/fd_rectangle_draw_part.yy",}, @@ -614,7 +630,6 @@ {"name":"polygon_points","order":2,"path":"scripts/polygon_points/polygon_points.yy",}, {"name":"transformBox","order":29,"path":"scripts/transformBox/transformBox.yy",}, {"name":"sh_grey_alpha","order":12,"path":"shaders/sh_grey_alpha/sh_grey_alpha.yy",}, - {"name":"sh_normal","order":1,"path":"shaders/sh_normal/sh_normal.yy",}, {"name":"s_node_time_map","order":39,"path":"sprites/s_node_time_map/s_node_time_map.yy",}, {"name":"node_crop","order":7,"path":"scripts/node_crop/node_crop.yy",}, {"name":"s_biterator_tab_content","order":14,"path":"sprites/s_biterator_tab_content/s_biterator_tab_content.yy",}, @@ -640,7 +655,7 @@ {"name":"panel_addon","order":5,"path":"scripts/panel_addon/panel_addon.yy",}, {"name":"s_node_text_splice","order":6,"path":"sprites/s_node_text_splice/s_node_text_splice.yy",}, {"name":"__atlas","order":6,"path":"scripts/__atlas/__atlas.yy",}, - {"name":"node_3d_transform","order":11,"path":"scripts/node_3d_transform/node_3d_transform.yy",}, + {"name":"node_3d_transform","order":7,"path":"scripts/node_3d_transform/node_3d_transform.yy",}, {"name":"sh_draw_single_channel","order":3,"path":"shaders/sh_draw_single_channel/sh_draw_single_channel.yy",}, {"name":"draw_sprite_ext_override","order":9,"path":"scripts/draw_sprite_ext_override/draw_sprite_ext_override.yy",}, {"name":"node_array_add","order":9,"path":"scripts/node_array_add/node_array_add.yy",}, @@ -693,6 +708,7 @@ {"name":"s_node_lua_surface","order":18,"path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",}, {"name":"node_data","order":1,"path":"scripts/node_data/node_data.yy",}, {"name":"node_wiggler","order":2,"path":"scripts/node_wiggler/node_wiggler.yy",}, + {"name":"d3d_matrix4","order":11,"path":"scripts/d3d_matrix4/d3d_matrix4.yy",}, {"name":"fd_GUIDE","order":5,"path":"scripts/fd_GUIDE/fd_GUIDE.yy",}, {"name":"node_fluid_update","order":3,"path":"scripts/node_fluid_update/node_fluid_update.yy",}, {"name":"s_node_grid_noise","order":5,"path":"sprites/s_node_grid_noise/s_node_grid_noise.yy",}, @@ -725,6 +741,7 @@ {"name":"fd_rectangle_set_material_size","order":7,"path":"scripts/fd_rectangle_set_material_size/fd_rectangle_set_material_size.yy",}, {"name":"fd_rectangle_shift_content","order":19,"path":"scripts/fd_rectangle_shift_content/fd_rectangle_shift_content.yy",}, {"name":"sh_texture_remap","order":24,"path":"shaders/sh_texture_remap/sh_texture_remap.yy",}, + {"name":"__node_3d_mesh_modifier","order":11,"path":"scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.yy",}, {"name":"obj_fd_rectangle","order":1,"path":"objects/obj_fd_rectangle/obj_fd_rectangle.yy",}, {"name":"node_noise_simplex","order":7,"path":"scripts/node_noise_simplex/node_noise_simplex.yy",}, {"name":"sh_fd_visualize_velocity_divergence_glsl","order":18,"path":"shaders/sh_fd_visualize_velocity_divergence_glsl/sh_fd_visualize_velocity_divergence_glsl.yy",}, @@ -763,6 +780,7 @@ {"name":"sh_color_replace","order":8,"path":"shaders/sh_color_replace/sh_color_replace.yy",}, {"name":"__surface","order":8,"path":"scripts/__surface/__surface.yy",}, {"name":"clipboard","order":9,"path":"extensions/clipboard/clipboard.yy",}, + {"name":"__node_3d_light","order":1,"path":"scripts/__node_3d_light/__node_3d_light.yy",}, {"name":"rotator","order":11,"path":"scripts/rotator/rotator.yy",}, {"name":"s_node_edge_detect","order":22,"path":"sprites/s_node_edge_detect/s_node_edge_detect.yy",}, {"name":"node_fluid_add_collider","order":6,"path":"scripts/node_fluid_add_collider/node_fluid_add_collider.yy",}, @@ -771,13 +789,14 @@ {"name":"node_grid_hex","order":2,"path":"scripts/node_grid_hex/node_grid_hex.yy",}, {"name":"node_pb_draw_blob","order":5,"path":"scripts/node_pb_draw_blob/node_pb_draw_blob.yy",}, {"name":"s_node_text_display","order":4,"path":"sprites/s_node_text_display/s_node_text_display.yy",}, + {"name":"sh_d3d_outline","order":16,"path":"shaders/sh_d3d_outline/sh_d3d_outline.yy",}, {"name":"node_strand_render_texture","order":7,"path":"scripts/node_strand_render_texture/node_strand_render_texture.yy",}, {"name":"luaRenderer","order":2,"path":"scripts/luaRenderer/luaRenderer.yy",}, {"name":"node_blur_zoom","order":3,"path":"scripts/node_blur_zoom/node_blur_zoom.yy",}, {"name":"node_bloom","order":3,"path":"scripts/node_bloom/node_bloom.yy",}, - {"name":"sh_bevel","order":3,"path":"shaders/sh_bevel/sh_bevel.yy",}, + {"name":"sh_bevel","order":2,"path":"shaders/sh_bevel/sh_bevel.yy",}, {"name":"sh_blend_overlay","order":15,"path":"shaders/sh_blend_overlay/sh_blend_overlay.yy",}, - {"name":"node_sprite_stack","order":4,"path":"scripts/node_sprite_stack/node_sprite_stack.yy",}, + {"name":"node_sprite_stack","order":3,"path":"scripts/node_sprite_stack/node_sprite_stack.yy",}, {"name":"s_node_json_file_read","order":11,"path":"sprites/s_node_json_file_read/s_node_json_file_read.yy",}, {"name":"s_node_palette_shift","order":58,"path":"sprites/s_node_palette_shift/s_node_palette_shift.yy",}, {"name":"__strandSim","order":2,"path":"scripts/__strandSim/__strandSim.yy",}, @@ -793,7 +812,6 @@ {"name":"__global_object_depths","order":7,"path":"scripts/__global_object_depths/__global_object_depths.yy",}, {"name":"s_node_filter_array","order":28,"path":"sprites/s_node_filter_array/s_node_filter_array.yy",}, {"name":"node_noise_grid_hex","order":5,"path":"scripts/node_noise_grid_hex/node_noise_grid_hex.yy",}, - {"name":"_3d_rotation","order":2,"path":"scripts/_3d_rotation/_3d_rotation.yy",}, {"name":"node_lua_global","order":1,"path":"scripts/node_lua_global/node_lua_global.yy",}, {"name":"o_dialog_preset","order":1,"path":"objects/o_dialog_preset/o_dialog_preset.yy",}, {"name":"s_node_mesh_transform","order":1,"path":"sprites/s_node_mesh_transform/s_node_mesh_transform.yy",}, @@ -802,6 +820,7 @@ {"name":"node_particle","order":14,"path":"scripts/node_particle/node_particle.yy",}, {"name":"node_pb_box_contract","order":8,"path":"scripts/node_pb_box_contract/node_pb_box_contract.yy",}, {"name":"histogram_drawer","order":2,"path":"scripts/histogram_drawer/histogram_drawer.yy",}, + {"name":"node_3d_scene","order":15,"path":"scripts/node_3d_scene/node_3d_scene.yy",}, {"name":"sh_color_picker_side_value","order":3,"path":"shaders/sh_color_picker_side_value/sh_color_picker_side_value.yy",}, {"name":"node_array_range","order":12,"path":"scripts/node_array_range/node_array_range.yy",}, {"name":"node_animation_control","order":11,"path":"scripts/node_animation_control/node_animation_control.yy",}, @@ -840,7 +859,7 @@ {"name":"s_node_stack","order":37,"path":"sprites/s_node_stack/s_node_stack.yy",}, {"name":"s_fade_up","order":3,"path":"sprites/s_fade_up/s_fade_up.yy",}, {"name":"panel_globalvar","order":2,"path":"scripts/panel_globalvar/panel_globalvar.yy",}, - {"name":"node_3d_render","order":20,"path":"scripts/node_3d_render/node_3d_render.yy",}, + {"name":"node_3d_render","order":5,"path":"scripts/node_3d_render/node_3d_render.yy",}, {"name":"node_guide","order":10,"path":"scripts/node_guide/node_guide.yy",}, {"name":"fd_rectangle_get_velocity_surface","order":24,"path":"scripts/fd_rectangle_get_velocity_surface/fd_rectangle_get_velocity_surface.yy",}, {"name":"s_node_text_char_get","order":2,"path":"sprites/s_node_text_char_get/s_node_text_char_get.yy",}, @@ -855,6 +874,7 @@ {"name":"node_global","order":3,"path":"scripts/node_global/node_global.yy",}, {"name":"spr_gameframe_buttons","order":1,"path":"sprites/spr_gameframe_buttons/spr_gameframe_buttons.yy",}, {"name":"s_node_draw_stack","order":4,"path":"sprites/s_node_draw_stack/s_node_draw_stack.yy",}, + {"name":"sh_d3d_grid_view","order":12,"path":"shaders/sh_d3d_grid_view/sh_d3d_grid_view.yy",}, {"name":"delaunay","order":1,"path":"scripts/delaunay/delaunay.yy",}, {"name":"s_node_noise_fbm","order":26,"path":"sprites/s_node_noise_fbm/s_node_noise_fbm.yy",}, {"name":"sh_color_select_content","order":1,"path":"shaders/sh_color_select_content/sh_color_select_content.yy",}, @@ -896,10 +916,11 @@ {"name":"s_node_compare","order":1,"path":"sprites/s_node_compare/s_node_compare.yy",}, {"name":"s_node_fluidSim_domain_queue","order":9,"path":"sprites/s_node_fluidSim_domain_queue/s_node_fluidSim_domain_queue.yy",}, {"name":"s_node_vfx_spawn","order":2,"path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",}, + {"name":"d3d_vec3","order":9,"path":"scripts/d3d_vec3/d3d_vec3.yy",}, {"name":"texture_set_repeat","order":1,"path":"scripts/texture_set_repeat/texture_set_repeat.yy",}, {"name":"o_dialog_color_quick_pick","order":5,"path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",}, {"name":"fd_rectangle_update_velocity","order":22,"path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",}, - {"name":"sh_3d_extrude_filler_depth","order":10,"path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",}, + {"name":"sh_3d_extrude_filler_depth","order":9,"path":"shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy",}, {"name":"sh_draw_mapping","order":4,"path":"shaders/sh_draw_mapping/sh_draw_mapping.yy",}, {"name":"__bbox","order":5,"path":"scripts/__bbox/__bbox.yy",}, {"name":"node_shadow","order":14,"path":"scripts/node_shadow/node_shadow.yy",}, @@ -944,6 +965,7 @@ {"name":"sh_seperate_shape_ite","order":2,"path":"shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.yy",}, {"name":"o_main","order":1,"path":"objects/o_main/o_main.yy",}, {"name":"area_function","order":2,"path":"scripts/area_function/area_function.yy",}, + {"name":"__node_3d_mesh","order":1,"path":"scripts/__node_3d_mesh/__node_3d_mesh.yy",}, {"name":"node_mesh_to_path","order":3,"path":"scripts/node_mesh_to_path/node_mesh_to_path.yy",}, {"name":"sh_convolution","order":44,"path":"shaders/sh_convolution/sh_convolution.yy",}, {"name":"number_function","order":14,"path":"scripts/number_function/number_function.yy",}, @@ -1060,6 +1082,7 @@ {"name":"sh_fd_calculate_pressure_srj_glsl","order":9,"path":"shaders/sh_fd_calculate_pressure_srj_glsl/sh_fd_calculate_pressure_srj_glsl.yy",}, {"name":"curve_bounce_function","order":1,"path":"scripts/curve_bounce_function/curve_bounce_function.yy",}, {"name":"node_pb_fx_shading","order":3,"path":"scripts/node_pb_fx_shading/node_pb_fx_shading.yy",}, + {"name":"sh_d3d_silhouette","order":15,"path":"shaders/sh_d3d_silhouette/sh_d3d_silhouette.yy",}, {"name":"fd_rectangle_replace_material_surface","order":23,"path":"scripts/fd_rectangle_replace_material_surface/fd_rectangle_replace_material_surface.yy",}, {"name":"pack_skyline","order":4,"path":"scripts/pack_skyline/pack_skyline.yy",}, {"name":"fd_x","order":4,"path":"scripts/fd_x/fd_x.yy",}, @@ -1088,6 +1111,7 @@ {"name":"s_node_atlas","order":5,"path":"sprites/s_node_atlas/s_node_atlas.yy",}, {"name":"node_fluid_add","order":4,"path":"scripts/node_fluid_add/node_fluid_add.yy",}, {"name":"BBMOD_Quaternion","order":3,"path":"scripts/BBMOD_Quaternion/BBMOD_Quaternion.yy",}, + {"name":"d3d_cube","order":7,"path":"scripts/d3d_cube/d3d_cube.yy",}, {"name":"o_dialog_output_visibility","order":2,"path":"objects/o_dialog_output_visibility/o_dialog_output_visibility.yy",}, {"name":"node_normal","order":1,"path":"scripts/node_normal/node_normal.yy",}, {"name":"s_node_glow","order":24,"path":"sprites/s_node_glow/s_node_glow.yy",}, @@ -1104,17 +1128,18 @@ {"name":"vct_slider","order":1,"path":"scripts/vct_slider/vct_slider.yy",}, {"name":"panel_node_align","order":3,"path":"scripts/panel_node_align/panel_node_align.yy",}, {"name":"sh_blur_alpha","order":1,"path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",}, + {"name":"d3d_light_directional","order":5,"path":"scripts/d3d_light_directional/d3d_light_directional.yy",}, {"name":"value_snap","order":10,"path":"scripts/value_snap/value_snap.yy",}, {"name":"file_dropper","order":1,"path":"extensions/file_dropper/file_dropper.yy",}, {"name":"s_biterator_b_shape_idle","order":3,"path":"sprites/s_biterator_b_shape_idle/s_biterator_b_shape_idle.yy",}, {"name":"sh_mirror_mask","order":8,"path":"shaders/sh_mirror_mask/sh_mirror_mask.yy",}, {"name":"node_export","order":10,"path":"scripts/node_export/node_export.yy",}, {"name":"controlPointBox","order":21,"path":"scripts/controlPointBox/controlPointBox.yy",}, - {"name":"sh_vertex_pt","order":2,"path":"shaders/sh_vertex_pt/sh_vertex_pt.yy",}, + {"name":"sh_vertex_pt","order":5,"path":"shaders/sh_vertex_pt/sh_vertex_pt.yy",}, {"name":"fd_rectangle_set_velocity_dissipation_type","order":13,"path":"scripts/fd_rectangle_set_velocity_dissipation_type/fd_rectangle_set_velocity_dissipation_type.yy",}, {"name":"node_color_replacement","order":3,"path":"scripts/node_color_replacement/node_color_replacement.yy",}, {"name":"path_reader","order":5,"path":"scripts/path_reader/path_reader.yy",}, - {"name":"node_3d_repeat","order":12,"path":"scripts/node_3d_repeat/node_3d_repeat.yy",}, + {"name":"node_3d_repeat","order":6,"path":"scripts/node_3d_repeat/node_3d_repeat.yy",}, {"name":"point_direction_positive","order":4,"path":"scripts/point_direction_positive/point_direction_positive.yy",}, {"name":"s_node_fluidSim_add_fluid","order":3,"path":"sprites/s_node_fluidSim_add_fluid/s_node_fluidSim_add_fluid.yy",}, {"name":"sh_replace_color","order":5,"path":"shaders/sh_replace_color/sh_replace_color.yy",}, @@ -1193,8 +1218,8 @@ {"name":"s_node_shape_polygon","order":25,"path":"sprites/s_node_shape_polygon/s_node_shape_polygon.yy",}, {"name":"s_node_pb_fx_interesct","order":6,"path":"sprites/s_node_pb_fx_interesct/s_node_pb_fx_interesct.yy",}, {"name":"node_path_eval","order":4,"path":"scripts/node_path_eval/node_path_eval.yy",}, - {"name":"sh_3d_depth","order":7,"path":"shaders/sh_3d_depth/sh_3d_depth.yy",}, - {"name":"node_3d_displace","order":18,"path":"scripts/node_3d_displace/node_3d_displace.yy",}, + {"name":"sh_3d_depth","order":6,"path":"shaders/sh_3d_depth/sh_3d_depth.yy",}, + {"name":"node_3d_displace","order":1,"path":"scripts/node_3d_displace/node_3d_displace.yy",}, {"name":"node_vector_dot","order":9,"path":"scripts/node_vector_dot/node_vector_dot.yy",}, {"name":"node_path_map_area","order":1,"path":"scripts/node_path_map_area/node_path_map_area.yy",}, {"name":"s_node_timeline_preview","order":2,"path":"sprites/s_node_timeline_preview/s_node_timeline_preview.yy",}, @@ -1215,6 +1240,7 @@ {"name":"__view_get","order":1,"path":"scripts/__view_get/__view_get.yy",}, {"name":"s_node_texture_map","order":38,"path":"sprites/s_node_texture_map/s_node_texture_map.yy",}, {"name":"fd_rectangle_create","order":7,"path":"scripts/fd_rectangle_create/fd_rectangle_create.yy",}, + {"name":"d3d_gizmo","order":4,"path":"scripts/d3d_gizmo/d3d_gizmo.yy",}, {"name":"s_node_level_selector","order":29,"path":"sprites/s_node_level_selector/s_node_level_selector.yy",}, {"name":"random_function","order":3,"path":"scripts/random_function/random_function.yy",}, {"name":"s_node_input","order":6,"path":"sprites/s_node_input/s_node_input.yy",}, @@ -1231,6 +1257,7 @@ {"name":"s_node_array_reverse","order":8,"path":"sprites/s_node_array_reverse/s_node_array_reverse.yy",}, {"name":"o_process_handler","order":3,"path":"objects/o_process_handler/o_process_handler.yy",}, {"name":"sh_ani_noise","order":8,"path":"shaders/sh_ani_noise/sh_ani_noise.yy",}, + {"name":"d3d_camera","order":3,"path":"scripts/d3d_camera/d3d_camera.yy",}, {"name":"sh_level","order":14,"path":"shaders/sh_level/sh_level.yy",}, {"name":"sh_grid_tri","order":3,"path":"shaders/sh_grid_tri/sh_grid_tri.yy",}, {"name":"s_node_text","order":1,"path":"sprites/s_node_text/s_node_text.yy",}, @@ -1238,10 +1265,11 @@ {"name":"s_node_ase_file","order":15,"path":"sprites/s_node_ase_file/s_node_ase_file.yy",}, {"name":"draw_line_round","order":4,"path":"scripts/draw_line_round/draw_line_round.yy",}, {"name":"vectorBox","order":18,"path":"scripts/vectorBox/vectorBox.yy",}, - {"name":"sh_3d_extrude_corner","order":9,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",}, + {"name":"sh_3d_extrude_corner","order":7,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",}, {"name":"sh_blend_normal_dim","order":10,"path":"shaders/sh_blend_normal_dim/sh_blend_normal_dim.yy",}, {"name":"node_skew","order":11,"path":"scripts/node_skew/node_skew.yy",}, {"name":"s_node_dot_product","order":13,"path":"sprites/s_node_dot_product/s_node_dot_product.yy",}, + {"name":"d3d_light","order":10,"path":"scripts/d3d_light/d3d_light.yy",}, {"name":"sh_downsample","order":1,"path":"shaders/sh_downsample/sh_downsample.yy",}, {"name":"sh_remove_black","order":33,"path":"shaders/sh_remove_black/sh_remove_black.yy",}, {"name":"path_parser","order":3,"path":"scripts/path_parser/path_parser.yy",}, @@ -1289,7 +1317,7 @@ {"name":"s_node_scatter","order":19,"path":"sprites/s_node_scatter/s_node_scatter.yy",}, {"name":"s_node_bokeh","order":51,"path":"sprites/s_node_bokeh/s_node_bokeh.yy",}, {"name":"s_biterator_toggler","order":13,"path":"sprites/s_biterator_toggler/s_biterator_toggler.yy",}, - {"name":"sh_vertex_depth_pass","order":6,"path":"shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy",}, + {"name":"sh_vertex_depth_pass","order":2,"path":"shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy",}, {"name":"sh_curve","order":3,"path":"shaders/sh_curve/sh_curve.yy",}, {"name":"sh_warp_4points","order":9,"path":"shaders/sh_warp_4points/sh_warp_4points.yy",}, {"name":"_f_p2","order":4,"path":"fonts/_f_p2/_f_p2.yy",}, @@ -1326,7 +1354,6 @@ {"name":"bin_function","order":11,"path":"scripts/bin_function/bin_function.yy",}, {"name":"s_node_feedback_output","order":9,"path":"sprites/s_node_feedback_output/s_node_feedback_output.yy",}, {"name":"sh_surface_replace_fast_find","order":2,"path":"shaders/sh_surface_replace_fast_find/sh_surface_replace_fast_find.yy",}, - {"name":"node_3d_combine","order":10,"path":"scripts/node_3d_combine/node_3d_combine.yy",}, {"name":"fd_rectangle_add_material","order":4,"path":"scripts/fd_rectangle_add_material/fd_rectangle_add_material.yy",}, {"name":"fd_rectangle_set_target","order":18,"path":"scripts/fd_rectangle_set_target/fd_rectangle_set_target.yy",}, {"name":"node_wav_file_read","order":2,"path":"scripts/node_wav_file_read/node_wav_file_read.yy",}, @@ -1357,6 +1384,7 @@ {"name":"__node_value_processor","order":6,"path":"scripts/__node_value_processor/__node_value_processor.yy",}, {"name":"s_node_group_input","order":16,"path":"sprites/s_node_group_input/s_node_group_input.yy",}, {"name":"sample_projects","order":6,"path":"scripts/sample_projects/sample_projects.yy",}, + {"name":"d3d_matrix3","order":6,"path":"scripts/d3d_matrix3/d3d_matrix3.yy",}, {"name":"draw_fit","order":12,"path":"scripts/draw_fit/draw_fit.yy",}, {"name":"node_armature_sample","order":5,"path":"scripts/node_armature_sample/node_armature_sample.yy",}, {"name":"sh_pb_shade","order":3,"path":"shaders/sh_pb_shade/sh_pb_shade.yy",}, @@ -1366,7 +1394,7 @@ {"name":"node_pb_box_split","order":2,"path":"scripts/node_pb_box_split/node_pb_box_split.yy",}, {"name":"s_node_output","order":7,"path":"sprites/s_node_output/s_node_output.yy",}, {"name":"sh_atlas","order":26,"path":"shaders/sh_atlas/sh_atlas.yy",}, - {"name":"node_3d_extrude","order":9,"path":"scripts/node_3d_extrude/node_3d_extrude.yy",}, + {"name":"node_3d_extrude","order":3,"path":"scripts/node_3d_extrude/node_3d_extrude.yy",}, {"name":"node_path_array","order":11,"path":"scripts/node_path_array/node_path_array.yy",}, {"name":"node_scale","order":8,"path":"scripts/node_scale/node_scale.yy",}, {"name":"panel_array_sequence","order":3,"path":"scripts/panel_array_sequence/panel_array_sequence.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 8852ece2d..cf10fdd1f 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -42,6 +42,7 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"font","folderPath":"folders/font.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"functions","folderPath":"folders/functions.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"3d","folderPath":"folders/functions/3d.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"misc","folderPath":"folders/functions/3d/misc.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"action","folderPath":"folders/functions/action.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/functions/animation.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"async","folderPath":"folders/functions/async.yy",}, @@ -94,7 +95,11 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"data","folderPath":"folders/nodes/data.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"__base__","folderPath":"folders/nodes/data/__base__.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"3D","folderPath":"folders/nodes/data/3D.yy",}, - {"resourceType":"GMFolder","resourceVersion":"1.0","name":"primitive","folderPath":"folders/nodes/data/3D/primitive.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"__legacy","folderPath":"folders/nodes/data/3D/__legacy.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"primitive","folderPath":"folders/nodes/data/3D/__legacy/primitive.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"2d effects","folderPath":"folders/nodes/data/3D/2d effects.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d light","folderPath":"folders/nodes/data/3D/d3d light.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"d3d mesh","folderPath":"folders/nodes/data/3D/d3d mesh.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"animation","folderPath":"folders/nodes/data/animation.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"audio","folderPath":"folders/nodes/data/audio.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"compose","folderPath":"folders/nodes/data/compose.yy",}, @@ -182,6 +187,8 @@ {"resourceType":"GMFolder","resourceVersion":"1.0","name":"shader","folderPath":"folders/shader.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"_helper","folderPath":"folders/shader/_helper.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"3d","folderPath":"folders/shader/3d.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"2d effect","folderPath":"folders/shader/3d/2d effect.yy",}, + {"resourceType":"GMFolder","resourceVersion":"1.0","name":"legacy","folderPath":"folders/shader/3d/legacy.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blend","folderPath":"folders/shader/blend.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"blur","folderPath":"folders/shader/blur.yy",}, {"resourceType":"GMFolder","resourceVersion":"1.0","name":"channels","folderPath":"folders/shader/channels.yy",}, @@ -701,8 +708,10 @@ {"id":{"name":"sh_normal_light","path":"shaders/sh_normal_light/sh_normal_light.yy",},}, {"id":{"name":"node_tool","path":"scripts/node_tool/node_tool.yy",},}, {"id":{"name":"sh_find_pixel","path":"shaders/sh_find_pixel/sh_find_pixel.yy",},}, + {"id":{"name":"__node_3d_camera","path":"scripts/__node_3d_camera/__node_3d_camera.yy",},}, {"id":{"name":"panel_preview_window","path":"scripts/panel_preview_window/panel_preview_window.yy",},}, {"id":{"name":"sh_scale3x","path":"shaders/sh_scale3x/sh_scale3x.yy",},}, + {"id":{"name":"__node_3d","path":"scripts/__node_3d/__node_3d.yy",},}, {"id":{"name":"node_csv_file_write","path":"scripts/node_csv_file_write/node_csv_file_write.yy",},}, {"id":{"name":"surface_functions","path":"scripts/surface_functions/surface_functions.yy",},}, {"id":{"name":"sh_fd_add_velocity_glsl","path":"shaders/sh_fd_add_velocity_glsl/sh_fd_add_velocity_glsl.yy",},}, @@ -849,6 +858,7 @@ {"id":{"name":"_f_code","path":"fonts/_f_code/_f_code.yy",},}, {"id":{"name":"sh_combine_rgb","path":"shaders/sh_combine_rgb/sh_combine_rgb.yy",},}, {"id":{"name":"node_armature_to_path","path":"scripts/node_armature_to_path/node_armature_to_path.yy",},}, + {"id":{"name":"d3d_object","path":"scripts/d3d_object/d3d_object.yy",},}, {"id":{"name":"s_node_strandSim","path":"sprites/s_node_strandSim/s_node_strandSim.yy",},}, {"id":{"name":"object_get_depth","path":"scripts/object_get_depth/object_get_depth.yy",},}, {"id":{"name":"o_dialog_panel","path":"objects/o_dialog_panel/o_dialog_panel.yy",},}, @@ -877,11 +887,13 @@ {"id":{"name":"node_pb_fx_strip","path":"scripts/node_pb_fx_strip/node_pb_fx_strip.yy",},}, {"id":{"name":"node_stripe","path":"scripts/node_stripe/node_stripe.yy",},}, {"id":{"name":"sh_texture_atlas","path":"shaders/sh_texture_atlas/sh_texture_atlas.yy",},}, + {"id":{"name":"d3d_vec4","path":"scripts/d3d_vec4/d3d_vec4.yy",},}, {"id":{"name":"s_node_fluidSim_domain","path":"sprites/s_node_fluidSim_domain/s_node_fluidSim_domain.yy",},}, {"id":{"name":"s_node_displace","path":"sprites/s_node_displace/s_node_displace.yy",},}, {"id":{"name":"sh_polar","path":"shaders/sh_polar/sh_polar.yy",},}, {"id":{"name":"s_node_warp_mesh","path":"sprites/s_node_warp_mesh/s_node_warp_mesh.yy",},}, {"id":{"name":"sh_pixel_cloud","path":"shaders/sh_pixel_cloud/sh_pixel_cloud.yy",},}, + {"id":{"name":"sh_d3d_wireframe","path":"shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy",},}, {"id":{"name":"s_biterator_b_grey_short","path":"sprites/s_biterator_b_grey_short/s_biterator_b_grey_short.yy",},}, {"id":{"name":"printer","path":"scripts/printer/printer.yy",},}, {"id":{"name":"node_iterate","path":"scripts/node_iterate/node_iterate.yy",},}, @@ -921,11 +933,13 @@ {"id":{"name":"byte_writer","path":"scripts/byte_writer/byte_writer.yy",},}, {"id":{"name":"checkboxGroup","path":"scripts/checkboxGroup/checkboxGroup.yy",},}, {"id":{"name":"node_FXAA","path":"scripts/node_FXAA/node_FXAA.yy",},}, + {"id":{"name":"__node_3d_object","path":"scripts/__node_3d_object/__node_3d_object.yy",},}, {"id":{"name":"s_node_pixel_find","path":"sprites/s_node_pixel_find/s_node_pixel_find.yy",},}, {"id":{"name":"s_biterator_canvas_cover","path":"sprites/s_biterator_canvas_cover/s_biterator_canvas_cover.yy",},}, {"id":{"name":"sh_noise_grid_tri","path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},}, {"id":{"name":"globals","path":"scripts/globals/globals.yy",},}, {"id":{"name":"s_node_noise_perlin","path":"sprites/s_node_noise_perlin/s_node_noise_perlin.yy",},}, + {"id":{"name":"sh_d3d_default","path":"shaders/sh_d3d_default/sh_d3d_default.yy",},}, {"id":{"name":"s_node_dithering","path":"sprites/s_node_dithering/s_node_dithering.yy",},}, {"id":{"name":"s_node_boolean","path":"sprites/s_node_boolean/s_node_boolean.yy",},}, {"id":{"name":"s_workshop_badge","path":"sprites/s_workshop_badge/s_workshop_badge.yy",},}, @@ -1009,6 +1023,7 @@ {"id":{"name":"sh_fd_calculate_pressure_jacobi_glsl","path":"shaders/sh_fd_calculate_pressure_jacobi_glsl/sh_fd_calculate_pressure_jacobi_glsl.yy",},}, {"id":{"name":"node_color_from_rgb","path":"scripts/node_color_from_rgb/node_color_from_rgb.yy",},}, {"id":{"name":"node_struct_get","path":"scripts/node_struct_get/node_struct_get.yy",},}, + {"id":{"name":"node_3d_mesh_cube","path":"scripts/node_3d_mesh_cube/node_3d_mesh_cube.yy",},}, {"id":{"name":"node_transform","path":"scripts/node_transform/node_transform.yy",},}, {"id":{"name":"curveBox","path":"scripts/curveBox/curveBox.yy",},}, {"id":{"name":"s_node_iterator_length","path":"sprites/s_node_iterator_length/s_node_iterator_length.yy",},}, @@ -1116,6 +1131,7 @@ {"id":{"name":"load_palette","path":"scripts/load_palette/load_palette.yy",},}, {"id":{"name":"sh_alpha_cutoff","path":"shaders/sh_alpha_cutoff/sh_alpha_cutoff.yy",},}, {"id":{"name":"luaHighlight","path":"scripts/luaHighlight/luaHighlight.yy",},}, + {"id":{"name":"d3d_rot3","path":"scripts/d3d_rot3/d3d_rot3.yy",},}, {"id":{"name":"sh_sample_points","path":"shaders/sh_sample_points/sh_sample_points.yy",},}, {"id":{"name":"node_combine_rgb","path":"scripts/node_combine_rgb/node_combine_rgb.yy",},}, {"id":{"name":"fd_rectangle_draw_part","path":"scripts/fd_rectangle_draw_part/fd_rectangle_draw_part.yy",},}, @@ -1133,7 +1149,7 @@ {"id":{"name":"sh_warp_4points_pers","path":"shaders/sh_warp_4points_pers/sh_warp_4points_pers.yy",},}, {"id":{"name":"node_mirror","path":"scripts/node_mirror/node_mirror.yy",},}, {"id":{"name":"node_corner","path":"scripts/node_corner/node_corner.yy",},}, - {"id":{"name":"vertex_function","path":"scripts/vertex_function/vertex_function.yy",},}, + {"id":{"name":"__vertex_function","path":"scripts/__vertex_function/__vertex_function.yy",},}, {"id":{"name":"node_path_anchor","path":"scripts/node_path_anchor/node_path_anchor.yy",},}, {"id":{"name":"s_node_path_wave","path":"sprites/s_node_path_wave/s_node_path_wave.yy",},}, {"id":{"name":"string_function","path":"scripts/string_function/string_function.yy",},}, @@ -1278,6 +1294,7 @@ {"id":{"name":"s_node_lua_surface","path":"sprites/s_node_lua_surface/s_node_lua_surface.yy",},}, {"id":{"name":"node_data","path":"scripts/node_data/node_data.yy",},}, {"id":{"name":"node_wiggler","path":"scripts/node_wiggler/node_wiggler.yy",},}, + {"id":{"name":"d3d_matrix4","path":"scripts/d3d_matrix4/d3d_matrix4.yy",},}, {"id":{"name":"fd_GUIDE","path":"scripts/fd_GUIDE/fd_GUIDE.yy",},}, {"id":{"name":"node_fluid_update","path":"scripts/node_fluid_update/node_fluid_update.yy",},}, {"id":{"name":"s_node_checker","path":"sprites/s_node_checker/s_node_checker.yy",},}, @@ -1320,6 +1337,7 @@ {"id":{"name":"fd_rectangle_set_material_size","path":"scripts/fd_rectangle_set_material_size/fd_rectangle_set_material_size.yy",},}, {"id":{"name":"fd_rectangle_shift_content","path":"scripts/fd_rectangle_shift_content/fd_rectangle_shift_content.yy",},}, {"id":{"name":"sh_texture_remap","path":"shaders/sh_texture_remap/sh_texture_remap.yy",},}, + {"id":{"name":"__node_3d_mesh_modifier","path":"scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.yy",},}, {"id":{"name":"obj_fd_rectangle","path":"objects/obj_fd_rectangle/obj_fd_rectangle.yy",},}, {"id":{"name":"node_noise_simplex","path":"scripts/node_noise_simplex/node_noise_simplex.yy",},}, {"id":{"name":"sh_fd_visualize_velocity_divergence_glsl","path":"shaders/sh_fd_visualize_velocity_divergence_glsl/sh_fd_visualize_velocity_divergence_glsl.yy",},}, @@ -1362,6 +1380,7 @@ {"id":{"name":"sh_color_replace","path":"shaders/sh_color_replace/sh_color_replace.yy",},}, {"id":{"name":"__surface","path":"scripts/__surface/__surface.yy",},}, {"id":{"name":"clipboard","path":"extensions/clipboard/clipboard.yy",},}, + {"id":{"name":"__node_3d_light","path":"scripts/__node_3d_light/__node_3d_light.yy",},}, {"id":{"name":"rotator","path":"scripts/rotator/rotator.yy",},}, {"id":{"name":"s_node_edge_detect","path":"sprites/s_node_edge_detect/s_node_edge_detect.yy",},}, {"id":{"name":"node_fluid_add_collider","path":"scripts/node_fluid_add_collider/node_fluid_add_collider.yy",},}, @@ -1372,6 +1391,7 @@ {"id":{"name":"draw_overlay","path":"scripts/draw_overlay/draw_overlay.yy",},}, {"id":{"name":"__background_get","path":"scripts/__background_get/__background_get.yy",},}, {"id":{"name":"s_node_text_display","path":"sprites/s_node_text_display/s_node_text_display.yy",},}, + {"id":{"name":"sh_d3d_outline","path":"shaders/sh_d3d_outline/sh_d3d_outline.yy",},}, {"id":{"name":"node_strand_render_texture","path":"scripts/node_strand_render_texture/node_strand_render_texture.yy",},}, {"id":{"name":"luaRenderer","path":"scripts/luaRenderer/luaRenderer.yy",},}, {"id":{"name":"node_blur_zoom","path":"scripts/node_blur_zoom/node_blur_zoom.yy",},}, @@ -1404,6 +1424,7 @@ {"id":{"name":"node_particle","path":"scripts/node_particle/node_particle.yy",},}, {"id":{"name":"node_pb_box_contract","path":"scripts/node_pb_box_contract/node_pb_box_contract.yy",},}, {"id":{"name":"histogram_drawer","path":"scripts/histogram_drawer/histogram_drawer.yy",},}, + {"id":{"name":"node_3d_scene","path":"scripts/node_3d_scene/node_3d_scene.yy",},}, {"id":{"name":"sh_color_picker_side_value","path":"shaders/sh_color_picker_side_value/sh_color_picker_side_value.yy",},}, {"id":{"name":"node_array_range","path":"scripts/node_array_range/node_array_range.yy",},}, {"id":{"name":"node_animation_control","path":"scripts/node_animation_control/node_animation_control.yy",},}, @@ -1461,6 +1482,7 @@ {"id":{"name":"node_global","path":"scripts/node_global/node_global.yy",},}, {"id":{"name":"spr_gameframe_buttons","path":"sprites/spr_gameframe_buttons/spr_gameframe_buttons.yy",},}, {"id":{"name":"s_node_draw_stack","path":"sprites/s_node_draw_stack/s_node_draw_stack.yy",},}, + {"id":{"name":"sh_d3d_grid_view","path":"shaders/sh_d3d_grid_view/sh_d3d_grid_view.yy",},}, {"id":{"name":"delaunay","path":"scripts/delaunay/delaunay.yy",},}, {"id":{"name":"s_node_noise_fbm","path":"sprites/s_node_noise_fbm/s_node_noise_fbm.yy",},}, {"id":{"name":"sh_color_select_content","path":"shaders/sh_color_select_content/sh_color_select_content.yy",},}, @@ -1505,6 +1527,7 @@ {"id":{"name":"s_node_fluidSim_domain_queue","path":"sprites/s_node_fluidSim_domain_queue/s_node_fluidSim_domain_queue.yy",},}, {"id":{"name":"sh_camera","path":"shaders/sh_camera/sh_camera.yy",},}, {"id":{"name":"s_node_vfx_spawn","path":"sprites/s_node_vfx_spawn/s_node_vfx_spawn.yy",},}, + {"id":{"name":"d3d_vec3","path":"scripts/d3d_vec3/d3d_vec3.yy",},}, {"id":{"name":"texture_set_repeat","path":"scripts/texture_set_repeat/texture_set_repeat.yy",},}, {"id":{"name":"o_dialog_color_quick_pick","path":"objects/o_dialog_color_quick_pick/o_dialog_color_quick_pick.yy",},}, {"id":{"name":"fd_rectangle_update_velocity","path":"scripts/fd_rectangle_update_velocity/fd_rectangle_update_velocity.yy",},}, @@ -1558,6 +1581,7 @@ {"id":{"name":"sh_seperate_shape_ite","path":"shaders/sh_seperate_shape_ite/sh_seperate_shape_ite.yy",},}, {"id":{"name":"o_main","path":"objects/o_main/o_main.yy",},}, {"id":{"name":"area_function","path":"scripts/area_function/area_function.yy",},}, + {"id":{"name":"__node_3d_mesh","path":"scripts/__node_3d_mesh/__node_3d_mesh.yy",},}, {"id":{"name":"node_mesh_to_path","path":"scripts/node_mesh_to_path/node_mesh_to_path.yy",},}, {"id":{"name":"node_fluid_sim","path":"scripts/node_fluid_sim/node_fluid_sim.yy",},}, {"id":{"name":"sh_convolution","path":"shaders/sh_convolution/sh_convolution.yy",},}, @@ -1653,6 +1677,7 @@ {"id":{"name":"s_node_pb_draw_roundrectangle","path":"sprites/s_node_pb_draw_roundrectangle/s_node_pb_draw_roundrectangle.yy",},}, {"id":{"name":"node_trail","path":"scripts/node_trail/node_trail.yy",},}, {"id":{"name":"byte_reader","path":"scripts/byte_reader/byte_reader.yy",},}, + {"id":{"name":"node_3d_light_directional","path":"scripts/node_3d_light_directional/node_3d_light_directional.yy",},}, {"id":{"name":"json_prettify","path":"scripts/json_prettify/json_prettify.yy",},}, {"id":{"name":"s_node_loop_output","path":"sprites/s_node_loop_output/s_node_loop_output.yy",},}, {"id":{"name":"_p_dialog","path":"objects/_p_dialog/_p_dialog.yy",},}, @@ -1689,6 +1714,7 @@ {"id":{"name":"sh_fd_calculate_pressure_srj_glsl","path":"shaders/sh_fd_calculate_pressure_srj_glsl/sh_fd_calculate_pressure_srj_glsl.yy",},}, {"id":{"name":"curve_bounce_function","path":"scripts/curve_bounce_function/curve_bounce_function.yy",},}, {"id":{"name":"node_pb_fx_shading","path":"scripts/node_pb_fx_shading/node_pb_fx_shading.yy",},}, + {"id":{"name":"sh_d3d_silhouette","path":"shaders/sh_d3d_silhouette/sh_d3d_silhouette.yy",},}, {"id":{"name":"fd_rectangle_replace_material_surface","path":"scripts/fd_rectangle_replace_material_surface/fd_rectangle_replace_material_surface.yy",},}, {"id":{"name":"pack_skyline","path":"scripts/pack_skyline/pack_skyline.yy",},}, {"id":{"name":"fd_x","path":"scripts/fd_x/fd_x.yy",},}, @@ -1721,6 +1747,7 @@ {"id":{"name":"s_node_atlas","path":"sprites/s_node_atlas/s_node_atlas.yy",},}, {"id":{"name":"node_fluid_add","path":"scripts/node_fluid_add/node_fluid_add.yy",},}, {"id":{"name":"BBMOD_Quaternion","path":"scripts/BBMOD_Quaternion/BBMOD_Quaternion.yy",},}, + {"id":{"name":"d3d_cube","path":"scripts/d3d_cube/d3d_cube.yy",},}, {"id":{"name":"o_dialog_output_visibility","path":"objects/o_dialog_output_visibility/o_dialog_output_visibility.yy",},}, {"id":{"name":"node_normal","path":"scripts/node_normal/node_normal.yy",},}, {"id":{"name":"s_node_glow","path":"sprites/s_node_glow/s_node_glow.yy",},}, @@ -1741,6 +1768,7 @@ {"id":{"name":"vct_slider","path":"scripts/vct_slider/vct_slider.yy",},}, {"id":{"name":"panel_node_align","path":"scripts/panel_node_align/panel_node_align.yy",},}, {"id":{"name":"sh_blur_alpha","path":"shaders/sh_blur_alpha/sh_blur_alpha.yy",},}, + {"id":{"name":"d3d_light_directional","path":"scripts/d3d_light_directional/d3d_light_directional.yy",},}, {"id":{"name":"node_render_sprite_sheet","path":"scripts/node_render_sprite_sheet/node_render_sprite_sheet.yy",},}, {"id":{"name":"textArrayBox","path":"scripts/textArrayBox/textArrayBox.yy",},}, {"id":{"name":"value_snap","path":"scripts/value_snap/value_snap.yy",},}, @@ -1877,6 +1905,7 @@ {"id":{"name":"sh_sample","path":"shaders/sh_sample/sh_sample.yy",},}, {"id":{"name":"s_node_texture_map","path":"sprites/s_node_texture_map/s_node_texture_map.yy",},}, {"id":{"name":"fd_rectangle_create","path":"scripts/fd_rectangle_create/fd_rectangle_create.yy",},}, + {"id":{"name":"d3d_gizmo","path":"scripts/d3d_gizmo/d3d_gizmo.yy",},}, {"id":{"name":"s_node_level_selector","path":"sprites/s_node_level_selector/s_node_level_selector.yy",},}, {"id":{"name":"random_function","path":"scripts/random_function/random_function.yy",},}, {"id":{"name":"s_node_input","path":"sprites/s_node_input/s_node_input.yy",},}, @@ -1896,6 +1925,7 @@ {"id":{"name":"sh_ani_noise","path":"shaders/sh_ani_noise/sh_ani_noise.yy",},}, {"id":{"name":"rectangle_collision","path":"scripts/rectangle_collision/rectangle_collision.yy",},}, {"id":{"name":"s_contest_banner","path":"sprites/s_contest_banner/s_contest_banner.yy",},}, + {"id":{"name":"d3d_camera","path":"scripts/d3d_camera/d3d_camera.yy",},}, {"id":{"name":"sh_level","path":"shaders/sh_level/sh_level.yy",},}, {"id":{"name":"sh_grid_tri","path":"shaders/sh_grid_tri/sh_grid_tri.yy",},}, {"id":{"name":"s_node_text","path":"sprites/s_node_text/s_node_text.yy",},}, @@ -1908,6 +1938,7 @@ {"id":{"name":"node_skew","path":"scripts/node_skew/node_skew.yy",},}, {"id":{"name":"s_node_dot_product","path":"sprites/s_node_dot_product/s_node_dot_product.yy",},}, {"id":{"name":"s_node_canvas","path":"sprites/s_node_canvas/s_node_canvas.yy",},}, + {"id":{"name":"d3d_light","path":"scripts/d3d_light/d3d_light.yy",},}, {"id":{"name":"sh_downsample","path":"shaders/sh_downsample/sh_downsample.yy",},}, {"id":{"name":"sh_remove_black","path":"shaders/sh_remove_black/sh_remove_black.yy",},}, {"id":{"name":"path_parser","path":"scripts/path_parser/path_parser.yy",},}, @@ -2037,6 +2068,7 @@ {"id":{"name":"s_node_group_input","path":"sprites/s_node_group_input/s_node_group_input.yy",},}, {"id":{"name":"sample_projects","path":"scripts/sample_projects/sample_projects.yy",},}, {"id":{"name":"load_function","path":"scripts/load_function/load_function.yy",},}, + {"id":{"name":"d3d_matrix3","path":"scripts/d3d_matrix3/d3d_matrix3.yy",},}, {"id":{"name":"draw_fit","path":"scripts/draw_fit/draw_fit.yy",},}, {"id":{"name":"node_armature_sample","path":"scripts/node_armature_sample/node_armature_sample.yy",},}, {"id":{"name":"sh_pb_shade","path":"shaders/sh_pb_shade/sh_pb_shade.yy",},}, diff --git a/datafiles/data/themes/default.zip b/datafiles/data/themes/default.zip index dbbf87651..152688c16 100644 Binary files a/datafiles/data/themes/default.zip and b/datafiles/data/themes/default.zip differ diff --git a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml index c50ac16b8..b14705f81 100644 --- a/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml +++ b/scripts/BBMOD_Quaternion/BBMOD_Quaternion.gml @@ -245,7 +245,7 @@ function BBMOD_Quaternion(_x=0.0, _y=0.0, _z=0.0, _w=1.0) constructor } var _right = _up.Cross(_forward); - var _w = sqrt(1.0 + _right.X + _up.Y + _forward.Z) * 0.5; + var _w = sqrt(abs(1.0 + _right.X + _up.Y + _forward.Z)) * 0.5; var _w4Recip = 1.0 / (4.0 * _w); X = (_up.Z - _forward.Y) * _w4Recip; diff --git a/scripts/_3D/_3D.gml b/scripts/_3D/_3D.gml index bb739082f..cc70c5f12 100644 --- a/scripts/_3D/_3D.gml +++ b/scripts/_3D/_3D.gml @@ -258,7 +258,7 @@ enum CAMERA_PROJ { VB = []; use_normal = true; - TM = matrix_build(0, 0, 0, 0, 0, 0, 1, 1, 1); + 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); @@ -301,7 +301,7 @@ enum CAMERA_PROJ { var cx = _x + _gpos[0] * _s; var cy = _y + _gpos[1] * _s; - + var _qrot = new BBMOD_Quaternion().FromEuler(_rot[0], -_rot[1], -_rot[2]); var _hover = noone; var _hoverDist = 10; diff --git a/scripts/_3D/_3D.yy b/scripts/_3D/_3D.yy index 69542ef68..749b6d39b 100644 --- a/scripts/_3D/_3D.yy +++ b/scripts/_3D/_3D.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/_3d_rotation/_3d_rotation.yy b/scripts/_3d_rotation/_3d_rotation.yy index 50e6c2cd4..2ac247a7e 100644 --- a/scripts/_3d_rotation/_3d_rotation.yy +++ b/scripts/_3d_rotation/_3d_rotation.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3d", - "path": "folders/functions/3d.yy", + "name": "misc", + "path": "folders/functions/3d/misc.yy", }, } \ No newline at end of file diff --git a/scripts/__node_3d/__node_3d.gml b/scripts/__node_3d/__node_3d.gml new file mode 100644 index 000000000..fce1fc994 --- /dev/null +++ b/scripts/__node_3d/__node_3d.gml @@ -0,0 +1,18 @@ +function Node_3D(_x, _y, _group = noone) : Node(_x, _y, _group) constructor { + name = "3D"; + + is_3D = true; + + //inputs[| 0] = nodeValue("Array in", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, []) + // .setVisible(true, true); + + //outputs[| 0] = nodeValue("Shuffled array", self, JUNCTION_CONNECT.output, VALUE_TYPE.any, []); + + static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) {} + + static submit = function(params = {}, shader = noone) {} + static submitUI = function(params = {}, shader = noone) {} + + static update = function(frame = PROJECT.animator.current_frame) {} + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {} +} \ No newline at end of file diff --git a/scripts/__node_3d/__node_3d.yy b/scripts/__node_3d/__node_3d.yy new file mode 100644 index 000000000..043e10b67 --- /dev/null +++ b/scripts/__node_3d/__node_3d.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3D", + "path": "folders/nodes/data/3D.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d/node_counter.yy b/scripts/__node_3d/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__node_3d_camera/__node_3d_camera.gml b/scripts/__node_3d_camera/__node_3d_camera.gml new file mode 100644 index 000000000..86c6bfb66 --- /dev/null +++ b/scripts/__node_3d_camera/__node_3d_camera.gml @@ -0,0 +1,11 @@ +function Node_3D_Camera(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { + name = "3D Camera"; + + static update = function(frame = PROJECT.animator.current_frame) { + + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + + } +} \ No newline at end of file diff --git a/scripts/__node_3d_camera/__node_3d_camera.yy b/scripts/__node_3d_camera/__node_3d_camera.yy new file mode 100644 index 000000000..a7474e304 --- /dev/null +++ b/scripts/__node_3d_camera/__node_3d_camera.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d_camera", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3D", + "path": "folders/nodes/data/3D.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d_camera/node_counter.yy b/scripts/__node_3d_camera/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d_camera/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__node_3d_light/__node_3d_light.gml b/scripts/__node_3d_light/__node_3d_light.gml new file mode 100644 index 000000000..b068d7ceb --- /dev/null +++ b/scripts/__node_3d_light/__node_3d_light.gml @@ -0,0 +1,38 @@ +function Node_3D_Light(_x, _y, _group = noone) : Node_3DObject(_x, _y, _group) constructor { + name = "3D Light"; + object = new __3dLight(); + + if(!LOADING && !APPENDING) { + inputs[| 0].setValue([ 0, 0, 1 ]); + } + + inputs[| input_d3d_index + 0] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, c_white); + + inputs[| input_d3d_index + 1] = nodeValue("Intensity", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 1) + .setDisplay(VALUE_DISPLAY.slider, [ 0, 1, 0.01 ]); + + input_light_index = ds_list_size(inputs); + + outputs[| 0] = nodeValue("Light", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3Light, object); + + #macro __d3d_input_list_light ["Light", false], input_d3d_index + 0, input_d3d_index + 1 + + static setLight = function() { + var _col = inputs[| input_d3d_index + 0].getValue(); + var _int = inputs[| input_d3d_index + 1].getValue(); + + object.color = _col; + object.intensity = _int; + + outputs[| 0].setValue(object); + } + + static update = function(frame = PROJECT.animator.current_frame) { + setTransform(); + setLight(); + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + + } +} \ No newline at end of file diff --git a/scripts/__node_3d_light/__node_3d_light.yy b/scripts/__node_3d_light/__node_3d_light.yy new file mode 100644 index 000000000..57cbe8f9d --- /dev/null +++ b/scripts/__node_3d_light/__node_3d_light.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d_light", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "d3d light", + "path": "folders/nodes/data/3D/d3d light.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d_light/node_counter.yy b/scripts/__node_3d_light/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d_light/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh/__node_3d_mesh.gml b/scripts/__node_3d_mesh/__node_3d_mesh.gml new file mode 100644 index 000000000..539521466 --- /dev/null +++ b/scripts/__node_3d_mesh/__node_3d_mesh.gml @@ -0,0 +1,17 @@ +function Node_3D_Mesh(_x, _y, _group = noone) : Node_3DObject(_x, _y, _group) constructor { + name = "3D Mesh"; + + input_mesh_index = ds_list_size(inputs); + + outputs[| 0] = nodeValue("Mesh", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3Mesh, noone); + + #macro __d3d_input_list_mesh ["Mesh", false] + + static update = function(frame = PROJECT.animator.current_frame) { + setTransform(); + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + + } +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh/__node_3d_mesh.yy b/scripts/__node_3d_mesh/__node_3d_mesh.yy new file mode 100644 index 000000000..4123327b4 --- /dev/null +++ b/scripts/__node_3d_mesh/__node_3d_mesh.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d_mesh", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "d3d mesh", + "path": "folders/nodes/data/3D/d3d mesh.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh/node_counter.yy b/scripts/__node_3d_mesh/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d_mesh/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.gml b/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.gml new file mode 100644 index 000000000..9db67539a --- /dev/null +++ b/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.gml @@ -0,0 +1,11 @@ +function Node_3D_Mesh_Modifier(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { + name = "3D Mesh Modifier"; + + static update = function(frame = PROJECT.animator.current_frame) { + + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { + + } +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.yy b/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.yy new file mode 100644 index 000000000..b9376a4c9 --- /dev/null +++ b/scripts/__node_3d_mesh_modifier/__node_3d_mesh_modifier.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d_mesh_modifier", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3D", + "path": "folders/nodes/data/3D.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d_mesh_modifier/node_counter.yy b/scripts/__node_3d_mesh_modifier/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d_mesh_modifier/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/__node_3d_object/__node_3d_object.gml b/scripts/__node_3d_object/__node_3d_object.gml new file mode 100644 index 000000000..2c34764ad --- /dev/null +++ b/scripts/__node_3d_object/__node_3d_object.gml @@ -0,0 +1,245 @@ +function Node_3DObject(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { + name = "3D Object"; + h = 64; + min_h = h; + + object = new __3dObject(); + + inputs[| 0] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ]) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 1] = nodeValue("Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0 ]) + .setDisplay(VALUE_DISPLAY.vector); + + inputs[| 2] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 1, 1, 1 ]) + .setDisplay(VALUE_DISPLAY.vector); + + input_d3d_index = ds_list_size(inputs); + + #macro __d3d_input_list_transform ["Transform", false], 0, 1, 2 + + #region ---- overlay ---- + drag_axis = noone; + drag_sv = 0; + drag_delta = 0; + drag_prev = 0; + + drag_mx = 0; + drag_my = 0; + drag_px = 0; + drag_py = 0; + drag_c0x = 0; + drag_c0y = 0; + drag_c1x = 0; + drag_c1y = 0; + drag_c2x = 0; + drag_c2y = 0; + + axis_hover = noone; + + tools = [ + new NodeTool( "Transform", THEME.tools_3d_transform ), + new NodeTool( "Rotate", THEME.tools_3d_rotate ), + new NodeTool( "Scale", THEME.tools_3d_scale ), + ]; + #endregion + + static drawOverlay3D = function(active, params, _mx, _my, _snx, _sny, _panel) { #region + var _pos = inputs[| 0].getValue(,,, true); + var _rot = inputs[| 1].getValue(,,, true); + var _sca = inputs[| 2].getValue(,,, true); + + var _camPos = params.cameraPosition; + var _camTar = params.cameraFocus; + var _camDis = params.camera_Dist; + var _camAx = params.camera_Ax; + var _camAy = params.camera_Ay; + + var _qrot = new BBMOD_Quaternion().FromEuler(_rot[0], -_rot[1], -_rot[2]); + var _qview = new BBMOD_Quaternion().FromEuler(_camAy, -_camAx, 0); + + var ga = []; + var dir = 0; + var size = 64; + var hs = size / 2; + var sq = 8; + + var _vpos = new __vec3( _pos[0], _pos[1], _pos[2] ); + var _posView = params.applyCamera(_vpos); + + var cx = _posView.x; + var cy = _posView.y; + + var _hover = noone; + var _hoverDist = 10; + var th; + + if(isUsingTool(0)) { #region move + ga[0] = new BBMOD_Vec3(-size, 0, 0); + ga[1] = new BBMOD_Vec3(0, 0, size); + ga[2] = new BBMOD_Vec3(0, -size, 0); + + ga[3] = [ new BBMOD_Vec3(-hs + sq, 0, hs - sq), + new BBMOD_Vec3(-hs - sq, 0, hs - sq), + new BBMOD_Vec3(-hs - sq, 0, hs + sq), + new BBMOD_Vec3(-hs + sq, 0, hs + sq), ]; + ga[4] = [ new BBMOD_Vec3( 0, -hs + sq, hs - sq), + new BBMOD_Vec3( 0, -hs - sq, hs - sq), + new BBMOD_Vec3( 0, -hs - sq, hs + sq), + new BBMOD_Vec3( 0, -hs + sq, hs + sq), ]; + ga[5] = [ new BBMOD_Vec3(-hs + sq, -hs - sq, 0), + new BBMOD_Vec3(-hs - sq, -hs - sq, 0), + new BBMOD_Vec3(-hs - sq, -hs + sq, 0), + new BBMOD_Vec3(-hs + sq, -hs + sq, 0), ]; + + for( var i = 3; i < 6; i++ ) { + for( var j = 0; j < 4; j++ ) + ga[i][j] = _qview.Rotate(_qrot.Rotate(ga[i][j])); + + th = 1; + + var p0x = cx + ga[i][0].X, p0y = cy + ga[i][0].Y; + var p1x = cx + ga[i][1].X, p1y = cy + ga[i][1].Y; + var p2x = cx + ga[i][2].X, p2y = cy + ga[i][2].Y; + var p3x = cx + ga[i][3].X, p3y = cy + ga[i][3].Y; + + draw_set_color(COLORS.axis[(i - 3 - 1 + 3) % 3]); + if(axis_hover == i || drag_axis == i) { + draw_primitive_begin(pr_trianglestrip); + draw_vertex(p0x, p0y); + draw_vertex(p1x, p1y); + draw_vertex(p3x, p3y); + draw_vertex(p2x, p2y); + draw_primitive_end(); + } else if (drag_axis == noone) { + draw_line(p0x, p0y, p1x, p1y); + draw_line(p1x, p1y, p2x, p2y); + draw_line(p2x, p2y, p3x, p3y); + draw_line(p3x, p3y, p0x, p0y); + } else + continue; + + if(point_in_rectangle_points(_mx, _my, p0x, p0y, p1x, p1y, p3x, p3y, p2x, p2y)) + _hover = i; + } + + for( var i = 0; i < 3; i++ ) { + ga[i] = _qview.Rotate(_qrot.Rotate(ga[i])); + + th = 2 + (axis_hover == i || drag_axis == i); + if(drag_axis != noone && drag_axis != i) + continue; + + draw_set_color(COLORS.axis[i]); + if(point_distance(cx, cy, cx + ga[i].X, cy + ga[i].Y) < 5) + draw_line_round(cx, cy, cx + ga[i].X, cy + ga[i].Y, th); + else + draw_line_round_arrow(cx, cy, cx + ga[i].X, cy + ga[i].Y, th, 2); + + var _d = distance_to_line(_mx, _my, cx, cy, cx + ga[i].X, cy + ga[i].Y); + if(_d < _hoverDist) { + _hover = i; + _hoverDist = _d; + } + } + + axis_hover = _hover; + + if(drag_axis != noone) { + if(!MOUSE_WRAPPING) { + drag_mx += _mx - drag_px; + drag_my += _my - drag_py; + + var _mmx = drag_mx - drag_c0x; + var _mmy = drag_my - drag_c0y; + var mAdj; + + if(drag_axis < 3) { + var _max = drag_c1x; + var _may = drag_c1y; + mAdj = dot_product(_mmx, _mmy, _max, _may); + + if(drag_prev != undefined) { + _pos[drag_axis] += (mAdj - drag_prev) * params.camera_Dist / 20000; + + if(inputs[| 0].setValue(_pos)) + UNDO_HOLDING = true; + } + } else { + var _max1 = drag_c1x, _may1 = drag_c1y; + var _max2 = drag_c2x, _may2 = drag_c2y; + + mAdj = [ dot_product(_mmx, _mmy, _max1, _may1), + dot_product(_mmx, _mmy, _max2, _may2) ]; + + if(drag_prev != undefined) { + _pos[(drag_axis - 3)] += (mAdj[0] - drag_prev[0]) * params.camera_Dist / 20000; + _pos[(drag_axis - 3 + 1) % 3] += (mAdj[1] - drag_prev[1]) * params.camera_Dist / 20000; + + if(inputs[| 0].setValue(_pos)) + UNDO_HOLDING = true; + } + } + + drag_prev = mAdj; + } + + setMouseWrap(); + drag_px = _mx; + drag_py = _my; + } + #endregion + } else if(isUsingTool(1)) { #region rotate + + #endregion + } else if(isUsingTool(2)) { #region scale + + #endregion + } + + if(drag_axis != noone && mouse_release(mb_left)) { + drag_axis = noone; + UNDO_HOLDING = false; + } + + if(_hover != noone && mouse_press(mb_left, active)) { + drag_axis = _hover; + drag_prev = undefined; + drag_mx = _mx; + drag_my = _my; + drag_px = _mx; + drag_py = _my; + + drag_c0x = cx; + drag_c0y = cy; + + if(drag_axis < 3) { + drag_c1x = ga[drag_axis].X; + drag_c1y = ga[drag_axis].Y; + } else { + drag_c1x = ga[(drag_axis - 3)].X; + drag_c1y = ga[(drag_axis - 3)].Y; + drag_c2x = ga[(drag_axis - 3 + 1) % 3].X; + drag_c2y = ga[(drag_axis - 3 + 1) % 3].Y; + } + } + } #endregion + + static setTransform = function() { + var _pos = inputs[| 0].getValue(); + var _rot = inputs[| 1].getValue(); + var _sca = inputs[| 2].getValue(); + + object.position.set(_pos[0], _pos[1], _pos[2]); + object.rotation.set(_rot[0], _rot[1], _rot[2]); + object.scale.set(_sca[0], _sca[1], _sca[2]); + + outputs[| 0].setValue(object); + } + + static submitUI = function(params = {}, shader = noone) { object.submitUI(params, shader); } + static submit = function(params = {}, shader = noone) { object.submit(params, shader); } + static submitSel = function(params = {}, shader = noone) { object.submitSel(params, shader); } + + static update = function(frame = PROJECT.animator.current_frame) {} +} \ No newline at end of file diff --git a/scripts/__node_3d_object/__node_3d_object.yy b/scripts/__node_3d_object/__node_3d_object.yy new file mode 100644 index 000000000..37893fba8 --- /dev/null +++ b/scripts/__node_3d_object/__node_3d_object.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__node_3d_object", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3D", + "path": "folders/nodes/data/3D.yy", + }, +} \ No newline at end of file diff --git a/scripts/__node_3d_object/node_counter.yy b/scripts/__node_3d_object/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/__node_3d_object/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/vertex_function/vertex_function.gml b/scripts/__vertex_function/__vertex_function.gml similarity index 100% rename from scripts/vertex_function/vertex_function.gml rename to scripts/__vertex_function/__vertex_function.gml diff --git a/scripts/__vertex_function/__vertex_function.yy b/scripts/__vertex_function/__vertex_function.yy new file mode 100644 index 000000000..093a2f7f7 --- /dev/null +++ b/scripts/__vertex_function/__vertex_function.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "__vertex_function", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/color_function/color_function.gml b/scripts/color_function/color_function.gml index 644ceb471..08f14712c 100644 --- a/scripts/color_function/color_function.gml +++ b/scripts/color_function/color_function.gml @@ -36,6 +36,21 @@ function colorMultiply(c1, c2) { return make_color_rgb((r1 * r2) / 255, (g1 * g2) / 255, (b1 * b2) / 255); } +function colorAdd(c1, c2) { + if(c1 == 0) return c2; + if(c2 == 0) return c1; + + var r1 = color_get_red(c1); + var g1 = color_get_green(c1); + var b1 = color_get_blue(c1); + + var r2 = color_get_red(c2); + var g2 = color_get_green(c2); + var b2 = color_get_blue(c2); + + return make_color_rgb(min(r1 + r2, 255), min(g1 + g2, 255), min(b1 + b2, 255)); +} + function color_diff(c1, c2, fast = false, alpha = false) { var _c1_r = color_get_red(c1); var _c1_g = color_get_green(c1); diff --git a/scripts/d3_vector/d3_vector.yy b/scripts/d3_vector/d3_vector.yy index 34049c12f..fb2654298 100644 --- a/scripts/d3_vector/d3_vector.yy +++ b/scripts/d3_vector/d3_vector.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3d", - "path": "folders/functions/3d.yy", + "name": "misc", + "path": "folders/functions/3d/misc.yy", }, } \ No newline at end of file diff --git a/scripts/d3d_camera/d3d_camera.gml b/scripts/d3d_camera/d3d_camera.gml new file mode 100644 index 000000000..01d1e2db4 --- /dev/null +++ b/scripts/d3d_camera/d3d_camera.gml @@ -0,0 +1,49 @@ +function __3dCamera() : __3dObject() constructor { + ivw = 0.2; //innerViewWidth + ivh = 0.2; //innerViewHeight + ovw = 0.5; //outerViewWidth + ovh = 0.5; //outerViewHeight + len = 0.5; //cameraLength + + vertex = [ + [ len, -ivw, ivh ], [ len, ivw, ivh ], + [ len, ivw, ivh ], [ len, ivw, -ivh ], + [ len, ivw, -ivh ], [ len, -ivw, -ivh ], + [ len, -ivw, -ivh ], [ len, -ivw, ivh ], + + [ -len, -ovw, ovh ], [ -len, ovw, ovh ], + [ -len, ovw, ovh ], [ -len, ovw, -ovh ], + [ -len, ovw, -ovh ], [ -len, -ovw, -ovh ], + [ -len, -ovw, -ovh ], [ -len, -ovw, ovh ], + + [ len, -ivw, ivh ], [ -len, -ovw, ovh ], + [ len, ivw, ivh ], [ -len, ovw, ovh ], + [ len, ivw, -ivh ], [ -len, ovw, -ovh ], + [ len, -ivw, -ivh ], [ -len, -ovw, -ovh ], + + [ -len, -ovw * 0.5, ovh + 0.2 ], [ -len, ovw * 0.5, ovh + 0.2 ], + [ -len, 0, ovh + 0.6 ], [ -len, ovw * 0.5, ovh + 0.2 ], + [ -len, -ovw * 0.5, ovh + 0.2 ], [ -len, 0, ovh + 0.6 ], + ]; + + VF = global.VF_POS_COL; + render_type = pr_linelist; + VB = build(); + + position.set(-5, -5, 5); + rotation.set(0, 30, 135); + scale.set(1, room_width / room_height, 1); +} + +function calculate_3d_position(camFx, camFy, camFz, camAx, camAy, camDist) { + var pos = new __vec3(); + + var radAx = degtorad(camAx); + var radAy = degtorad(camAy); + + pos.x = camFx + (cos(radAy) * sin(radAx)) * camDist; + pos.y = camFy + (cos(radAy) * cos(radAx)) * camDist; + pos.z = camFz + (sin(radAy)) * camDist; + + return pos; +} \ No newline at end of file diff --git a/scripts/vertex_function/vertex_function.yy b/scripts/d3d_camera/d3d_camera.yy similarity index 86% rename from scripts/vertex_function/vertex_function.yy rename to scripts/d3d_camera/d3d_camera.yy index d89aa13c3..b4ecfe6e5 100644 --- a/scripts/vertex_function/vertex_function.yy +++ b/scripts/d3d_camera/d3d_camera.yy @@ -1,7 +1,7 @@ { "resourceType": "GMScript", "resourceVersion": "1.0", - "name": "vertex_function", + "name": "d3d_camera", "isCompatibility": false, "isDnD": false, "parent": { diff --git a/scripts/d3d_cube/d3d_cube.gml b/scripts/d3d_cube/d3d_cube.gml new file mode 100644 index 000000000..7752ec09f --- /dev/null +++ b/scripts/d3d_cube/d3d_cube.gml @@ -0,0 +1,50 @@ +function __3dCube() : __3dObject() constructor { + VF = global.VF_POS_NORM_TEX_COL; + render_type = pr_trianglelist; + + static initModel = function(size) { + size /= 2; + + vertex = [ + [-size, -size, size], [size, -size, size], [size, size, size], + [-size, -size, size], [size, size, size], [-size, size, size], + + [-size, -size, -size], [size, -size, -size], [size, size, -size], + [-size, -size, -size], [size, size, -size], [-size, size, -size], + + [-size, -size, size], [-size, size, size], [-size, size, -size], + [-size, -size, size], [-size, size, -size], [-size, -size, -size], + + [size, -size, size], [size, size, size], [size, size, -size], + [size, -size, size], [size, size, -size], [size, -size, -size], + + [-size, size, size], [size, size, size], [size, size, -size], + [-size, size, size], [size, size, -size], [-size, size, -size], + + [-size, -size, size], [size, -size, size], [size, -size, -size], + [-size, -size, size], [size, -size, -size], [-size, -size, -size] + ]; + + normals = [ + [0, 0, 1], [0, 0, 1], [0, 0, 1], + [0, 0, 1], [0, 0, 1], [0, 0, 1], + + [0, 0, -1], [0, 0, -1], [0, 0, -1], + [0, 0, -1], [0, 0, -1], [0, 0, -1], + + [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], + [-1, 0, 0], [-1, 0, 0], [-1, 0, 0], + + [1, 0, 0], [1, 0, 0], [1, 0, 0], + [1, 0, 0], [1, 0, 0], [1, 0, 0], + + [0, 1, 0], [0, 1, 0], [0, 1, 0], + [0, 1, 0], [0, 1, 0], [0, 1, 0], + + [0, -1, 0], [0, -1, 0], [0, -1, 0], + [0, -1, 0], [0, -1, 0], [0, -1, 0] + ]; + + VB = build(); + } initModel(1); +} \ No newline at end of file diff --git a/scripts/d3d_cube/d3d_cube.yy b/scripts/d3d_cube/d3d_cube.yy new file mode 100644 index 000000000..d98cce271 --- /dev/null +++ b/scripts/d3d_cube/d3d_cube.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_cube", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_gizmo/d3d_gizmo.gml b/scripts/d3d_gizmo/d3d_gizmo.gml new file mode 100644 index 000000000..6548fcac2 --- /dev/null +++ b/scripts/d3d_gizmo/d3d_gizmo.gml @@ -0,0 +1,3 @@ +function __3dGizmo() constructor { + +} \ No newline at end of file diff --git a/scripts/d3d_gizmo/d3d_gizmo.yy b/scripts/d3d_gizmo/d3d_gizmo.yy new file mode 100644 index 000000000..64cb050dd --- /dev/null +++ b/scripts/d3d_gizmo/d3d_gizmo.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_gizmo", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_light/d3d_light.gml b/scripts/d3d_light/d3d_light.gml new file mode 100644 index 000000000..f3cfab089 --- /dev/null +++ b/scripts/d3d_light/d3d_light.gml @@ -0,0 +1,39 @@ +function __3dLight() : __3dObject() constructor { + UI_vertex = []; + for( var i = 0; i <= 32; i++ ) + UI_vertex[i] = [ 0, lengthdir_x(0.5, i / 32 * 360), lengthdir_y(0.5, i / 32 * 360), c_yellow, 0.8 ]; + VB_UI = build(noone, UI_vertex); + + color = c_white; + intensity = 1; + + static presubmit = function(params = {}) { + var _rot = new __rot3(0, 0, 0).lookAt(position, params.cameraPosition); + + var rot = matrix_build(0, 0, 0, + _rot.x, _rot.y, _rot.z, + 1, 1, 1); + var sca = matrix_build(0, 0, 0, + 0, 0, 0, + 0.6, 0.6, 0.6); + var pos = matrix_build(position.x, position.y, position.z, + 0, 0, 0, + 1, 1, 1); + + matrix_stack_clear(); + matrix_stack_push(pos); + matrix_stack_push(rot); + + matrix_set(matrix_world, matrix_stack_top()); + vertex_submit(VB_UI, pr_linestrip, -1); + + matrix_stack_push(sca); + matrix_set(matrix_world, matrix_stack_top()); + vertex_submit(VB_UI, pr_linestrip, -1); + + matrix_stack_clear(); + matrix_set(matrix_world, matrix_build_identity()); + } + + static shine = function(params = {}) {} +} \ No newline at end of file diff --git a/scripts/d3d_light/d3d_light.yy b/scripts/d3d_light/d3d_light.yy new file mode 100644 index 000000000..dc67ea0fd --- /dev/null +++ b/scripts/d3d_light/d3d_light.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_light", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_light_directional/d3d_light_directional.gml b/scripts/d3d_light_directional/d3d_light_directional.gml new file mode 100644 index 000000000..f843494ae --- /dev/null +++ b/scripts/d3d_light_directional/d3d_light_directional.gml @@ -0,0 +1,30 @@ +function __3dLightDirectional() : __3dLight() constructor { + vertex = [ + [ 1, 0, 0, c_yellow, 0.8 ], [ 3, 0, 0, c_yellow, 0.8 ] + ]; + VF = global.VF_POS_COL; + render_type = pr_linelist; + VB = build(); + + color = c_white; + intensity = 1; + position.set(1, 0, 0); + + static submit = function(params = {}, shader = noone) { shine(params); } + static submitUI = function(params = {}, shader = noone) { shine(params); submitVertex(params, shader); } + static submitSel = function(params = {}) { + shader_set(sh_d3d_wireframe); + presubmit(params); + shader_reset(); + } + + static shine = function(params = {}) { + shader_set(sh_d3d_default); + + shader_set_f("light_dir_direction", position.x, position.y, position.z); + shader_set_f("light_dir_color", colToVec4(color)); + shader_set_f("light_dir_intensity", intensity); + + shader_reset(); + } +} \ No newline at end of file diff --git a/scripts/d3d_light_directional/d3d_light_directional.yy b/scripts/d3d_light_directional/d3d_light_directional.yy new file mode 100644 index 000000000..f8e234ae3 --- /dev/null +++ b/scripts/d3d_light_directional/d3d_light_directional.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_light_directional", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_matrix3/d3d_matrix3.gml b/scripts/d3d_matrix3/d3d_matrix3.gml new file mode 100644 index 000000000..a8a08b307 --- /dev/null +++ b/scripts/d3d_matrix3/d3d_matrix3.gml @@ -0,0 +1,36 @@ +function __mat3() constructor { + raw = [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; + + static det = function() { + return raw[0]*raw[4]*raw[8] + raw[1]*raw[5]*raw[6] + raw[2]*raw[3]*raw[7] + - raw[2]*raw[4]*raw[6] - raw[0]*raw[5]*raw[7] - raw[1]*raw[3]*raw[8]; + }; + + static multiplyMatrix = function(matrix) { + var result = new __mat3(); + + for (var i = 0; i < 3; i++) { + for (var j = 0; j < 3; j++) { + var sum = 0; + for (var k = 0; k < 3; k++) { + sum += raw[i * 3 + k] * matrix.raw[k * 3 + j]; + } + result.raw[i * 3 + j] = sum; + } + } + + return result; + }; + + static multiplyVector = function(vector) { + var result = new __vec3(); + + for (var i = 0; i < 3; i++) { + result.setIndex(i, raw[i * 3 + 0] * vector.x + + raw[i * 3 + 1] * vector.y + + raw[i * 3 + 2] * vector.z); + } + + return result; + }; +} diff --git a/scripts/d3d_matrix3/d3d_matrix3.yy b/scripts/d3d_matrix3/d3d_matrix3.yy new file mode 100644 index 000000000..222c62580 --- /dev/null +++ b/scripts/d3d_matrix3/d3d_matrix3.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_matrix3", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_matrix4/d3d_matrix4.gml b/scripts/d3d_matrix4/d3d_matrix4.gml new file mode 100644 index 000000000..cb40c7cc1 --- /dev/null +++ b/scripts/d3d_matrix4/d3d_matrix4.gml @@ -0,0 +1,120 @@ +function __mat4() constructor { + raw = [ 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0, + 0, 0, 0, 0 ]; + + static setRaw = function(raw) { + gml_pragma("forceinline"); + self.raw = raw; + return self; + } + + static det = function() { + // Compute and return the determinant of the matrix + return raw[0]*raw[5]*raw[10]*raw[15] + raw[4]*raw[9]*raw[14]*raw[3] + + raw[8]*raw[13]*raw[2]*raw[7] + raw[12]*raw[1]*raw[6]*raw[11] - + raw[12]*raw[9]*raw[6]*raw[3] - raw[8]*raw[5]*raw[14]*raw[11] - + raw[4]*raw[13]*raw[10]*raw[7] - raw[0]*raw[1]*raw[2]*raw[15]; + }; + + static transpose = function() { + var result = new __mat4(); + + // Transpose the matrix + for (var i = 0; i < 4; i++) + for (var j = 0; j < 4; j++) { + result.raw[i * 4 + j] = raw[j * 4 + i]; + } + + return result; + } + + static invert = function() { + var result = new __mat4(); + var temp = clone(); + + // Create a copy of the matrix to work with + for (var i = 0; i < 16; i++) + result.raw[i] = i % 5 == 0 ? 1 : 0; // Identity matrix + + for (var i = 0; i < 4; i++) { + var pivot = temp.raw[i * 4 + i]; + + if (pivot == 0) { + // Handle the case when the pivot is zero (singular matrix) + // You might want to return an error here or handle it differently + return result; + } + + // Divide the current row by the pivot value + for (var j = 0; j < 4; j++) { + temp.raw[i * 4 + j] /= pivot; + result.raw[i * 4 + j] /= pivot; + } + + // Subtract the current row from other rows to make them 0 + for (var j = 0; j < 4; j++) { + if (j != i) { + var factor = temp.raw[j * 4 + i]; + for (var k = 0; k < 4; k++) { + temp.raw[j * 4 + k] -= factor * temp.raw[i * 4 + k]; + result.raw[j * 4 + k] -= factor * result.raw[i * 4 + k]; + } + } + } + } + + return result; + } + + + static multiplyMatrix = function(matrix) { + var result = new __mat4(); + + // Perform matrix multiplication + for (var i = 0; i < 4; i++) { + for (var j = 0; j < 4; j++) { + var sum = 0; + for (var k = 0; k < 4; k++) + sum += raw[i * 4 + k] * matrix.raw[k * 4 + j]; + result.raw[i * 4 + j] = sum; + } + } + + return result; + }; + + static multiplyVector = function(vector) { + var result = new __vec4(); + + // Perform matrix-vector multiplication + for (var i = 0; i < 4; i++) { + result.setIndex(i, raw[i * 4 + 0] * vector.x + + raw[i * 4 + 1] * vector.y + + raw[i * 4 + 2] * vector.z + + raw[i * 4 + 3] * vector.w); + } + + return result; + }; + + static clone = function() { + var result = new __mat4(); + + // Copy the raw values to the cloned matrix + for (var i = 0; i < 16; i++) + result.raw[i] = raw[i]; + + return result; + } + + static toString = function() { + var s0 = $"[{raw[ 0]}, {raw[ 1]}, {raw[ 2]}, {raw[ 3]}]"; + var s1 = $"[{raw[ 4]}, {raw[ 5]}, {raw[ 6]}, {raw[ 7]}]"; + var s2 = $"[{raw[ 8]}, {raw[ 9]}, {raw[10]}, {raw[11]}]"; + var s3 = $"[{raw[12]}, {raw[13]}, {raw[14]}, {raw[15]}]"; + + return $"[{s0},\n{s1},\n{s2},\n{s3}]"; + } +} diff --git a/scripts/d3d_matrix4/d3d_matrix4.yy b/scripts/d3d_matrix4/d3d_matrix4.yy new file mode 100644 index 000000000..37733e5ea --- /dev/null +++ b/scripts/d3d_matrix4/d3d_matrix4.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_matrix4", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_object/d3d_object.gml b/scripts/d3d_object/d3d_object.gml new file mode 100644 index 000000000..47f5dced2 --- /dev/null +++ b/scripts/d3d_object/d3d_object.gml @@ -0,0 +1,138 @@ +#region vertex format + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_color(); + global.VF_POS_COL = vertex_format_end(); + + vertex_format_begin(); + vertex_format_add_position_3d(); + vertex_format_add_normal(); + vertex_format_add_texcoord(); + vertex_format_add_color(); + global.VF_POS_NORM_TEX_COL = vertex_format_end(); +#endregion + +function __3dObject() constructor { + vertex = []; + normals = []; + uv = []; + VB = noone; + VF = global.VF_POS_COL; + render_type = pr_trianglelist; + + custom_shader = noone; + + position = new __vec3(0, 0, 0); + rotation = new __rot3(0, 0, 0); + scale = new __vec3(1, 1, 1); + + static build = function(_buffer = VB, _vertex = vertex, _normal = normals) { + if(_buffer != noone) vertex_delete_buffer(_buffer); + + _buffer = vertex_create_buffer(); + vertex_begin(_buffer, VF); + for( var i = 0, n = array_length(_vertex); i < n; i++ ) { + var v = _vertex[i]; + + switch(VF) { + case global.VF_POS_COL : + var cc = array_length(v) > 3? v[3] : c_gray; + var aa = array_length(v) > 4? v[4] : 1; + + vertex_position_3d(_buffer, v[0], v[1], v[2]); + vertex_color(_buffer, cc, aa); + break; + case global.VF_POS_NORM_TEX_COL : + var nor = _normal[i]; + var cc = array_length(v) > 3? v[3] : c_white; + var aa = array_length(v) > 4? v[4] : 1; + + vertex_position_3d(_buffer, v[0], v[1], v[2]); + vertex_normal(_buffer, nor[0], nor[1], nor[2]); + vertex_texcoord(_buffer, 0, 0); + vertex_color(_buffer, cc, aa); + break; + } + } + vertex_end(_buffer); + + return _buffer; + } + + static presubmit = function(params = {}) {} + static postsubmit = function(params = {}) {} + + static submit = function(params = {}, shader = noone) { submitVertex(params, shader); } + static submitUI = function(params = {}, shader = noone) { submitVertex(params, shader); } + static submitSel = function(params = {}) { submitVertex(params, sh_d3d_silhouette); } + + static submitVertex = function(params = {}, shader = noone) { + if(shader != noone) + shader_set(shader); + else if(custom_shader != noone) + shader_set(custom_shader); + else { + switch(VF) { + case global.VF_POS_NORM_TEX_COL: shader_set(sh_d3d_default); break; + case global.VF_POS_COL: shader_set(sh_d3d_wireframe); break; + } + } + + presubmit(params); + + if(VB != noone) { + var rot = matrix_build(0, 0, 0, + rotation.x, rotation.y, rotation.z, + 1, 1, 1); + var sca = matrix_build(0, 0, 0, + 0, 0, 0, + scale.x, scale.y, scale.z); + var pos = matrix_build(position.x, position.y, position.z, + 0, 0, 0, + 1, 1, 1); + + matrix_stack_clear(); + matrix_stack_push(pos); + matrix_stack_push(rot); + matrix_stack_push(sca); + matrix_set(matrix_world, matrix_stack_top()); + + vertex_submit(VB, render_type, -1); + + matrix_stack_clear(); + matrix_set(matrix_world, matrix_build_identity()); + } + + postsubmit(params); + + shader_reset(); + } +} + +function __3dObjectParameters(camPos, camFoc) constructor { + self.cameraPosition = camPos; + self.cameraFocus = camFoc; + + camera_Ax = 0; + camera_Ay = 0; + camera_Dist = 0; + + camera_w = 1; + camera_h = 1; + + camera_viewMat = new __mat4(); + camera_projMat = new __mat4(); + + static applyCamera = function(vec3) { + var _cam = vec3; + var _vec4 = new __vec4().set(_cam, 1); + + var _view = camera_viewMat.transpose().multiplyVector(_vec4); + var _proj = camera_projMat.transpose().multiplyVector(_view); + _proj._divide(_proj.w); + _proj.x = camera_w / 2 + _proj.x * camera_w / 2; + _proj.y = camera_h / 2 + _proj.y * camera_h / 2; + + return _proj; + } +} \ No newline at end of file diff --git a/scripts/d3d_object/d3d_object.yy b/scripts/d3d_object/d3d_object.yy new file mode 100644 index 000000000..d05ed8397 --- /dev/null +++ b/scripts/d3d_object/d3d_object.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_object", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_rot3/d3d_rot3.gml b/scripts/d3d_rot3/d3d_rot3.gml new file mode 100644 index 000000000..40318676e --- /dev/null +++ b/scripts/d3d_rot3/d3d_rot3.gml @@ -0,0 +1,75 @@ +function __rot3(_x = 0, _y = 0, _z = 0) constructor { + x = _x; + y = _y; + z = _z; + + static set = function(_x, _y, _z) { + gml_pragma("forceinline"); + x = _x; + y = _y; + z = _z; + return self; + } + + static toDirection = function() { + var _x = degtorad( x); + var _y = degtorad( y); + var _z = degtorad(-z); + + var rotationMatrix = new __mat3(); + + var cosX = cos(_x); + var sinX = sin(_x); + var cosY = cos(_y); + var sinY = sin(_y); + var cosZ = cos(_z); + var sinZ = sin(_z); + + rotationMatrix.raw[0][0] = cosY * cosZ; + rotationMatrix.raw[0][1] = -cosX * sinZ + sinX * sinY * cosZ; + rotationMatrix.raw[0][2] = sinX * sinZ + cosX * sinY * cosZ; + rotationMatrix.raw[1][0] = cosY * sinZ; + rotationMatrix.raw[1][1] = cosX * cosZ + sinX * sinY * sinZ; + rotationMatrix.raw[1][2] = -sinX * cosZ + cosX * sinY * sinZ; + rotationMatrix.raw[2][0] = -sinY; + rotationMatrix.raw[2][1] = sinX * cosY; + rotationMatrix.raw[2][2] = cosX * cosY; + + var initialVector = new __vec3(1, 0, 0); + var rotatedVector = rotationMatrix.multiplyVector(initialVector); + rotatedVector.z *= -1; + + return rotatedVector; + } + + static lookAt = function(from, to, up = __vec3_up) { + var dir = to.subtract(from)._normalize(); + + var az = arctan2(dir.y, dir.x); + var ay = arcsin(dir.z); + + var w0 = new __vec3( -dir.y, dir.x, 0); + var u0 = w0.cross(dir); + var ax = arctan2( w0.dot(up) / w0.length(), u0.dot(up) / u0.length() ); + + ax = radtodeg(ax); + ay = radtodeg(ay); + az = radtodeg(az); + + set(ax, -ay, -az); + + return self; + } + + static equal = function(to) { + gml_pragma("forceinline"); + return x == to.x && y == to.y && z == to.z; + } + + static clone = function() { + gml_pragma("forceinline"); + return new __rot3(x, y, z); + } + + static toString = function() { return $"[{x}, {y}, {z}]"; } +} \ No newline at end of file diff --git a/scripts/d3d_rot3/d3d_rot3.yy b/scripts/d3d_rot3/d3d_rot3.yy new file mode 100644 index 000000000..490b11c54 --- /dev/null +++ b/scripts/d3d_rot3/d3d_rot3.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_rot3", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_vec3/d3d_vec3.gml b/scripts/d3d_vec3/d3d_vec3.gml new file mode 100644 index 000000000..30a828366 --- /dev/null +++ b/scripts/d3d_vec3/d3d_vec3.gml @@ -0,0 +1,150 @@ +#macro __vec3_forward new __vec3(1.0, 0.0, 0.0) +#macro __vec3_right new __vec3(0.0, 1.0, 0.0) +#macro __vec3_up new __vec3(0.0, 0.0, 1.0) + +function __vec3(_x = 0, _y = 0, _z = 0) constructor { + x = _x; + y = _y; + z = _z; + + // Static methods + static set = function(_x = 0, _y = _x, _z = _x) { + if(is_struct(_x) && is_instanceof(_x, __vec3)) { + x = _x.x; + y = _x.y; + z = _x.z; + return; + } + + x = _x; + y = _y; + z = _z; + return self; + } + + static setIndex = function(index, value) { + gml_pragma("forceinline"); + switch(index) { + case 0 : x = value; break; + case 1 : y = value; break; + case 2 : z = value; break; + } + return self; + } + + static add = function(_vec3) { + gml_pragma("forceinline"); + return new __vec3(x + _vec3.x, y + _vec3.y, z + _vec3.z); + } + + static subtract = function(_vec3) { + gml_pragma("forceinline"); + return new __vec3(x - _vec3.x, y - _vec3.y, z - _vec3.z); + } + + static multiply = function(_scalar) { + gml_pragma("forceinline"); + return new __vec3(x * _scalar, y * _scalar, z * _scalar); + } + + static divide = function(_scalar) { + gml_pragma("forceinline"); + if (_scalar != 0) + return new __vec3(x / _scalar, y / _scalar, z / _scalar); + + return new __vec3(x, y, z); // Avoid division by zero + } + + static dot = function(_vec3) { + gml_pragma("forceinline"); + return x * _vec3.x + y * _vec3.y + z * _vec3.z; + } + + static cross = function(_vec3) { + gml_pragma("forceinline"); + var cross_x = y * _vec3.z - z * _vec3.y; + var cross_y = z * _vec3.x - x * _vec3.z; + var cross_z = x * _vec3.y - y * _vec3.x; + return new __vec3(cross_x, cross_y, cross_z); + } + + // In-place computation functions + static _add = function(_vec3) { + gml_pragma("forceinline"); + x += _vec3.x; + y += _vec3.y; + z += _vec3.z; + return self; + } + + static _subtract = function(_vec3) { + gml_pragma("forceinline"); + x -= _vec3.x; + y -= _vec3.y; + z -= _vec3.z; + return self; + } + + static _multiply = function(_scalar) { + gml_pragma("forceinline"); + x *= _scalar; + y *= _scalar; + z *= _scalar; + return self; + } + + static _divide = function(_scalar) { + gml_pragma("forceinline"); + if (_scalar != 0) { + x /= _scalar; + y /= _scalar; + z /= _scalar; + } + return self; + } + + static distance = function(_vec3) { + gml_pragma("forceinline"); + var dx = _vec3.x - x; + var dy = _vec3.y - y; + var dz = _vec3.z - z; + return sqrt(dx * dx + dy * dy + dz * dz); + } + + static length = function() { + gml_pragma("forceinline"); + return sqrt(x * x + y * y + z * z); + } + + static _normalize = function() { + gml_pragma("forceinline"); + var _length = length(); + if (_length != 0) { + x /= _length; + y /= _length; + z /= _length; + } + return self; + } + + static _lerp = function(to, speed = 0.3) { + gml_pragma("forceinline"); + x = lerp(x, to.x, speed); + y = lerp(y, to.y, speed); + z = lerp(z, to.z, speed); + } + + static equal = function(to) { + gml_pragma("forceinline"); + return x == to.x && y == to.y && z == to.z; + } + + static clone = function() { + gml_pragma("forceinline"); + return new __vec3(x, y, z); + } + + static toString = function() { return $"[{x}, {y}, {z}]"; } + + static toBBMOD = function() { return new BBMOD_Vec3(x, y, z); } +} diff --git a/scripts/d3d_vec3/d3d_vec3.yy b/scripts/d3d_vec3/d3d_vec3.yy new file mode 100644 index 000000000..f47270815 --- /dev/null +++ b/scripts/d3d_vec3/d3d_vec3.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_vec3", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/d3d_vec4/d3d_vec4.gml b/scripts/d3d_vec4/d3d_vec4.gml new file mode 100644 index 000000000..dc0012f6f --- /dev/null +++ b/scripts/d3d_vec4/d3d_vec4.gml @@ -0,0 +1,158 @@ +function __vec4(_x = 0, _y = 0, _z = 0, _w = 0) constructor { + x = _x; + y = _y; + z = _z; + w = _w; + + // Static methods + static set = function(_x = 0, _y = _x, _z = _x, _w = _x) { + if (is_struct(_x)) { + if(is_instanceof(_x, __vec4)) { + x = _x.x; + y = _x.y; + z = _x.z; + w = _x.w; + } else if(is_instanceof(_x, __vec3)) { + x = _x.x; + y = _x.y; + z = _x.z; + w = _y; + } + return self; + } + + x = _x; + y = _y; + z = _z; + w = _w; + + return self; + } + + static setIndex = function(index, value) { + gml_pragma("forceinline"); + switch(index) { + case 0 : x = value; break; + case 1 : y = value; break; + case 2 : z = value; break; + case 3 : w = value; break; + } + + return self; + } + + static add = function(_vec4) { + gml_pragma("forceinline"); + return new __vec4(x + _vec4.x, y + _vec4.y, z + _vec4.z, w + _vec4.w); + } + + static subtract = function(_vec4) { + gml_pragma("forceinline"); + return new __vec4(x - _vec4.x, y - _vec4.y, z - _vec4.z, w - _vec4.w); + } + + static multiply = function(_scalar) { + gml_pragma("forceinline"); + return new __vec4(x * _scalar, y * _scalar, z * _scalar, w * _scalar); + } + + static divide = function(_scalar) { + gml_pragma("forceinline"); + if (_scalar != 0) + return new __vec4(x / _scalar, y / _scalar, z / _scalar, w / _scalar); + + return new __vec4(x, y, z, w); // Avoid division by zero + } + + static dot = function(_vec4) { + gml_pragma("forceinline"); + return x * _vec4.x + y * _vec4.y + z * _vec4.z + w * _vec4.w; + } + + // In-place computation functions + static _add = function(_vec4) { + gml_pragma("forceinline"); + x += _vec4.x; + y += _vec4.y; + z += _vec4.z; + w += _vec4.w; + return self; + } + + static _subtract = function(_vec4) { + gml_pragma("forceinline"); + x -= _vec4.x; + y -= _vec4.y; + z -= _vec4.z; + w -= _vec4.w; + return self; + } + + static _multiply = function(_scalar) { + gml_pragma("forceinline"); + x *= _scalar; + y *= _scalar; + z *= _scalar; + w *= _scalar; + return self; + } + + static _divide = function(_scalar) { + gml_pragma("forceinline"); + if (_scalar != 0) { + x /= _scalar; + y /= _scalar; + z /= _scalar; + w /= _scalar; + } + return self; + } + + static distance = function(_vec4) { + gml_pragma("forceinline"); + var dx = _vec4.x - x; + var dy = _vec4.y - y; + var dz = _vec4.z - z; + var dw = _vec4.w - w; + return sqrt(dx * dx + dy * dy + dz * dz + dw * dw); + } + + static length = function() { + gml_pragma("forceinline"); + return sqrt(x * x + y * y + z * z + w * w); + } + + static _normalize = function() { + gml_pragma("forceinline"); + var _length = length(); + if (_length != 0) { + x /= _length; + y /= _length; + z /= _length; + w /= _length; + } + return self; + } + + static _lerp = function(to, speed = 0.3) { + gml_pragma("forceinline"); + x = lerp(x, to.x, speed); + y = lerp(y, to.y, speed); + z = lerp(z, to.z, speed); + w = lerp(w, to.w, speed); + } + + static equal = function(to) { + gml_pragma("forceinline"); + return x == to.x && y == to.y && z == to.z && w == to.w; + } + + static clone = function() { + gml_pragma("forceinline"); + return new __vec4(x, y, z, w); + } + + static toString = function() { + return $"[{x}, {y}, {z}, {w}]"; + } +} diff --git a/scripts/d3d_vec4/d3d_vec4.yy b/scripts/d3d_vec4/d3d_vec4.yy new file mode 100644 index 000000000..6eba5534c --- /dev/null +++ b/scripts/d3d_vec4/d3d_vec4.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "d3d_vec4", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3d", + "path": "folders/functions/3d.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_3d_combine/node_3d_combine.yy b/scripts/node_3d_combine/node_3d_combine.yy index a6cee4804..2a7b4fb46 100644 --- a/scripts/node_3d_combine/node_3d_combine.yy +++ b/scripts/node_3d_combine/node_3d_combine.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_displace/node_3d_displace.yy b/scripts/node_3d_displace/node_3d_displace.yy index 9d0dc5820..3cd88df28 100644 --- a/scripts/node_3d_displace/node_3d_displace.yy +++ b/scripts/node_3d_displace/node_3d_displace.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_export/node_3d_export.yy b/scripts/node_3d_export/node_3d_export.yy index 247a2cd3c..fddfe63b6 100644 --- a/scripts/node_3d_export/node_3d_export.yy +++ b/scripts/node_3d_export/node_3d_export.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_extrude/node_3d_extrude.yy b/scripts/node_3d_extrude/node_3d_extrude.yy index 59d6ff62c..91efc0e58 100644 --- a/scripts/node_3d_extrude/node_3d_extrude.yy +++ b/scripts/node_3d_extrude/node_3d_extrude.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_light_directional/node_3d_light_directional.gml b/scripts/node_3d_light_directional/node_3d_light_directional.gml new file mode 100644 index 000000000..7b33faf28 --- /dev/null +++ b/scripts/node_3d_light_directional/node_3d_light_directional.gml @@ -0,0 +1,16 @@ +function Node_3D_Light_Directional(_x, _y, _group = noone) : Node_3D_Light(_x, _y, _group) constructor { + name = "Directional Light"; + object = new __3dLightDirectional(); + + input_display_list = [ + ["Transform", false], 0, + __d3d_input_list_light, + ] + + static update = function(frame = PROJECT.animator.current_frame) { + setTransform(); + setLight(); + + object.rotation.lookAt(object.position, new __vec3()); + } +} \ No newline at end of file diff --git a/scripts/node_3d_light_directional/node_3d_light_directional.yy b/scripts/node_3d_light_directional/node_3d_light_directional.yy new file mode 100644 index 000000000..f80753d77 --- /dev/null +++ b/scripts/node_3d_light_directional/node_3d_light_directional.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_3d_light_directional", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "d3d light", + "path": "folders/nodes/data/3D/d3d light.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_3d_light_directional/node_counter.yy b/scripts/node_3d_light_directional/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/node_3d_light_directional/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_3d_mesh_cube/node_3d_mesh_cube.gml b/scripts/node_3d_mesh_cube/node_3d_mesh_cube.gml new file mode 100644 index 000000000..9c2b50ed1 --- /dev/null +++ b/scripts/node_3d_mesh_cube/node_3d_mesh_cube.gml @@ -0,0 +1,9 @@ +function Node_3D_Mesh_Cube(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) constructor { + name = "3D Cube"; + object = new __3dCube(); + + input_display_list = [ + __d3d_input_list_mesh, + __d3d_input_list_transform, + ] +} \ No newline at end of file diff --git a/scripts/node_3d_mesh_cube/node_3d_mesh_cube.yy b/scripts/node_3d_mesh_cube/node_3d_mesh_cube.yy new file mode 100644 index 000000000..3d15beff3 --- /dev/null +++ b/scripts/node_3d_mesh_cube/node_3d_mesh_cube.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_3d_mesh_cube", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "d3d mesh", + "path": "folders/nodes/data/3D/d3d mesh.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_3d_mesh_cube/node_counter.yy b/scripts/node_3d_mesh_cube/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/node_3d_mesh_cube/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_3d_obj/node_3D_obj.yy b/scripts/node_3d_obj/node_3D_obj.yy index f4ca3489e..3f57caaf7 100644 --- a/scripts/node_3d_obj/node_3D_obj.yy +++ b/scripts/node_3d_obj/node_3D_obj.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_plane/node_3d_plane.yy b/scripts/node_3d_plane/node_3d_plane.yy index cb1289790..360127934 100644 --- a/scripts/node_3d_plane/node_3d_plane.yy +++ b/scripts/node_3d_plane/node_3d_plane.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "primitive", - "path": "folders/nodes/data/3D/primitive.yy", + "path": "folders/nodes/data/3D/__legacy/primitive.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_prim_cone/node_3d_prim_cone.yy b/scripts/node_3d_prim_cone/node_3d_prim_cone.yy index cad633d09..4cc66a3d7 100644 --- a/scripts/node_3d_prim_cone/node_3d_prim_cone.yy +++ b/scripts/node_3d_prim_cone/node_3d_prim_cone.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "primitive", - "path": "folders/nodes/data/3D/primitive.yy", + "path": "folders/nodes/data/3D/__legacy/primitive.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_prim_cube/node_3d_prim_cube.yy b/scripts/node_3d_prim_cube/node_3d_prim_cube.yy index fb612e697..67db0e917 100644 --- a/scripts/node_3d_prim_cube/node_3d_prim_cube.yy +++ b/scripts/node_3d_prim_cube/node_3d_prim_cube.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "primitive", - "path": "folders/nodes/data/3D/primitive.yy", + "path": "folders/nodes/data/3D/__legacy/primitive.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.yy b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.yy index c966c1fb8..7bc832563 100644 --- a/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.yy +++ b/scripts/node_3d_prim_cylinder/node_3d_prim_cylinder.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "primitive", - "path": "folders/nodes/data/3D/primitive.yy", + "path": "folders/nodes/data/3D/__legacy/primitive.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_prim_sphere/node_3d_prim_sphere.yy b/scripts/node_3d_prim_sphere/node_3d_prim_sphere.yy index ecec1fdf4..c60a5840e 100644 --- a/scripts/node_3d_prim_sphere/node_3d_prim_sphere.yy +++ b/scripts/node_3d_prim_sphere/node_3d_prim_sphere.yy @@ -6,6 +6,6 @@ "isDnD": false, "parent": { "name": "primitive", - "path": "folders/nodes/data/3D/primitive.yy", + "path": "folders/nodes/data/3D/__legacy/primitive.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_render/node_3d_render.yy b/scripts/node_3d_render/node_3d_render.yy index 994a71a53..07bbfd8a4 100644 --- a/scripts/node_3d_render/node_3d_render.yy +++ b/scripts/node_3d_render/node_3d_render.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_repeat/node_3d_repeat.yy b/scripts/node_3d_repeat/node_3d_repeat.yy index 5d0811578..12e4c6c07 100644 --- a/scripts/node_3d_repeat/node_3d_repeat.yy +++ b/scripts/node_3d_repeat/node_3d_repeat.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_3d_scene/node_3d_scene.gml b/scripts/node_3d_scene/node_3d_scene.gml new file mode 100644 index 000000000..3a531022e --- /dev/null +++ b/scripts/node_3d_scene/node_3d_scene.gml @@ -0,0 +1,75 @@ +function Node_3D_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constructor { + name = "3D Scene"; + + //inputs[| 0] = nodeValue("Array in", self, JUNCTION_CONNECT.input, VALUE_TYPE.any, []) + // .setVisible(true, true); + + outputs[| 0] = nodeValue("Scene", self, JUNCTION_CONNECT.output, VALUE_TYPE.d3Scene, self); + + setIsDynamicInput(1); + + static createNewInput = function() { + var index = ds_list_size(inputs); + inputs[| index] = nodeValue("Object", self, JUNCTION_CONNECT.input, VALUE_TYPE.d3Mesh, noone ) + .setVisible(true, true); + } + if(!LOADING && !APPENDING) createNewInput(); + + static refreshDynamicInput = function() { + 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; + + createNewInput(); + } + + static onValueFromUpdate = function(index) { + if(index < input_fix_len) return; + if(LOADING || APPENDING) return; + + refreshDynamicInput(); + } + + static submitSel = function(params = {}) { + for( var i = input_fix_len, n = ds_list_size(inputs); i < n; i += data_length ) { + var _obj = inputs[| i].getValue(); + if(_obj == noone) continue; + + _obj.submitSel(params); + } + } + + static submitUI = function(params = {}, shader = noone) { + for( var i = input_fix_len, n = ds_list_size(inputs); i < n; i += data_length ) { + var _obj = inputs[| i].getValue(); + if(_obj == noone) continue; + + _obj.submitUI(params, shader); + } + } + + static submit = function(params = {}, shader = noone) { + for( var i = input_fix_len, n = ds_list_size(inputs); i < n; i += data_length ) { + var _obj = inputs[| i].getValue(); + if(_obj == noone) continue; + + _obj.submit(params, shader); + } + } + + static update = function(frame = PROJECT.animator.current_frame) { + + } + + static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {} +} \ No newline at end of file diff --git a/scripts/node_3d_scene/node_3d_scene.yy b/scripts/node_3d_scene/node_3d_scene.yy new file mode 100644 index 000000000..8be8b0f2b --- /dev/null +++ b/scripts/node_3d_scene/node_3d_scene.yy @@ -0,0 +1,11 @@ +{ + "resourceType": "GMScript", + "resourceVersion": "1.0", + "name": "node_3d_scene", + "isCompatibility": false, + "isDnD": false, + "parent": { + "name": "3D", + "path": "folders/nodes/data/3D.yy", + }, +} \ No newline at end of file diff --git a/scripts/node_3d_scene/node_counter.yy b/scripts/node_3d_scene/node_counter.yy new file mode 100644 index 000000000..10832a0b0 --- /dev/null +++ b/scripts/node_3d_scene/node_counter.yy @@ -0,0 +1,12 @@ +{ + "isDnD": false, + "isCompatibility": false, + "parent": { + "name": "variable", + "path": "folders/nodes/data/variable.yy", + }, + "resourceVersion": "1.0", + "name": "node_counter", + "tags": [], + "resourceType": "GMScript", +} \ No newline at end of file diff --git a/scripts/node_3d_transform/node_3d_transform.yy b/scripts/node_3d_transform/node_3d_transform.yy index daf13ae23..6728673e9 100644 --- a/scripts/node_3d_transform/node_3d_transform.yy +++ b/scripts/node_3d_transform/node_3d_transform.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "__legacy", + "path": "folders/nodes/data/3D/__legacy.yy", }, } \ No newline at end of file diff --git a/scripts/node_bevel/node_bevel.yy b/scripts/node_bevel/node_bevel.yy index d8168cf5f..94ae4892a 100644 --- a/scripts/node_bevel/node_bevel.yy +++ b/scripts/node_bevel/node_bevel.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "2d effects", + "path": "folders/nodes/data/3D/2d effects.yy", }, } \ No newline at end of file diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index 1d67948bf..1c9a8f61e 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -137,6 +137,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x input_fix_len = 0; data_length = 1; + is_3D = false; + static createNewInput = noone; static initTooltip = function() { diff --git a/scripts/node_normal/node_normal.yy b/scripts/node_normal/node_normal.yy index f038099d2..4b9e0eb19 100644 --- a/scripts/node_normal/node_normal.yy +++ b/scripts/node_normal/node_normal.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "2d effects", + "path": "folders/nodes/data/3D/2d effects.yy", }, } \ No newline at end of file diff --git a/scripts/node_normal_light/node_normal_light.yy b/scripts/node_normal_light/node_normal_light.yy index 48f1385e0..25f1ea8ec 100644 --- a/scripts/node_normal_light/node_normal_light.yy +++ b/scripts/node_normal_light/node_normal_light.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "2d effects", + "path": "folders/nodes/data/3D/2d effects.yy", }, } \ No newline at end of file diff --git a/scripts/node_registry/node_registry.gml b/scripts/node_registry/node_registry.gml index 32fcb195b..9d38d0e1f 100644 --- a/scripts/node_registry/node_registry.gml +++ b/scripts/node_registry/node_registry.gml @@ -342,29 +342,38 @@ function NodeObject(_name, _spr, _node, _create, tags = []) constructor { var threeD = ds_list_create(); addNodeCatagory("3D", threeD); - ds_list_add(threeD, "2D operations"); + ds_list_add(threeD, "2D Operations"); addNodeObject(threeD, "Normal", s_node_normal, "Node_Normal", [1, Node_Normal],, "Create normal map using greyscale value as height."); addNodeObject(threeD, "Normal Light", s_node_normal_light, "Node_Normal_Light", [1, Node_Normal_Light],, "Light up the image using normal mapping."); addNodeObject(threeD, "Bevel", s_node_bevel, "Node_Bevel", [1, Node_Bevel], ["shade", "auto shade"], "Apply 2D bevel on the image."); addNodeObject(threeD, "Sprite Stack", s_node_stack, "Node_Sprite_Stack", [1, Node_Sprite_Stack],, "Create sprite stack either from repeating a single image or stacking different images using array."); ///**/ addNodeObject(threeD, "Depth 3D", s_node_stack, "Node_3D_Depth", [1, Node_3D_Depth],, "Create 3D looking image from depth map.").setVersion(1447); - ds_list_add(threeD, "3D generates"); - addNodeObject(threeD, "3D Object", s_node_3d_obj, "Node_3D_Obj", [0, Node_create_3D_Obj],, "Load .obj file from your computer as a 3D object."); - addNodeObject(threeD, "3D Plane", s_node_3d_plane, "Node_3D_Plane", [1, Node_3D_Plane],, "Put 2D image on a plane in 3D space."); - addNodeObject(threeD, "3D Cube", s_node_3d_cube, "Node_3D_Cube", [1, Node_3D_Cube]); - addNodeObject(threeD, "3D Cylinder", s_node_3d_cylinder, "Node_3D_Cylinder", [1, Node_3D_Cylinder]); - addNodeObject(threeD, "3D Sphere", s_node_3d_sphere, "Node_3D_Sphere", [1, Node_3D_Sphere]).setVersion(1090); - addNodeObject(threeD, "3D Cone", s_node_3d_cone, "Node_3D_Cone", [1, Node_3D_Cone]).setVersion(1090); - addNodeObject(threeD, "3D Extrude", s_node_3d_extrude, "Node_3D_Extrude", [1, Node_3D_Extrude],, "Extrude 2D image into 3D object."); + ds_list_add(threeD, "3D"); + addNodeObject(threeD, "3D Scene", s_node_3d_cube, "Node_3D_Scene", [1, Node_3D_Scene]); - ds_list_add(threeD, "3D operations"); - addNodeObject(threeD, "3D Transform", s_node_3d_transform, "Node_3D_Transform", [1, Node_3D_Transform]).setVersion(1080); - addNodeObject(threeD, "3D Combine", s_node_3d_obj_combine, "Node_3D_Combine", [1, Node_3D_Combine],, "Combine multiple 3D object to a single scene,").setVersion(1080); - addNodeObject(threeD, "3D Repeat", s_node_3d_array, "Node_3D_Repeat", [1, Node_3D_Repeat], ["3d array"], "Repeat 3D object multiple times.").setVersion(1080); - addNodeObject(threeD, "3D Displace", s_node_3d_displace, "Node_3D_Displace", [1, Node_3D_Displace]).setVersion(1143); + ds_list_add(threeD, "Mesh"); + addNodeObject(threeD, "3D Cube", s_node_3d_cube, "Node_3D_Mesh_Cube", [1, Node_3D_Mesh_Cube]); - addNodeObject(threeD, "3D Export", s_node_3d_export, "Node_3D_Export", [1, Node_3D_Export]).setVersion(1143); + ds_list_add(threeD, "Light"); + addNodeObject(threeD, "Directional Light", s_node_3d_cube, "Node_3D_Light_Directional", [1, Node_3D_Light_Directional]); + + //ds_list_add(threeD, "3D generates"); + //addNodeObject(threeD, "3D Object", s_node_3d_obj, "Node_3D_Obj", [0, Node_create_3D_Obj],, "Load .obj file from your computer as a 3D object."); + //addNodeObject(threeD, "3D Plane", s_node_3d_plane, "Node_3D_Plane", [1, Node_3D_Plane],, "Put 2D image on a plane in 3D space."); + //addNodeObject(threeD, "3D Cube", s_node_3d_cube, "Node_3D_Cube", [1, Node_3D_Cube]); + //addNodeObject(threeD, "3D Cylinder", s_node_3d_cylinder, "Node_3D_Cylinder", [1, Node_3D_Cylinder]); + //addNodeObject(threeD, "3D Sphere", s_node_3d_sphere, "Node_3D_Sphere", [1, Node_3D_Sphere]).setVersion(1090); + //addNodeObject(threeD, "3D Cone", s_node_3d_cone, "Node_3D_Cone", [1, Node_3D_Cone]).setVersion(1090); + //addNodeObject(threeD, "3D Extrude", s_node_3d_extrude, "Node_3D_Extrude", [1, Node_3D_Extrude],, "Extrude 2D image into 3D object."); + + //ds_list_add(threeD, "3D operations"); + //addNodeObject(threeD, "3D Transform", s_node_3d_transform, "Node_3D_Transform", [1, Node_3D_Transform]).setVersion(1080); + //addNodeObject(threeD, "3D Combine", s_node_3d_obj_combine, "Node_3D_Combine", [1, Node_3D_Combine],, "Combine multiple 3D object to a single scene,").setVersion(1080); + //addNodeObject(threeD, "3D Repeat", s_node_3d_array, "Node_3D_Repeat", [1, Node_3D_Repeat], ["3d array"], "Repeat 3D object multiple times.").setVersion(1080); + //addNodeObject(threeD, "3D Displace", s_node_3d_displace, "Node_3D_Displace", [1, Node_3D_Displace]).setVersion(1143); + + //addNodeObject(threeD, "3D Export", s_node_3d_export, "Node_3D_Export", [1, Node_3D_Export]).setVersion(1143); var generator = ds_list_create(); addNodeCatagory("Generate", generator); diff --git a/scripts/node_sprite_stack/node_sprite_stack.yy b/scripts/node_sprite_stack/node_sprite_stack.yy index 988705088..8ffb67162 100644 --- a/scripts/node_sprite_stack/node_sprite_stack.yy +++ b/scripts/node_sprite_stack/node_sprite_stack.yy @@ -5,7 +5,7 @@ "isCompatibility": false, "isDnD": false, "parent": { - "name": "3D", - "path": "folders/nodes/data/3D.yy", + "name": "2d effects", + "path": "folders/nodes/data/3D/2d effects.yy", }, } \ No newline at end of file diff --git a/scripts/node_value/node_value.gml b/scripts/node_value/node_value.gml index 4cdcb07c6..f846495a2 100644 --- a/scripts/node_value/node_value.gml +++ b/scripts/node_value/node_value.gml @@ -36,6 +36,11 @@ enum VALUE_TYPE { pbBox = 25, + d3Mesh = 26, + d3Light = 27, + d3Camera = 28, + d3Scene = 29, + action = 99, } @@ -155,6 +160,11 @@ function value_bit(i) { case VALUE_TYPE.trigger : return 1 << 22; case VALUE_TYPE.action : return 1 << 22 | 1 << 3; + case VALUE_TYPE.d3Mesh : return 1 << 29; + case VALUE_TYPE.d3Light : return 1 << 29; + case VALUE_TYPE.d3Camera : return 1 << 29; + case VALUE_TYPE.d3Scene : return 1 << 29 | 1 << 30; + case VALUE_TYPE.any : return ~0 & ~(1 << 32); } return 0; diff --git a/scripts/panel_graph/panel_graph.gml b/scripts/panel_graph/panel_graph.gml index 679a0be32..4058b4873 100644 --- a/scripts/panel_graph/panel_graph.gml +++ b/scripts/panel_graph/panel_graph.gml @@ -1150,7 +1150,7 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor { for( var j = 0, m = ds_list_size(_node.outputs); j < m; j++ ) { var _junction = _node.outputs[| j]; if(!_junction.visible) continue; - if(_junction.type != value_dragging.type) continue; + if(value_bit(_junction.type) & value_bit(value_dragging.type) == 0) continue; ds_priority_add(_jlist, _junction, _junction.y); } diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 59e72a03a..d00073ed6 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -5,73 +5,111 @@ function Panel_Preview() : PanelContent() constructor { last_focus = noone; - function initSize() { - canvas_x = w / 2; - canvas_y = h / 2; - } - run_in(1, function() { initSize() }); + #region ---- canvas control & sample ---- + function initSize() { + canvas_x = w / 2; + canvas_y = h / 2; + } + run_in(1, function() { initSize() }); - canvas_x = 0; - canvas_y = 0; - canvas_s = ui(1); - canvas_w = ui(128); - canvas_h = ui(128); - canvas_a = 0; + canvas_x = 0; + canvas_y = 0; + canvas_s = ui(1); + canvas_w = ui(128); + canvas_h = ui(128); + canvas_a = 0; - canvas_bg = -1; + canvas_bg = -1; - do_fullView = false; + do_fullView = false; - canvas_hover = true; - canvas_dragging_key = false; - canvas_dragging = false; - canvas_drag_key = 0; - canvas_drag_mx = 0; - canvas_drag_my = 0; - canvas_drag_sx = 0; - canvas_drag_sy = 0; + canvas_hover = true; + canvas_dragging_key = false; + canvas_dragging = false; + canvas_drag_key = 0; + canvas_drag_mx = 0; + canvas_drag_my = 0; + canvas_drag_sx = 0; + canvas_drag_sy = 0; - canvas_zooming_key = false; - canvas_zooming = false; - canvas_zoom_mx = 0; - canvas_zoom_my = 0; - canvas_zoom_m = 0; - canvas_zoom_s = 0; + canvas_zooming_key = false; + canvas_zooming = false; + canvas_zoom_mx = 0; + canvas_zoom_my = 0; + canvas_zoom_m = 0; + canvas_zoom_s = 0; + + sample_color = noone; + sample_x = noone; + sample_y = noone; - sample_color = noone; - sample_x = noone; - sample_y = noone; + #endregion - preview_node = [ noone, noone ]; - preview_surface = [ 0, 0 ]; - tile_surface = surface_create(1, 1); + #region ---- preview ---- + preview_node = [ noone, noone ]; + preview_surface = [ 0, 0 ]; + tile_surface = surface_create(1, 1); - preview_x = 0; - preview_x_to = 0; - preview_x_max = 0; - preview_sequence = [ 0, 0 ]; - _preview_sequence = preview_sequence; - preview_rate = 10; + preview_x = 0; + preview_x_to = 0; + preview_x_max = 0; + preview_sequence = [ 0, 0 ]; + _preview_sequence = preview_sequence; + preview_rate = 10; + + right_menu_y = 8; + mouse_on_preview = false; + + resetViewOnDoubleClick = true; - tool_x = 0; - tool_x_to = 0; - tool_x_max = 0; - tool_current = noone; + splitView = 0; + splitPosition = 0.5; + splitSelection = 0; - right_menu_y = 8; - mouse_on_preview = false; + splitViewDragging = false; + splitViewStart = 0; + splitViewMouse = 0; - resetViewOnDoubleClick = true; + tileMode = 0; + #endregion - splitView = 0; - splitPosition = 0.5; - splitSelection = 0; + #region ---- tool ---- + tool_x = 0; + tool_x_to = 0; + tool_x_max = 0; + tool_current = noone; + #endregion - splitViewDragging = false; - splitViewStart = 0; - splitViewMouse = 0; + #region ---- 3d ---- + d3_active = false; + d3_surface = noone; + d3_outline_surface = noone; + + d3_camW = 1; + d3_camH = 1; + + d3_camLerp = false; + d3_camPos = new __vec3(); + d3_camTar = new __vec3(); - tileMode = 0; + d3_camAx = 135; + d3_camAy = 45; + d3_camDist = 16; + + d3_camTarget = new __vec3(); + + d3_camPanning = false; + d3_camPan_mx = 0; + d3_camPan_my = 0; + + d3_zoom_speed = 0.2; + d3_pan_speed = 2; + + d3_camera = new __3dCamera(); + d3_preview_params = new __3dObjectParameters(d3_camPos, d3_camTar); + + d3_light_ambient = $303030; + #endregion tb_framerate = new textBox(TEXTBOX_INPUT.number, function(val) { preview_rate = real(val); }); @@ -589,6 +627,143 @@ function Panel_Preview() : PanelContent() constructor { } } #endregion + function draw3D() { #region + var _prev_node = getNodePreview(); + _prev_node.previewing = 1; + + #region draw + d3_surface = surface_verify(d3_surface, w, h); + d3_outline_surface = surface_verify(d3_outline_surface, w, h); + + d3_camW = w; + d3_camH = h; + + var cam = camera_get_active(); + var _pos, targ; + + if(keyboard_check(vk_tab)) { + _pos = d3_camera.position; + var _camDir = d3_camera.rotation.toDirection(); + _camDir._multiply(_pos.z / _camDir.z); + targ = _pos.subtract(_camDir); + d3_camLerp = true; + } else { + _pos = calculate_3d_position(d3_camTarget.x, d3_camTarget.y, d3_camTarget.z, d3_camAx, d3_camAy, d3_camDist); + targ = d3_camTarget; + } + + if(d3_camLerp) { + d3_camPos._lerp(_pos, 0.2); + d3_camTar._lerp(targ, 0.2); + + if(d3_camPos.equal(_pos) && d3_camTar.equal(targ)) + d3_camLerp = false; + } else { + d3_camPos.set(_pos); + d3_camTar.set(targ); + } + + d3_preview_params.cameraPosition = d3_camPos; + d3_preview_params.cameraFocus = d3_camTar; + d3_preview_params.camera_Ax = d3_camAx; + d3_preview_params.camera_Ay = d3_camAy; + d3_preview_params.camera_Dist = d3_camDist; + + d3_preview_params.camera_w = d3_camW; + d3_preview_params.camera_h = d3_camH; + + d3_preview_params.camera_projMat.setRaw(matrix_build_projection_perspective_fov(60, w / h, 1, 32000)); + d3_preview_params.camera_viewMat.setRaw(matrix_build_lookat(d3_camPos.x, d3_camPos.y, d3_camPos.z, d3_camTar.x, d3_camTar.y, d3_camTar.z, 0, 0, -1)); + + surface_set_target(d3_surface); + draw_clear(COLORS.panel_3d_bg); + + camera_set_proj_mat(cam, d3_preview_params.camera_projMat.raw); + camera_set_view_mat(cam, d3_preview_params.camera_viewMat.raw); + + camera_apply(cam); + + gpu_set_ztestenable(true); + gpu_set_zwriteenable(false); + shader_set(sh_d3d_grid_view); + var _dist = round(d3_camTar.distance(d3_camPos)); + var _tx = round(d3_camTar.x); + var _ty = round(d3_camTar.y); + + var _scale = _dist; + while(_scale > 32) _scale /= 2; + + shader_set_f("scale", _scale); + shader_set_f("shift", _tx / _dist / 2, _ty / _dist / 2); + draw_sprite_stretched(s_fx_pixel, 0, _tx - _dist, _ty - _dist, _dist * 2, _dist * 2); + shader_reset(); + gpu_set_zwriteenable(true); + + shader_set(sh_d3d_default); + shader_set_f("light_ambient", colToVec4(d3_light_ambient)); + + //shader_set_f("light_dir_direction", 0, 0, 0); + //shader_set_f("light_dir_color", 0); + //shader_set_f("light_dir_intensity", 0); + shader_reset(); + + _prev_node.submitUI(d3_preview_params); + + surface_reset_target(); + draw_surface(d3_surface, 0, 0); + + #region outline + var inspect_node = PANEL_INSPECTOR.inspecting; + if(inspect_node) { + surface_set_target(d3_outline_surface); + draw_clear(c_black); + + camera_set_proj_mat(cam, d3_preview_params.camera_projMat.raw); + camera_set_view_mat(cam, d3_preview_params.camera_viewMat.raw); + camera_apply(cam); + + gpu_set_ztestenable(false); + inspect_node.submitSel(d3_preview_params); + surface_reset_target(); + + shader_set(sh_d3d_outline); + shader_set_dim("dimension", d3_outline_surface); + shader_set_color("outlineColor", COLORS._main_accent); + draw_surface(d3_outline_surface, 0, 0); + shader_reset(); + } + #endregion + #endregion + + #region camera + if(pHOVER) { + if(mouse_wheel_up()) d3_camDist = max( 1, d3_camDist * (1 - d3_zoom_speed)); + if(mouse_wheel_down()) d3_camDist = min(1000, d3_camDist * (1 + d3_zoom_speed)); + } + + if(d3_camPanning) { + if(!MOUSE_WRAPPING) { + var dx = mx - d3_camPan_mx; + var dy = my - d3_camPan_my; + + d3_camAx += dx * 0.2 * d3_pan_speed; + d3_camAy += dy * 0.1 * d3_pan_speed; + } + + d3_camPan_mx = mx; + d3_camPan_my = my; + setMouseWrap(); + + if(mouse_release(mb_middle)) + d3_camPanning = false; + } else if(mouse_press(mb_middle, pFOCUS)) { + d3_camPanning = true; + d3_camPan_mx = mx; + d3_camPan_my = my; + } + #endregion + } #endregion + function drawPreviewOverlay() { #region right_menu_y = toolbar_height - ui(4); toolbar_draw = false; @@ -738,13 +913,15 @@ function Panel_Preview() : PanelContent() constructor { overlayHover &= point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height); overlayHover &= !key_mod_press(CTRL); - _node.drawOverlay(overlayHover, cx, cy, canvas_s, _mx, _my, _snx, _sny, { w: w, h: h }); + if(d3_active) _node.drawOverlay3D(overlayHover, d3_preview_params, _mx, _my, _snx, _sny, { w, h }); + else _node.drawOverlay(overlayHover, cx, cy, canvas_s, _mx, _my, _snx, _sny, { w, h }); var _tool = tool_hovering; tool_hovering = noone; if(_node.tools != -1) { - draw_sprite_stretched(THEME.tool_side, 1, 0, 0, tool_width, h); + var aa = d3_active? 0.5 : 1; + draw_sprite_stretched_ext(THEME.tool_side, 1, 0, ui(32), tool_width, h - toolbar_height - ui(32), c_white, aa); var xx = ui(1) + tool_width / 2; var yy = ui(34) + tool_size / 2; @@ -828,9 +1005,10 @@ function Panel_Preview() : PanelContent() constructor { //draw_sprite_stretched_ext(THEME.toolbar_shadow, 0, 0, ty - 12 + 4, w, 12, c_white, 0.5); var scHeight = ui(32); + var aa = d3_active? 0.5 : 1; - draw_sprite_stretched(THEME.toolbar, 1, 0, 0, w, scHeight); - draw_sprite_stretched(THEME.toolbar, 0, 0, ty, w, h); + draw_sprite_stretched_ext(THEME.toolbar, 1, 0, 0, w, scHeight, c_white, aa); + draw_sprite_stretched_ext(THEME.toolbar, 0, 0, ty, w, toolbar_height, c_white, aa); if(!_node) return; @@ -1005,6 +1183,8 @@ function Panel_Preview() : PanelContent() constructor { function drawContent(panel) { #region >>>>>>>>>>>>>>>>>>>> MAIN DRAW <<<<<<<<<<<<<<<<<<<< mouse_on_preview = pHOVER && point_in_rectangle(mx, my, 0, toolbar_height, w, h - toolbar_height); + var _prev_node = getNodePreview(); + d3_active = _prev_node != noone && _prev_node.is_3D; draw_clear(COLORS.panel_bg_clear); if(canvas_bg == -1 && canvas_s >= 0.1) @@ -1012,15 +1192,21 @@ function Panel_Preview() : PanelContent() constructor { else draw_clear(canvas_bg); - draw_set_color(COLORS._main_icon_dark); - draw_line_width(canvas_x, 0, canvas_x, h, 1); - draw_line_width(0, canvas_y, w, canvas_y, 1); + if(d3_active) { + draw3D(); + } else { - title = __txt("Preview"); + draw_set_color(COLORS._main_icon_dark); + draw_line_width(canvas_x, 0, canvas_x, h, 1); + draw_line_width(0, canvas_y, w, canvas_y, 1); + + title = __txt("Preview"); + + dragCanvas(); + getPreviewData(); + drawNodePreview(); + } - dragCanvas(); - getPreviewData(); - drawNodePreview(); drawPreviewOverlay(); var inspect_node = PANEL_INSPECTOR.inspecting; @@ -1051,7 +1237,7 @@ function Panel_Preview() : PanelContent() constructor { ],, getNodePreview()); } - drawSplitView(); + if(!d3_active) drawSplitView(); drawToolBar(tool); } #endregion diff --git a/shaders/sh_3d_depth/sh_3d_depth.yy b/shaders/sh_3d_depth/sh_3d_depth.yy index 6b2bc9fe7..e13a4c490 100644 --- a/shaders/sh_3d_depth/sh_3d_depth.yy +++ b/shaders/sh_3d_depth/sh_3d_depth.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_3d_depth", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy b/shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy index 4ec3d5af6..4951b13fb 100644 --- a/shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy +++ b/shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_3d_extrude_corner", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_3d_extrude_filler/sh_3d_extrude_filler.yy b/shaders/sh_3d_extrude_filler/sh_3d_extrude_filler.yy index 22b0434c7..28a728d81 100644 --- a/shaders/sh_3d_extrude_filler/sh_3d_extrude_filler.yy +++ b/shaders/sh_3d_extrude_filler/sh_3d_extrude_filler.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_3d_extrude_filler", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy b/shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy index 2c44b049d..cc1a62fbd 100644 --- a/shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy +++ b/shaders/sh_3d_extrude_filler_depth/sh_3d_extrude_filler_depth.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_3d_extrude_filler_depth", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_bevel/sh_bevel.yy b/shaders/sh_bevel/sh_bevel.yy index 9b1d7d29e..ce89ddf19 100644 --- a/shaders/sh_bevel/sh_bevel.yy +++ b/shaders/sh_bevel/sh_bevel.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_bevel", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "2d effect", + "path": "folders/shader/3d/2d effect.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_d3d_default/sh_d3d_default.fsh b/shaders/sh_d3d_default/sh_d3d_default.fsh new file mode 100644 index 000000000..bc24db871 --- /dev/null +++ b/shaders/sh_d3d_default/sh_d3d_default.fsh @@ -0,0 +1,33 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec3 v_vNormal; + +varying vec3 v_worldPosition; + +uniform vec4 light_ambient; +uniform vec3 light_dir_direction; +uniform vec4 light_dir_color; +uniform float light_dir_intensity; + +void main() { + vec4 final_color = texture2D( gm_BaseTexture, v_vTexcoord ); + final_color *= v_vColour; + + ///////////////// LIGHT ///////////////// + + vec3 light_effect = light_ambient.rgb * light_ambient.a; + + float light_dir_strength = dot(normalize(v_vNormal), normalize(light_dir_direction)); + light_dir_strength = max(light_dir_strength * light_dir_intensity, 0.); + light_effect += light_dir_color.rgb * light_dir_color.a * light_dir_strength; + + light_effect = max(light_effect, 0.); + final_color.rgb *= light_effect; + + ///////////////// FINAL ///////////////// + + gl_FragColor = final_color; +} diff --git a/shaders/sh_d3d_default/sh_d3d_default.vsh b/shaders/sh_d3d_default/sh_d3d_default.vsh new file mode 100644 index 000000000..a61299944 --- /dev/null +++ b/shaders/sh_d3d_default/sh_d3d_default.vsh @@ -0,0 +1,26 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; +varying vec3 v_vNormal; + +varying vec3 v_worldPosition; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_worldPosition = (gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos).xyz; + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; + + vec3 worldNormal = normalize(gm_Matrices[MATRIX_WORLD] * vec4(in_Normal, 0.)).xyz; + v_vNormal = worldNormal; +} diff --git a/shaders/sh_d3d_default/sh_d3d_default.yy b/shaders/sh_d3d_default/sh_d3d_default.yy new file mode 100644 index 000000000..6d47fb847 --- /dev/null +++ b/shaders/sh_d3d_default/sh_d3d_default.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_d3d_default", + "parent": { + "name": "3d", + "path": "folders/shader/3d.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh new file mode 100644 index 000000000..86cf955ae --- /dev/null +++ b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.fsh @@ -0,0 +1,34 @@ +#extension GL_OES_standard_derivatives : enable +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +varying float v_distanceToCamera; +varying vec3 v_worldPosition; + +uniform float scale; +uniform vec2 shift; + +vec4 grid(vec2 pos, float scale) { + vec2 coord = pos * scale; // use the scale variable to set the distance between the lines + vec2 derivative = fwidth(coord); + vec2 grid = abs(fract(coord - 0.5) - 0.5) / derivative; + float line = min(grid.x, grid.y); + float minimumy = min(derivative.y, 1.); + float minimumx = min(derivative.x, 1.); + vec4 color = vec4(.3, .3, .3, 1. - min(line, 1.)); + // y axis + if(pos.x > -1. * minimumx / scale && pos.x < 1. * minimumx / scale) + color.y = 1.; + // x axis + if(pos.y > -1. * minimumy / scale && pos.y < 1. * minimumy / scale) + color.x = 1.; + return color; +} + +void main() { + gl_FragColor = grid( v_vTexcoord - 0.5 + shift, scale ); + gl_FragColor.a *= 1. - length(v_vTexcoord - 0.5) * 2.; +} diff --git a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh new file mode 100644 index 000000000..7d131d3d0 --- /dev/null +++ b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.vsh @@ -0,0 +1,26 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +varying float v_distanceToCamera; +varying vec3 v_worldPosition; + +void main() { + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_worldPosition = (gm_Matrices[MATRIX_WORLD] * vec4(in_Position, 1.)).xyz; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; + + vec4 worldView = gm_Matrices[MATRIX_WORLD_VIEW] * object_space_pos; + v_distanceToCamera = length(worldView.xyz); +} diff --git a/shaders/sh_d3d_grid_view/sh_d3d_grid_view.yy b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.yy new file mode 100644 index 000000000..a726fcf59 --- /dev/null +++ b/shaders/sh_d3d_grid_view/sh_d3d_grid_view.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_d3d_grid_view", + "parent": { + "name": "3d", + "path": "folders/shader/3d.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_d3d_outline/sh_d3d_outline.fsh b/shaders/sh_d3d_outline/sh_d3d_outline.fsh new file mode 100644 index 000000000..5a15cdca0 --- /dev/null +++ b/shaders/sh_d3d_outline/sh_d3d_outline.fsh @@ -0,0 +1,39 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +uniform vec2 dimension; +uniform vec4 outlineColor; + +#define TAU 6.283185307179586 + +void main() { + vec2 pixelPosition = v_vTexcoord * dimension; + gl_FragColor = vec4(0.); + + vec4 sam = texture2D( gm_BaseTexture, v_vTexcoord ); + if(sam.r > 0.5) return; + + for(float i = 1.; i <= 2.; i++) { + float base = 1.; + float top = 0.; + for(float j = 0.; j <= 8.; j++) { + float ang = top / base * TAU; + top += 2.; + if(top >= base) { + top = 1.; + base *= 2.; + } + + vec2 pxs = (pixelPosition + vec2( cos(ang), sin(ang)) * i) / dimension; + vec4 sam = texture2D( gm_BaseTexture, pxs ); + + if(sam.r > 0.5) { + gl_FragColor = outlineColor; + return; + } + } + } +} diff --git a/shaders/sh_d3d_outline/sh_d3d_outline.vsh b/shaders/sh_d3d_outline/sh_d3d_outline.vsh new file mode 100644 index 000000000..3900c20f4 --- /dev/null +++ b/shaders/sh_d3d_outline/sh_d3d_outline.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +//attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_d3d_outline/sh_d3d_outline.yy b/shaders/sh_d3d_outline/sh_d3d_outline.yy new file mode 100644 index 000000000..6713f1ade --- /dev/null +++ b/shaders/sh_d3d_outline/sh_d3d_outline.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_d3d_outline", + "parent": { + "name": "3d", + "path": "folders/shader/3d.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_d3d_silhouette/sh_d3d_silhouette.fsh b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.fsh new file mode 100644 index 000000000..1c8842497 --- /dev/null +++ b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.fsh @@ -0,0 +1,9 @@ +// +// Simple passthrough fragment shader +// +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() { + gl_FragColor = vec4(1.); +} diff --git a/shaders/sh_d3d_silhouette/sh_d3d_silhouette.vsh b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.vsh new file mode 100644 index 000000000..5479806bd --- /dev/null +++ b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.vsh @@ -0,0 +1,19 @@ +// +// Simple passthrough vertex shader +// +attribute vec3 in_Position; // (x,y,z) +attribute vec3 in_Normal; // (x,y,z) unused in this shader. +attribute vec4 in_Colour; // (r,g,b,a) +attribute vec2 in_TextureCoord; // (u,v) + +varying vec2 v_vTexcoord; +varying vec4 v_vColour; + +void main() +{ + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; + v_vTexcoord = in_TextureCoord; +} diff --git a/shaders/sh_d3d_silhouette/sh_d3d_silhouette.yy b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.yy new file mode 100644 index 000000000..bafcb6177 --- /dev/null +++ b/shaders/sh_d3d_silhouette/sh_d3d_silhouette.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_d3d_silhouette", + "parent": { + "name": "3d", + "path": "folders/shader/3d.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_d3d_wireframe/sh_d3d_wireframe.fsh b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.fsh new file mode 100644 index 000000000..c10580806 --- /dev/null +++ b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.fsh @@ -0,0 +1,5 @@ +varying vec4 v_vColour; + +void main() { + gl_FragColor = v_vColour; +} diff --git a/shaders/sh_d3d_wireframe/sh_d3d_wireframe.vsh b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.vsh new file mode 100644 index 000000000..6024f6979 --- /dev/null +++ b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.vsh @@ -0,0 +1,11 @@ +attribute vec3 in_Position; // (x,y,z) +attribute vec4 in_Colour; // (r,g,b,a) + +varying vec4 v_vColour; + +void main() { + vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0); + gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos; + + v_vColour = in_Colour; +} diff --git a/shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy new file mode 100644 index 000000000..b4fbd83e3 --- /dev/null +++ b/shaders/sh_d3d_wireframe/sh_d3d_wireframe.yy @@ -0,0 +1,10 @@ +{ + "resourceType": "GMShader", + "resourceVersion": "1.0", + "name": "sh_d3d_wireframe", + "parent": { + "name": "3d", + "path": "folders/shader/3d.yy", + }, + "type": 1, +} \ No newline at end of file diff --git a/shaders/sh_normal/sh_normal.yy b/shaders/sh_normal/sh_normal.yy index 0db5ed8da..c2f956618 100644 --- a/shaders/sh_normal/sh_normal.yy +++ b/shaders/sh_normal/sh_normal.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_normal", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "2d effect", + "path": "folders/shader/3d/2d effect.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_normal_light/sh_normal_light.yy b/shaders/sh_normal_light/sh_normal_light.yy index f7636561f..a067be9d3 100644 --- a/shaders/sh_normal_light/sh_normal_light.yy +++ b/shaders/sh_normal_light/sh_normal_light.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_normal_light", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "2d effect", + "path": "folders/shader/3d/2d effect.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy b/shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy index 1c0f4409c..17ac5fcfa 100644 --- a/shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy +++ b/shaders/sh_vertex_depth_pass/sh_vertex_depth_pass.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_vertex_depth_pass", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy b/shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy index 06775faef..987821a61 100644 --- a/shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy +++ b/shaders/sh_vertex_normal_pass/sh_vertex_normal_pass.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_vertex_normal_pass", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy b/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy index bfb857b2b..fbb87cc74 100644 --- a/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy +++ b/shaders/sh_vertex_pnt_light/sh_vertex_pnt_light.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_vertex_pnt_light", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/shaders/sh_vertex_pt/sh_vertex_pt.yy b/shaders/sh_vertex_pt/sh_vertex_pt.yy index 8b4a50289..bd8e1b63a 100644 --- a/shaders/sh_vertex_pt/sh_vertex_pt.yy +++ b/shaders/sh_vertex_pt/sh_vertex_pt.yy @@ -3,8 +3,8 @@ "resourceVersion": "1.0", "name": "sh_vertex_pt", "parent": { - "name": "3d", - "path": "folders/shader/3d.yy", + "name": "legacy", + "path": "folders/shader/3d/legacy.yy", }, "type": 1, } \ No newline at end of file diff --git a/sprites/s_fx_pixel/c48d04b1-d839-4d79-9821-5aab3420e684.png b/sprites/s_fx_pixel/c48d04b1-d839-4d79-9821-5aab3420e684.png index 58a2d46a9..08bce9ac1 100644 Binary files a/sprites/s_fx_pixel/c48d04b1-d839-4d79-9821-5aab3420e684.png and b/sprites/s_fx_pixel/c48d04b1-d839-4d79-9821-5aab3420e684.png differ diff --git a/sprites/s_fx_pixel/layers/c48d04b1-d839-4d79-9821-5aab3420e684/93a5ddf0-87b9-47aa-b697-63cfef2d5408.png b/sprites/s_fx_pixel/layers/c48d04b1-d839-4d79-9821-5aab3420e684/93a5ddf0-87b9-47aa-b697-63cfef2d5408.png index 58a2d46a9..08bce9ac1 100644 Binary files a/sprites/s_fx_pixel/layers/c48d04b1-d839-4d79-9821-5aab3420e684/93a5ddf0-87b9-47aa-b697-63cfef2d5408.png and b/sprites/s_fx_pixel/layers/c48d04b1-d839-4d79-9821-5aab3420e684/93a5ddf0-87b9-47aa-b697-63cfef2d5408.png differ diff --git a/sprites/s_fx_pixel/s_fx_pixel.yy b/sprites/s_fx_pixel/s_fx_pixel.yy index 0e3289afc..7df70ecf8 100644 --- a/sprites/s_fx_pixel/s_fx_pixel.yy +++ b/sprites/s_fx_pixel/s_fx_pixel.yy @@ -10,7 +10,7 @@ "collisionKind": 1, "collisionTolerance": 0, "DynamicTexturePage": false, - "edgeFiltering": false, + "edgeFiltering": true, "For3D": true, "frames": [ {"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"c48d04b1-d839-4d79-9821-5aab3420e684",},