mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
1.17.3.001
This commit is contained in:
parent
641efb3868
commit
4567c6d89a
10 changed files with 131 additions and 22 deletions
|
@ -945,6 +945,7 @@
|
|||
{"name":"node_pin","order":2,"path":"scripts/node_pin/node_pin.yy",},
|
||||
{"name":"node_pixel_builder","order":4,"path":"scripts/node_pixel_builder/node_pixel_builder.yy",},
|
||||
{"name":"node_pixel_cloud","order":20,"path":"scripts/node_pixel_cloud/node_pixel_cloud.yy",},
|
||||
{"name":"node_pixel_sampler","order":22,"path":"scripts/node_pixel_sampler/node_pixel_sampler.yy",},
|
||||
{"name":"node_pixel_sort","order":12,"path":"scripts/node_pixel_sort/node_pixel_sort.yy",},
|
||||
{"name":"node_plot_linear","order":5,"path":"scripts/node_plot_linear/node_plot_linear.yy",},
|
||||
{"name":"node_polar","order":4,"path":"scripts/node_polar/node_polar.yy",},
|
||||
|
|
|
@ -1388,6 +1388,7 @@
|
|||
{"id":{"name":"node_pin","path":"scripts/node_pin/node_pin.yy",},},
|
||||
{"id":{"name":"node_pixel_builder","path":"scripts/node_pixel_builder/node_pixel_builder.yy",},},
|
||||
{"id":{"name":"node_pixel_cloud","path":"scripts/node_pixel_cloud/node_pixel_cloud.yy",},},
|
||||
{"id":{"name":"node_pixel_sampler","path":"scripts/node_pixel_sampler/node_pixel_sampler.yy",},},
|
||||
{"id":{"name":"node_pixel_sort","path":"scripts/node_pixel_sort/node_pixel_sort.yy",},},
|
||||
{"id":{"name":"node_plot_linear","path":"scripts/node_plot_linear/node_plot_linear.yy",},},
|
||||
{"id":{"name":"node_polar","path":"scripts/node_polar/node_polar.yy",},},
|
||||
|
|
|
@ -179,42 +179,42 @@ event_inherited();
|
|||
_outputs = res[$ _node.outputNode].outputs;
|
||||
} else {
|
||||
var _new_list = APPEND(_node.path);
|
||||
if(_new_list == noone) return;
|
||||
|
||||
_inputs = ds_list_create();
|
||||
_outputs = ds_list_create();
|
||||
|
||||
var tx = 99999;
|
||||
var ty = 99999;
|
||||
for( var i = 0; i < ds_list_size(_new_list); i++ ) {
|
||||
tx = min(tx, _new_list[| i].x);
|
||||
ty = min(tx, _new_list[| i].y);
|
||||
for( var i = 0; i < array_length(_new_list); i++ ) {
|
||||
tx = min(tx, _new_list[i].x);
|
||||
ty = min(tx, _new_list[i].y);
|
||||
|
||||
if(is_instanceof(context, Node_Collection_Inline) && !is_instanceof(_new_list[| i], Node_Collection_Inline))
|
||||
context.addNode(_new_list[| i]);
|
||||
if(is_instanceof(context, Node_Collection_Inline) && !is_instanceof(_new_list[i], Node_Collection_Inline))
|
||||
context.addNode(_new_list[i]);
|
||||
}
|
||||
|
||||
var shx = tx - node_target_x;
|
||||
var shy = ty - node_target_y;
|
||||
|
||||
for( var i = 0; i < ds_list_size(_new_list); i++ ) {
|
||||
_new_list[| i].x -= shx;
|
||||
_new_list[| i].y -= shy;
|
||||
for( var i = 0; i < array_length(_new_list); i++ ) {
|
||||
_new_list[i].x -= shx;
|
||||
_new_list[i].y -= shy;
|
||||
}
|
||||
|
||||
for( var i = 0; i < ds_list_size(_new_list); i++ ) {
|
||||
var _in = _new_list[| i].inputs;
|
||||
for( var i = 0; i < array_length(_new_list); i++ ) {
|
||||
var _in = _new_list[i].inputs;
|
||||
for( var j = 0; j < ds_list_size(_in); j++ ) {
|
||||
if(_in[| j].value_from == noone)
|
||||
ds_list_add(_inputs, _in[| j]);
|
||||
}
|
||||
|
||||
var _ot = _new_list[| i].outputs;
|
||||
var _ot = _new_list[i].outputs;
|
||||
for( var j = 0; j < ds_list_size(_ot); j++ ) {
|
||||
if(array_empty(_ot[| j].value_to))
|
||||
ds_list_add(_outputs, _ot[| j]);
|
||||
}
|
||||
}
|
||||
|
||||
ds_list_destroy(_new_list);
|
||||
}
|
||||
|
||||
//try to connect
|
||||
|
|
|
@ -177,7 +177,10 @@ function __3dScene(camera, name = "New scene") constructor {
|
|||
} #endregion
|
||||
|
||||
static ssaoPass = function(deferData) { #region
|
||||
if(!ssao_enabled) return;
|
||||
if(!ssao_enabled) {
|
||||
surface_free(deferData.ssao);
|
||||
return;
|
||||
}
|
||||
|
||||
var _sw = surface_get_width_safe(deferData.geometry_data[0]);
|
||||
var _sh = surface_get_height_safe(deferData.geometry_data[0]);
|
||||
|
@ -196,6 +199,7 @@ function __3dScene(camera, name = "New scene") constructor {
|
|||
surface_reset_shader();
|
||||
|
||||
deferData.ssao = surface_verify(deferData.ssao, _sw, _sh);
|
||||
|
||||
surface_set_shader(deferData.ssao, sh_d3d_ssao_blur);
|
||||
shader_set_f("dimension", _sw, _sh);
|
||||
shader_set_surface("vNormal", deferData.geometry_data[2]);
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
LATEST_VERSION = 11700;
|
||||
VERSION = 11730;
|
||||
SAVE_VERSION = 11700;
|
||||
VERSION_STRING = "1.17.3.0";
|
||||
VERSION_STRING = "1.17.3.001";
|
||||
BUILD_NUMBER = 11730;
|
||||
|
||||
globalvar HOTKEYS, HOTKEY_CONTEXT;
|
||||
|
|
12
scripts/node_pixel_sampler/node_checkerboard.yy
Normal file
12
scripts/node_pixel_sampler/node_checkerboard.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/nodes/data/generator.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_checkerboard",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
58
scripts/node_pixel_sampler/node_pixel_sampler.gml
Normal file
58
scripts/node_pixel_sampler/node_pixel_sampler.gml
Normal file
|
@ -0,0 +1,58 @@
|
|||
function Node_Pixel_Sampler(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) constructor {
|
||||
name = "Pixel Sampler";
|
||||
|
||||
inputs[| 0] = nodeValue("Base Texture", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone );
|
||||
|
||||
inputs[| 1] = nodeValue("Color", self, JUNCTION_CONNECT.input, VALUE_TYPE.color, cola(c_white));
|
||||
|
||||
inputs[| 2] = nodeValue("Empty", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, false);
|
||||
|
||||
inputs[| 3] = nodeValue("Mask", self, JUNCTION_CONNECT.input, VALUE_TYPE.surface, noone);
|
||||
|
||||
inputs[| 4] = nodeValue("Use mask dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.boolean, true);
|
||||
|
||||
outputs[| 0] = nodeValue("Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, noone);
|
||||
|
||||
input_display_list = [
|
||||
["Surfaces", false], 0, 3, 4,
|
||||
["Solid", false], 1, 2,
|
||||
];
|
||||
|
||||
attribute_surface_depth();
|
||||
|
||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
||||
var _dim = _data[0];
|
||||
var _col = _data[1];
|
||||
var _emp = _data[2];
|
||||
var _msk = _data[3];
|
||||
var _msd = _data[4];
|
||||
|
||||
var _maskUse = is_surface(_msk);
|
||||
|
||||
inputs[| 4].setVisible(_maskUse);
|
||||
if(_maskUse && _msd) _dim = [ surface_get_width_safe(_msk), surface_get_height_safe(_msk) ];
|
||||
|
||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||
|
||||
if(_emp) {
|
||||
surface_set_target(_outSurf);
|
||||
DRAW_CLEAR
|
||||
surface_reset_target();
|
||||
return _outSurf;
|
||||
}
|
||||
|
||||
if(_maskUse) {
|
||||
surface_set_shader(_outSurf, sh_solid);
|
||||
draw_surface_stretched_ext(_msk, 0, 0, _dim[0], _dim[1], _col, _color_get_alpha(_col));
|
||||
surface_reset_shader();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
|
||||
surface_set_target(_outSurf);
|
||||
draw_clear(_col);
|
||||
surface_reset_target();
|
||||
|
||||
return _outSurf;
|
||||
}
|
||||
}
|
13
scripts/node_pixel_sampler/node_pixel_sampler.yy
Normal file
13
scripts/node_pixel_sampler/node_pixel_sampler.yy
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"$GMScript":"",
|
||||
"%Name":"node_pixel_sampler",
|
||||
"isCompatibility":false,
|
||||
"isDnD":false,
|
||||
"name":"node_pixel_sampler",
|
||||
"parent":{
|
||||
"name":"generator",
|
||||
"path":"folders/nodes/data/generator.yy",
|
||||
},
|
||||
"resourceType":"GMScript",
|
||||
"resourceVersion":"2.0",
|
||||
}
|
12
scripts/node_pixel_sampler/node_stripe.yy
Normal file
12
scripts/node_pixel_sampler/node_stripe.yy
Normal file
|
@ -0,0 +1,12 @@
|
|||
{
|
||||
"isDnD": false,
|
||||
"isCompatibility": false,
|
||||
"parent": {
|
||||
"name": "generator",
|
||||
"path": "folders/nodes/data/generator.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "node_stripe",
|
||||
"tags": [],
|
||||
"resourceType": "GMScript",
|
||||
}
|
|
@ -7,6 +7,7 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
|
||||
inputs[| 0] = nodeValue("Vector", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setArrayDynamic()
|
||||
.setVisible(true, true);
|
||||
|
||||
outputs[| 0] = nodeValue("x", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
|
||||
|
@ -14,8 +15,9 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
outputs[| 2] = nodeValue("z", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
|
||||
outputs[| 3] = nodeValue("w", self, JUNCTION_CONNECT.output, VALUE_TYPE.float, 0);
|
||||
|
||||
static step = function() { #region
|
||||
static step = function() {
|
||||
if(inputs[| 0].value_from == noone) return;
|
||||
|
||||
var type = VALUE_TYPE.float;
|
||||
if(inputs[| 0].value_from.type == VALUE_TYPE.integer)
|
||||
type = VALUE_TYPE.integer;
|
||||
|
@ -23,13 +25,19 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
inputs[| 0].setType(type);
|
||||
for( var i = 0; i < 4; i++ )
|
||||
outputs[| i].setType(type);
|
||||
} #endregion
|
||||
}
|
||||
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) { #region
|
||||
return array_safe_get_fast(_data[0], _output_index);
|
||||
} #endregion
|
||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||
var _arr = _data[0];
|
||||
if(!is_array(_arr)) return _arr;
|
||||
|
||||
if(_output_index < array_length(_arr))
|
||||
return _arr[_output_index];
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||
draw_set_text(f_sdf, fa_center, fa_center, COLORS._main_text);
|
||||
var str = "";
|
||||
for( var i = 0; i < 4; i++ )
|
||||
|
@ -39,5 +47,5 @@ function Node_Vector_Split(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
|||
var bbox = drawGetBbox(xx, yy, _s);
|
||||
var ss = string_scale(str, bbox.w, bbox.h);
|
||||
draw_text_transformed(bbox.xc, bbox.yc, str, ss, ss, 0);
|
||||
} #endregion
|
||||
}
|
||||
} #endregion
|
Loading…
Reference in a new issue