Skip to content

Commit

Permalink
🟦 [Nodes] Improved Kaleidoscope
Browse files Browse the repository at this point in the history
  • Loading branch information
JulesFouchy committed Oct 14, 2023
1 parent 6fa411e commit 2c233e4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 6 deletions.
5 changes: 3 additions & 2 deletions Nodes/50 2D Modifier/Kaleidoscope.clbnode
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
INPUT float 'Time';
INPUT int 'Splits';
INPUT Angle 'Angle';

// inspired by Gatkan's work https://www.shadertoy.com/view/XdtBWH
UV main(UV Image)
{
float angle = atan(Image.x, Image.y);
float angle = atan(Image.y, Image.x);
angle = ((angle / PI) + 1.) * 0.5;
angle = angle + 0.25;
angle = mod(angle, 1. / float('Splits')) * float('Splits');
Expand All @@ -13,5 +14,5 @@ UV main(UV Image)
angle = angle * 0.1;
float y = length(Image);
angle = angle * (y * 3.);
return vec2(angle + ('Time' * 0.5), y + ('Time' * 0.1));
return rotation_2D('Angle') * vec2(angle + ('Time' * 0.5), y + ('Time' * 0.1));
}
34 changes: 30 additions & 4 deletions Nodes/50 2D Modifier/Kaleidoscope.clbnode.presets.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
"index": 1,
"data": {
"Name": "Splits",
"Value": 5,
"Value": 6,
"Metadata": {
"Bounds": {
"Has min bound": false,
"Min": 0,
"Has min bound": true,
"Min": 1,
"Has max bound": false,
"Max": 12,
"Drag speed": 0.03999999910593033,
"Drag speed": 0.019999999552965165,
"Use slider": false
}
},
Expand All @@ -61,6 +61,32 @@
}
}
}
},
{
"index": 11,
"data": {
"Name": "Angle",
"Value": {
"Radians": {
"Radians": 0.0
}
},
"Metadata": {
"Number of snaps": 24,
"Snaps offset (in radians)": 0.0,
"Always snap": false
},
"Default Value": {
"Radians": {
"Radians": 0.0
}
},
"Default Metadata": {
"Number of snaps": 24,
"Snaps offset (in radians)": 0.0,
"Always snap": false
}
}
}
]
}
Expand Down

0 comments on commit 2c233e4

Please sign in to comment.