mirror of
https://github.com/Relintai/mat_maker_gd.git
synced 2025-04-30 10:57:56 +02:00
51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
{
|
|
"name": "sdf3d_circle_repeat",
|
|
"node_position": {
|
|
"x": 0,
|
|
"y": 0
|
|
},
|
|
"parameters": {
|
|
"c": 5
|
|
},
|
|
"shader_model": {
|
|
"code": "",
|
|
"global": "vec3 circle_repeat_transform(vec3 p, float count) {\n\tfloat r = 6.28/count;\n\tfloat pa = atan(p.x, p.y);\n\tfloat a = mod(pa+0.5*r, r)-0.5*r;\n\tvec3 rv;\n\tfloat c = cos(a-pa);\n\tfloat s = sin(a-pa);\n\trv.x = p.x*c+p.y*s;\n\trv.y = -p.x*s+p.y*c;\n\trv.z = p.z;\n\treturn rv;\n}\n",
|
|
"inputs": [
|
|
{
|
|
"default": "vec2(100, 0.0)",
|
|
"label": "",
|
|
"longdesc": "The input shape, defined as a signed distance function",
|
|
"name": "in",
|
|
"shortdesc": "Input",
|
|
"type": "sdf3dc"
|
|
}
|
|
],
|
|
"instance": "",
|
|
"longdesc": "Repeats its input shape around a circle",
|
|
"name": "Circle Repeat",
|
|
"outputs": [
|
|
{
|
|
"longdesc": "The shape generated by the repeat operation",
|
|
"sdf3dc": "$in(circle_repeat_transform($uv, $c))",
|
|
"shortdesc": "Output",
|
|
"type": "sdf3dc"
|
|
}
|
|
],
|
|
"parameters": [
|
|
{
|
|
"control": "None",
|
|
"default": 4,
|
|
"label": "",
|
|
"longdesc": "The number of repetitions of the input shape around the circle",
|
|
"max": 32,
|
|
"min": 1,
|
|
"name": "c",
|
|
"shortdesc": "Count",
|
|
"step": 1,
|
|
"type": "float"
|
|
}
|
|
],
|
|
"shortdesc": "Circle Repeat"
|
|
},
|
|
"type": "shader"
|
|
} |