mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
- [Pytagorean, Herringbones, Random tiles] Add level property.
This commit is contained in:
parent
3fc1d43953
commit
3fd650d273
6 changed files with 39 additions and 18 deletions
|
@ -64,11 +64,14 @@ function Node_Herringbone_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
||||||
|
|
||||||
inputs[| 20] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
inputs[| 20] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||||
.setDisplay(VALUE_DISPLAY.rotation_range);
|
.setDisplay(VALUE_DISPLAY.rotation_range);
|
||||||
|
|
||||||
|
inputs[| 21] = nodeValue("Level", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Pattern", false], 1, 3, 12, 2, 11, 17, 4, 13,
|
["Pattern", false], 1, 3, 12, 2, 11, 17, 4, 13,
|
||||||
["Render", false], 7, 8, 5, 18, 6, 9, 10,
|
["Render", false], 7, 8, 5, 18, 6, 9, 10, 21,
|
||||||
["Truchet", true, 14], 15, 16, 20,
|
["Truchet", true, 14], 15, 16, 20,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -96,9 +99,10 @@ function Node_Herringbone_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
||||||
|
|
||||||
var _col_gap = _data[6];
|
var _col_gap = _data[6];
|
||||||
|
|
||||||
inputs[| 5].setVisible(_mode == 0);
|
inputs[| 5].setVisible(_mode == 0);
|
||||||
inputs[| 6].setVisible(_mode != 1);
|
inputs[| 6].setVisible(_mode != 1);
|
||||||
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
inputs[| 21].setVisible(_mode == 1);
|
||||||
|
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
@ -120,6 +124,7 @@ function Node_Herringbone_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y,
|
||||||
shader_set_f("truchetSeed", _data[15]);
|
shader_set_f("truchetSeed", _data[15]);
|
||||||
shader_set_f("truchetThres", _data[16]);
|
shader_set_f("truchetThres", _data[16]);
|
||||||
shader_set_f("truchetAngle", _data[20]);
|
shader_set_f("truchetAngle", _data[20]);
|
||||||
|
shader_set_f("level", _data[21]);
|
||||||
|
|
||||||
shader_set_gradient(_data[5], _data[18], _data[19], inputs[| 5]);
|
shader_set_gradient(_data[5], _data[18], _data[19], inputs[| 5]);
|
||||||
|
|
||||||
|
|
|
@ -65,11 +65,14 @@ function Node_Pytagorean_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
||||||
|
|
||||||
inputs[| 20] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
inputs[| 20] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||||
.setDisplay(VALUE_DISPLAY.rotation_range);
|
.setDisplay(VALUE_DISPLAY.rotation_range);
|
||||||
|
|
||||||
|
inputs[| 21] = nodeValue("Level", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Pattern", false], 1, 3, 12, 2, 11, 17, 4, 13,
|
["Pattern", false], 1, 3, 12, 2, 11, 17, 4, 13,
|
||||||
["Render", false], 7, 8, 5, 18, 6, 9, 10,
|
["Render", false], 7, 8, 5, 18, 6, 9, 10, 21,
|
||||||
["Truchet", true, 14], 15, 16, 20,
|
["Truchet", true, 14], 15, 16, 20,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -98,9 +101,10 @@ function Node_Pytagorean_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
||||||
var _col_gap = _data[6];
|
var _col_gap = _data[6];
|
||||||
var _gra = _data[5];
|
var _gra = _data[5];
|
||||||
|
|
||||||
inputs[| 5].setVisible(_mode == 0);
|
inputs[| 5].setVisible(_mode == 0);
|
||||||
inputs[| 6].setVisible(_mode != 1);
|
inputs[| 6].setVisible(_mode != 1);
|
||||||
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
inputs[| 21].setVisible(_mode == 1);
|
||||||
|
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
@ -122,6 +126,7 @@ function Node_Pytagorean_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _
|
||||||
shader_set_f("truchetSeed", _data[15]);
|
shader_set_f("truchetSeed", _data[15]);
|
||||||
shader_set_f("truchetThres", _data[16]);
|
shader_set_f("truchetThres", _data[16]);
|
||||||
shader_set_f("truchetAngle", _data[20]);
|
shader_set_f("truchetAngle", _data[20]);
|
||||||
|
shader_set_f("level", _data[21]);
|
||||||
|
|
||||||
shader_set_gradient(_data[5], _data[18], _data[19], inputs[| 5]);
|
shader_set_gradient(_data[5], _data[18], _data[19], inputs[| 5]);
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,14 @@ function Node_Random_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
inputs[| 19] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
inputs[| 19] = nodeValue("Texture angle", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||||
.setDisplay(VALUE_DISPLAY.rotation_range);
|
.setDisplay(VALUE_DISPLAY.rotation_range);
|
||||||
|
|
||||||
|
inputs[| 20] = nodeValue("Level", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 1 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.slider_range);
|
||||||
|
|
||||||
input_display_list = [
|
input_display_list = [
|
||||||
["Output", false], 0,
|
["Output", false], 0,
|
||||||
["Pattern", false], 1, 3, 12, 2, 11, 4, 13,
|
["Pattern", false], 1, 3, 12, 2, 11, 4, 13,
|
||||||
["Render", false], 7, 8, 5, 17, 6, 9, 10,
|
["Render", false], 7, 8, 5, 17, 6, 9, 10, 20,
|
||||||
["Truchet", true, 14], 15, 16, 19,
|
["Truchet", true, 14], 15, 16, 19,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -94,9 +97,10 @@ function Node_Random_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
var _col_gap = _data[6];
|
var _col_gap = _data[6];
|
||||||
|
|
||||||
inputs[| 5].setVisible(_mode == 0);
|
inputs[| 5].setVisible(_mode == 0);
|
||||||
inputs[| 6].setVisible(_mode != 1);
|
inputs[| 6].setVisible(_mode != 1);
|
||||||
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
inputs[| 20].setVisible(_mode == 1);
|
||||||
|
inputs[| 9].setVisible(_mode == 2 || _mode == 3);
|
||||||
|
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
|
@ -117,6 +121,7 @@ function Node_Random_Tile(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
shader_set_f("truchetSeed", _data[15]);
|
shader_set_f("truchetSeed", _data[15]);
|
||||||
shader_set_f("truchetThres", _data[16]);
|
shader_set_f("truchetThres", _data[16]);
|
||||||
shader_set_f("truchetAngle", _data[19]);
|
shader_set_f("truchetAngle", _data[19]);
|
||||||
|
shader_set_f("level", _data[20]);
|
||||||
|
|
||||||
shader_set_gradient(_data[5], _data[17], _data[18], inputs[| 5]);
|
shader_set_gradient(_data[5], _data[17], _data[18], inputs[| 5]);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ uniform int textureTruchet;
|
||||||
uniform float truchetSeed;
|
uniform float truchetSeed;
|
||||||
uniform float truchetThres;
|
uniform float truchetThres;
|
||||||
uniform vec2 truchetAngle;
|
uniform vec2 truchetAngle;
|
||||||
|
uniform vec2 level;
|
||||||
|
|
||||||
uniform float tileLength;
|
uniform float tileLength;
|
||||||
|
|
||||||
|
@ -230,7 +231,8 @@ void main() { #region
|
||||||
vec4 colr;
|
vec4 colr;
|
||||||
|
|
||||||
if(mode == 1) {
|
if(mode == 1) {
|
||||||
gl_FragColor = vec4(vec3(hc.y), 1.0);
|
float dist = (hc.y - level.x) / (level.y - level.x);
|
||||||
|
gl_FragColor = vec4(vec3(dist), 1.0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,7 @@ uniform int textureTruchet;
|
||||||
uniform float truchetSeed;
|
uniform float truchetSeed;
|
||||||
uniform float truchetThres;
|
uniform float truchetThres;
|
||||||
uniform vec2 truchetAngle;
|
uniform vec2 truchetAngle;
|
||||||
|
uniform vec2 level;
|
||||||
|
|
||||||
uniform float phase;
|
uniform float phase;
|
||||||
|
|
||||||
|
@ -264,7 +265,8 @@ void main() { #region
|
||||||
vec4 colr;
|
vec4 colr;
|
||||||
|
|
||||||
if(mode == 1) {
|
if(mode == 1) {
|
||||||
gl_FragColor = vec4(vec3(hc.y), 1.0);
|
float dist = (hc.y * 2. - level.x) / (level.y - level.x);
|
||||||
|
gl_FragColor = vec4(vec3(dist), 1.0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ uniform int textureTruchet;
|
||||||
uniform float truchetSeed;
|
uniform float truchetSeed;
|
||||||
uniform float truchetThres;
|
uniform float truchetThres;
|
||||||
uniform vec2 truchetAngle;
|
uniform vec2 truchetAngle;
|
||||||
|
uniform vec2 level;
|
||||||
|
|
||||||
#define PI 3.14159265359
|
#define PI 3.14159265359
|
||||||
#define TAU 6.28318530718
|
#define TAU 6.28318530718
|
||||||
|
@ -239,7 +240,8 @@ void main() { #region
|
||||||
vec4 colr;
|
vec4 colr;
|
||||||
|
|
||||||
if(mode == 1) {
|
if(mode == 1) {
|
||||||
gl_FragColor = vec4(vec3(hc.y), 1.0);
|
float dist = (hc.y - level.x) / (level.y - level.x);
|
||||||
|
gl_FragColor = vec4(vec3(dist), 1.0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue