mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-24 03:48:06 +01:00
1.17.11
This commit is contained in:
parent
0f57d13ca0
commit
33a7cd02ed
32 changed files with 417 additions and 184 deletions
|
@ -1057,6 +1057,7 @@
|
||||||
{"name":"node_registry","order":9,"path":"scripts/node_registry/node_registry.yy",},
|
{"name":"node_registry","order":9,"path":"scripts/node_registry/node_registry.yy",},
|
||||||
{"name":"node_repeat_texture","order":23,"path":"scripts/node_repeat_texture/node_repeat_texture.yy",},
|
{"name":"node_repeat_texture","order":23,"path":"scripts/node_repeat_texture/node_repeat_texture.yy",},
|
||||||
{"name":"node_repeat","order":5,"path":"scripts/node_repeat/node_repeat.yy",},
|
{"name":"node_repeat","order":5,"path":"scripts/node_repeat/node_repeat.yy",},
|
||||||
|
{"name":"node_revert","order":29,"path":"scripts/node_revert/node_revert.yy",},
|
||||||
{"name":"node_rigid_activate","order":1,"path":"scripts/node_rigid_activate/node_rigid_activate.yy",},
|
{"name":"node_rigid_activate","order":1,"path":"scripts/node_rigid_activate/node_rigid_activate.yy",},
|
||||||
{"name":"node_rigid_force_apply","order":2,"path":"scripts/node_rigid_force_apply/node_rigid_force_apply.yy",},
|
{"name":"node_rigid_force_apply","order":2,"path":"scripts/node_rigid_force_apply/node_rigid_force_apply.yy",},
|
||||||
{"name":"node_rigid_global","order":3,"path":"scripts/node_rigid_global/node_rigid_global.yy",},
|
{"name":"node_rigid_global","order":3,"path":"scripts/node_rigid_global/node_rigid_global.yy",},
|
||||||
|
@ -2386,6 +2387,7 @@
|
||||||
{"name":"s_node_repeat","order":23,"path":"sprites/s_node_repeat/s_node_repeat.yy",},
|
{"name":"s_node_repeat","order":23,"path":"sprites/s_node_repeat/s_node_repeat.yy",},
|
||||||
{"name":"s_node_replace_palette","order":44,"path":"sprites/s_node_replace_palette/s_node_replace_palette.yy",},
|
{"name":"s_node_replace_palette","order":44,"path":"sprites/s_node_replace_palette/s_node_replace_palette.yy",},
|
||||||
{"name":"s_node_resize","order":139,"path":"sprites/s_node_resize/s_node_resize.yy",},
|
{"name":"s_node_resize","order":139,"path":"sprites/s_node_resize/s_node_resize.yy",},
|
||||||
|
{"name":"s_node_revert","order":12,"path":"sprites/s_node_revert/s_node_revert.yy",},
|
||||||
{"name":"s_node_RGB_combine","order":46,"path":"sprites/s_node_RGB_combine/s_node_RGB_combine.yy",},
|
{"name":"s_node_RGB_combine","order":46,"path":"sprites/s_node_RGB_combine/s_node_RGB_combine.yy",},
|
||||||
{"name":"s_node_RGB","order":45,"path":"sprites/s_node_RGB/s_node_RGB.yy",},
|
{"name":"s_node_RGB","order":45,"path":"sprites/s_node_RGB/s_node_RGB.yy",},
|
||||||
{"name":"s_node_rigid_override","order":9,"path":"sprites/s_node_rigid_override/s_node_rigid_override.yy",},
|
{"name":"s_node_rigid_override","order":9,"path":"sprites/s_node_rigid_override/s_node_rigid_override.yy",},
|
||||||
|
|
|
@ -1645,6 +1645,7 @@
|
||||||
{"id":{"name":"node_render_sprite_sheet","path":"scripts/node_render_sprite_sheet/node_render_sprite_sheet.yy",},},
|
{"id":{"name":"node_render_sprite_sheet","path":"scripts/node_render_sprite_sheet/node_render_sprite_sheet.yy",},},
|
||||||
{"id":{"name":"node_repeat_texture","path":"scripts/node_repeat_texture/node_repeat_texture.yy",},},
|
{"id":{"name":"node_repeat_texture","path":"scripts/node_repeat_texture/node_repeat_texture.yy",},},
|
||||||
{"id":{"name":"node_repeat","path":"scripts/node_repeat/node_repeat.yy",},},
|
{"id":{"name":"node_repeat","path":"scripts/node_repeat/node_repeat.yy",},},
|
||||||
|
{"id":{"name":"node_revert","path":"scripts/node_revert/node_revert.yy",},},
|
||||||
{"id":{"name":"node_rgb_channel","path":"scripts/node_rgb_channel/node_rgb_channel.yy",},},
|
{"id":{"name":"node_rgb_channel","path":"scripts/node_rgb_channel/node_rgb_channel.yy",},},
|
||||||
{"id":{"name":"node_rigid_activate","path":"scripts/node_rigid_activate/node_rigid_activate.yy",},},
|
{"id":{"name":"node_rigid_activate","path":"scripts/node_rigid_activate/node_rigid_activate.yy",},},
|
||||||
{"id":{"name":"node_rigid_force_apply","path":"scripts/node_rigid_force_apply/node_rigid_force_apply.yy",},},
|
{"id":{"name":"node_rigid_force_apply","path":"scripts/node_rigid_force_apply/node_rigid_force_apply.yy",},},
|
||||||
|
@ -3124,6 +3125,7 @@
|
||||||
{"id":{"name":"s_node_repeat","path":"sprites/s_node_repeat/s_node_repeat.yy",},},
|
{"id":{"name":"s_node_repeat","path":"sprites/s_node_repeat/s_node_repeat.yy",},},
|
||||||
{"id":{"name":"s_node_replace_palette","path":"sprites/s_node_replace_palette/s_node_replace_palette.yy",},},
|
{"id":{"name":"s_node_replace_palette","path":"sprites/s_node_replace_palette/s_node_replace_palette.yy",},},
|
||||||
{"id":{"name":"s_node_resize","path":"sprites/s_node_resize/s_node_resize.yy",},},
|
{"id":{"name":"s_node_resize","path":"sprites/s_node_resize/s_node_resize.yy",},},
|
||||||
|
{"id":{"name":"s_node_revert","path":"sprites/s_node_revert/s_node_revert.yy",},},
|
||||||
{"id":{"name":"s_node_RGB_combine","path":"sprites/s_node_RGB_combine/s_node_RGB_combine.yy",},},
|
{"id":{"name":"s_node_RGB_combine","path":"sprites/s_node_RGB_combine/s_node_RGB_combine.yy",},},
|
||||||
{"id":{"name":"s_node_RGB","path":"sprites/s_node_RGB/s_node_RGB.yy",},},
|
{"id":{"name":"s_node_RGB","path":"sprites/s_node_RGB/s_node_RGB.yy",},},
|
||||||
{"id":{"name":"s_node_rigid_override","path":"sprites/s_node_rigid_override/s_node_rigid_override.yy",},},
|
{"id":{"name":"s_node_rigid_override","path":"sprites/s_node_rigid_override/s_node_rigid_override.yy",},},
|
||||||
|
|
|
@ -87,6 +87,7 @@ function __part(_node) : __particleObject() constructor {
|
||||||
scy_history = [];
|
scy_history = [];
|
||||||
|
|
||||||
follow = false;
|
follow = false;
|
||||||
|
rot_base = 0;
|
||||||
rot_s = 0;
|
rot_s = 0;
|
||||||
|
|
||||||
path = noone;
|
path = noone;
|
||||||
|
@ -131,16 +132,16 @@ function __part(_node) : __particleObject() constructor {
|
||||||
|
|
||||||
frame = 0;
|
frame = 0;
|
||||||
|
|
||||||
static reset = function() { #region
|
static reset = function() {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
surf = noone;
|
surf = noone;
|
||||||
|
|
||||||
prevx = undefined;
|
prevx = undefined;
|
||||||
prevy = undefined;
|
prevy = undefined;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static create = function(_surf, _x, _y, _life) { #region
|
static create = function(_surf, _x, _y, _life) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
active = true;
|
active = true;
|
||||||
|
@ -165,9 +166,9 @@ function __part(_node) : __particleObject() constructor {
|
||||||
scy_history = array_create(life);
|
scy_history = array_create(life);
|
||||||
blend_history = array_create(life);
|
blend_history = array_create(life);
|
||||||
alp_history = array_create(life);
|
alp_history = array_create(life);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) { #region
|
static setPhysic = function(_sx, _sy, _ac, _g, _gDir, _turn, _turnSpd) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
speedx = _sx;
|
speedx = _sx;
|
||||||
|
@ -183,9 +184,9 @@ function __part(_node) : __particleObject() constructor {
|
||||||
|
|
||||||
spVec[0] = point_distance(0, 0, speedx, speedy);
|
spVec[0] = point_distance(0, 0, speedx, speedy);
|
||||||
spVec[1] = point_direction(0, 0, speedx, speedy);
|
spVec[1] = point_direction(0, 0, speedx, speedy);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setWiggle = function(wiggle_maps) { #region
|
static setWiggle = function(wiggle_maps) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
wig_psx = wiggle_maps.wig_psx;
|
wig_psx = wiggle_maps.wig_psx;
|
||||||
|
@ -194,30 +195,31 @@ function __part(_node) : __particleObject() constructor {
|
||||||
wig_scx = wiggle_maps.wig_scx;
|
wig_scx = wiggle_maps.wig_scx;
|
||||||
wig_scy = wiggle_maps.wig_scy;
|
wig_scy = wiggle_maps.wig_scy;
|
||||||
wig_dir = wiggle_maps.wig_dir;
|
wig_dir = wiggle_maps.wig_dir;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setGround = function(_ground, _ground_offset, _ground_bounce, _ground_frict) { #region
|
static setGround = function(_ground, _ground_offset, _ground_bounce, _ground_frict) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
ground = _ground;
|
ground = _ground;
|
||||||
ground_y = y + _ground_offset;
|
ground_y = y + _ground_offset;
|
||||||
ground_bounce = _ground_bounce;
|
ground_bounce = _ground_bounce;
|
||||||
ground_friction = clamp(1 - _ground_frict, 0, 1);
|
ground_friction = clamp(1 - _ground_frict, 0, 1);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) { #region
|
static setTransform = function(_scx, _scy, _sct, _rot, _rots, _follow) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
sc_sx = _scx;
|
sc_sx = _scx;
|
||||||
sc_sy = _scy;
|
sc_sy = _scy;
|
||||||
sct = _sct;
|
sct = _sct;
|
||||||
|
|
||||||
|
rot_base = _rot;
|
||||||
rot = _rot;
|
rot = _rot;
|
||||||
rot_s = _rots;
|
rot_s = _rots;
|
||||||
follow = _follow;
|
follow = _follow;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setDraw = function(_col, _blend, _alp, _fade) { #region
|
static setDraw = function(_col, _blend, _alp, _fade) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
col = _col;
|
col = _col;
|
||||||
|
@ -225,24 +227,24 @@ function __part(_node) : __particleObject() constructor {
|
||||||
alp = _alp;
|
alp = _alp;
|
||||||
alp_draw = _alp;
|
alp_draw = _alp;
|
||||||
alp_fade = _fade;
|
alp_fade = _fade;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static setPath = function(_path, _pathDiv) { #region
|
static setPath = function(_path, _pathDiv) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
path = _path;
|
path = _path;
|
||||||
pathDiv = _pathDiv;
|
pathDiv = _pathDiv;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static kill = function(callDestroy = true) { #region
|
static kill = function(callDestroy = true) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
active = false;
|
active = false;
|
||||||
if(callDestroy && node.onPartDestroy != noone)
|
if(callDestroy && node.onPartDestroy != noone)
|
||||||
node.onPartDestroy(self);
|
node.onPartDestroy(self);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static step = function(frame = 0) { #region
|
static step = function(frame = 0) {
|
||||||
INLINE
|
INLINE
|
||||||
trailLife++;
|
trailLife++;
|
||||||
|
|
||||||
|
@ -281,8 +283,10 @@ function __part(_node) : __particleObject() constructor {
|
||||||
speedx = lengthdir_x(diss, dirr) + gravX;
|
speedx = lengthdir_x(diss, dirr) + gravX;
|
||||||
speedy = lengthdir_y(diss, dirr) + gravY;
|
speedy = lengthdir_y(diss, dirr) + gravY;
|
||||||
|
|
||||||
if(follow) rot = spVec[1];
|
rot_base += rot_s;
|
||||||
else rot += rot_s;
|
|
||||||
|
if(follow) rot = spVec[1] + rot_base;
|
||||||
|
else rot = rot_base;
|
||||||
|
|
||||||
if(node.onPartStep != noone && step_int > 0 && safe_mod(life, step_int) == 0)
|
if(node.onPartStep != noone && step_int > 0 && safe_mod(life, step_int) == 0)
|
||||||
node.onPartStep(self);
|
node.onPartStep(self);
|
||||||
|
@ -291,6 +295,7 @@ function __part(_node) : __particleObject() constructor {
|
||||||
|
|
||||||
if(prevx != undefined) {
|
if(prevx != undefined) {
|
||||||
spVec[0] = point_distance(prevx, prevy, x, y);
|
spVec[0] = point_distance(prevx, prevy, x, y);
|
||||||
|
if(spVec[0] > 1)
|
||||||
spVec[1] = point_direction(prevx, prevy, x, y);
|
spVec[1] = point_direction(prevx, prevy, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,9 +317,9 @@ function __part(_node) : __particleObject() constructor {
|
||||||
drawrot += wig_rot.get(seed + life);
|
drawrot += wig_rot.get(seed + life);
|
||||||
drawsx += wig_scy.get(seed + life);
|
drawsx += wig_scy.get(seed + life);
|
||||||
drawsy += wig_scy.get(seed + life);
|
drawsy += wig_scy.get(seed + life);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static draw = function(exact, surf_w, surf_h) { #region
|
static draw = function(exact, surf_w, surf_h) {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
if(render_type == PARTICLE_RENDER_TYPE.line) {
|
if(render_type == PARTICLE_RENDER_TYPE.line) {
|
||||||
|
@ -462,19 +467,18 @@ function __part(_node) : __particleObject() constructor {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static getPivot = function() { #region
|
static getPivot = function() {
|
||||||
INLINE
|
INLINE
|
||||||
|
|
||||||
return [x, y];
|
return [x, y];
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static clone = function() { #region
|
static clone = function() {
|
||||||
var _p = new __part(node);
|
var _p = new __part(node);
|
||||||
struct_override(_p, self);
|
struct_override(_p, self);
|
||||||
return _p;
|
return _p;
|
||||||
} #endregion
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region helper
|
#region helper
|
||||||
|
|
|
@ -115,6 +115,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
newInput(49, nodeValue_Bool("Stretch Animation", self, false ));
|
newInput(49, nodeValue_Bool("Stretch Animation", self, false ));
|
||||||
|
|
||||||
|
newInput(50, nodeValue_Palette("Color by Index", self, [ cola(c_white) ] ));
|
||||||
|
|
||||||
for (var i = 2, n = array_length(inputs); i < n; i++)
|
for (var i = 2, n = array_length(inputs); i < n; i++)
|
||||||
inputs[i].rejectArray();
|
inputs[i].rejectArray();
|
||||||
|
|
||||||
|
@ -130,7 +132,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
["Rotation", true], 15, 8, 9,
|
["Rotation", true], 15, 8, 9,
|
||||||
["Scale", true], 10, 17, 11,
|
["Scale", true], 10, 17, 11,
|
||||||
["Wiggles", true], 20, 41, 42, 43,
|
["Wiggles", true], 20, 41, 42, 43,
|
||||||
["Color", true], 12, 28, 13, 14,
|
["Color", true], 12, 28, 50, 13, 14,
|
||||||
["Render", true], 21,
|
["Render", true], 21,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -142,6 +144,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
parts_runner = 0;
|
parts_runner = 0;
|
||||||
|
|
||||||
seed = 0;
|
seed = 0;
|
||||||
|
spawn_index_raw = 0;
|
||||||
spawn_index = 0;
|
spawn_index = 0;
|
||||||
scatter_index = 0;
|
scatter_index = 0;
|
||||||
def_surface = -1;
|
def_surface = -1;
|
||||||
|
@ -194,6 +197,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
var _color = getInputData(12);
|
var _color = getInputData(12);
|
||||||
var _blend = getInputData(28);
|
var _blend = getInputData(28);
|
||||||
|
var _color_idx = getInputData(50);
|
||||||
|
var _color_idx_len = array_length(_color_idx);
|
||||||
var _alpha = getInputData(13);
|
var _alpha = getInputData(13);
|
||||||
|
|
||||||
var _arr_type = getInputData(22);
|
var _arr_type = getInputData(22);
|
||||||
|
@ -212,7 +217,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
if(array_empty(_inSurf)) return;
|
if(array_empty(_inSurf)) return;
|
||||||
|
|
||||||
random_set_seed(seed); seed++;
|
random_set_seed(seed); seed += 1000;
|
||||||
var _amo = irandom_range(_spawn_amount[0], _spawn_amount[1]);
|
var _amo = irandom_range(_spawn_amount[0], _spawn_amount[1]);
|
||||||
if(_distrib == 2) _posDist = get_points_from_dist(_dist_map, _amo, seed);
|
if(_distrib == 2) _posDist = get_points_from_dist(_dist_map, _amo, seed);
|
||||||
|
|
||||||
|
@ -247,10 +252,12 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
xx = _spawn_area[0] + _spr.x + _spr.w / 2;
|
xx = _spawn_area[0] + _spr.x + _spr.w / 2;
|
||||||
yy = _spawn_area[1] + _spr.y + _spr.h / 2;
|
yy = _spawn_area[1] + _spr.y + _spr.h / 2;
|
||||||
part.atlas = _spr;
|
part.atlas = _spr;
|
||||||
|
|
||||||
} else if(_distrib < 2) {
|
} else if(_distrib < 2) {
|
||||||
var sp = area_get_random_point(_spawn_area, _distrib, _scatter, spawn_index, _amo);
|
var sp = area_get_random_point(_spawn_area, _distrib, _scatter, spawn_index, _amo);
|
||||||
xx = sp[0];
|
xx = sp[0];
|
||||||
yy = sp[1];
|
yy = sp[1];
|
||||||
|
|
||||||
} else if(_distrib == 2) {
|
} else if(_distrib == 2) {
|
||||||
var sp = array_safe_get_fast(_posDist, i);
|
var sp = array_safe_get_fast(_posDist, i);
|
||||||
if(!is_array(sp)) continue;
|
if(!is_array(sp)) continue;
|
||||||
|
@ -258,6 +265,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
xx = _spawn_area[0] + _spawn_area[2] * (sp[0] * 2 - 1.);
|
xx = _spawn_area[0] + _spawn_area[2] * (sp[0] * 2 - 1.);
|
||||||
yy = _spawn_area[1] + _spawn_area[3] * (sp[1] * 2 - 1.);
|
yy = _spawn_area[1] + _spawn_area[3] * (sp[1] * 2 - 1.);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
xx = _pos[0];
|
xx = _pos[0];
|
||||||
yy = _pos[1];
|
yy = _pos[1];
|
||||||
|
@ -268,7 +276,8 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
var _rot = angle_random_eval(_rotation);
|
var _rot = angle_random_eval(_rotation);
|
||||||
var _rot_spd = random_range(_rotation_speed[0], _rotation_speed[1]);
|
var _rot_spd = random_range(_rotation_speed[0], _rotation_speed[1]);
|
||||||
|
|
||||||
var _dirr = _directCenter? point_direction(_spawn_area[0], _spawn_area[1], xx, yy) : angle_random_eval(_direction);
|
var _dirRand = angle_random_eval(_direction);
|
||||||
|
var _dirr = _directCenter? point_direction(_spawn_area[0], _spawn_area[1], xx, yy) + _dirRand : _dirRand;
|
||||||
|
|
||||||
var _velo = random_range(_velocity[0], _velocity[1]);
|
var _velo = random_range(_velocity[0], _velocity[1]);
|
||||||
var _vx = lengthdir_x(_velo, _dirr);
|
var _vx = lengthdir_x(_velo, _dirr);
|
||||||
|
@ -282,6 +291,9 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
var _alp = random_range(_alpha[0], _alpha[1]);
|
var _alp = random_range(_alpha[0], _alpha[1]);
|
||||||
var _bld = _blend.eval(random(1));
|
var _bld = _blend.eval(random(1));
|
||||||
|
|
||||||
|
var _clr_ind = array_safe_get(_color_idx, safe_mod(spawn_index, _color_idx_len), cola(c_white));
|
||||||
|
_bld = colorMultiply(_bld, _clr_ind);
|
||||||
|
|
||||||
part.seed = irandom_range(100000, 999999);
|
part.seed = irandom_range(100000, 999999);
|
||||||
part.create(_spr, xx, yy, _lif);
|
part.create(_spr, xx, yy, _lif);
|
||||||
part.anim_speed = random_range(_anim_speed[0], _anim_speed[1]);
|
part.anim_speed = random_range(_anim_speed[0], _anim_speed[1]);
|
||||||
|
@ -305,6 +317,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
onSpawn(_time, part);
|
onSpawn(_time, part);
|
||||||
|
|
||||||
parts_runner = safe_mod(parts_runner + 1, attributes.part_amount);
|
parts_runner = safe_mod(parts_runner + 1, attributes.part_amount);
|
||||||
|
spawn_index_raw++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -344,6 +357,7 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
surface_cache = {};
|
surface_cache = {};
|
||||||
getSurfaceCache();
|
getSurfaceCache();
|
||||||
|
|
||||||
|
spawn_index_raw = 0;
|
||||||
spawn_index = 0;
|
spawn_index = 0;
|
||||||
scatter_index = 0;
|
scatter_index = 0;
|
||||||
|
|
||||||
|
@ -433,13 +447,10 @@ function Node_VFX_Spawner_Base(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
var _inSurf = getInputData(0);
|
var _inSurf = getInputData(0);
|
||||||
var _dist = getInputData(4);
|
var _dist = getInputData(4);
|
||||||
var _scatt = getInputData(24);
|
var _scatt = getInputData(24);
|
||||||
var _dirAng = getInputData(29);
|
|
||||||
var _turn = getInputData(34);
|
var _turn = getInputData(34);
|
||||||
var _spwTyp = getInputData(16);
|
var _spwTyp = getInputData(16);
|
||||||
var _usePth = getInputData(45);
|
var _usePth = getInputData(45);
|
||||||
|
|
||||||
inputs[ 6].setVisible(!_dirAng);
|
|
||||||
|
|
||||||
inputs[24].setVisible(_dist < 2);
|
inputs[24].setVisible(_dist < 2);
|
||||||
|
|
||||||
inputs[30].setVisible(_dist == 2, _dist == 2);
|
inputs[30].setVisible(_dist == 2, _dist == 2);
|
||||||
|
|
|
@ -22,10 +22,13 @@ function area_get_random_point(area, distrib = AREA_DISTRIBUTION.area, scatter =
|
||||||
var _area_t = array_safe_get_fast(area, 4);
|
var _area_t = array_safe_get_fast(area, 4);
|
||||||
var xx = 0, yy = 0;
|
var xx = 0, yy = 0;
|
||||||
|
|
||||||
|
index = safe_mod(index, total);
|
||||||
|
|
||||||
switch(distrib) {
|
switch(distrib) {
|
||||||
case AREA_DISTRIBUTION.area :
|
case AREA_DISTRIBUTION.area :
|
||||||
if(scatter == AREA_SCATTER.uniform) {
|
if(scatter == AREA_SCATTER.uniform) {
|
||||||
if(_area_t == AREA_SHAPE.rectangle) {
|
if(_area_t == AREA_SHAPE.rectangle) {
|
||||||
|
|
||||||
var _col = ceil(sqrt(total));
|
var _col = ceil(sqrt(total));
|
||||||
var _row = ceil(total / _col);
|
var _row = ceil(total / _col);
|
||||||
|
|
||||||
|
@ -37,6 +40,9 @@ function area_get_random_point(area, distrib = AREA_DISTRIBUTION.area, scatter =
|
||||||
|
|
||||||
xx = _area_x - _area_w + (_icol + 0.5) * _iwid;
|
xx = _area_x - _area_w + (_icol + 0.5) * _iwid;
|
||||||
yy = _area_y - _area_h + (_irow + 0.5) * _ihig;
|
yy = _area_y - _area_h + (_irow + 0.5) * _ihig;
|
||||||
|
|
||||||
|
//print($"{yy} = {_area_y} - {_area_h} + ({_irow} + 0.5) * {_ihig}")
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(index == 0) {
|
if(index == 0) {
|
||||||
xx = _area_x;
|
xx = _area_x;
|
||||||
|
@ -61,10 +67,12 @@ function area_get_random_point(area, distrib = AREA_DISTRIBUTION.area, scatter =
|
||||||
xx = _area_x + lengthdir_x(_sr, _sa);
|
xx = _area_x + lengthdir_x(_sr, _sa);
|
||||||
yy = _area_y + lengthdir_y(_sr, _sa) / _a;
|
yy = _area_y + lengthdir_y(_sr, _sa) / _a;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(scatter == AREA_SCATTER.random) {
|
} else if(scatter == AREA_SCATTER.random) {
|
||||||
if(_area_t == AREA_SHAPE.rectangle) {
|
if(_area_t == AREA_SHAPE.rectangle) {
|
||||||
xx = _area_x + random_range(-_area_w, _area_w);
|
xx = _area_x + random_range(-_area_w, _area_w);
|
||||||
yy = _area_y + random_range(-_area_h, _area_h);
|
yy = _area_y + random_range(-_area_h, _area_h);
|
||||||
|
|
||||||
} else if(_area_t == AREA_SHAPE.elipse) {
|
} else if(_area_t == AREA_SHAPE.elipse) {
|
||||||
var rr = random(360);
|
var rr = random(360);
|
||||||
xx = _area_x + lengthdir_x(1, rr) * random(_area_w);
|
xx = _area_x + lengthdir_x(1, rr) * random(_area_w);
|
||||||
|
@ -109,6 +117,7 @@ function area_get_random_point(area, distrib = AREA_DISTRIBUTION.area, scatter =
|
||||||
xx = _area_x + lengthdir_x(_area_w, rr);
|
xx = _area_x + lengthdir_x(_area_w, rr);
|
||||||
yy = _area_y + lengthdir_y(_area_h, rr);
|
yy = _area_y + lengthdir_y(_area_h, rr);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(scatter == AREA_SCATTER.random) {
|
} else if(scatter == AREA_SCATTER.random) {
|
||||||
if(_area_t == AREA_SHAPE.rectangle) {
|
if(_area_t == AREA_SHAPE.rectangle) {
|
||||||
var perimeter = _area_w * 2 + _area_h * 2;
|
var perimeter = _area_w * 2 + _area_h * 2;
|
||||||
|
@ -126,6 +135,7 @@ function area_get_random_point(area, distrib = AREA_DISTRIBUTION.area, scatter =
|
||||||
xx = _area_x + _area_w;
|
xx = _area_x + _area_w;
|
||||||
yy = _area_y + random_range(-_area_h, _area_h);
|
yy = _area_y + random_range(-_area_h, _area_h);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if(_area_t == AREA_SHAPE.elipse) {
|
} else if(_area_t == AREA_SHAPE.elipse) {
|
||||||
var rr = random(360);
|
var rr = random(360);
|
||||||
xx = _area_x + lengthdir_x(_area_w, rr);
|
xx = _area_x + lengthdir_x(_area_w, rr);
|
||||||
|
|
|
@ -19,11 +19,15 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
newInput(6, nodeValue_Int("Seed", self, seed_random(6)))
|
newInput(6, nodeValue_Int("Seed", self, seed_random(6)))
|
||||||
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[6].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) });
|
||||||
|
|
||||||
|
newInput(7, nodeValue_Bool("Loop", self, false));
|
||||||
|
|
||||||
|
newInput(8, nodeValue_Enum_Scroll("Blend Mode", self, 0, [ "Normal", "Alpha", "Additive" ]));
|
||||||
|
|
||||||
outputs[0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
outputs[0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 0,
|
input_display_list = [ 0,
|
||||||
["Delay", false], 1, 2,
|
["Delay", false], 1, 2,
|
||||||
["Render", false], 3, 5, 6, 4,
|
["Render", false], 3, 5, 6, 4, 7, 8,
|
||||||
];
|
];
|
||||||
|
|
||||||
insp2UpdateTooltip = "Clear cache";
|
insp2UpdateTooltip = "Clear cache";
|
||||||
|
@ -45,6 +49,8 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
var _alpC = getInputData(4);
|
var _alpC = getInputData(4);
|
||||||
var _psel = getInputData(5);
|
var _psel = getInputData(5);
|
||||||
var _seed = getInputData(6);
|
var _seed = getInputData(6);
|
||||||
|
var _loop = getInputData(7);
|
||||||
|
var _blnd = getInputData(8);
|
||||||
|
|
||||||
cacheCurrentFrame(_surf);
|
cacheCurrentFrame(_surf);
|
||||||
|
|
||||||
|
@ -62,8 +68,16 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
surface_set_target(_outSurf);
|
surface_set_target(_outSurf);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
||||||
|
switch(_blnd) {
|
||||||
|
case 0 : BLEND_NORMAL; break;
|
||||||
|
case 1 : BLEND_ALPHA; break;
|
||||||
|
case 2 : BLEND_ADD; break;
|
||||||
|
}
|
||||||
|
|
||||||
for( var i = _amo - 1; i >= 0; i-- ) {
|
for( var i = _amo - 1; i >= 0; i-- ) {
|
||||||
var _ff = CURRENT_FRAME - i * _frm;
|
var _ff = CURRENT_FRAME - i * _frm;
|
||||||
|
if(_loop) _ff = (_ff + TOTAL_FRAMES) % TOTAL_FRAMES;
|
||||||
|
|
||||||
var _s = array_safe_get_fast(cached_output, _ff);
|
var _s = array_safe_get_fast(cached_output, _ff);
|
||||||
if(!is_surface(_s)) continue;
|
if(!is_surface(_s)) continue;
|
||||||
|
|
||||||
|
@ -77,6 +91,8 @@ function Node_MK_Delay_Machine(_x, _y, _group = noone) : Node(_x, _y, _group) co
|
||||||
|
|
||||||
draw_surface_ext(_s, 0, 0, 1, 1, 0, cc, aa);
|
draw_surface_ext(_s, 0, 0, 1, 1, 0, cc, aa);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
outputs[0].setValue(_outSurf);
|
outputs[0].setValue(_outSurf);
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) constructor {
|
function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y, _group) constructor {
|
||||||
name = "Transform 3D";
|
name = "Transform 3D";
|
||||||
batch_output = false;
|
|
||||||
|
|
||||||
preview_channel = 1;
|
preview_channel = 1;
|
||||||
object = new __3dPlane();
|
object = new __3dPlane();
|
||||||
|
@ -23,16 +22,24 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
||||||
|
|
||||||
newInput(in_mesh + 3, nodeValue_Vec2("Texture Tiling", self, [ 1, 1 ]));
|
newInput(in_mesh + 3, nodeValue_Vec2("Texture Tiling", self, [ 1, 1 ]));
|
||||||
|
|
||||||
|
newInput(in_mesh + 4, nodeValue_Vec2("View Range", self, [ 0.001, 10 ]));
|
||||||
|
|
||||||
|
newInput(in_mesh + 5, nodeValue_Vec2("Depth Range", self, [ 0, 1 ]));
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Material", false], in_mesh + 0, in_mesh + 3,
|
["Material", false], in_mesh + 0, in_mesh + 3,
|
||||||
__d3d_input_list_transform,
|
__d3d_input_list_transform,
|
||||||
["Camera", false], in_mesh + 1, in_mesh + 2,
|
["Camera", false], in_mesh + 1, in_mesh + 2, in_mesh + 4,
|
||||||
|
["Render", false], in_mesh + 5,
|
||||||
]
|
]
|
||||||
|
|
||||||
outputs[0].setVisible(false);
|
outputs[0].setVisible(false);
|
||||||
|
|
||||||
outputs[1] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
outputs[1] = nodeValue_Output("Rendered", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
output_display_list = [ 1 ]
|
outputs[2] = nodeValue_Output("Depth", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
output_display_list = [ 1, 2 ]
|
||||||
|
|
||||||
attribute_interpolation();
|
attribute_interpolation();
|
||||||
|
|
||||||
|
@ -58,19 +65,20 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
||||||
draw_rectangle(_px, _py, _px + _pws, _py + _phs, true);
|
draw_rectangle(_px, _py, _px + _pws, _py + _phs, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
static processData = function(_outData, _data, _output_index, _array_index = 0) {
|
||||||
var _surf = _data[in_mesh + 0];
|
var _surf = _data[in_mesh + 0];
|
||||||
var _proj = _data[in_mesh + 1];
|
var _proj = _data[in_mesh + 1];
|
||||||
var _fov = _data[in_mesh + 2];
|
var _fov = _data[in_mesh + 2];
|
||||||
var _tile = _data[in_mesh + 3];
|
var _tile = _data[in_mesh + 3];
|
||||||
|
var _view = _data[in_mesh + 4];
|
||||||
|
var _dept = _data[in_mesh + 5];
|
||||||
|
|
||||||
camObj.transform.position.set(new __vec3(0, 0, 2));
|
camObj.transform.position.set(new __vec3(0, 0, 2));
|
||||||
camObj.transform.rotation = new BBMOD_Quaternion().FromEuler(0, -90, 180);
|
camObj.transform.rotation = new BBMOD_Quaternion().FromEuler(0, -90, 180);
|
||||||
camObj.transform.scale.set(.5, .5, .5);
|
camObj.transform.scale.set(.5, .5, .5);
|
||||||
|
|
||||||
if(!is_surface(_surf)) return 0;
|
if(!is_surface(_surf)) return noone;
|
||||||
|
|
||||||
if(_output_index == 0) {
|
|
||||||
object.materials = [ new __d3dMaterial(_surf) ];
|
object.materials = [ new __d3dMaterial(_surf) ];
|
||||||
setTransform(object, _data);
|
setTransform(object, _data);
|
||||||
|
|
||||||
|
@ -78,19 +86,24 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
||||||
materialPreview.surface = _surf;
|
materialPreview.surface = _surf;
|
||||||
setTransform(objectPreview, _data);
|
setTransform(objectPreview, _data);
|
||||||
}
|
}
|
||||||
return object;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_output_index == 1) {
|
|
||||||
var _dim = surface_get_dimension(_surf);
|
var _dim = surface_get_dimension(_surf);
|
||||||
var projMat = _proj? matrix_build_projection_perspective_fov(_fov, _dim[0] / _dim[1], 0.001, 10) : matrix_build_projection_ortho(1, 1, 0.001, 10);
|
var projMat = _proj? matrix_build_projection_perspective_fov(_fov, _dim[0] / _dim[1], _view[0], _view[1]) : matrix_build_projection_ortho(1, 1, _view[0], _view[1]);
|
||||||
var viewMat = matrix_build_lookat(0, 0, 1,
|
var viewMat = matrix_build_lookat(0, 0, 1,
|
||||||
0, 0, 0,
|
0, 0, 0,
|
||||||
1, 0, 0);
|
1, 0, 0);
|
||||||
|
|
||||||
_output = surface_verify(_output, _dim[0], _dim[1]);
|
var _outSurf = surface_verify(_outData[1], _dim[0], _dim[1]);
|
||||||
surface_set_shader(_output, sh_d3d_3d_transform);
|
var _dptSurf = surface_verify(_outData[2], _dim[0], _dim[1]);
|
||||||
|
|
||||||
|
surface_set_target_ext(0, _outSurf);
|
||||||
|
surface_set_target_ext(1, _dptSurf);
|
||||||
|
shader_set(sh_d3d_3d_transform);
|
||||||
|
DRAW_CLEAR
|
||||||
|
BLEND_OVERRIDE
|
||||||
|
|
||||||
shader_set_2("tiling", _tile);
|
shader_set_2("tiling", _tile);
|
||||||
|
shader_set_f("viewPlane", _dept);
|
||||||
|
|
||||||
camera_set_view_mat(camera, viewMat);
|
camera_set_view_mat(camera, viewMat);
|
||||||
camera_set_proj_mat(camera, projMat);
|
camera_set_proj_mat(camera, projMat);
|
||||||
|
@ -99,20 +112,17 @@ function Node_3D_Transform_Image(_x, _y, _group = noone) : Node_3D_Mesh(_x, _y,
|
||||||
|
|
||||||
object.transform.submitMatrix();
|
object.transform.submitMatrix();
|
||||||
matrix_set(matrix_world, matrix_stack_top());
|
matrix_set(matrix_world, matrix_stack_top());
|
||||||
|
|
||||||
vertex_submit(object.VB[0], pr_trianglelist, surface_get_texture(_surf));
|
vertex_submit(object.VB[0], pr_trianglelist, surface_get_texture(_surf));
|
||||||
|
|
||||||
object.transform.clearMatrix();
|
object.transform.clearMatrix();
|
||||||
matrix_set(matrix_world, matrix_build_identity());
|
matrix_set(matrix_world, matrix_build_identity());
|
||||||
|
|
||||||
camera_apply(0);
|
camera_apply(0);
|
||||||
|
|
||||||
|
BLEND_NORMAL
|
||||||
gpu_set_texfilter(false);
|
gpu_set_texfilter(false);
|
||||||
surface_reset_shader();
|
surface_reset_target();
|
||||||
|
|
||||||
return _output;
|
return [ object, _outSurf, _dptSurf ];
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static getPreviewObject = function() { return objectPreview; }
|
static getPreviewObject = function() { return objectPreview; }
|
||||||
|
|
|
@ -43,30 +43,32 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
|
|
||||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
outputs[1] = nodeValue_Output("Bloom Mask", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
temp_surface = [ 0 ];
|
temp_surface = [ 0 ];
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
surface_blur_init();
|
surface_blur_init();
|
||||||
|
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) { #region
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
var _typ = getSingleValue(13);
|
var _typ = getSingleValue(13);
|
||||||
var _hov = false;
|
var _hov = false;
|
||||||
|
|
||||||
if(_typ == 1) { var hv = inputs[14].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; }
|
if(_typ == 1) { var hv = inputs[14].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny); _hov |= hv; }
|
||||||
|
|
||||||
return _hov;
|
return _hov;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
__step_mask_modifier();
|
__step_mask_modifier();
|
||||||
|
|
||||||
var _typ = getSingleValue(13);
|
var _typ = getSingleValue(13);
|
||||||
inputs[11].setVisible(_typ == 0);
|
inputs[11].setVisible(_typ == 0);
|
||||||
inputs[12].setVisible(_typ == 0);
|
inputs[12].setVisible(_typ == 0);
|
||||||
inputs[14].setVisible(_typ == 1);
|
inputs[14].setVisible(_typ == 1);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static processData = function(_outSurf, _data, _output_index, _array_index) {
|
static processData = function(_outData, _data, _output_index, _array_index) {
|
||||||
var _surf = _data[0];
|
var _surf = _data[0];
|
||||||
var _size = _data[1];
|
var _size = _data[1];
|
||||||
var _tole = _data[2];
|
var _tole = _data[2];
|
||||||
|
@ -82,6 +84,8 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
var _sh = surface_get_height_safe(_surf);
|
var _sh = surface_get_height_safe(_surf);
|
||||||
|
|
||||||
temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh);
|
temp_surface[0] = surface_verify(temp_surface[0], _sw, _sh);
|
||||||
|
var _outSurf = surface_verify(_outData[0], _sw, _sh);
|
||||||
|
var _maskSurf = surface_verify(_outData[1], _sw, _sh);
|
||||||
|
|
||||||
surface_set_shader(temp_surface[0], sh_bloom_pass);
|
surface_set_shader(temp_surface[0], sh_bloom_pass);
|
||||||
draw_clear_alpha(c_black, 1);
|
draw_clear_alpha(c_black, 1);
|
||||||
|
@ -106,10 +110,14 @@ function Node_Bloom(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
draw_surface_safe(_surf);
|
draw_surface_safe(_surf);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
||||||
|
surface_set_shader(_maskSurf, noone);
|
||||||
|
draw_surface_safe(pass1blur);
|
||||||
|
surface_reset_shader();
|
||||||
|
|
||||||
__process_mask_modifier(_data);
|
__process_mask_modifier(_data);
|
||||||
_outSurf = mask_apply(_surf, _outSurf, _data[5], _data[6]);
|
_outSurf = mask_apply(_surf, _outSurf, _data[5], _data[6]);
|
||||||
_outSurf = channel_apply(_surf, _outSurf, _data[8]);
|
_outSurf = channel_apply(_surf, _outSurf, _data[8]);
|
||||||
|
|
||||||
return _outSurf;
|
return [ _outSurf, _maskSurf ];
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,8 +22,9 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
|
||||||
enableNodeGroup();
|
enableNodeGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
if(cache_loading) {
|
if(!cache_loading) return;
|
||||||
|
|
||||||
cached_output[cache_loading_progress] = __surface_array_deserialize(cache_content[cache_loading_progress]);
|
cached_output[cache_loading_progress] = __surface_array_deserialize(cache_content[cache_loading_progress]);
|
||||||
cache_result[cache_loading_progress] = true;
|
cache_result[cache_loading_progress] = true;
|
||||||
cache_loading_progress++;
|
cache_loading_progress++;
|
||||||
|
@ -33,9 +34,8 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} #endregion
|
|
||||||
|
|
||||||
static update = function() { #region
|
static update = function() {
|
||||||
if(recoverCache() || cache_loading) return;
|
if(recoverCache() || cache_loading) return;
|
||||||
|
|
||||||
if(!inputs[0].value_from) return;
|
if(!inputs[0].value_from) return;
|
||||||
|
@ -46,25 +46,23 @@ function Node_Cache(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group) const
|
||||||
|
|
||||||
var _surf = getInputData(0);
|
var _surf = getInputData(0);
|
||||||
cacheCurrentFrame(_surf);
|
cacheCurrentFrame(_surf);
|
||||||
|
|
||||||
disableNodeGroup();
|
disableNodeGroup();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
if(cache_loading)
|
if(cache_loading) draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
||||||
draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
}
|
||||||
} #endregion
|
|
||||||
|
|
||||||
static doSerialize = function(_map) { #region
|
static doSerialize = function(_map) {
|
||||||
_map.cache = surface_array_serialize(cached_output);
|
_map.cache = surface_array_serialize(cached_output);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static postDeserialize = function() { #region
|
static postDeserialize = function() {
|
||||||
refreshCacheGroup();
|
refreshCacheGroup();
|
||||||
|
|
||||||
if(!struct_has(load_map, "cache")) return;
|
if(!struct_has(load_map, "cache")) return;
|
||||||
cache_content = json_try_parse(load_map.cache);
|
cache_content = json_try_parse(load_map.cache);
|
||||||
cache_loading_progress = 0;
|
cache_loading_progress = 0;
|
||||||
cache_loading = true;
|
cache_loading = true;
|
||||||
} #endregion
|
}
|
||||||
}
|
}
|
|
@ -29,7 +29,7 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
|
||||||
enableNodeGroup();
|
enableNodeGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
static step = function() { #region
|
static step = function() {
|
||||||
if(!cache_loading) return;
|
if(!cache_loading) return;
|
||||||
|
|
||||||
var _content = cache_content[cache_loading_progress];
|
var _content = cache_content[cache_loading_progress];
|
||||||
|
@ -42,9 +42,9 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
|
||||||
cache_loading = false;
|
cache_loading = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static update = function() { #region
|
static update = function() {
|
||||||
if(cache_loading) return;
|
if(cache_loading) return;
|
||||||
|
|
||||||
if(!inputs[0].value_from) return;
|
if(!inputs[0].value_from) return;
|
||||||
|
@ -77,22 +77,22 @@ function Node_Cache_Array(_x, _y, _group = noone) : __Node_Cache(_x, _y, _group)
|
||||||
outputs[0].setValue(ss);
|
outputs[0].setValue(ss);
|
||||||
|
|
||||||
disableNodeGroup();
|
disableNodeGroup();
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) { #region
|
static onDrawNode = function(xx, yy, _mx, _my, _s, _hover, _focus) {
|
||||||
if(cache_loading) draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
if(cache_loading) draw_sprite_ui(THEME.loading, 0, xx + w * _s / 2, yy + h * _s / 2, _s, _s, current_time / 2, COLORS._main_icon, 1);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static doSerialize = function(_map) { #region
|
static doSerialize = function(_map) {
|
||||||
_map.cache = surface_array_serialize(cached_output);
|
_map.cache = surface_array_serialize(cached_output);
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static postDeserialize = function() { #region
|
static postDeserialize = function() {
|
||||||
refreshCacheGroup();
|
refreshCacheGroup();
|
||||||
|
|
||||||
if(!struct_has(load_map, "cache")) return;
|
if(!struct_has(load_map, "cache")) return;
|
||||||
cache_content = json_try_parse(load_map.cache);
|
cache_content = json_try_parse(load_map.cache);
|
||||||
cache_loading_progress = 0;
|
cache_loading_progress = 0;
|
||||||
cache_loading = true;
|
cache_loading = true;
|
||||||
} #endregion
|
}
|
||||||
}
|
}
|
|
@ -38,21 +38,19 @@ function __Node_Cache(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
static enableNodeGroup = function() { #region
|
static enableNodeGroup = function() { #region
|
||||||
if(LOADING || APPENDING) return;
|
if(LOADING || APPENDING) return;
|
||||||
print("Enacle");
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
||||||
cache_group_members[i].renderActive = true;
|
cache_group_members[i].renderActive = true;
|
||||||
clearCache(true);
|
clearCache(true);
|
||||||
} #endregion
|
} #endregion
|
||||||
|
|
||||||
static disableNodeGroup = function() { #region
|
static disableNodeGroup = function() {
|
||||||
if(LOADING || APPENDING) return;
|
if(LOADING || APPENDING) return;
|
||||||
print("Disable");
|
|
||||||
|
|
||||||
if(IS_PLAYING && IS_LAST_FRAME)
|
if(IS_PLAYING && IS_LAST_FRAME)
|
||||||
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
for( var i = 0, n = array_length(cache_group_members); i < n; i++ )
|
||||||
cache_group_members[i].renderActive = false;
|
cache_group_members[i].renderActive = false;
|
||||||
} #endregion
|
}
|
||||||
|
|
||||||
static refreshCacheGroup = function() { #region
|
static refreshCacheGroup = function() { #region
|
||||||
cache_group_members = [];
|
cache_group_members = [];
|
||||||
|
|
|
@ -7,10 +7,12 @@ function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
|
|
||||||
newInput(1, nodeValue_Int("Frames", self, 1));
|
newInput(1, nodeValue_Int("Frames", self, 1));
|
||||||
|
|
||||||
|
newInput(2, nodeValue_Bool("Loop", self, false));
|
||||||
|
|
||||||
outputs[0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
outputs[0] = nodeValue_Output("Surface", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 0,
|
input_display_list = [ 0,
|
||||||
["Delay", false], 1,
|
["Delay", false], 1, 2,
|
||||||
];
|
];
|
||||||
|
|
||||||
surf_indexes = [];
|
surf_indexes = [];
|
||||||
|
@ -24,9 +26,12 @@ function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
static processData = function(_output, _data, _output_index, _array_index = 0) {
|
||||||
var _surf = _data[0];
|
var _surf = _data[0];
|
||||||
var _frme = _data[1];
|
var _frme = _data[1];
|
||||||
|
var _loop = _data[2];
|
||||||
|
|
||||||
var _time = CURRENT_FRAME;
|
var _time = CURRENT_FRAME;
|
||||||
var _frtm = clamp(_time - _frme, 0, TOTAL_FRAMES - 1);
|
var _frtm = _time - _frme;
|
||||||
|
if(_loop) _frtm = (_frtm + TOTAL_FRAMES) % TOTAL_FRAMES;
|
||||||
|
else _frtm = clamp(_frtm, 0, TOTAL_FRAMES - 1);
|
||||||
|
|
||||||
var _sw = surface_get_width_safe(_surf);
|
var _sw = surface_get_width_safe(_surf);
|
||||||
var _sh = surface_get_height_safe(_surf);
|
var _sh = surface_get_height_safe(_surf);
|
||||||
|
@ -35,12 +40,15 @@ function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
|
|
||||||
surface_set_target(surf_indexes[_array_index][_time]);
|
surface_set_target(surf_indexes[_array_index][_time]);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
BLEND_OVERRIDE
|
||||||
draw_surface_safe(_surf);
|
draw_surface_safe(_surf);
|
||||||
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
_output = surface_verify(_output, _sw, _sh);
|
_output = surface_verify(_output, _sw, _sh);
|
||||||
surface_set_target(_output);
|
surface_set_target(_output);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
BLEND_OVERRIDE
|
||||||
|
|
||||||
if(0 <= _frtm && _frtm < TOTAL_FRAMES) {
|
if(0 <= _frtm && _frtm < TOTAL_FRAMES) {
|
||||||
draw_surface_safe(surf_indexes[_array_index][_frtm]);
|
draw_surface_safe(surf_indexes[_array_index][_frtm]);
|
||||||
|
@ -48,6 +56,8 @@ function Node_Delay(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) con
|
||||||
surface_free(surf_indexes[_array_index][_frtm]);
|
surface_free(surf_indexes[_array_index][_frtm]);
|
||||||
surf_indexes[_array_index][_frtm] = 0;
|
surf_indexes[_array_index][_frtm] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BLEND_NORMAL
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
return _output;
|
return _output;
|
||||||
|
|
|
@ -158,7 +158,7 @@ function Node_Line(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) cons
|
||||||
var _wig = _data[4];
|
var _wig = _data[4];
|
||||||
var _sed = _data[5];
|
var _sed = _data[5];
|
||||||
var _ang = _data[6];
|
var _ang = _data[6];
|
||||||
var _pat = _data[7]; print(_pat);
|
var _pat = _data[7];
|
||||||
var _ratio = _data[8];
|
var _ratio = _data[8];
|
||||||
var _shift = _data[9];
|
var _shift = _data[9];
|
||||||
|
|
||||||
|
|
|
@ -245,10 +245,14 @@ function Node_Processor(_x, _y, _group = noone) : Node(_x, _y, _group) construct
|
||||||
|
|
||||||
if(_os == 1) {
|
if(_os == 1) {
|
||||||
data = processData(_out[0], inputs_data, 0, 0);
|
data = processData(_out[0], inputs_data, 0, 0);
|
||||||
|
if(data == noone) return;
|
||||||
|
|
||||||
outputs[0].setValue(data);
|
outputs[0].setValue(data);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
data = processData(_out, inputs_data, 0, 0);
|
data = processData(_out, inputs_data, 0, 0);
|
||||||
|
if(data == noone) return;
|
||||||
|
|
||||||
for(var i = 0; i < _os; i++) outputs[i].setValue(data[i]);
|
for(var i = 0; i < _os; i++) outputs[i].setValue(data[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1008,6 +1008,7 @@ function __initNodes() {
|
||||||
addNodeObject(animation, "Rate Remap", s_node_rate_remap, "Node_Rate_Remap", [1, Node_Rate_Remap],, "Remap animation to a new framerate.").setVersion(1147);
|
addNodeObject(animation, "Rate Remap", s_node_rate_remap, "Node_Rate_Remap", [1, Node_Rate_Remap],, "Remap animation to a new framerate.").setVersion(1147);
|
||||||
addNodeObject(animation, "Delay", s_node_delay, "Node_Delay", [1, Node_Delay],, "Delay the animation by fix amount of frames.").setVersion(11640);
|
addNodeObject(animation, "Delay", s_node_delay, "Node_Delay", [1, Node_Delay],, "Delay the animation by fix amount of frames.").setVersion(11640);
|
||||||
addNodeObject(animation, "Stagger", s_node_stagger, "Node_Stagger", [1, Node_Stagger],, "Delay the animation based on array index.").setVersion(11640);
|
addNodeObject(animation, "Stagger", s_node_stagger, "Node_Stagger", [1, Node_Stagger],, "Delay the animation based on array index.").setVersion(11640);
|
||||||
|
addNodeObject(animation, "Revert", s_node_revert, "Node_Revert", [1, Node_Revert],, "Cache the entire animation and replay backward.").setVersion(1_17_11_0);
|
||||||
|
|
||||||
ds_list_add(animation, "Value");
|
ds_list_add(animation, "Value");
|
||||||
addNodeObject(animation, "WaveTable", s_node_wave, "Node_Fn_WaveTable", [1, Node_Fn_WaveTable],, "Create value changing overtime in wave pattern.").setVersion(11720);
|
addNodeObject(animation, "WaveTable", s_node_wave, "Node_Fn_WaveTable", [1, Node_Fn_WaveTable],, "Create value changing overtime in wave pattern.").setVersion(11720);
|
||||||
|
|
12
scripts/node_revert/node_outline.yy
Normal file
12
scripts/node_revert/node_outline.yy
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "process",
|
||||||
|
"path": "folders/nodes/data/process.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_outline",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
33
scripts/node_revert/node_revert.gml
Normal file
33
scripts/node_revert/node_revert.gml
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
function Node_Revert(_x, _y, _group = noone) : Node(_x, _y, _group) constructor {
|
||||||
|
name = "Revert";
|
||||||
|
use_cache = CACHE_USE.manual;
|
||||||
|
|
||||||
|
newInput(0, nodeValue_Surface("Surface in", self));
|
||||||
|
|
||||||
|
outputs[0] = nodeValue_Output("Output", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
|
input_display_list = [
|
||||||
|
["Surfaces", true], 0,
|
||||||
|
];
|
||||||
|
|
||||||
|
insp2UpdateTooltip = "Clear cache";
|
||||||
|
insp2UpdateIcon = [ THEME.cache, 0, COLORS._main_icon ];
|
||||||
|
|
||||||
|
static onInspector2Update = function() {
|
||||||
|
clearCache(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static update = function() {
|
||||||
|
|
||||||
|
if(!inputs[0].value_from) return;
|
||||||
|
if(!inputs[0].value_from.node.renderActive) return;
|
||||||
|
|
||||||
|
var _surf = getInputData(0);
|
||||||
|
cacheCurrentFrame(_surf);
|
||||||
|
|
||||||
|
var _frm = TOTAL_FRAMES - CURRENT_FRAME - 1;
|
||||||
|
if(!cacheExist(_frm)) return;
|
||||||
|
|
||||||
|
outputs[0].setValue(getCacheFrame(_frm));
|
||||||
|
}
|
||||||
|
}
|
13
scripts/node_revert/node_revert.yy
Normal file
13
scripts/node_revert/node_revert.yy
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"$GMScript":"v1",
|
||||||
|
"%Name":"node_revert",
|
||||||
|
"isCompatibility":false,
|
||||||
|
"isDnD":false,
|
||||||
|
"name":"node_revert",
|
||||||
|
"parent":{
|
||||||
|
"name":"misc",
|
||||||
|
"path":"folders/nodes/data/misc.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMScript",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
}
|
|
@ -17,11 +17,14 @@ function Node_Vignette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
newInput(5, nodeValue_Float("Roundness", self, 0))
|
newInput(5, nodeValue_Float("Roundness", self, 0))
|
||||||
.setDisplay(VALUE_DISPLAY.slider);
|
.setDisplay(VALUE_DISPLAY.slider);
|
||||||
|
|
||||||
|
newInput(6, nodeValue_Bool("Lighten", self, false))
|
||||||
|
|
||||||
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
outputs[0] = nodeValue_Output("Surface out", self, VALUE_TYPE.surface, noone);
|
||||||
|
|
||||||
input_display_list = [ 1,
|
input_display_list = [ 1,
|
||||||
["Surfaces", false], 0,
|
["Surfaces", false], 0,
|
||||||
["Vignette", false], 5, 2, 3,
|
["Vignette", false], 5, 2, 3,
|
||||||
|
["Render", false], 6,
|
||||||
]
|
]
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
@ -32,6 +35,7 @@ function Node_Vignette(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
shader_set_f("strength", _data[3]);
|
shader_set_f("strength", _data[3]);
|
||||||
shader_set_f("amplitude", _data[4]);
|
shader_set_f("amplitude", _data[4]);
|
||||||
shader_set_f("smoothness", _data[5]);
|
shader_set_f("smoothness", _data[5]);
|
||||||
|
shader_set_i("light", _data[6]);
|
||||||
|
|
||||||
draw_surface_safe(_data[0]);
|
draw_surface_safe(_data[0]);
|
||||||
surface_reset_shader();
|
surface_reset_shader();
|
||||||
|
|
|
@ -13,6 +13,8 @@ void main() {
|
||||||
vec4 _col1 = texture2D( fore, v_vTexcoord );
|
vec4 _col1 = texture2D( fore, v_vTexcoord );
|
||||||
|
|
||||||
vec4 res = _col0 + _col1 * opacity;
|
vec4 res = _col0 + _col1 * opacity;
|
||||||
|
|
||||||
|
////////// Alpha
|
||||||
float bright = dot(_col1.rgb, vec3(0.2126, 0.7152, 0.0722));
|
float bright = dot(_col1.rgb, vec3(0.2126, 0.7152, 0.0722));
|
||||||
float aa = _col0.a + bright * opacity;
|
float aa = _col0.a + bright * opacity;
|
||||||
res.a = aa;
|
res.a = aa;
|
||||||
|
|
|
@ -12,7 +12,7 @@ uniform float points_x[MAX_POINTS];
|
||||||
uniform float points_y[MAX_POINTS];
|
uniform float points_y[MAX_POINTS];
|
||||||
|
|
||||||
uniform float intensity;
|
uniform float intensity;
|
||||||
uniform float i_curve[64];
|
uniform float i_curve[1024];
|
||||||
uniform int i_amount;
|
uniform int i_amount;
|
||||||
|
|
||||||
vec4 sample(vec2 pos) { #region
|
vec4 sample(vec2 pos) { #region
|
||||||
|
@ -88,7 +88,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx
|
||||||
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
float curveEval(in float[64] curve, in int amo, in float _x) {
|
float curveEval(in float[1024] curve, in int amo, in float _x) {
|
||||||
|
|
||||||
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
||||||
int _segs = (amo - _shf) / 6 - 1;
|
int _segs = (amo - _shf) / 6 - 1;
|
||||||
|
|
|
@ -4,19 +4,19 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform float w_curve[64];
|
uniform float w_curve[1024];
|
||||||
uniform int w_amount;
|
uniform int w_amount;
|
||||||
|
|
||||||
uniform float r_curve[64];
|
uniform float r_curve[1024];
|
||||||
uniform int r_amount;
|
uniform int r_amount;
|
||||||
|
|
||||||
uniform float g_curve[64];
|
uniform float g_curve[1024];
|
||||||
uniform int g_amount;
|
uniform int g_amount;
|
||||||
|
|
||||||
uniform float b_curve[64];
|
uniform float b_curve[1024];
|
||||||
uniform int b_amount;
|
uniform int b_amount;
|
||||||
|
|
||||||
uniform float a_curve[64];
|
uniform float a_curve[1024];
|
||||||
uniform int a_amount;
|
uniform int a_amount;
|
||||||
|
|
||||||
float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) {
|
float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) {
|
||||||
|
@ -73,7 +73,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx
|
||||||
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
float curveEval(in float[64] curve, in int amo, in float _x) {
|
float curveEval(in float[1024] curve, in int amo, in float _x) {
|
||||||
|
|
||||||
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
||||||
int _segs = (amo - _shf) / 6 - 1;
|
int _segs = (amo - _shf) / 6 - 1;
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform float h_curve[64];
|
uniform float h_curve[1024];
|
||||||
uniform int h_amount;
|
uniform int h_amount;
|
||||||
|
|
||||||
uniform float s_curve[64];
|
uniform float s_curve[1024];
|
||||||
uniform int s_amount;
|
uniform int s_amount;
|
||||||
|
|
||||||
uniform float v_curve[64];
|
uniform float v_curve[1024];
|
||||||
uniform int v_amount;
|
uniform int v_amount;
|
||||||
|
|
||||||
float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) {
|
float eval_curve_segment_t(in float _y0, in float ax0, in float ay0, in float bx1, in float by1, in float _y1, in float prog) {
|
||||||
|
@ -64,7 +64,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx
|
||||||
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
float curveEval(in float[64] curve, in int amo, in float _x) {
|
float curveEval(in float[1024] curve, in int amo, in float _x) {
|
||||||
|
|
||||||
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
||||||
int _segs = (amo - _shf) / 6 - 1;
|
int _segs = (amo - _shf) / 6 - 1;
|
||||||
|
|
|
@ -1,9 +1,16 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying float v_LightDepth;
|
||||||
|
|
||||||
|
uniform vec2 viewPlane;
|
||||||
uniform vec2 tiling;
|
uniform vec2 tiling;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 px = fract(v_vTexcoord * tiling);
|
vec2 uv_coord = fract(v_vTexcoord * tiling);
|
||||||
gl_FragColor = texture2D( gm_BaseTexture, px );
|
vec4 mat_baseColor = texture2D( gm_BaseTexture, uv_coord );
|
||||||
|
|
||||||
|
float depth = (v_LightDepth - viewPlane.x) / (viewPlane.y - viewPlane.x);
|
||||||
|
depth = 1. - depth;
|
||||||
|
|
||||||
|
gl_FragData[0] = mat_baseColor;
|
||||||
|
gl_FragData[1] = vec4(vec3(depth), 1.);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,19 +1,15 @@
|
||||||
//
|
attribute vec3 in_Position;
|
||||||
// Simple passthrough vertex shader
|
attribute vec3 in_Normal;
|
||||||
//
|
attribute vec4 in_Colour;
|
||||||
attribute vec3 in_Position; // (x,y,z)
|
attribute vec2 in_TextureCoord;
|
||||||
//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 vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying float v_LightDepth;
|
||||||
|
|
||||||
void main()
|
void main() {
|
||||||
{
|
|
||||||
vec4 object_space_pos = vec4( in_Position.x, in_Position.y, in_Position.z, 1.0);
|
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;
|
gl_Position = gm_Matrices[MATRIX_WORLD_VIEW_PROJECTION] * object_space_pos;
|
||||||
|
|
||||||
v_vColour = in_Colour;
|
v_LightDepth = gl_Position.z / gl_Position.w;
|
||||||
v_vTexcoord = in_TextureCoord;
|
v_vTexcoord = in_TextureCoord;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,7 @@ uniform float dist;
|
||||||
uniform int useMap;
|
uniform int useMap;
|
||||||
uniform sampler2D strengthMap;
|
uniform sampler2D strengthMap;
|
||||||
|
|
||||||
uniform float alpha_curve[64];
|
uniform float alpha_curve[1024];
|
||||||
uniform int curve_amount;
|
uniform int curve_amount;
|
||||||
uniform float randomAmount;
|
uniform float randomAmount;
|
||||||
|
|
||||||
|
|
|
@ -10,22 +10,20 @@ uniform float max_distance;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
vec4 col = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||||
|
float aa = alpha == 1? texture2D( original, v_vTexcoord ).a : 1.;
|
||||||
|
|
||||||
if(col.xy == vec2(0.)) {
|
if(col.xy == vec2(0.)) {
|
||||||
gl_FragColor = vec4(vec3(0.), 1.);
|
gl_FragColor = vec4(vec3(0.), aa);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float dist = (max_distance - distance(col.xy, v_vTexcoord)) / max_distance;
|
float dist = (max_distance - distance(col.xy, v_vTexcoord)) / max_distance;
|
||||||
|
if(invert == 1) dist = 1. - dist;
|
||||||
|
|
||||||
if((side == 0 && col.z == 0.) || (side == 1 && col.z == 1.)) {
|
if((side == 0 && col.z == 0.) || (side == 1 && col.z == 1.)) {
|
||||||
gl_FragColor = vec4(vec3(col.z), 1.);
|
gl_FragColor = vec4(vec3(col.z), aa);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
float aa = 1.;
|
|
||||||
|
|
||||||
if(alpha == 1) aa = texture2D( original, v_vTexcoord ).a;
|
|
||||||
if(invert == 1) dist = 1. - dist;
|
|
||||||
|
|
||||||
gl_FragColor = vec4(vec3(dist), aa);
|
gl_FragColor = vec4(vec3(dist), aa);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ uniform int tile;
|
||||||
uniform int drawBG;
|
uniform int drawBG;
|
||||||
uniform int drawDF;
|
uniform int drawDF;
|
||||||
uniform vec2 dfLevel;
|
uniform vec2 dfLevel;
|
||||||
uniform float w_curve[64];
|
uniform float w_curve[1024];
|
||||||
uniform int w_amount;
|
uniform int w_amount;
|
||||||
|
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
@ -106,7 +106,7 @@ float eval_curve_segment_x(in float _y0, in float ax0, in float ay0, in float bx
|
||||||
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
return eval_curve_segment_t(_y0, ax0, ay0, bx1, by1, _y1, _xt);
|
||||||
}
|
}
|
||||||
|
|
||||||
float curveEval(in float[64] curve, in int amo, in float _x) {
|
float curveEval(in float[1024] curve, in int amo, in float _x) {
|
||||||
|
|
||||||
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
int _shf = amo - int(floor(float(amo) / 6.) * 6.);
|
||||||
int _segs = (amo - _shf) / 6 - 1;
|
int _segs = (amo - _shf) / 6 - 1;
|
||||||
|
|
|
@ -5,6 +5,7 @@ uniform float exposure;
|
||||||
uniform float strength;
|
uniform float strength;
|
||||||
uniform float amplitude;
|
uniform float amplitude;
|
||||||
uniform float smoothness;
|
uniform float smoothness;
|
||||||
|
uniform int light;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 uv = v_vTexcoord;
|
vec2 uv = v_vTexcoord;
|
||||||
|
@ -24,5 +25,8 @@ void main() {
|
||||||
vig = clamp(vig, 0., 1.);
|
vig = clamp(vig, 0., 1.);
|
||||||
|
|
||||||
vec4 samp = texture2D( gm_BaseTexture, v_vTexcoord );
|
vec4 samp = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||||
gl_FragColor = vec4(samp.rgb * (1. - ((1. - vig) * strength)), samp.a);
|
float str = (1. - ((1. - vig) * strength));
|
||||||
|
|
||||||
|
if(light == 1) str = str < 0.001? 10000. : 1. / str;
|
||||||
|
gl_FragColor = vec4(samp.rgb * str, samp.a);
|
||||||
}
|
}
|
||||||
|
|
BIN
sprites/s_node_revert/1fb6b3f0-c200-4273-80f6-e96fa553995b.png
Normal file
BIN
sprites/s_node_revert/1fb6b3f0-c200-4273-80f6-e96fa553995b.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
90
sprites/s_node_revert/s_node_revert.yy
Normal file
90
sprites/s_node_revert/s_node_revert.yy
Normal file
|
@ -0,0 +1,90 @@
|
||||||
|
{
|
||||||
|
"$GMSprite":"",
|
||||||
|
"%Name":"s_node_revert",
|
||||||
|
"bboxMode":0,
|
||||||
|
"bbox_bottom":51,
|
||||||
|
"bbox_left":3,
|
||||||
|
"bbox_right":56,
|
||||||
|
"bbox_top":12,
|
||||||
|
"collisionKind":1,
|
||||||
|
"collisionTolerance":0,
|
||||||
|
"DynamicTexturePage":false,
|
||||||
|
"edgeFiltering":false,
|
||||||
|
"For3D":false,
|
||||||
|
"frames":[
|
||||||
|
{"$GMSpriteFrame":"","%Name":"1fb6b3f0-c200-4273-80f6-e96fa553995b","name":"1fb6b3f0-c200-4273-80f6-e96fa553995b","resourceType":"GMSpriteFrame","resourceVersion":"2.0",},
|
||||||
|
],
|
||||||
|
"gridX":0,
|
||||||
|
"gridY":0,
|
||||||
|
"height":64,
|
||||||
|
"HTile":false,
|
||||||
|
"layers":[
|
||||||
|
{"$GMImageLayer":"","%Name":"d731e6b4-02b8-4d03-a630-971be1f4542b","blendMode":0,"displayName":"default","isLocked":false,"name":"d731e6b4-02b8-4d03-a630-971be1f4542b","opacity":100.0,"resourceType":"GMImageLayer","resourceVersion":"2.0","visible":true,},
|
||||||
|
],
|
||||||
|
"name":"s_node_revert",
|
||||||
|
"nineSlice":null,
|
||||||
|
"origin":4,
|
||||||
|
"parent":{
|
||||||
|
"name":"animation",
|
||||||
|
"path":"folders/nodes/icons/animation.yy",
|
||||||
|
},
|
||||||
|
"preMultiplyAlpha":false,
|
||||||
|
"resourceType":"GMSprite",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"sequence":{
|
||||||
|
"$GMSequence":"",
|
||||||
|
"%Name":"s_node_revert",
|
||||||
|
"autoRecord":true,
|
||||||
|
"backdropHeight":768,
|
||||||
|
"backdropImageOpacity":0.5,
|
||||||
|
"backdropImagePath":"",
|
||||||
|
"backdropWidth":1366,
|
||||||
|
"backdropXOffset":0.0,
|
||||||
|
"backdropYOffset":0.0,
|
||||||
|
"events":{
|
||||||
|
"$KeyframeStore<MessageEventKeyframe>":"",
|
||||||
|
"Keyframes":[],
|
||||||
|
"resourceType":"KeyframeStore<MessageEventKeyframe>",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
},
|
||||||
|
"eventStubScript":null,
|
||||||
|
"eventToFunction":{},
|
||||||
|
"length":1.0,
|
||||||
|
"lockOrigin":false,
|
||||||
|
"moments":{
|
||||||
|
"$KeyframeStore<MomentsEventKeyframe>":"",
|
||||||
|
"Keyframes":[],
|
||||||
|
"resourceType":"KeyframeStore<MomentsEventKeyframe>",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
},
|
||||||
|
"name":"s_node_revert",
|
||||||
|
"playback":1,
|
||||||
|
"playbackSpeed":30.0,
|
||||||
|
"playbackSpeedType":0,
|
||||||
|
"resourceType":"GMSequence",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"showBackdrop":true,
|
||||||
|
"showBackdropImage":false,
|
||||||
|
"timeUnits":1,
|
||||||
|
"tracks":[
|
||||||
|
{"$GMSpriteFramesTrack":"","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"$KeyframeStore<SpriteFrameKeyframe>":"","Keyframes":[
|
||||||
|
{"$Keyframe<SpriteFrameKeyframe>":"","Channels":{
|
||||||
|
"0":{"$SpriteFrameKeyframe":"","Id":{"name":"1fb6b3f0-c200-4273-80f6-e96fa553995b","path":"sprites/s_node_revert/s_node_revert.yy",},"resourceType":"SpriteFrameKeyframe","resourceVersion":"2.0",},
|
||||||
|
},"Disabled":false,"id":"0c9b46cc-4742-44b2-9251-22348d392e67","IsCreationKey":false,"Key":0.0,"Length":1.0,"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"2.0","Stretch":false,},
|
||||||
|
],"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"2.0",},"modifiers":[],"name":"frames","resourceType":"GMSpriteFramesTrack","resourceVersion":"2.0","spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
|
||||||
|
],
|
||||||
|
"visibleRange":null,
|
||||||
|
"volume":1.0,
|
||||||
|
"xorigin":32,
|
||||||
|
"yorigin":32,
|
||||||
|
},
|
||||||
|
"swatchColours":null,
|
||||||
|
"swfPrecision":0.5,
|
||||||
|
"textureGroupId":{
|
||||||
|
"name":"Default",
|
||||||
|
"path":"texturegroups/Default",
|
||||||
|
},
|
||||||
|
"type":0,
|
||||||
|
"VTile":false,
|
||||||
|
"width":64,
|
||||||
|
}
|
Loading…
Reference in a new issue