mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 06:26:42 +01:00
Small QoL for 0.8.2
This commit is contained in:
parent
93d6734080
commit
f83ad6920a
7 changed files with 19 additions and 9 deletions
|
@ -151,7 +151,7 @@
|
|||
{"id":{"name":"s_node_transform_single","path":"sprites/s_node_transform_single/s_node_transform_single.yy",},"order":89,},
|
||||
{"id":{"name":"s_button_hide_fill","path":"sprites/s_button_hide_fill/s_button_hide_fill.yy",},"order":15,},
|
||||
{"id":{"name":"sh_blur_radial","path":"shaders/sh_blur_radial/sh_blur_radial.yy",},"order":18,},
|
||||
{"id":{"name":"sh_grid","path":"shaders/sh_grid/sh_grid.yy",},"order":35,},
|
||||
{"id":{"name":"sh_grid","path":"shaders/sh_grid/sh_grid.yy",},"order":14,},
|
||||
{"id":{"name":"s_button_hide","path":"sprites/s_button_hide/s_button_hide.yy",},"order":10,},
|
||||
{"id":{"name":"sh_twirl","path":"shaders/sh_twirl/sh_twirl.yy",},"order":19,},
|
||||
{"id":{"name":"s_checkbox","path":"sprites/s_checkbox/s_checkbox.yy",},"order":11,},
|
||||
|
|
|
@ -11,6 +11,7 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
|
|||
uniform_pos = shader_get_uniform(shader, "position");
|
||||
uniform_sca = shader_get_uniform(shader, "scale");
|
||||
uniform_wid = shader_get_uniform(shader, "width");
|
||||
uniform_ang = shader_get_uniform(shader, "angle");
|
||||
|
||||
inputs[| 0] = nodeValue(0, "Dimension", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, def_surf_size2, VALUE_TAG.dimension_2d )
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
@ -24,8 +25,12 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
|
|||
inputs[| 3] = nodeValue(3, "Gap", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0.02)
|
||||
.setDisplay(VALUE_DISPLAY.slider, [0, 0.5, 0.01]);
|
||||
|
||||
inputs[| 4] = nodeValue(4, "Angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||
.setDisplay(VALUE_DISPLAY.rotation);
|
||||
|
||||
input_display_list = [
|
||||
["Effect settings", false], 0, 1, 2, 3
|
||||
["Effect settings", false], 0, 3,
|
||||
["Transformation", false], 1, 4, 2
|
||||
];
|
||||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
|
||||
|
@ -39,6 +44,7 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
|
|||
var _pos = inputs[| 1].getValue();
|
||||
var _sca = inputs[| 2].getValue();
|
||||
var _wid = inputs[| 3].getValue();
|
||||
var _ang = inputs[| 4].getValue();
|
||||
|
||||
var _outSurf = outputs[| 0].getValue();
|
||||
if(!is_surface(_outSurf)) {
|
||||
|
@ -52,6 +58,7 @@ function Node_Grid(_x, _y) : Node(_x, _y) constructor {
|
|||
shader_set_uniform_f(uniform_pos, _pos[0] / _dim[0], _pos[1] / _dim[1]);
|
||||
shader_set_uniform_f_array(uniform_sca, _sca);
|
||||
shader_set_uniform_f(uniform_wid, _wid);
|
||||
shader_set_uniform_f(uniform_ang, degtorad(_ang));
|
||||
|
||||
draw_sprite_ext(s_fx_pixel, 0, 0, 0, _dim[0], _dim[1], 0, c_white, 1);
|
||||
shader_reset();
|
||||
|
|
|
@ -43,7 +43,7 @@ function Node_Image_gif(_x, _y) : Node(_x, _y) constructor {
|
|||
|
||||
outputs[| 0] = nodeValue(0, "Surface out", self, JUNCTION_CONNECT.output, VALUE_TYPE.surface, surface_create(1, 1));
|
||||
outputs[| 1] = nodeValue(1, "Path", self, JUNCTION_CONNECT.output, VALUE_TYPE.path, "")
|
||||
.setVisible(true);
|
||||
.setVisible(true, true);
|
||||
|
||||
spr = noone;
|
||||
path_current = "";
|
||||
|
|
|
@ -22,9 +22,8 @@ function Node_Path(_x, _y) : Node(_x, _y) constructor {
|
|||
var index = ds_list_size(inputs);
|
||||
|
||||
inputs[| index] = nodeValue(index, "Anchor", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ _x, _y, 0, 0, 0, 0 ])
|
||||
.setDisplay(VALUE_DISPLAY.vector)
|
||||
.setDisplay(VALUE_DISPLAY.vector);
|
||||
|
||||
|
||||
return inputs[| index];
|
||||
}
|
||||
|
||||
|
|
|
@ -56,8 +56,9 @@ void main() {
|
|||
float _a = atan(_p.y, _p.x) + angle;
|
||||
prog = (_a - floor(_a / TAU) * TAU) / TAU;
|
||||
}
|
||||
prog = abs(prog + shift);
|
||||
prog = prog + shift;
|
||||
if(gradient_loop == 1) {
|
||||
prog = abs(prog);
|
||||
if(prog > 1.) {
|
||||
if(prog == floor(prog))
|
||||
prog = 1.;
|
||||
|
|
|
@ -6,10 +6,13 @@ varying vec4 v_vColour;
|
|||
|
||||
uniform vec2 position;
|
||||
uniform vec2 scale;
|
||||
uniform float angle;
|
||||
uniform float width;
|
||||
|
||||
void main() {
|
||||
vec2 _pos = v_vTexcoord - position;
|
||||
vec2 pos = v_vTexcoord - position, _pos;
|
||||
_pos.x = pos.x * cos(angle) - pos.y * sin(angle);
|
||||
_pos.y = pos.x * sin(angle) + pos.y * cos(angle);
|
||||
|
||||
vec2 dist = _pos - floor(_pos * scale) / scale;
|
||||
float ww = width / 2.;
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"type": 1,
|
||||
"parent": {
|
||||
"name": "filter",
|
||||
"path": "folders/shader/filter.yy",
|
||||
"name": "generator",
|
||||
"path": "folders/shader/generator.yy",
|
||||
},
|
||||
"resourceVersion": "1.0",
|
||||
"name": "sh_grid",
|
||||
|
|
Loading…
Reference in a new issue