mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-09 03:35:13 +01:00
Panel function separation
This commit is contained in:
parent
2f17e33923
commit
084b1afb5a
11 changed files with 127 additions and 244 deletions
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
"resources": [
|
"resources": [
|
||||||
|
{"id":{"name":"panel_function","path":"scripts/panel_function/panel_function.yy",},"order":6,},
|
||||||
{"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},"order":33,},
|
{"id":{"name":"node_time_remap","path":"scripts/node_time_remap/node_time_remap.yy",},"order":33,},
|
||||||
{"id":{"name":"s_node_blur","path":"sprites/s_node_blur/s_node_blur.yy",},"order":70,},
|
{"id":{"name":"s_node_blur","path":"sprites/s_node_blur/s_node_blur.yy",},"order":70,},
|
||||||
{"id":{"name":"sh_perlin","path":"shaders/sh_perlin/sh_perlin.yy",},"order":1,},
|
{"id":{"name":"sh_perlin","path":"shaders/sh_perlin/sh_perlin.yy",},"order":1,},
|
||||||
|
|
|
@ -1,142 +1 @@
|
||||||
{
|
{ "nodes": [ { "group": -1.0, "x": 64.0, "id": 2.0, "inputs": [ { "from node": 1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 0.0, 0.0, 0.0 ] ], "anim": 0.0, "visible": true, "from index": 0.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 0.32000000000000000666133814775094, 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 0.41999999999999998445687765524781, 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 } ], "attri": { }, "type": "Node_Level", "y": -96.0, "name": "Level" }, { "group": -1.0, "x": 224.0, "id": 3.0, "inputs": [ { "from node": 2.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 0.0, 0.0, 0.0 ] ], "anim": 0.0, "visible": true, "from index": 0.0 }, { "from node": -1.0, "on end": 0.0, "data": [ 0 ], "raw value": [ [ 0.0, 22677.0, 0.0, 0.0 ], [ 0.15120967741935484318638316381112, 2331102.0, 0.0, 0.0 ], [ 1.0, 10475775.0, 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 }, { "from node": -1.0, "on end": 0, "data": [ ], "raw value": [ [ 0.0, 0.0, 0.0, 0.0 ] ], "anim": false, "visible": false, "from index": -1.0 } ], "attri": { }, "type": "Node_Colorize", "y": -96.0, "name": "Colorize" }, { "group": -1.0, "x": -96.0, "id": 1.0, "inputs": [ { "from node": 0.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 0.0, 0.0, 0.0 ] ], "anim": 0.0, "visible": true, "from index": 0.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, 8.0, 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, [ 0.0, 1.0 ], 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, [ 6.0, 1.0 ], 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 } ], "attri": { }, "type": "Node_Bevel", "y": -96.0, "name": "Bevel" }, { "group": -1.0, "x": -256.0, "id": 0.0, "inputs": [ { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, "arrowRight.png", 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 }, { "from node": -1.0, "on end": 0.0, "data": [ ], "raw value": [ [ 0.0, [ 0.0, 0.0, 0.0, 0.0 ], 0.0, 0.0 ] ], "anim": 0.0, "visible": false, "from index": -1.0 } ], "attri": { }, "type": "Node_Image", "y": -96.0, "name": "arrowRight" } ], "version": 82.0, "animator": { "framerate": 15.0, "frames_total": 12.0 } }
|
||||||
"nodes": [{
|
|
||||||
"group": -1.0,
|
|
||||||
"x": 640.0,
|
|
||||||
"id": 2.0,
|
|
||||||
"inputs": [{
|
|
||||||
"from node": 1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": 0.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.32000000000000000666133814775094]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.41999999999999998445687765524781]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}],
|
|
||||||
"attri": {},
|
|
||||||
"type": "Node_Level",
|
|
||||||
"y": 288.0,
|
|
||||||
"name": "Level"
|
|
||||||
}, {
|
|
||||||
"group": -1.0,
|
|
||||||
"x": 800.0,
|
|
||||||
"id": 3.0,
|
|
||||||
"inputs": [{
|
|
||||||
"from node": 2.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": 0.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 22677.0],
|
|
||||||
[0.15120967741935484318638316381112, 2331102.0],
|
|
||||||
[1.0, 10475775.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}],
|
|
||||||
"attri": {},
|
|
||||||
"type": "Node_Colorize",
|
|
||||||
"y": 288.0,
|
|
||||||
"name": "Colorize"
|
|
||||||
}, {
|
|
||||||
"group": -1.0,
|
|
||||||
"x": 480.0,
|
|
||||||
"id": 1.0,
|
|
||||||
"inputs": [{
|
|
||||||
"from node": 0.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": 0.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 8.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, [0.0, 1.0]]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, [6.0, 1.0]]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, 0.0]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}],
|
|
||||||
"attri": {},
|
|
||||||
"type": "Node_Bevel",
|
|
||||||
"y": 288.0,
|
|
||||||
"name": "Bevel"
|
|
||||||
}, {
|
|
||||||
"group": -1.0,
|
|
||||||
"x": 320.0,
|
|
||||||
"id": 0.0,
|
|
||||||
"inputs": [{
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, "arrowRight.png"]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}, {
|
|
||||||
"from node": -1.0,
|
|
||||||
"on end": 0,
|
|
||||||
"raw value": [
|
|
||||||
[0.0, [0.0, 0.0, 0.0, 0.0]]
|
|
||||||
],
|
|
||||||
"anim": 0.0,
|
|
||||||
"from index": -1.0
|
|
||||||
}],
|
|
||||||
"attri": {},
|
|
||||||
"type": "Node_Image",
|
|
||||||
"y": 288.0,
|
|
||||||
"name": "arrowRight"
|
|
||||||
}],
|
|
||||||
"version": 60.0,
|
|
||||||
"animator": {
|
|
||||||
"framerate": 15.0,
|
|
||||||
"frames_total": 12.0
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -46,7 +46,7 @@
|
||||||
};
|
};
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region panel
|
#region inputs
|
||||||
globalvar FOCUS, FOCUS_STR, HOVER, DOUBLE_CLICK, CURRENT_PATH;
|
globalvar FOCUS, FOCUS_STR, HOVER, DOUBLE_CLICK, CURRENT_PATH;
|
||||||
globalvar TEXTBOX_ACTIVE;
|
globalvar TEXTBOX_ACTIVE;
|
||||||
|
|
||||||
|
@ -55,69 +55,6 @@
|
||||||
FOCUS = noone;
|
FOCUS = noone;
|
||||||
FOCUS_STR = "";
|
FOCUS_STR = "";
|
||||||
HOVER = noone;
|
HOVER = noone;
|
||||||
|
|
||||||
globalvar PANEL_MAIN, PANEL_MENU, PANEL_PREVIEW, PANEL_INSPECTOR, PANEL_GRAPH, PANEL_ANIMATION, PANEL_COLLECTION;
|
|
||||||
PANEL_MAIN = 0;
|
|
||||||
|
|
||||||
function clearPanel() {
|
|
||||||
delete PANEL_MAIN;
|
|
||||||
delete PANEL_MENU;
|
|
||||||
delete PANEL_INSPECTOR;
|
|
||||||
delete PANEL_PREVIEW;
|
|
||||||
delete PANEL_GRAPH;
|
|
||||||
|
|
||||||
PANEL_MAIN = 0;
|
|
||||||
PANEL_MENU = 0;
|
|
||||||
PANEL_INSPECTOR = 0;
|
|
||||||
PANEL_PREVIEW = 0;
|
|
||||||
PANEL_GRAPH = 0;
|
|
||||||
}
|
|
||||||
function setPanel() {
|
|
||||||
PANEL_MAIN = new Panel(noone, 0, 0, WIN_W, WIN_H);
|
|
||||||
|
|
||||||
var split_menu = PANEL_MAIN.split_v(40);
|
|
||||||
PANEL_MENU = new Panel_Menu(split_menu[0]);
|
|
||||||
|
|
||||||
var split_ins = split_menu[1].split_h(-400);
|
|
||||||
PANEL_INSPECTOR = new Panel_Inspector(split_ins[1]);
|
|
||||||
|
|
||||||
switch(PREF_MAP[? "panel_layout"]) {
|
|
||||||
case 0 :
|
|
||||||
var split_anim = split_ins[0].split_v(-48);
|
|
||||||
PANEL_ANIMATION = new Panel_Animation(split_anim[1]);
|
|
||||||
|
|
||||||
var split_prev = split_anim[0].split_v(-500);
|
|
||||||
PANEL_PREVIEW = new Panel_Preview(split_prev[0]);
|
|
||||||
|
|
||||||
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
|
|
||||||
|
|
||||||
if(PREF_MAP[? "panel_collection"]) {
|
|
||||||
var pane = PANEL_GRAPH.panel.split_h(460);
|
|
||||||
pane[1].set(PANEL_GRAPH);
|
|
||||||
PANEL_COLLECTION = new Panel_Collection(pane[0]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 1 :
|
|
||||||
var split_anim = split_ins[0].split_v(-240);
|
|
||||||
PANEL_ANIMATION = new Panel_Animation(split_anim[1]);
|
|
||||||
|
|
||||||
var split_prev = split_anim[0].split_h(400);
|
|
||||||
PANEL_PREVIEW = new Panel_Preview(split_prev[0]);
|
|
||||||
|
|
||||||
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
|
|
||||||
|
|
||||||
if(PREF_MAP[? "panel_collection"]) {
|
|
||||||
var pane = PANEL_ANIMATION.panel.split_h(460);
|
|
||||||
pane[1].set(PANEL_ANIMATION);
|
|
||||||
PANEL_COLLECTION = new Panel_Collection(pane[0]);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
PANEL_ANIMATION.updatePropertyList();
|
|
||||||
PANEL_MAIN.refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
TEXTBOX_ACTIVE = noone
|
TEXTBOX_ACTIVE = noone
|
||||||
|
|
||||||
globalvar ADD_NODE_PAGE, ADD_NODE_W, ADD_NODE_H;
|
globalvar ADD_NODE_PAGE, ADD_NODE_W, ADD_NODE_H;
|
||||||
|
@ -125,27 +62,7 @@
|
||||||
ADD_NODE_W = 372 + 16 * 3 + 8;
|
ADD_NODE_W = 372 + 16 * 3 + 8;
|
||||||
ADD_NODE_H = 320;
|
ADD_NODE_H = 320;
|
||||||
|
|
||||||
function findPanel(_name, _pane, _res) {
|
|
||||||
if(instanceof(_pane) != "Panel")
|
|
||||||
return _res;
|
|
||||||
if(!ds_exists(_pane.childs, ds_type_list))
|
|
||||||
return _res;
|
|
||||||
|
|
||||||
if(ds_list_size(_pane.childs) == 0 && _pane.content && instanceof(_pane.content) == _name) {
|
|
||||||
return _pane.content;
|
|
||||||
}
|
|
||||||
|
|
||||||
for(var i = 0; i < ds_list_size(_pane.childs); i++) {
|
|
||||||
var _re = findPanel(_name, _pane.childs[| i], _res);
|
|
||||||
if(_re != noone)
|
|
||||||
_res = _re;
|
|
||||||
}
|
|
||||||
|
|
||||||
return _res;
|
|
||||||
}
|
|
||||||
|
|
||||||
globalvar AXIS_COLOR;
|
globalvar AXIS_COLOR;
|
||||||
|
|
||||||
AXIS_COLOR = [ c_ui_red, c_ui_lime, c_ui_cyan, c_yellow, c_aqua, c_fuchsia, c_orange, c_ltgray ];
|
AXIS_COLOR = [ c_ui_red, c_ui_lime, c_ui_cyan, c_yellow, c_aqua, c_fuchsia, c_orange, c_ltgray ];
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,6 @@ function Node_Image(_x, _y) : Node(_x, _y) constructor {
|
||||||
case ".jpeg":
|
case ".jpeg":
|
||||||
case ".gif":
|
case ".gif":
|
||||||
name = _name;
|
name = _name;
|
||||||
inputs[| 0].setValue(path);
|
|
||||||
outputs[| 1].setValue(path);
|
outputs[| 1].setValue(path);
|
||||||
|
|
||||||
if(spr) sprite_delete(spr);
|
if(spr) sprite_delete(spr);
|
||||||
|
|
|
@ -95,7 +95,6 @@ function Node_Image_Animated(_x, _y) : Node(_x, _y) constructor {
|
||||||
spr = [];
|
spr = [];
|
||||||
|
|
||||||
path_loaded = array_create(array_length(paths));
|
path_loaded = array_create(array_length(paths));
|
||||||
inputs[| 0].setValue(paths);
|
|
||||||
|
|
||||||
for( var i = 0; i < array_length(paths); i++ ) {
|
for( var i = 0; i < array_length(paths); i++ ) {
|
||||||
path_loaded[i] = paths[i];
|
path_loaded[i] = paths[i];
|
||||||
|
|
|
@ -71,7 +71,6 @@ function Node_Image_gif(_x, _y) : Node(_x, _y) constructor {
|
||||||
switch(ext) {
|
switch(ext) {
|
||||||
case ".gif":
|
case ".gif":
|
||||||
name = _name;
|
name = _name;
|
||||||
inputs[| 0].setValue(path);
|
|
||||||
outputs[| 1].setValue(path);
|
outputs[| 1].setValue(path);
|
||||||
|
|
||||||
if(spr) sprite_delete(spr);
|
if(spr) sprite_delete(spr);
|
||||||
|
|
|
@ -95,7 +95,6 @@ function Node_Image_Sequence(_x, _y) : Node(_x, _y) constructor {
|
||||||
spr = [];
|
spr = [];
|
||||||
|
|
||||||
path_loaded = array_create(array_length(paths));
|
path_loaded = array_create(array_length(paths));
|
||||||
inputs[| 0].setValue(paths);
|
|
||||||
|
|
||||||
for( var i = 0; i < array_length(paths); i++ ) {
|
for( var i = 0; i < array_length(paths); i++ ) {
|
||||||
path_loaded[i] = paths[i];
|
path_loaded[i] = paths[i];
|
||||||
|
|
85
scripts/panel_function/panel_function.gml
Normal file
85
scripts/panel_function/panel_function.gml
Normal file
|
@ -0,0 +1,85 @@
|
||||||
|
#region data
|
||||||
|
globalvar PANEL_MAIN, PANEL_MENU, PANEL_PREVIEW, PANEL_INSPECTOR, PANEL_GRAPH, PANEL_ANIMATION, PANEL_COLLECTION;
|
||||||
|
PANEL_MAIN = 0;
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region functions
|
||||||
|
function clearPanel() {
|
||||||
|
delete PANEL_MAIN;
|
||||||
|
delete PANEL_MENU;
|
||||||
|
delete PANEL_INSPECTOR;
|
||||||
|
delete PANEL_PREVIEW;
|
||||||
|
delete PANEL_GRAPH;
|
||||||
|
|
||||||
|
PANEL_MAIN = 0;
|
||||||
|
PANEL_MENU = 0;
|
||||||
|
PANEL_INSPECTOR = 0;
|
||||||
|
PANEL_PREVIEW = 0;
|
||||||
|
PANEL_GRAPH = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
function setPanel() {
|
||||||
|
PANEL_MAIN = new Panel(noone, 0, 0, WIN_W, WIN_H);
|
||||||
|
|
||||||
|
var split_menu = PANEL_MAIN.split_v(40);
|
||||||
|
PANEL_MENU = new Panel_Menu(split_menu[0]);
|
||||||
|
|
||||||
|
var split_ins = split_menu[1].split_h(-400);
|
||||||
|
PANEL_INSPECTOR = new Panel_Inspector(split_ins[1]);
|
||||||
|
|
||||||
|
switch(PREF_MAP[? "panel_layout"]) {
|
||||||
|
case 0 :
|
||||||
|
var split_anim = split_ins[0].split_v(-48);
|
||||||
|
PANEL_ANIMATION = new Panel_Animation(split_anim[1]);
|
||||||
|
|
||||||
|
var split_prev = split_anim[0].split_v(-500);
|
||||||
|
PANEL_PREVIEW = new Panel_Preview(split_prev[0]);
|
||||||
|
|
||||||
|
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
|
||||||
|
|
||||||
|
if(PREF_MAP[? "panel_collection"]) {
|
||||||
|
var pane = PANEL_GRAPH.panel.split_h(460);
|
||||||
|
pane[1].set(PANEL_GRAPH);
|
||||||
|
PANEL_COLLECTION = new Panel_Collection(pane[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 1 :
|
||||||
|
var split_anim = split_ins[0].split_v(-240);
|
||||||
|
PANEL_ANIMATION = new Panel_Animation(split_anim[1]);
|
||||||
|
|
||||||
|
var split_prev = split_anim[0].split_h(400);
|
||||||
|
PANEL_PREVIEW = new Panel_Preview(split_prev[0]);
|
||||||
|
|
||||||
|
PANEL_GRAPH = new Panel_Graph(split_prev[1]);
|
||||||
|
|
||||||
|
if(PREF_MAP[? "panel_collection"]) {
|
||||||
|
var pane = PANEL_ANIMATION.panel.split_h(460);
|
||||||
|
pane[1].set(PANEL_ANIMATION);
|
||||||
|
PANEL_COLLECTION = new Panel_Collection(pane[0]);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
PANEL_ANIMATION.updatePropertyList();
|
||||||
|
PANEL_MAIN.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
function findPanel(_name, _pane, _res) {
|
||||||
|
if(instanceof(_pane) != "Panel")
|
||||||
|
return _res;
|
||||||
|
if(!ds_exists(_pane.childs, ds_type_list))
|
||||||
|
return _res;
|
||||||
|
|
||||||
|
if(ds_list_size(_pane.childs) == 0 && _pane.content && instanceof(_pane.content) == _name) {
|
||||||
|
return _pane.content;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(var i = 0; i < ds_list_size(_pane.childs); i++) {
|
||||||
|
var _re = findPanel(_name, _pane.childs[| i], _res);
|
||||||
|
if(_re != noone)
|
||||||
|
_res = _re;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _res;
|
||||||
|
}
|
||||||
|
#endregion
|
12
scripts/panel_function/panel_function.yy
Normal file
12
scripts/panel_function/panel_function.yy
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "data",
|
||||||
|
"path": "folders/panels/data.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "panel_function",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
|
@ -12,7 +12,14 @@ uniform float gradient_shift;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec4 _col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
|
vec4 _col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
|
||||||
float prog = fract(dot(_col.rgb, vec3(0.2126, 0.7152, 0.0722)) + gradient_shift);
|
float prog = abs(dot(_col.rgb, vec3(0.2126, 0.7152, 0.0722)) + gradient_shift);
|
||||||
|
if(prog > 1.) {
|
||||||
|
if(prog == floor(prog))
|
||||||
|
prog = 1.;
|
||||||
|
else
|
||||||
|
prog = fract(prog);
|
||||||
|
}
|
||||||
|
|
||||||
vec4 col = vec4(0.);
|
vec4 col = vec4(0.);
|
||||||
|
|
||||||
for(int i = 0; i < 16; i++) {
|
for(int i = 0; i < 16; i++) {
|
||||||
|
|
|
@ -56,9 +56,15 @@ void main() {
|
||||||
float _a = atan(_p.y, _p.x) + angle;
|
float _a = atan(_p.y, _p.x) + angle;
|
||||||
prog = (_a - floor(_a / TAU) * TAU) / TAU;
|
prog = (_a - floor(_a / TAU) * TAU) / TAU;
|
||||||
}
|
}
|
||||||
prog += shift;
|
prog = abs(prog + shift);
|
||||||
if(gradient_loop == 1)
|
if(gradient_loop == 1) {
|
||||||
|
if(prog > 1.) {
|
||||||
|
if(prog == floor(prog))
|
||||||
|
prog = 1.;
|
||||||
|
else
|
||||||
prog = fract(prog);
|
prog = fract(prog);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
vec4 col = gradientEval(prog);
|
vec4 col = gradientEval(prog);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue