diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index 2ed780195..66d7fa234 100644 Binary files a/fonts/_f_sdf/_f_sdf.old.png and b/fonts/_f_sdf/_f_sdf.old.png differ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index 66d7fa234..f8099b008 100644 Binary files a/fonts/_f_sdf/_f_sdf.png and b/fonts/_f_sdf/_f_sdf.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index 9a87707f5..e8a232f27 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.old.png and b/fonts/_f_sdf_medium/_f_sdf_medium.old.png differ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index e8a232f27..70bc94d20 100644 Binary files a/fonts/_f_sdf_medium/_f_sdf_medium.png and b/fonts/_f_sdf_medium/_f_sdf_medium.png differ diff --git a/objects/o_main/Create_0.gml b/objects/o_main/Create_0.gml index ec21313b4..30e0a67a4 100644 --- a/objects/o_main/Create_0.gml +++ b/objects/o_main/Create_0.gml @@ -302,6 +302,10 @@ #endregion #region 3D + globalvar USE_DEPTH; + _use_depth = noone; + USE_DEPTH = false; + set3DGlobalPreview(); #endregion diff --git a/objects/o_main/Step_1.gml b/objects/o_main/Step_1.gml index 89b914bca..b309acb44 100644 --- a/objects/o_main/Step_1.gml +++ b/objects/o_main/Step_1.gml @@ -201,4 +201,13 @@ _HOVERING_ELEMENT = noone; MOUSE_WRAP = false; #endregion +#region depth + if(_use_depth != USE_DEPTH) { + _use_depth = USE_DEPTH; + surface_depth_disable(!USE_DEPTH); + } + + USE_DEPTH = false; +#endregion + //if(global.cache_call) print($"CACHE called: {global.cache_call} | hit: {global.cache_hit} ({global.cache_hit / global.cache_call * 100}%)"); \ No newline at end of file diff --git a/scripts/__3D/__3D.gml b/scripts/__3D/__3D.gml index 4151c82d9..3c36ec811 100644 --- a/scripts/__3D/__3D.gml +++ b/scripts/__3D/__3D.gml @@ -554,6 +554,7 @@ enum CAMERA_PROJ { var lightFor = [ -cos(degtorad(_ldir)), -_lhgt, -sin(degtorad(_ldir)) ]; gpu_set_ztestenable(true); + surface_set_target(_outSurf); DRAW_CLEAR @@ -615,6 +616,7 @@ enum CAMERA_PROJ { matrix_set(matrix_world, MATRIX_IDENTITY); gpu_set_ztestenable(false); + var cam = camera_get_active(); camera_set_view_mat(cam, matrix_build_lookat(0, 0, 1, 0, 0, 0, 0, 1, 0)); camera_set_proj_mat(cam, matrix_build_projection_ortho(1, 1, 0.1, 256)); diff --git a/scripts/__node_3d/__node_3d.gml b/scripts/__node_3d/__node_3d.gml index f4e827aec..8169f4452 100644 --- a/scripts/__node_3d/__node_3d.gml +++ b/scripts/__node_3d/__node_3d.gml @@ -1,6 +1,7 @@ function Node_3D(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor { name = "3D"; is_3D = true; + surface_depth_disable(false); mesh_prev_surface = surface_create(64, 64); @@ -60,6 +61,7 @@ function Node_3D(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constr D3D_GLOBAL_PREVIEW.submitUI(_prev); } + surface_reset_target(); D3D_GLOBAL_PREVIEW.camera.resetCamera(); diff --git a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml index 603a2b332..e9b7da0c9 100644 --- a/scripts/_node_VFX_spawner/_node_VFX_spawner.gml +++ b/scripts/_node_VFX_spawner/_node_VFX_spawner.gml @@ -252,14 +252,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co var _posDist = []; - random_set_seed(seed); + random_set_seed(seed); seed++; var _amo = irandom_range(_spawn_amount[0], _spawn_amount[1]); if(_distrib == 2) _posDist = get_points_from_dist(_dist_map, _amo, seed); - //print($"[{display_name}] Frame {_time}: Spawning {_amo} particles, seed {seed}, at {_pos}"); - - random_set_seed(seed); - for( var i = 0; i < _amo; i++ ) { parts_runner = clamp(parts_runner, 0, array_length(parts) - 1); var part = parts[parts_runner]; diff --git a/scripts/d3d_light_directional/d3d_light_directional.gml b/scripts/d3d_light_directional/d3d_light_directional.gml index dfd765c50..25d60f8a1 100644 --- a/scripts/d3d_light_directional/d3d_light_directional.gml +++ b/scripts/d3d_light_directional/d3d_light_directional.gml @@ -61,6 +61,7 @@ function __3dLightDirectional() : __3dLight() constructor { draw_clear(c_black); shader_set(shadow_mapper); shader_set_i("use_8bit", OS == os_macosx); + gpu_set_ztestenable(true); camera_set_view_mat(shadow_map_camera, shadow_map_view); @@ -72,6 +73,7 @@ function __3dLightDirectional() : __3dLight() constructor { shader_reset(); surface_reset_target(); camera_apply(0); + gpu_set_ztestenable(false); } #endregion } \ No newline at end of file diff --git a/scripts/d3d_light_point/d3d_light_point.gml b/scripts/d3d_light_point/d3d_light_point.gml index c6509c88b..db769d1bc 100644 --- a/scripts/d3d_light_point/d3d_light_point.gml +++ b/scripts/d3d_light_point/d3d_light_point.gml @@ -75,6 +75,7 @@ function __3dLightPoint() : __3dLight() constructor { shader_reset(); surface_reset_target(); camera_apply(0); + gpu_set_ztestenable(false); } #endregion diff --git a/scripts/d3d_scene/d3d_scene.gml b/scripts/d3d_scene/d3d_scene.gml index c85fc7085..36e762954 100644 --- a/scripts/d3d_scene/d3d_scene.gml +++ b/scripts/d3d_scene/d3d_scene.gml @@ -136,7 +136,9 @@ function __3dScene(camera, name = "New scene") constructor { surface_set_target_ext(0, deferData.geometry_data[0]); surface_set_target_ext(1, deferData.geometry_data[1]); surface_set_target_ext(2, deferData.geometry_data[2]); + gpu_set_zwriteenable(true); + gpu_set_ztestenable(true); gpu_set_alphatestenable(true); @@ -154,6 +156,7 @@ function __3dScene(camera, name = "New scene") constructor { submit(object, sh_d3d_geometry); shader_reset(); + gpu_set_ztestenable(false); gpu_set_alphatestenable(false); surface_reset_target(); diff --git a/scripts/node_3d_camera/node_3d_camera.gml b/scripts/node_3d_camera/node_3d_camera.gml index fd1bc7038..97f3ad14b 100644 --- a/scripts/node_3d_camera/node_3d_camera.gml +++ b/scripts/node_3d_camera/node_3d_camera.gml @@ -328,10 +328,11 @@ function Node_3D_Camera(_x, _y, _group = noone) : Node_3D_Object(_x, _y, _group) DRAW_CLEAR gpu_set_zwriteenable(true); - gpu_set_ztestenable(true); gpu_set_cullmode(_back); - - if(_blend == 1) { + + if(_blend == 0) { + gpu_set_ztestenable(true); + } else { BLEND_ADD gpu_set_ztestenable(false); } diff --git a/scripts/node_data/node_data.gml b/scripts/node_data/node_data.gml index cdcb94fbf..00ffe873a 100644 --- a/scripts/node_data/node_data.gml +++ b/scripts/node_data/node_data.gml @@ -338,7 +338,10 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x var _hi = ui(junction_draw_pad_y); var _ho = ui(junction_draw_pad_y); - var _prev_surf = previewable && preview_draw && is_surface(getGraphPreviewSurface()); + var _prev_surf = previewable && preview_draw && + ( is_surface(getGraphPreviewSurface()) || + (preview_channel >= 0 && preview_channel < ds_list_size(outputs) && outputs[| preview_channel].type == VALUE_TYPE.surface) + ); for( var i = 0; i < ds_list_size(inputs); i++ ) { var _inp = inputs[| i]; @@ -511,6 +514,8 @@ function Node(_x, _y, _group = PANEL_GRAPH.getCurrentContext()) : __Node_Base(_x will_setHeight = false; } + if(is_3D) USE_DEPTH = true; + if(is_simulation) PROJECT.animator.is_simulating = true; } #endregion diff --git a/scripts/node_path_wave/node_path_wave.gml b/scripts/node_path_wave/node_path_wave.gml index e96c5acbd..5a550050d 100644 --- a/scripts/node_path_wave/node_path_wave.gml +++ b/scripts/node_path_wave/node_path_wave.gml @@ -21,7 +21,7 @@ function Node_Path_Wave(_x, _y, _group = noone) : Node(_x, _y, _group) construct inputs[| 6] = nodeValue("Wiggle", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false); inputs[| 7] = nodeValue("Wiggle Amplitude", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ -2, 2 ]) - .setDisplay(VALUE_DISPLAY.range, { linked : true }); + .setDisplay(VALUE_DISPLAY.range); inputs[| 8] = nodeValue("Wiggle Frequency", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 8); diff --git a/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml b/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml index d1ad049c1..bdf86f171 100644 --- a/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml +++ b/scripts/node_render_sprite_sheet/node_render_sprite_sheet.gml @@ -109,10 +109,8 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) var grup = getInputData(1); - if(grup == SPRITE_ANIM_GROUP.animation) - animationInit(clear); - else - arrayRender(); + if(grup == SPRITE_ANIM_GROUP.animation) animationInit(clear); + else arrayRender(); } #endregion static arrayRender = function() { #region @@ -129,7 +127,7 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) var cDep = attrDepth(); if(!is_array(inpt)) { - outputs[| 0].setValue(inpt); + outputs[| 0].setValue(surface_clone(inpt)); outputs[| 1].setValue([]); return; } @@ -465,9 +463,6 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) var _sx = 0; var _sy = 0; - surface_set_target(oo); - BLEND_OVERRIDE - switch(pack) { case SPRITE_STACK.horizontal : px = padd[2] + _frame * _w + max(0, _frame) * spac; @@ -500,15 +495,17 @@ function Node_Render_Sprite_Sheet(_x, _y, _group = noone) : Node(_x, _y, _group) _sy = py + _row * _h + max(0, _row) * spc2[1]; break; } - - printIf(log, $" > Drawing frame ({CURRENT_FRAME}) at {_sx}, {_sy}"); - array_push(_atli, new SurfaceAtlas(_surfi, _sx, _sy)); - draw_surface_safe(inpt[i], _sx, _sy); + + surface_set_shader(oo, noone, false, BLEND.over); + + printIf(log, $" > Drawing frame ({CURRENT_FRAME}) {_surfi} at {_sx}, {_sy}"); + + _atli[i] = new SurfaceAtlas(_surfi, _sx, _sy); + draw_surface(_surfi, _sx, _sy); + + surface_reset_shader(); drawn = true; - - BLEND_NORMAL; - surface_reset_target(); } #endregion if(drawn) array_safe_set(anim_drawn, CURRENT_FRAME, true); diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index e96528879..88330500f 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -843,7 +843,7 @@ function Panel_Preview() : PanelContent() constructor { gpu_set_ztestenable(true); gpu_set_zwriteenable(false); - + if(OS != os_macosx) { gpu_set_cullmode(cull_noculling); diff --git a/shaders/sh_stripe/sh_stripe.fsh b/shaders/sh_stripe/sh_stripe.fsh index b5b19f368..6014014be 100644 --- a/shaders/sh_stripe/sh_stripe.fsh +++ b/shaders/sh_stripe/sh_stripe.fsh @@ -150,7 +150,10 @@ void main() { #region if(gradient_use == 0) { if(blend == 0) gl_FragColor = _s > rat? color0 : color1; - else gl_FragColor = vec4(vec3(sin(_s * 2. * PI) * 0.5 + 0.5), 1.); + else { + _s = sin(_s * 2. * PI) * 0.5 + 0.5; + gl_FragColor = mix(color0, color1, _s); + } } else { if(_s > rat) gl_FragColor = gradientEval(random(vec2(slot))); else gl_FragColor = gradientEval(random(vec2(slot + 1.)));