Fix stretching when using non square surface on multiple nodes.
|
@ -655,13 +655,6 @@
|
||||||
{"$GMIncludedFile":"","%Name":"tile_0126.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Getting started","name":"tile_0126.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"tile_0126.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Getting started","name":"tile_0126.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Broken heart.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Broken heart.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Broken heart.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Broken heart.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Broken heart.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Broken heart.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Broken heart.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"card_back.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"card_back.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"card_clubs_02.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"card_clubs_02.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"card_clubs_03.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"card_clubs_03.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"card_clubs_04.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"card_clubs_04.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"card_clubs_05.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"card_clubs_05.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"Cards flipping.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Cards flipping.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"Cards flipping.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Cards flipping.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
|
||||||
{"$GMIncludedFile":"","%Name":"dice_1.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_1.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"dice_1.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_1.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"dice_2.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_2.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"dice_2.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_2.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"dice_3.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_3.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"dice_3.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"dice_3.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
@ -672,6 +665,8 @@
|
||||||
{"$GMIncludedFile":"","%Name":"Dice.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Dice.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Dice.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Dice.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Shiny gem.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Shiny gem.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Shiny gem.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Shiny gem.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"Shiny gem.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Shiny gem.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"Shiny gem.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Shiny gem.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
{"$GMIncludedFile":"","%Name":"Space cloud.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Space cloud.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
{"$GMIncludedFile":"","%Name":"Space cloud.pxc","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"Space cloud.pxc","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"spark.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"spark.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"spark.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"spark.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"tile_0044.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"tile_0044.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"tile_0044.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"tile_0044.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
{"$GMIncludedFile":"","%Name":"tile_0067.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"tile_0067.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
{"$GMIncludedFile":"","%Name":"tile_0067.png","CopyToMask":-1,"filePath":"datafiles/Welcome files/Sample Projects","name":"tile_0067.png","resourceType":"GMIncludedFile","resourceVersion":"2.0",},
|
||||||
|
|
Before Width: | Height: | Size: 887 B |
BIN
datafiles/Welcome files/Sample Projects/Space cloud.png
Normal file
After Width: | Height: | Size: 2.1 KiB |
1
datafiles/Welcome files/Sample Projects/Space cloud.pxc
Normal file
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.4 KiB |
|
@ -2,7 +2,7 @@ function Node_Shader_Generator(_x, _y, _group = noone) : Node_Shader(_x, _y, _gr
|
||||||
name = "";
|
name = "";
|
||||||
|
|
||||||
newInput(0, nodeValue_Dimension(self));
|
newInput(0, nodeValue_Dimension(self));
|
||||||
addShaderProp(SHADER_UNIFORM.float, "u_resolution");
|
addShaderProp(SHADER_UNIFORM.float, "dimension");
|
||||||
|
|
||||||
attribute_surface_depth();
|
attribute_surface_depth();
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ function Node_Shader_Processor(_x, _y, _group = noone) : Node_Shader(_x, _y, _gr
|
||||||
_outSurf = surface_verify(_outSurf, _sw, _sh, attrDepth());
|
_outSurf = surface_verify(_outSurf, _sw, _sh, attrDepth());
|
||||||
|
|
||||||
surface_set_shader(_outSurf, shader);
|
surface_set_shader(_outSurf, shader);
|
||||||
shader_set_f("u_resolution", _sw, _sh);
|
shader_set_f("dimension", _sw, _sh);
|
||||||
setShader(_data);
|
setShader(_data);
|
||||||
|
|
||||||
draw_surface_safe(_surf);
|
draw_surface_safe(_surf);
|
||||||
|
|
|
@ -66,6 +66,7 @@ function Node_Noise_Aniso(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_ani_noise);
|
surface_set_shader(_outSurf, sh_ani_noise);
|
||||||
|
shader_set_2("dimension", _dim);
|
||||||
shader_set_f("position", _pos[0] / _dim[0], _pos[1] / _dim[1]);
|
shader_set_f("position", _pos[0] / _dim[0], _pos[1] / _dim[1]);
|
||||||
shader_set_f("seed", _data[2]);
|
shader_set_f("seed", _data[2]);
|
||||||
shader_set_f("colrSeed", _data[10]);
|
shader_set_f("colrSeed", _data[10]);
|
||||||
|
|
|
@ -79,7 +79,7 @@ function Node_Perlin(_x, _y, _group = noone) : Node_Processor(_x, _y, _group) co
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_perlin_tiled);
|
surface_set_shader(_outSurf, sh_perlin_tiled);
|
||||||
shader_set_f("u_resolution", _dim);
|
shader_set_2("dimension", _dim);
|
||||||
shader_set_2("position", _pos);
|
shader_set_2("position", _pos);
|
||||||
shader_set_f("rotation", degtorad(_rot));
|
shader_set_f("rotation", degtorad(_rot));
|
||||||
shader_set_f_map("scale", _data[2], _data[10], inputs[2]);
|
shader_set_f_map("scale", _data[2], _data[10], inputs[2]);
|
||||||
|
|
|
@ -42,7 +42,7 @@ function Node_Perlin_Smear(_x, _y, _group = noone) : Node_Processor(_x, _y, _gro
|
||||||
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
_outSurf = surface_verify(_outSurf, _dim[0], _dim[1], attrDepth());
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_perlin_smear);
|
surface_set_shader(_outSurf, sh_perlin_smear);
|
||||||
shader_set_f("u_resolution", _dim);
|
shader_set_f("dimension", _dim);
|
||||||
shader_set_2("position", _pos);
|
shader_set_2("position", _pos);
|
||||||
shader_set_2("scale", _sca);
|
shader_set_2("scale", _sca);
|
||||||
shader_set_f("bright", _bri);
|
shader_set_f("bright", _bri);
|
||||||
|
|
|
@ -74,6 +74,7 @@ function Node_RM_Cloud(_x, _y, _group = noone) : Node_Processor(_x, _y, _group)
|
||||||
|
|
||||||
surface_set_shader(_outSurf, sh_rm_cloud);
|
surface_set_shader(_outSurf, sh_rm_cloud);
|
||||||
|
|
||||||
|
shader_set_2("dimension", _dim);
|
||||||
shader_set_3("position", _pos);
|
shader_set_3("position", _pos);
|
||||||
shader_set_3("rotation", _rot);
|
shader_set_3("rotation", _rot);
|
||||||
shader_set_f("objectScale", _sca * 4);
|
shader_set_f("objectScale", _sca * 4);
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform float colrSeed;
|
uniform float colrSeed;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
|
@ -44,7 +45,8 @@ void main() {
|
||||||
ang = radians(ang);
|
ang = radians(ang);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
vec2 pos = (v_vTexcoord - position) * mat2(cos(ang), - sin(ang), sin(ang), cos(ang));
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
vec2 pos = (ntx - position) * mat2(cos(ang), - sin(ang), sin(ang), cos(ang));
|
||||||
|
|
||||||
float yy = floor(pos.y * nsy);
|
float yy = floor(pos.y * nsy);
|
||||||
float xx = (pos.x + random(vec2(1., yy), seed)) * nsx;
|
float xx = (pos.x + random(vec2(1., yy), seed)) * nsx;
|
||||||
|
|
|
@ -36,8 +36,9 @@ void main() {
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 pos = position / dimension;
|
vec2 pos = position / dimension;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 st = (ntx - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
vec3 color = vec3(.0);
|
vec3 color = vec3(.0);
|
||||||
|
|
||||||
float m_dist = 1.;
|
float m_dist = 1.;
|
||||||
|
@ -70,7 +71,7 @@ void main() {
|
||||||
float rad = pow(float(j) / sca, radiusScale) * sca * .5 + random(vec2(angl)) * 0.1;
|
float rad = pow(float(j) / sca, radiusScale) * sca * .5 + random(vec2(angl)) * 0.1;
|
||||||
vec2 point = vec2(cos(angl) * rad, sin(angl) * rad) + pos;
|
vec2 point = vec2(cos(angl) * rad, sin(angl) * rad) + pos;
|
||||||
|
|
||||||
vec2 _diff = point - v_vTexcoord;
|
vec2 _diff = point - ntx;
|
||||||
float dist = length(_diff);
|
float dist = length(_diff);
|
||||||
m_dist = min(m_dist, dist);
|
m_dist = min(m_dist, dist);
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,8 +59,9 @@ void main() {
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 pos = position / dimension;
|
vec2 pos = position / dimension;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca * 0.75;
|
vec2 st = (ntx - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca * 0.75;
|
||||||
|
|
||||||
float n = voronoi3d(vec3(st, seed), sca);
|
float n = voronoi3d(vec3(st, seed), sca);
|
||||||
n = middle + (n - middle) * contrast;
|
n = middle + (n - middle) * contrast;
|
||||||
|
|
|
@ -37,8 +37,9 @@ void main() {
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 pos = position / dimension;
|
vec2 pos = position / dimension;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 st = (ntx - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
|
|
||||||
float md = 8.;
|
float md = 8.;
|
||||||
vec2 mg, mr;
|
vec2 mg, mr;
|
||||||
|
@ -83,7 +84,7 @@ void main() {
|
||||||
vec2 neighbor = vec2(cos(ang) * rad, sin(ang) * rad);
|
vec2 neighbor = vec2(cos(ang) * rad, sin(ang) * rad);
|
||||||
vec2 point = neighbor + pos;
|
vec2 point = neighbor + pos;
|
||||||
|
|
||||||
vec2 _diff = point - v_vTexcoord;
|
vec2 _diff = point - ntx;
|
||||||
float dist = length(_diff);
|
float dist = length(_diff);
|
||||||
|
|
||||||
if(dist < md) {
|
if(dist < md) {
|
||||||
|
@ -103,7 +104,7 @@ void main() {
|
||||||
vec2 neighbor = vec2(cos(ang) * rad, sin(ang) * rad);
|
vec2 neighbor = vec2(cos(ang) * rad, sin(ang) * rad);
|
||||||
vec2 point = neighbor + pos;
|
vec2 point = neighbor + pos;
|
||||||
|
|
||||||
vec2 r = point - v_vTexcoord;
|
vec2 r = point - ntx;
|
||||||
if(dot(mr - r, mr - r) > .0001)
|
if(dot(mr - r, mr - r) > .0001)
|
||||||
md = min( md, dot( 0.5 * (mr + r), normalize(r - mr)) );
|
md = min( md, dot( 0.5 * (mr + r), normalize(r - mr)) );
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,9 @@ void main() {
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 pos = position / dimension;
|
vec2 pos = position / dimension;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 st = (ntx - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
vec3 color = vec3(.0);
|
vec3 color = vec3(.0);
|
||||||
|
|
||||||
vec2 i_st = floor(st);
|
vec2 i_st = floor(st);
|
||||||
|
@ -80,7 +81,7 @@ void main() {
|
||||||
float rad = pow(float(j) / sca, radiusScale) * sca * .5 + random(vec2(ang)) * 0.1;
|
float rad = pow(float(j) / sca, radiusScale) * sca * .5 + random(vec2(ang)) * 0.1;
|
||||||
vec2 point = vec2(cos(ang) * rad, sin(ang) * rad) + pos;
|
vec2 point = vec2(cos(ang) * rad, sin(ang) * rad) + pos;
|
||||||
|
|
||||||
vec2 _diff = point - v_vTexcoord;
|
vec2 _diff = point - ntx;
|
||||||
float dist = length(_diff);
|
float dist = length(_diff);
|
||||||
|
|
||||||
if(dist < m_dist) {
|
if(dist < m_dist) {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float scale;
|
uniform float scale;
|
||||||
uniform float time;
|
uniform float time;
|
||||||
|
@ -14,7 +15,8 @@ vec2 random2( vec2 p ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 st = v_vTexcoord + position;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
vec2 st = ntx + position;
|
||||||
vec3 color = vec3(.0);
|
vec3 color = vec3(.0);
|
||||||
|
|
||||||
// Scale
|
// Scale
|
||||||
|
|
|
@ -205,8 +205,10 @@ void main() {
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
|
||||||
if(mode == 1) {
|
if(mode == 1) {
|
||||||
vec2 px = floor((v_vTexcoord - position) * dimension);
|
vec2 px = floor((ntx - position) * dimension);
|
||||||
|
|
||||||
sca = floor(sca);
|
sca = floor(sca);
|
||||||
vec2 scaG = sca - (gapAcc + 1.);
|
vec2 scaG = sca - (gapAcc + 1.);
|
||||||
|
@ -240,7 +242,7 @@ void main() {
|
||||||
|
|
||||||
sca = dimension / sca;
|
sca = dimension / sca;
|
||||||
|
|
||||||
vec2 pos = v_vTexcoord - position, _pos;
|
vec2 pos = ntx - position, _pos;
|
||||||
float ratio = dimension.x / dimension.y;
|
float ratio = dimension.x / dimension.y;
|
||||||
_pos.x = pos.x * ratio * cos(ang) - pos.y * sin(ang);
|
_pos.x = pos.x * ratio * cos(ang) - pos.y * sin(ang);
|
||||||
_pos.y = pos.x * ratio * sin(ang) + pos.y * cos(ang);
|
_pos.y = pos.x * ratio * sin(ang) + pos.y * cos(ang);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform float density;
|
uniform float density;
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -16,11 +16,12 @@ uniform float thickness;
|
||||||
float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(1., 6.), vec2(2., 7.))) * (1. + seed / 100.)); }
|
float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(1., 6.), vec2(2., 7.))) * (1. + seed / 100.)); }
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 tx = 1. / u_resolution;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 ps = v_vTexcoord;
|
vec2 tx = 1. / dimension;
|
||||||
|
vec2 ps = ntx;
|
||||||
float w = 0.;
|
float w = 0.;
|
||||||
|
|
||||||
vec2 dim = u_resolution;
|
vec2 dim = dimension;
|
||||||
vec2 pos = ps;
|
vec2 pos = ps;
|
||||||
|
|
||||||
float _t = min(tx.x, tx.y) / 2.;
|
float _t = min(tx.x, tx.y) / 2.;
|
||||||
|
|
|
@ -7,7 +7,7 @@ varying vec4 v_vColour;
|
||||||
#define PI 3.141592
|
#define PI 3.141592
|
||||||
#define TAU 6.283184
|
#define TAU 6.283184
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
|
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
|
@ -60,7 +60,8 @@ vec3 Oilnoise(in vec2 pos, in vec3 RGB) {
|
||||||
|
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 pos = v_vTexcoord * scale + position;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
vec2 pos = ntx * scale + position;
|
||||||
vec3 col = Oilnoise(pos, color.rgb * gamma);
|
vec3 col = Oilnoise(pos, color.rgb * gamma);
|
||||||
gl_FragColor = vec4(col, 1.0);
|
gl_FragColor = vec4(col, 1.0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,13 +5,14 @@ uniform float progress;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
uniform vec2 detail;
|
uniform vec2 detail;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 uv = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
vec2 uv = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
||||||
|
|
||||||
for(float i = detail.x; i <= detail.y; i++) {
|
for(float i = detail.x; i <= detail.y; i++) {
|
||||||
uv.x += .5 / i * sin(i * 3. * uv.y + progress);
|
uv.x += .5 / i * sin(i * 3. * uv.y + progress);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -15,8 +15,9 @@ uniform float amplitude;
|
||||||
uniform int mode;
|
uniform int mode;
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
vec2 pos = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
||||||
vec4 col = vec4(0., 0., 0., 1.);
|
vec4 col = vec4(0., 0., 0., 1.);
|
||||||
|
|
||||||
for (int i = 0; i < iteration; i++) {
|
for (int i = 0; i < iteration; i++) {
|
||||||
|
|
|
@ -26,7 +26,7 @@ uniform vec2 scale;
|
||||||
uniform int scaleUseSurf;
|
uniform int scaleUseSurf;
|
||||||
uniform sampler2D scaleSurf;
|
uniform sampler2D scaleSurf;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float trRotation;
|
uniform float trRotation;
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ void main() {
|
||||||
|
|
||||||
float r = radians(trRotation);
|
float r = radians(trRotation);
|
||||||
vec2 pos = v_vTexcoord;
|
vec2 pos = v_vTexcoord;
|
||||||
pos.x *= (u_resolution.x / u_resolution.y);
|
pos.x *= (dimension.x / dimension.y);
|
||||||
pos = (pos - position / u_resolution) * mat2(cos(r), -sin(r), sin(r), cos(r)) * scale;
|
pos = (pos - position / dimension) * mat2(cos(r), -sin(r), sin(r), cos(r)) * scale;
|
||||||
|
|
||||||
vec3 f = gabor_wave(pos);
|
vec3 f = gabor_wave(pos);
|
||||||
vec3 col = vec3(0.5 + 0.5 * f.x);
|
vec3 col = vec3(0.5 + 0.5 * f.x);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -92,8 +92,9 @@ vec3 iterateNoise ( vec2 pos, int iteration ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale * 4.;
|
vec2 pos = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale * 4.;
|
||||||
vec3 col = iterateNoise(pos, iteration);
|
vec3 col = iterateNoise(pos, iteration);
|
||||||
|
|
||||||
// if(mode == 0) col = vec3(noiseHoneycomb(pos));
|
// if(mode == 0) col = vec3(noiseHoneycomb(pos));
|
||||||
|
|
|
@ -20,7 +20,7 @@ uniform vec2 scale;
|
||||||
uniform int scaleUseSurf;
|
uniform int scaleUseSurf;
|
||||||
uniform sampler2D scaleSurf;
|
uniform sampler2D scaleSurf;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
|
||||||
|
@ -77,8 +77,9 @@ void main() {
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca / 16.;
|
vec2 pos = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca / 16.;
|
||||||
|
|
||||||
prog /= 100.;
|
prog /= 100.;
|
||||||
vec3 uv = vec3( pos + prog, prog * .5 );
|
vec3 uv = vec3( pos + prog, prog * .5 );
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float density;
|
uniform float density;
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
|
@ -20,11 +20,12 @@ uniform float thickness;
|
||||||
float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(1., 6.), vec2(2., 7.))) * (1. + seed / 100.)); }
|
float random (in vec2 st) { return fract(sin(dot(st.xy + vec2(1., 6.), vec2(2., 7.))) * (1. + seed / 100.)); }
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 tx = 1. / u_resolution;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 ps = v_vTexcoord + position;
|
vec2 tx = 1. / dimension;
|
||||||
|
vec2 ps = ntx + position;
|
||||||
float w = 0.;
|
float w = 0.;
|
||||||
|
|
||||||
vec2 dim = axis == 0? u_resolution : u_resolution.yx;
|
vec2 dim = axis == 0? dimension : dimension.yx;
|
||||||
vec2 pos = axis == 0? ps : ps.yx;
|
vec2 pos = axis == 0? ps : ps.yx;
|
||||||
|
|
||||||
float _t = min(tx.x, tx.y) / 2.;
|
float _t = min(tx.x, tx.y) / 2.;
|
||||||
|
|
|
@ -11,7 +11,7 @@ varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
|
||||||
|
@ -66,8 +66,9 @@ void main() {
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca / 16.;
|
vec2 pos = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca / 16.;
|
||||||
|
|
||||||
vec3 col = vec3(0.);
|
vec3 col = vec3(0.);
|
||||||
col += WaveletNoise(pos * 5., (2.9864 + prog), detl) * .5 + .5;
|
col += WaveletNoise(pos * 5., (2.9864 + prog), detl) * .5 + .5;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float scale;
|
uniform float scale;
|
||||||
uniform int iteration;
|
uniform int iteration;
|
||||||
|
@ -39,7 +39,8 @@ float perlin ( vec2 pos, int iteration ) {
|
||||||
///////////////////// PERLIN END /////////////////////
|
///////////////////// PERLIN END /////////////////////
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 pos = position + v_vTexcoord * scale;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
vec2 pos = position + ntx * scale;
|
||||||
float n = perlin(pos, iteration);
|
float n = perlin(pos, iteration);
|
||||||
|
|
||||||
gl_FragColor = vec4(vec3(n), 1.0);
|
gl_FragColor = vec4(vec3(n), 1.0);
|
||||||
|
|
|
@ -4,7 +4,7 @@ varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform int type;
|
uniform int type;
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
|
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
@ -193,8 +193,9 @@ void main() { #region
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 uv = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 uv = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
|
|
||||||
if(colored == 0) {
|
if(colored == 0) {
|
||||||
gl_FragColor = vec4(vec3(perlin(uv)), 1.0);
|
gl_FragColor = vec4(vec3(perlin(uv)), 1.0);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -49,7 +49,7 @@ float noise (in vec2 st) {
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = position / u_resolution;
|
vec2 pos = position / dimension;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale;
|
||||||
|
|
||||||
float amp = bright;
|
float amp = bright;
|
||||||
|
|
|
@ -2,7 +2,7 @@ varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -88,7 +88,7 @@ void main() { #region
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
vec2 pos = position / u_resolution;
|
vec2 pos = position / dimension;
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,8 @@ void main() { #region
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
vec2 pos = (v_vTexcoord - position) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * amo;
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
vec2 pos = (ntx - position) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * amo;
|
||||||
|
|
||||||
float value = 0.0;
|
float value = 0.0;
|
||||||
int num = 4;
|
int num = 4;
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
|
|
||||||
float d(vec4 c) { return (c.r + c.g + c.b) / 3. * c.a; }
|
float d(vec4 c) { return (c.r + c.g + c.b) / 3. * c.a; }
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 tx = 1. / u_resolution;
|
vec2 tx = 1. / dimension;
|
||||||
vec4 cc = texture2D( gm_BaseTexture, v_vTexcoord );
|
vec4 cc = texture2D( gm_BaseTexture, v_vTexcoord );
|
||||||
int emp = 0;
|
int emp = 0;
|
||||||
|
|
||||||
vec2 px = v_vTexcoord * u_resolution;
|
vec2 px = v_vTexcoord * dimension;
|
||||||
|
|
||||||
gl_FragColor = vec4(0.);
|
gl_FragColor = vec4(0.);
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,8 @@ const int MAX_MARCHING_STEPS = 200;
|
||||||
const float EPSILON = 1e-6;
|
const float EPSILON = 1e-6;
|
||||||
const float PI = 3.14159265358979323846;
|
const float PI = 3.14159265358979323846;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
|
|
||||||
uniform vec3 position;
|
uniform vec3 position;
|
||||||
uniform vec3 rotation;
|
uniform vec3 rotation;
|
||||||
uniform float objectScale;
|
uniform float objectScale;
|
||||||
|
@ -354,6 +356,8 @@ vec3 marchDensity(in vec3 camera, in vec3 direction, out vec3 hitPos) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
|
||||||
mat3 rx = rotateX(rotation.x);
|
mat3 rx = rotateX(rotation.x);
|
||||||
mat3 ry = rotateY(rotation.y);
|
mat3 ry = rotateY(rotation.y);
|
||||||
mat3 rz = rotateZ(rotation.z);
|
mat3 rz = rotateZ(rotation.z);
|
||||||
|
@ -361,7 +365,7 @@ void main() {
|
||||||
irotMatrix = inverse(rotMatrix);
|
irotMatrix = inverse(rotMatrix);
|
||||||
|
|
||||||
float z = 1. / tan(radians(fov) / 2.);
|
float z = 1. / tan(radians(fov) / 2.);
|
||||||
dir = normalize(vec3((v_vTexcoord - .5) * 2., -z));
|
dir = normalize(vec3((ntx - .5) * 2., -z));
|
||||||
eye = vec3(0., 0., 5.);
|
eye = vec3(0., 0., 5.);
|
||||||
|
|
||||||
dir = normalize(irotMatrix * dir) / objectScale;
|
dir = normalize(irotMatrix * dir) / objectScale;
|
||||||
|
|
|
@ -147,22 +147,24 @@ float simplex(in vec2 st) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
|
|
||||||
sca = scale;
|
sca = scale;
|
||||||
if(scaleUseSurf == 1) {
|
if(scaleUseSurf == 1) {
|
||||||
vec4 _vMap = texture2D( scaleSurf, v_vTexcoord );
|
vec4 _vMap = texture2D( scaleSurf, ntx );
|
||||||
sca = vec2(mix(scale.x, scale.y, (_vMap.r + _vMap.g + _vMap.b) / 3.));
|
sca = vec2(mix(scale.x, scale.y, (_vMap.r + _vMap.g + _vMap.b) / 3.));
|
||||||
}
|
}
|
||||||
|
|
||||||
itr = iteration.x;
|
itr = iteration.x;
|
||||||
itrMax = max(iteration.x, iteration.y);
|
itrMax = max(iteration.x, iteration.y);
|
||||||
if(iterationUseSurf == 1) {
|
if(iterationUseSurf == 1) {
|
||||||
vec4 _vMap = texture2D( iterationSurf, v_vTexcoord );
|
vec4 _vMap = texture2D( iterationSurf, ntx );
|
||||||
itr = mix(iteration.x, iteration.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
|
itr = mix(iteration.x, iteration.y, (_vMap.r + _vMap.g + _vMap.b) / 3.);
|
||||||
}
|
}
|
||||||
|
|
||||||
vec2 pos = position.xy / dimension;
|
vec2 pos = position.xy / dimension;
|
||||||
float ang = rotation;
|
float ang = rotation;
|
||||||
vec2 st = (v_vTexcoord - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
vec2 st = (ntx - pos) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * sca;
|
||||||
|
|
||||||
if(colored == 0) {
|
if(colored == 0) {
|
||||||
gl_FragColor = vec4(vec3(simplex(st)), 1.0);
|
gl_FragColor = vec4(vec3(simplex(st)), 1.0);
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
varying vec2 v_vTexcoord;
|
varying vec2 v_vTexcoord;
|
||||||
varying vec4 v_vColour;
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 dimension;
|
||||||
|
|
||||||
uniform float seed;
|
uniform float seed;
|
||||||
uniform float progress;
|
uniform float progress;
|
||||||
uniform float paramA;
|
uniform float paramA;
|
||||||
uniform vec2 u_resolution;
|
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform float rotation;
|
uniform float rotation;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
@ -213,17 +214,20 @@ vec3 squareVoronoi( in vec2 x ) { #region // IQ classic voronoi - shadertoy.com/
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
void main() { #region
|
void main() {
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
float ang = radians(rotation);
|
float ang = radians(rotation);
|
||||||
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale / 4.;
|
vec2 pos = (ntx - position / dimension) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale / 4.;
|
||||||
|
|
||||||
if(mode == 0) {
|
if(mode == 0) {
|
||||||
gl_FragColor = vec4(vec3(.1 + blockVoronoi(pos * vec2(1., -1.))), 1.0);
|
gl_FragColor = vec4(vec3(.1 + blockVoronoi(pos * vec2(1., -1.))), 1.0);
|
||||||
|
|
||||||
} else if(mode == 1) {
|
} else if(mode == 1) {
|
||||||
vec3 v = vec3(triangleVoronoi(pos * 2.));
|
vec3 v = vec3(triangleVoronoi(pos * 2.));
|
||||||
gl_FragColor = vec4(vec3(v.r), 1.0);
|
gl_FragColor = vec4(vec3(v.r), 1.0);
|
||||||
|
|
||||||
} else if(mode == 2) {
|
} else if(mode == 2) {
|
||||||
gl_FragColor = vec4(vec3(squareVoronoi(pos * 4.).r), 1.0);
|
gl_FragColor = vec4(vec3(squareVoronoi(pos * 4.).r), 1.0);
|
||||||
}
|
}
|
||||||
} #endregion
|
}
|
|
@ -7,7 +7,7 @@ uniform float seed;
|
||||||
uniform float progress;
|
uniform float progress;
|
||||||
uniform float detail;
|
uniform float detail;
|
||||||
|
|
||||||
uniform vec2 u_resolution;
|
uniform vec2 dimension;
|
||||||
uniform vec2 position;
|
uniform vec2 position;
|
||||||
uniform vec2 scale;
|
uniform vec2 scale;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ vec4 snoise(vec3 v) {
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
vec2 p = v_vTexcoord - .5;
|
vec2 p = v_vTexcoord - .5;
|
||||||
p.x *= (u_resolution.x / u_resolution.y);
|
p.x *= (dimension.x / dimension.y);
|
||||||
p = (p + position) * scale / 2.;
|
p = (p + position) * scale / 2.;
|
||||||
|
|
||||||
vec3 pos = vec3(p.x, progress, p.y);
|
vec3 pos = vec3(p.x, progress, p.y);
|
||||||
|
|
|
@ -32,8 +32,8 @@ void main() {
|
||||||
ang = radians(ang);
|
ang = radians(ang);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
vec2 ntx = v_vTexcoord * vec2(1., dimension.y / dimension.x);
|
||||||
vec2 pos = v_vTexcoord - position;
|
vec2 pos = ntx - position;
|
||||||
float _cell = 1. / (amo * 2.);
|
float _cell = 1. / (amo * 2.);
|
||||||
pos.y -= _cell / 2.;
|
pos.y -= _cell / 2.;
|
||||||
pos *= mat2(cos(ang), -sin(ang), sin(ang), cos(ang));
|
pos *= mat2(cos(ang), -sin(ang), sin(ang), cos(ang));
|
||||||
|
|