mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-01-23 03:18:03 +01:00
- [Supporter] New Honeycomb noise node.
This commit is contained in:
parent
80fb5622b5
commit
79baea6a2f
28 changed files with 249 additions and 23 deletions
|
@ -136,9 +136,16 @@
|
||||||
{"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",},
|
{"name":"components","order":3,"path":"folders/panels/inspectors/components.yy",},
|
||||||
{"name":"overlay","order":6,"path":"folders/panels/preview/overlay.yy",},
|
{"name":"overlay","order":6,"path":"folders/panels/preview/overlay.yy",},
|
||||||
{"name":"sprites","order":7,"path":"folders/panels/preview/sprites.yy",},
|
{"name":"sprites","order":7,"path":"folders/panels/preview/sprites.yy",},
|
||||||
|
{"name":"3d","order":1,"path":"folders/shader/3d.yy",},
|
||||||
{"name":"2d effect","order":12,"path":"folders/shader/3d/2d effect.yy",},
|
{"name":"2d effect","order":12,"path":"folders/shader/3d/2d effect.yy",},
|
||||||
{"name":"legacy","order":13,"path":"folders/shader/3d/legacy.yy",},
|
{"name":"legacy","order":13,"path":"folders/shader/3d/legacy.yy",},
|
||||||
{"name":"ssao","order":14,"path":"folders/shader/3d/ssao.yy",},
|
{"name":"ssao","order":14,"path":"folders/shader/3d/ssao.yy",},
|
||||||
|
{"name":"blend","order":2,"path":"folders/shader/blend.yy",},
|
||||||
|
{"name":"canvas","order":3,"path":"folders/shader/canvas.yy",},
|
||||||
|
{"name":"color_picker","order":4,"path":"folders/shader/color_picker.yy",},
|
||||||
|
{"name":"color_selector","order":5,"path":"folders/shader/color_selector.yy",},
|
||||||
|
{"name":"draw","order":6,"path":"folders/shader/draw.yy",},
|
||||||
|
{"name":"filter","order":7,"path":"folders/shader/filter.yy",},
|
||||||
{"name":"blend_edge","order":40,"path":"folders/shader/filter/blend_edge.yy",},
|
{"name":"blend_edge","order":40,"path":"folders/shader/filter/blend_edge.yy",},
|
||||||
{"name":"blur","order":50,"path":"folders/shader/filter/blur.yy",},
|
{"name":"blur","order":50,"path":"folders/shader/filter/blur.yy",},
|
||||||
{"name":"channels","order":41,"path":"folders/shader/filter/channels.yy",},
|
{"name":"channels","order":41,"path":"folders/shader/filter/channels.yy",},
|
||||||
|
@ -152,20 +159,29 @@
|
||||||
{"name":"shape_seperator","order":47,"path":"folders/shader/filter/shape_seperator.yy",},
|
{"name":"shape_seperator","order":47,"path":"folders/shader/filter/shape_seperator.yy",},
|
||||||
{"name":"surface_replace","order":48,"path":"folders/shader/filter/surface_replace.yy",},
|
{"name":"surface_replace","order":48,"path":"folders/shader/filter/surface_replace.yy",},
|
||||||
{"name":"warp","order":49,"path":"folders/shader/filter/warp.yy",},
|
{"name":"warp","order":49,"path":"folders/shader/filter/warp.yy",},
|
||||||
|
{"name":"flood_fill","order":8,"path":"folders/shader/flood_fill.yy",},
|
||||||
|
{"name":"generator","order":9,"path":"folders/shader/generator.yy",},
|
||||||
{"name":"blinker","order":19,"path":"folders/shader/generator/blinker.yy",},
|
{"name":"blinker","order":19,"path":"folders/shader/generator/blinker.yy",},
|
||||||
{"name":"cell","order":20,"path":"folders/shader/generator/cell.yy",},
|
{"name":"cell","order":20,"path":"folders/shader/generator/cell.yy",},
|
||||||
{"name":"grid","order":18,"path":"folders/shader/generator/grid.yy",},
|
{"name":"grid","order":18,"path":"folders/shader/generator/grid.yy",},
|
||||||
{"name":"interpret","order":17,"path":"folders/shader/generator/interpret.yy",},
|
{"name":"interpret","order":17,"path":"folders/shader/generator/interpret.yy",},
|
||||||
{"name":"noise","order":16,"path":"folders/shader/generator/noise.yy",},
|
{"name":"noise","order":19,"path":"folders/shader/noise.yy",},
|
||||||
{"name":"random_shape","order":21,"path":"folders/shader/generator/random_shape.yy",},
|
{"name":"random_shape","order":21,"path":"folders/shader/generator/random_shape.yy",},
|
||||||
{"name":"reaction_diffusion","order":22,"path":"folders/shader/generator/reaction_diffusion.yy",},
|
{"name":"reaction_diffusion","order":22,"path":"folders/shader/generator/reaction_diffusion.yy",},
|
||||||
{"name":"region","order":23,"path":"folders/shader/generator/region.yy",},
|
{"name":"region","order":23,"path":"folders/shader/generator/region.yy",},
|
||||||
{"name":"vector_mapper","order":24,"path":"folders/shader/generator/vector_mapper.yy",},
|
{"name":"vector_mapper","order":24,"path":"folders/shader/generator/vector_mapper.yy",},
|
||||||
|
{"name":"mask","order":10,"path":"folders/shader/mask.yy",},
|
||||||
|
{"name":"misc","order":11,"path":"folders/shader/misc.yy",},
|
||||||
{"name":"find_boundary","order":7,"path":"folders/shader/misc/find_boundary.yy",},
|
{"name":"find_boundary","order":7,"path":"folders/shader/misc/find_boundary.yy",},
|
||||||
|
{"name":"MK effects","order":12,"path":"folders/shader/MK effects.yy",},
|
||||||
{"name":"Flag","order":3,"path":"folders/shader/MK effects/Flag.yy",},
|
{"name":"Flag","order":3,"path":"folders/shader/MK effects/Flag.yy",},
|
||||||
{"name":"Tile","order":4,"path":"folders/shader/MK effects/Tile.yy",},
|
{"name":"Tile","order":4,"path":"folders/shader/MK effects/Tile.yy",},
|
||||||
{"name":"ray march","order":1,"path":"folders/shader/ray march.yy",},
|
{"name":"pixel_builder","order":13,"path":"folders/shader/pixel_builder.yy",},
|
||||||
{"name":"svg","order":2,"path":"folders/shader/svg.yy",},
|
{"name":"ray march","order":17,"path":"folders/shader/ray march.yy",},
|
||||||
|
{"name":"sprites","order":14,"path":"folders/shader/sprites.yy",},
|
||||||
|
{"name":"svg","order":18,"path":"folders/shader/svg.yy",},
|
||||||
|
{"name":"transition","order":15,"path":"folders/shader/transition.yy",},
|
||||||
|
{"name":"UI","order":16,"path":"folders/shader/UI.yy",},
|
||||||
{"name":"histogram","order":3,"path":"folders/shader/UI/histogram.yy",},
|
{"name":"histogram","order":3,"path":"folders/shader/UI/histogram.yy",},
|
||||||
{"name":"node","order":5,"path":"folders/shader/UI/node.yy",},
|
{"name":"node","order":5,"path":"folders/shader/UI/node.yy",},
|
||||||
{"name":"palette mixer","order":2,"path":"folders/shader/UI/palette mixer.yy",},
|
{"name":"palette mixer","order":2,"path":"folders/shader/UI/palette mixer.yy",},
|
||||||
|
@ -797,6 +813,7 @@
|
||||||
{"name":"node_guide","order":10,"path":"scripts/node_guide/node_guide.yy",},
|
{"name":"node_guide","order":10,"path":"scripts/node_guide/node_guide.yy",},
|
||||||
{"name":"node_herringbone_tile","order":7,"path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},
|
{"name":"node_herringbone_tile","order":7,"path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},
|
||||||
{"name":"node_hlsl","order":13,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
{"name":"node_hlsl","order":13,"path":"scripts/node_hlsl/node_hlsl.yy",},
|
||||||
|
{"name":"node_honey_noise","order":20,"path":"scripts/node_honey_noise/node_honey_noise.yy",},
|
||||||
{"name":"node_hsv_channel","order":1,"path":"scripts/node_hsv_channel/node_hsv_channel.yy",},
|
{"name":"node_hsv_channel","order":1,"path":"scripts/node_hsv_channel/node_hsv_channel.yy",},
|
||||||
{"name":"node_image_animated","order":1,"path":"scripts/node_image_animated/node_image_animated.yy",},
|
{"name":"node_image_animated","order":1,"path":"scripts/node_image_animated/node_image_animated.yy",},
|
||||||
{"name":"node_image_gif","order":2,"path":"scripts/node_image_gif/node_image_gif.yy",},
|
{"name":"node_image_gif","order":2,"path":"scripts/node_image_gif/node_image_gif.yy",},
|
||||||
|
@ -1450,6 +1467,7 @@
|
||||||
{"name":"sh_noise_gabor","order":6,"path":"shaders/sh_noise_gabor/sh_noise_gabor.yy",},
|
{"name":"sh_noise_gabor","order":6,"path":"shaders/sh_noise_gabor/sh_noise_gabor.yy",},
|
||||||
{"name":"sh_noise_grid_hex","order":7,"path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},
|
{"name":"sh_noise_grid_hex","order":7,"path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},
|
||||||
{"name":"sh_noise_grid_tri","order":8,"path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},
|
{"name":"sh_noise_grid_tri","order":8,"path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},
|
||||||
|
{"name":"sh_noise_honey","order":19,"path":"shaders/sh_noise_honey/sh_noise_honey.yy",},
|
||||||
{"name":"sh_noise_shard","order":9,"path":"shaders/sh_noise_shard/sh_noise_shard.yy",},
|
{"name":"sh_noise_shard","order":9,"path":"shaders/sh_noise_shard/sh_noise_shard.yy",},
|
||||||
{"name":"sh_noise_strand","order":10,"path":"shaders/sh_noise_strand/sh_noise_strand.yy",},
|
{"name":"sh_noise_strand","order":10,"path":"shaders/sh_noise_strand/sh_noise_strand.yy",},
|
||||||
{"name":"sh_noise_wavelet","order":11,"path":"shaders/sh_noise_wavelet/sh_noise_wavelet.yy",},
|
{"name":"sh_noise_wavelet","order":11,"path":"shaders/sh_noise_wavelet/sh_noise_wavelet.yy",},
|
||||||
|
|
|
@ -287,7 +287,7 @@
|
||||||
{"$GMFolder":"","%Name":"cell","folderPath":"folders/shader/generator/cell.yy","name":"cell","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"cell","folderPath":"folders/shader/generator/cell.yy","name":"cell","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"grid","folderPath":"folders/shader/generator/grid.yy","name":"grid","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"grid","folderPath":"folders/shader/generator/grid.yy","name":"grid","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"interpret","folderPath":"folders/shader/generator/interpret.yy","name":"interpret","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"interpret","folderPath":"folders/shader/generator/interpret.yy","name":"interpret","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"noise","folderPath":"folders/shader/generator/noise.yy","name":"noise","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"noise","folderPath":"folders/shader/noise.yy","name":"noise","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"random_shape","folderPath":"folders/shader/generator/random_shape.yy","name":"random_shape","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"random_shape","folderPath":"folders/shader/generator/random_shape.yy","name":"random_shape","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"reaction_diffusion","folderPath":"folders/shader/generator/reaction_diffusion.yy","name":"reaction_diffusion","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"reaction_diffusion","folderPath":"folders/shader/generator/reaction_diffusion.yy","name":"reaction_diffusion","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"region","folderPath":"folders/shader/generator/region.yy","name":"region","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"region","folderPath":"folders/shader/generator/region.yy","name":"region","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
@ -1219,6 +1219,7 @@
|
||||||
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
{"id":{"name":"node_guide","path":"scripts/node_guide/node_guide.yy",},},
|
||||||
{"id":{"name":"node_herringbone_tile","path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},},
|
{"id":{"name":"node_herringbone_tile","path":"scripts/node_herringbone_tile/node_herringbone_tile.yy",},},
|
||||||
{"id":{"name":"node_hlsl","path":"scripts/node_hlsl/node_hlsl.yy",},},
|
{"id":{"name":"node_hlsl","path":"scripts/node_hlsl/node_hlsl.yy",},},
|
||||||
|
{"id":{"name":"node_honey_noise","path":"scripts/node_honey_noise/node_honey_noise.yy",},},
|
||||||
{"id":{"name":"node_hsv_channel","path":"scripts/node_hsv_channel/node_hsv_channel.yy",},},
|
{"id":{"name":"node_hsv_channel","path":"scripts/node_hsv_channel/node_hsv_channel.yy",},},
|
||||||
{"id":{"name":"node_image_animated","path":"scripts/node_image_animated/node_image_animated.yy",},},
|
{"id":{"name":"node_image_animated","path":"scripts/node_image_animated/node_image_animated.yy",},},
|
||||||
{"id":{"name":"node_image_gif","path":"scripts/node_image_gif/node_image_gif.yy",},},
|
{"id":{"name":"node_image_gif","path":"scripts/node_image_gif/node_image_gif.yy",},},
|
||||||
|
@ -1978,6 +1979,7 @@
|
||||||
{"id":{"name":"sh_noise_gabor","path":"shaders/sh_noise_gabor/sh_noise_gabor.yy",},},
|
{"id":{"name":"sh_noise_gabor","path":"shaders/sh_noise_gabor/sh_noise_gabor.yy",},},
|
||||||
{"id":{"name":"sh_noise_grid_hex","path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},},
|
{"id":{"name":"sh_noise_grid_hex","path":"shaders/sh_noise_grid_hex/sh_noise_grid_hex.yy",},},
|
||||||
{"id":{"name":"sh_noise_grid_tri","path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},},
|
{"id":{"name":"sh_noise_grid_tri","path":"shaders/sh_noise_grid_tri/sh_noise_grid_tri.yy",},},
|
||||||
|
{"id":{"name":"sh_noise_honey","path":"shaders/sh_noise_honey/sh_noise_honey.yy",},},
|
||||||
{"id":{"name":"sh_noise_shard","path":"shaders/sh_noise_shard/sh_noise_shard.yy",},},
|
{"id":{"name":"sh_noise_shard","path":"shaders/sh_noise_shard/sh_noise_shard.yy",},},
|
||||||
{"id":{"name":"sh_noise_strand","path":"shaders/sh_noise_strand/sh_noise_strand.yy",},},
|
{"id":{"name":"sh_noise_strand","path":"shaders/sh_noise_strand/sh_noise_strand.yy",},},
|
||||||
{"id":{"name":"sh_noise_wavelet","path":"shaders/sh_noise_wavelet/sh_noise_wavelet.yy",},},
|
{"id":{"name":"sh_noise_wavelet","path":"shaders/sh_noise_wavelet/sh_noise_wavelet.yy",},},
|
||||||
|
|
12
scripts/node_honey_noise/node_gradient.yy
Normal file
12
scripts/node_honey_noise/node_gradient.yy
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"isDnD": false,
|
||||||
|
"isCompatibility": false,
|
||||||
|
"parent": {
|
||||||
|
"name": "generator",
|
||||||
|
"path": "folders/nodes/data/generator.yy",
|
||||||
|
},
|
||||||
|
"resourceVersion": "1.0",
|
||||||
|
"name": "node_gradient",
|
||||||
|
"tags": [],
|
||||||
|
"resourceType": "GMScript",
|
||||||
|
}
|
37
scripts/node_honey_noise/node_honey_noise.gml
Normal file
37
scripts/node_honey_noise/node_honey_noise.gml
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
function Node_Honeycomb_Noise(_x, _y, _group = noone) : Node_Shader_Generator(_x, _y, _group) constructor {
|
||||||
|
name = "Honeycomb Noise";
|
||||||
|
shader = sh_noise_honey;
|
||||||
|
|
||||||
|
inputs[| 1] = nodeValue("Position", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 0, 0 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.vector)
|
||||||
|
.setUnitRef(function(index) { return getDimension(index); });
|
||||||
|
addShaderProp(SHADER_UNIFORM.float, "position");
|
||||||
|
|
||||||
|
inputs[| 2] = nodeValue("Scale", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, [ 2, 2 ])
|
||||||
|
.setDisplay(VALUE_DISPLAY.vector);
|
||||||
|
addShaderProp(SHADER_UNIFORM.float, "scale");
|
||||||
|
|
||||||
|
inputs[| 3] = nodeValue("Rotation", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.rotation);
|
||||||
|
addShaderProp(SHADER_UNIFORM.float, "rotation");
|
||||||
|
|
||||||
|
inputs[| 4] = nodeValue("Mode", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 0)
|
||||||
|
.setDisplay(VALUE_DISPLAY.enum_button, [ "Hexagon", "Star" ]);
|
||||||
|
addShaderProp(SHADER_UNIFORM.integer, "mode");
|
||||||
|
|
||||||
|
inputs[| 5] = nodeValue("Seed", self, JUNCTION_CONNECT.input, VALUE_TYPE.float, seed_random(6))
|
||||||
|
.setDisplay(VALUE_DISPLAY._default, { side_button : button(function() { randomize(); inputs[| 5].setValue(seed_random(6)); }).setIcon(THEME.icon_random, 0, COLORS._main_icon) })
|
||||||
|
addShaderProp(SHADER_UNIFORM.float, "seed");
|
||||||
|
|
||||||
|
inputs[| 6] = nodeValue("Iteration", self, JUNCTION_CONNECT.input, VALUE_TYPE.integer, 1);
|
||||||
|
addShaderProp(SHADER_UNIFORM.integer, "iteration");
|
||||||
|
|
||||||
|
input_display_list = [ 5,
|
||||||
|
["Output", true], 0,
|
||||||
|
["Noise", false], 1, 2, 3, 4, 6.
|
||||||
|
];
|
||||||
|
|
||||||
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
|
inputs[| 1].drawOverlay(hover, active, _x, _y, _s, _mx, _my, _snx, _sny);
|
||||||
|
}
|
||||||
|
}
|
13
scripts/node_honey_noise/node_honey_noise.yy
Normal file
13
scripts/node_honey_noise/node_honey_noise.yy
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
{
|
||||||
|
"$GMScript":"",
|
||||||
|
"%Name":"node_honey_noise",
|
||||||
|
"isCompatibility":false,
|
||||||
|
"isDnD":false,
|
||||||
|
"name":"node_honey_noise",
|
||||||
|
"parent":{
|
||||||
|
"name":"noise",
|
||||||
|
"path":"folders/nodes/data/generator/noise.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMScript",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
}
|
|
@ -725,6 +725,7 @@ function __initNodes() {
|
||||||
addNodeObject(generator, "Bubble Noise", s_node_bubble_noise, "Node_Noise_Bubble", [1, Node_Noise_Bubble]).patreonExtra();
|
addNodeObject(generator, "Bubble Noise", s_node_bubble_noise, "Node_Noise_Bubble", [1, Node_Noise_Bubble]).patreonExtra();
|
||||||
addNodeObject(generator, "Flow Noise", s_node_flow_noise, "Node_Flow_Noise", [1, Node_Flow_Noise]).patreonExtra();
|
addNodeObject(generator, "Flow Noise", s_node_flow_noise, "Node_Flow_Noise", [1, Node_Flow_Noise]).patreonExtra();
|
||||||
addNodeObject(generator, "Cristal Noise", s_node_cristal, "Node_Noise_Cristal", [1, Node_Noise_Cristal]).patreonExtra();
|
addNodeObject(generator, "Cristal Noise", s_node_cristal, "Node_Noise_Cristal", [1, Node_Noise_Cristal]).patreonExtra();
|
||||||
|
addNodeObject(generator, "Honeycomb Noise", s_node_honey, "Node_Honeycomb_Noise", [1, Node_Honeycomb_Noise]).patreonExtra();
|
||||||
|
|
||||||
ds_list_add(generator, "Patterns");
|
ds_list_add(generator, "Patterns");
|
||||||
addNodeObject(generator, "Stripe", s_node_stripe, "Node_Stripe", [1, Node_Stripe],, "Generate stripe pattern.");
|
addNodeObject(generator, "Stripe", s_node_stripe, "Node_Stripe", [1, Node_Stripe],, "Generate stripe pattern.");
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_ani_noise",
|
"name":"sh_ani_noise",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise",
|
"name":"sh_noise",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_bubble",
|
"name":"sh_noise_bubble",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_cristal",
|
"name":"sh_noise_cristal",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_fbm",
|
"name":"sh_noise_fbm",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_flow",
|
"name":"sh_noise_flow",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_fold",
|
"name":"sh_noise_fold",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_gabor",
|
"name":"sh_noise_gabor",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_grid_hex",
|
"name":"sh_noise_grid_hex",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_grid_tri",
|
"name":"sh_noise_grid_tri",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
112
shaders/sh_noise_honey/sh_noise_honey.fsh
Normal file
112
shaders/sh_noise_honey/sh_noise_honey.fsh
Normal file
|
@ -0,0 +1,112 @@
|
||||||
|
//Honeycomb Noise by foxes
|
||||||
|
//https://www.shadertoy.com/view/ltsSW7
|
||||||
|
|
||||||
|
varying vec2 v_vTexcoord;
|
||||||
|
varying vec4 v_vColour;
|
||||||
|
|
||||||
|
uniform vec2 u_resolution;
|
||||||
|
uniform vec2 position;
|
||||||
|
uniform float rotation;
|
||||||
|
uniform vec2 scale;
|
||||||
|
uniform float seed;
|
||||||
|
|
||||||
|
uniform int mode;
|
||||||
|
uniform int iteration;
|
||||||
|
|
||||||
|
float hash(float x) { return fract(fract(x * (0.3183098861 + seed / 100000.)) * fract(x * (0.15915494309 + seed / 100000.)) * 265871.1723); }
|
||||||
|
vec3 hash(vec3 x) { return fract(fract(x * (0.3183098861 + seed / 100000.)) * fract(x * (0.15915494309 + seed / 100000.)) * 265871.1723); }
|
||||||
|
|
||||||
|
float hash2(vec2 x) { return hash(dot(mod(x, 100.0), vec2(127.1, 311.7))); }
|
||||||
|
vec3 hash3x2(vec2 x1,vec2 x2,vec2 x3) { return hash(vec3(dot(mod(x1, 100.0), vec2(127.1, 311.7)),
|
||||||
|
dot(mod(x2, 100.0), vec2(127.1, 311.7)),
|
||||||
|
dot(mod(x3, 100.0), vec2(127.1, 311.7)) )); }
|
||||||
|
|
||||||
|
vec4 hash4( vec4 n ) { return fract(sin(n) * (753.5453123 + seed / 100000.)); }
|
||||||
|
|
||||||
|
float noise2( vec2 x ) {
|
||||||
|
vec3 p = floor(vec3(x, x.y + 0.5));
|
||||||
|
vec3 f = fract(vec3(x, x.y + 0.5));
|
||||||
|
|
||||||
|
float n = p.x + p.y * 157.0;
|
||||||
|
vec4 s1 = hash4(vec4(n) + vec4(0.0, 1.0, 157.0, 158.0));
|
||||||
|
s1.xy = mix(s1.xz, s1.yw, vec2(f.x));
|
||||||
|
|
||||||
|
return mix(s1.x, s1.y, f.y);
|
||||||
|
}
|
||||||
|
|
||||||
|
float noiseHoneycomb(vec2 i) {
|
||||||
|
vec2 c3;
|
||||||
|
i.x *= 1.15470053837925;
|
||||||
|
c3.x = floor(i.x) + 1.0;
|
||||||
|
|
||||||
|
vec2 b = vec2(i.y + i.x * 0.5, i.y - i.x * 0.5);
|
||||||
|
c3.y = floor(b.x) + floor(b.y);
|
||||||
|
vec3 o = fract(vec3(i.x, b.xy));
|
||||||
|
|
||||||
|
vec4 s;
|
||||||
|
vec3 m1 = hash3x2(c3 + vec2(1.0, 0.0), c3 + vec2(-1.0, -1.0), c3 + vec2(-1.0, 1.0));
|
||||||
|
vec3 m2 = hash3x2(c3, c3 + vec2(0.0, 1.0), c3 + vec2(0.0, -1.0));
|
||||||
|
vec3 m3 = hash3x2(c3 + vec2(-1.0, 0.0), c3 + vec2(1.0, 1.0), c3 + vec2(1.0, -1.0));
|
||||||
|
vec3 m4 = vec3(m2.x, m2.z, m2.y);
|
||||||
|
|
||||||
|
vec3 w1 = vec3(o.x, (1.0 - o.y), o.z);
|
||||||
|
vec3 w2 = vec3((1.0 - o.x), o.y, (1.0 - o.z));
|
||||||
|
|
||||||
|
vec2 d = fract(c3 * 0.5) * 2.0;
|
||||||
|
|
||||||
|
s = fract(vec4(dot(m1, w1), dot(m2, w2), dot(m3, w2), dot(m4, w1)));
|
||||||
|
|
||||||
|
return fract(mix(mix(s.z, s.w, d.x), mix(s.x, s.y, d.x), d.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
float noiseHoneycombStar(vec2 i) {
|
||||||
|
vec2 c3;
|
||||||
|
i.x *= 1.154700538379251;
|
||||||
|
c3.x = floor(i.x) + 1.0;
|
||||||
|
vec2 b = vec2(i.y + i.x * 0.5, i.y - i.x * 0.5);
|
||||||
|
c3.y = floor(b.x) + floor(b.y);
|
||||||
|
vec3 o = fract(vec3(i.x, b.xy));
|
||||||
|
|
||||||
|
vec4 s;
|
||||||
|
vec3 m1 = vec3(hash2(c3 + vec2(1.0, 0.0)), hash2(c3 + vec2(-1.0, -1.0)), hash2(c3 + vec2(-1.0, 1.0)));
|
||||||
|
vec3 m2 = vec3(hash2(c3), hash2(c3 + vec2(0.0, 1.0)), hash2(c3 + vec2(0.0, -1.0)));
|
||||||
|
vec3 m3 = vec3(hash2(c3 + vec2(-1.0, 0.0)), hash2(c3 + vec2(1.0, 1.0)), hash2(c3 + vec2(1.0, -1.0)));
|
||||||
|
vec3 m4 = vec3(m2.x, m2.z, m2.y);
|
||||||
|
|
||||||
|
vec3 w1 = vec3(o.x, (1.0 - o.y), o.z);
|
||||||
|
vec3 w2 = vec3((1.0 - o.x), o.y, (1.0 - o.z));
|
||||||
|
w1 = w1 * w1 * (3.0 - 2.0 * w1);
|
||||||
|
w2 = w2 * w2 * (3.0 - 2.0 * w2);
|
||||||
|
|
||||||
|
vec2 d = fract(c3 * 0.5) * 2.0;
|
||||||
|
|
||||||
|
s = fract(vec4(dot(m1, w1), dot(m2, w2), dot(m3, w2), dot(m4, w1)));
|
||||||
|
|
||||||
|
return fract(mix(mix(s.z, s.w, d.x), mix(s.x, s.y, d.x), d.y));
|
||||||
|
}
|
||||||
|
|
||||||
|
float iterateNoise ( vec2 pos, int iteration ) {
|
||||||
|
float amp = pow(2., float(iteration) - 1.) / (pow(2., float(iteration)) - 1.);
|
||||||
|
float n = 0.;
|
||||||
|
|
||||||
|
for(int i = 0; i < iteration; i++) {
|
||||||
|
if(mode == 0) n += vec3(noiseHoneycomb(pos)) * amp;
|
||||||
|
else if(mode == 1) n += vec3(noiseHoneycombStar(pos)) * amp;
|
||||||
|
|
||||||
|
amp *= .5;
|
||||||
|
pos *= 2.;
|
||||||
|
}
|
||||||
|
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
float ang = radians(rotation);
|
||||||
|
vec2 pos = (v_vTexcoord - position / u_resolution) * mat2(cos(ang), -sin(ang), sin(ang), cos(ang)) * scale * 4.;
|
||||||
|
vec3 col = vec3(iterateNoise(pos, iteration));
|
||||||
|
|
||||||
|
// if(mode == 0) col = vec3(noiseHoneycomb(pos));
|
||||||
|
// else if(mode == 1) col = vec3(noiseHoneycombStar(pos));
|
||||||
|
|
||||||
|
gl_FragColor = vec4(col, 1.);
|
||||||
|
}
|
19
shaders/sh_noise_honey/sh_noise_honey.vsh
Normal file
19
shaders/sh_noise_honey/sh_noise_honey.vsh
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//
|
||||||
|
// Simple passthrough vertex shader
|
||||||
|
//
|
||||||
|
attribute vec3 in_Position; // (x,y,z)
|
||||||
|
//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 vec4 v_vColour;
|
||||||
|
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
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;
|
||||||
|
|
||||||
|
v_vColour = in_Colour;
|
||||||
|
v_vTexcoord = in_TextureCoord;
|
||||||
|
}
|
12
shaders/sh_noise_honey/sh_noise_honey.yy
Normal file
12
shaders/sh_noise_honey/sh_noise_honey.yy
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"$GMShader":"",
|
||||||
|
"%Name":"sh_noise_honey",
|
||||||
|
"name":"sh_noise_honey",
|
||||||
|
"parent":{
|
||||||
|
"name":"noise",
|
||||||
|
"path":"folders/shader/noise.yy",
|
||||||
|
},
|
||||||
|
"resourceType":"GMShader",
|
||||||
|
"resourceVersion":"2.0",
|
||||||
|
"type":1,
|
||||||
|
}
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_shard",
|
"name":"sh_noise_shard",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_strand",
|
"name":"sh_noise_strand",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_noise_wavelet",
|
"name":"sh_noise_wavelet",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_perlin",
|
"name":"sh_perlin",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_perlin_extra",
|
"name":"sh_perlin_extra",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_perlin_smear",
|
"name":"sh_perlin_smear",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_perlin_tiled",
|
"name":"sh_perlin_tiled",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_simplex",
|
"name":"sh_simplex",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"name":"sh_voronoi_extra",
|
"name":"sh_voronoi_extra",
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"noise",
|
"name":"noise",
|
||||||
"path":"folders/shader/generator/noise.yy",
|
"path":"folders/shader/noise.yy",
|
||||||
},
|
},
|
||||||
"resourceType":"GMShader",
|
"resourceType":"GMShader",
|
||||||
"resourceVersion":"2.0",
|
"resourceVersion":"2.0",
|
||||||
|
|
Loading…
Reference in a new issue