From bfa9f7f6a5077a46e78d0124f84482183e264e33 Mon Sep 17 00:00:00 2001 From: Tanasart Date: Wed, 20 Dec 2023 09:54:26 +0700 Subject: [PATCH] - [3D scene] Fix nested scene not rendering. --- PixelComposer.resource_order | 1 + PixelComposer.yyp | 1 + fonts/_f_sdf/_f_sdf.old.png | Bin 82361 -> 82361 bytes fonts/_f_sdf/_f_sdf.png | Bin 82361 -> 82361 bytes fonts/_f_sdf_medium/_f_sdf_medium.old.png | Bin 59906 -> 59906 bytes fonts/_f_sdf_medium/_f_sdf_medium.png | Bin 59906 -> 59906 bytes objects/o_pie_menu/Create_0.gml | 4 +++ objects/o_pie_menu/o_pie_menu.yy | 33 ++++++++++++++++++++++ scripts/d3d_group/d3d_group.gml | 22 ++++++++------- scripts/d3d_object/d3d_object.gml | 2 ++ scripts/d3d_scene/d3d_scene.gml | 6 +++- scripts/dynaSurf_3d/dynaSurf_3d.gml | 2 +- scripts/node_3d_scene/node_3d_scene.gml | 5 ++-- scripts/panel_preview/panel_preview.gml | 4 ++- 14 files changed, 64 insertions(+), 16 deletions(-) create mode 100644 objects/o_pie_menu/Create_0.gml create mode 100644 objects/o_pie_menu/o_pie_menu.yy diff --git a/PixelComposer.resource_order b/PixelComposer.resource_order index 14fcd62bd..87177c9af 100644 --- a/PixelComposer.resource_order +++ b/PixelComposer.resource_order @@ -827,6 +827,7 @@ {"name":"s_node_pb_fx_radial","order":4,"path":"sprites/s_node_pb_fx_radial/s_node_pb_fx_radial.yy",}, {"name":"__background_get_internal","order":2,"path":"scripts/__background_get_internal/__background_get_internal.yy",}, {"name":"s_node_array_sample","order":18,"path":"sprites/s_node_array_sample/s_node_array_sample.yy",}, + {"name":"o_pie_menu","order":14,"path":"objects/o_pie_menu/o_pie_menu.yy",}, {"name":"s_biterator_b_labels","order":9,"path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",}, {"name":"FirebaseREST_Firestore_collection_decode","order":6,"path":"scripts/FirebaseREST_Firestore_collection_decode/FirebaseREST_Firestore_collection_decode.yy",}, {"name":"s_node_mk_flip_grid","order":2,"path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",}, diff --git a/PixelComposer.yyp b/PixelComposer.yyp index 72973824f..7ae6179ac 100644 --- a/PixelComposer.yyp +++ b/PixelComposer.yyp @@ -1100,6 +1100,7 @@ {"id":{"name":"s_node_pb_fx_radial","path":"sprites/s_node_pb_fx_radial/s_node_pb_fx_radial.yy",},}, {"id":{"name":"__background_get_internal","path":"scripts/__background_get_internal/__background_get_internal.yy",},}, {"id":{"name":"s_node_array_sample","path":"sprites/s_node_array_sample/s_node_array_sample.yy",},}, + {"id":{"name":"o_pie_menu","path":"objects/o_pie_menu/o_pie_menu.yy",},}, {"id":{"name":"s_biterator_b_labels","path":"sprites/s_biterator_b_labels/s_biterator_b_labels.yy",},}, {"id":{"name":"FirebaseREST_Firestore_collection_decode","path":"scripts/FirebaseREST_Firestore_collection_decode/FirebaseREST_Firestore_collection_decode.yy",},}, {"id":{"name":"s_node_mk_flip_grid","path":"sprites/s_node_mk_flip_grid/s_node_mk_flip_grid.yy",},}, diff --git a/fonts/_f_sdf/_f_sdf.old.png b/fonts/_f_sdf/_f_sdf.old.png index 34a9fdf5cb675b961d95a6100a148982a214ab35..ae4b55e04aa6908730414926d384e1286a035ec7 100644 GIT binary patch delta 99 zcmdnl%(}CgwP6dRv7@MwL5P8Ym5GU!v7t7QVPKGWaA)px4@X8BOeujmj2EX@Ix@;D VV(4=3RN!L(0#8>zmvv4FO#nIJ8B72G delta 99 zcmdnl%(}CgwP6dRv7@M=Wr%^Xm9dGHv5~fcft7)Qmu3I+=^l=ZGMG}6pFPl0D-5gpUXO@geCwbzZpsZ diff --git a/fonts/_f_sdf/_f_sdf.png b/fonts/_f_sdf/_f_sdf.png index 052cad204284a863fd555a952bda1e86d48baa20..7ffe1ecdff34aca14ff3704c43f5f369b43c1d36 100644 GIT binary patch delta 99 zcmdnl%(}CgwP6dRv7@MwL5P8om5HU5p{cfkft7)Q6X%j2(>)v+WiX|TLu6d0S2{Av WD`MzMakQPy00f?{elF{r5}E)K;27=z delta 99 zcmdnl%(}CgwP6dRv7@M=Wr(4nm63s!p@p`Aft7*5%&0%X(>)v+WiX{)u)DmUUg^jv XuZW>*zfh_H0}yz+`njxgN@xNAU$h!+ diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.old.png b/fonts/_f_sdf_medium/_f_sdf_medium.old.png index 994fccd9896a434475ccda0183f3d9833cfc6ce2..8820791f8a5ca7570b25350fcc8ced3c36d0b482 100644 GIT binary patch delta 121 zcmZp=!rXL)c|*-hQ6qy80|P4)6DwmwZ6L$IAo1YN+{qJP%7kLb2+U!;$iTp$QQ{g= tl9E`GYE_b%n_66wm|MVLWME{hYiOj4p~t;bfe)yM!PC{xWt~$(69D6dB3}Ri delta 121 zcmZp=!rXL)c|*-hQA5iR17j;=6Dwn5Z36=<1A{kyEy0r~zLW{YkeMrN^PYi$L8HVq uq9i4;B-N@UGdH!kBr&&u!N|bKSl7@<7emh}HdzCp9tKZWKbLh*2~7a?Q6k6y diff --git a/fonts/_f_sdf_medium/_f_sdf_medium.png b/fonts/_f_sdf_medium/_f_sdf_medium.png index 36416e8a4c41eca1d377ba3f13703690e9ca3e9b..cca2a2ef5bd19dcc8b54836cfe19161c5a34e681 100644 GIT binary patch delta 121 zcmZp=!rXL)c|*-hQ6qy810yRFODjWDZ36=<0|O_{B|j!ld?^!(A!8gO&uzAI-qPpi$x) uQIe8al4@0wnVVW%l9*e-U}RuqtZQhbi=js{HLnGzhr!d;&t;ucLK6V%%OcwV diff --git a/objects/o_pie_menu/Create_0.gml b/objects/o_pie_menu/Create_0.gml new file mode 100644 index 000000000..19135ad06 --- /dev/null +++ b/objects/o_pie_menu/Create_0.gml @@ -0,0 +1,4 @@ +/// @description Insert description here +// You can write your code in this editor + +depth = -9999; \ No newline at end of file diff --git a/objects/o_pie_menu/o_pie_menu.yy b/objects/o_pie_menu/o_pie_menu.yy new file mode 100644 index 000000000..8765d65fe --- /dev/null +++ b/objects/o_pie_menu/o_pie_menu.yy @@ -0,0 +1,33 @@ +{ + "resourceType": "GMObject", + "resourceVersion": "1.0", + "name": "o_pie_menu", + "eventList": [ + {"resourceType":"GMEvent","resourceVersion":"1.0","name":"","collisionObjectId":null,"eventNum":0,"eventType":0,"isDnD":false,}, + ], + "managed": true, + "overriddenProperties": [], + "parent": { + "name": "dialog", + "path": "folders/dialog.yy", + }, + "parentObjectId": null, + "persistent": false, + "physicsAngularDamping": 0.1, + "physicsDensity": 0.5, + "physicsFriction": 0.2, + "physicsGroup": 1, + "physicsKinematic": false, + "physicsLinearDamping": 0.1, + "physicsObject": false, + "physicsRestitution": 0.1, + "physicsSensor": false, + "physicsShape": 1, + "physicsShapePoints": [], + "physicsStartAwake": true, + "properties": [], + "solid": false, + "spriteId": null, + "spriteMaskId": null, + "visible": true, +} \ No newline at end of file diff --git a/scripts/d3d_group/d3d_group.gml b/scripts/d3d_group/d3d_group.gml index bd8baf6e9..8514103a4 100644 --- a/scripts/d3d_group/d3d_group.gml +++ b/scripts/d3d_group/d3d_group.gml @@ -57,36 +57,38 @@ function __3dGroup() constructor { array_push(objects, _obj); } #endregion - static submit = function(scene = {}, shader = noone) { + static submit = function(scene = {}, shader = noone) { #region transform.submitMatrix(); for( var i = 0, n = array_length(objects); i < n; i++ ) objects[i].submit(scene, shader); transform.clearMatrix(); - } + } #endregion - static submitUI = function(scene = {}, shader = noone) { + static submitUI = function(scene = {}, shader = noone) { #region transform.submitMatrix(); for( var i = 0, n = array_length(objects); i < n; i++ ) objects[i].submitUI(scene, shader); transform.clearMatrix(); - } - static submitSel = function(scene = {}, shader = noone) { + } #endregion + + static submitSel = function(scene = {}, shader = noone) { #region transform.submitMatrix(); for( var i = 0, n = array_length(objects); i < n; i++ ) objects[i].submitSel(scene, shader); transform.clearMatrix(); - } - static submitShader = function(scene = {}, shader = noone) { + } #endregion + + static submitShader = function(scene = {}, shader = noone) { #region transform.submitMatrix(); for( var i = 0, n = array_length(objects); i < n; i++ ) objects[i].submitShader(scene, shader); transform.clearMatrix(); - } + } #endregion - static submitShadow = function(scene = {}, object = noone) { + static submitShadow = function(scene = {}, object = noone) { #region for( var i = 0, n = array_length(objects); i < n; i++ ) objects[i].submitShadow(scene, object); - } + } #endregion static map = function(callback, scene = {}) { #region for( var i = 0, n = array_length(objects); i < n; i++ ) diff --git a/scripts/d3d_object/d3d_object.gml b/scripts/d3d_object/d3d_object.gml index 221d4821c..1c9174e9b 100644 --- a/scripts/d3d_object/d3d_object.gml +++ b/scripts/d3d_object/d3d_object.gml @@ -170,6 +170,8 @@ function __3dObject() constructor { vertex_submit(VB[i], render_type, _tex); } else vertex_submit(VB[i], render_type, _tex); + + //print($"Submit vertex ({scene}) [{VB[i]}]"); } gpu_set_tex_repeat(false); diff --git a/scripts/d3d_scene/d3d_scene.gml b/scripts/d3d_scene/d3d_scene.gml index c1971d8aa..c85fc7085 100644 --- a/scripts/d3d_scene/d3d_scene.gml +++ b/scripts/d3d_scene/d3d_scene.gml @@ -10,7 +10,7 @@ d3_view_camera.projection = CAMERA_PROJECTION.orthograph; d3_view_camera.setMatrix(); - D3D_GLOBAL_PREVIEW = new __3dScene(d3_view_camera); + D3D_GLOBAL_PREVIEW = new __3dScene(d3_view_camera, "Global node preview"); D3D_GLOBAL_PREVIEW.apply_transform = true; D3D_GLOBAL_PREVIEW.defer_normal = false; @@ -323,4 +323,8 @@ function __3dScene(camera, name = "New scene") constructor { return self; } #endregion + + static toString = function() { #region + return $"[3D Scene] {name}"; + } #endregion } \ No newline at end of file diff --git a/scripts/dynaSurf_3d/dynaSurf_3d.gml b/scripts/dynaSurf_3d/dynaSurf_3d.gml index a525f0f13..b9b10418a 100644 --- a/scripts/dynaSurf_3d/dynaSurf_3d.gml +++ b/scripts/dynaSurf_3d/dynaSurf_3d.gml @@ -5,7 +5,7 @@ function dynaSurf_3d() : dynaSurf() constructor { camTarget = new __vec3(); camera_ay = 45; - scene = new __3dScene(camera); + scene = new __3dScene(camera, "Dynamic surf scene"); w = 1; h = 1; diff --git a/scripts/node_3d_scene/node_3d_scene.gml b/scripts/node_3d_scene/node_3d_scene.gml index f62771eef..2a8c82bea 100644 --- a/scripts/node_3d_scene/node_3d_scene.gml +++ b/scripts/node_3d_scene/node_3d_scene.gml @@ -44,9 +44,8 @@ function Node_3D_Scene(_x, _y, _group = noone) : Node_3D(_x, _y, _group) constru for( var i = input_fix_len, n = ds_list_size(inputs); i < n; i += data_length ) { var _obj = _data[i]; - if(!is_instanceof(_obj, __3dObject)) continue; - - _scene.addObject(_obj); + if(is_instanceof(_obj, __3dObject) || is_instanceof(_obj, __3dGroup)) + _scene.addObject(_obj); } return _scene; diff --git a/scripts/panel_preview/panel_preview.gml b/scripts/panel_preview/panel_preview.gml index 93c476a61..94cd63479 100644 --- a/scripts/panel_preview/panel_preview.gml +++ b/scripts/panel_preview/panel_preview.gml @@ -132,7 +132,7 @@ function Panel_Preview() : PanelContent() constructor { #endregion #region scene - d3_scene = new __3dScene(d3_view_camera, "Preview"); + d3_scene = new __3dScene(d3_view_camera, "Preview panel"); d3_scene.lightAmbient = $404040; d3_scene.cull_mode = cull_counterclockwise; d3_scene_preview = d3_scene; @@ -881,11 +881,13 @@ function Panel_Preview() : PanelContent() constructor { d3_scene_preview.apply(d3_deferData); + //print("========= Submit begin ========="); for( var i = 0, n = array_length(_prev_obj); i < n; i++ ) { var _prev = _prev_obj[i]; if(_prev == noone) continue; _prev.submitUI(d3_scene_preview); //////////////// SUBMIT //////////////// } + //print("========= Submit end ========="); gpu_set_cullmode(cull_noculling); surface_reset_target();