2019-10-27 14:36:16 +01:00
|
|
|
{
|
|
|
|
"name": "noise",
|
|
|
|
"node_position": {
|
|
|
|
"x": 0,
|
|
|
|
"y": 0
|
|
|
|
},
|
|
|
|
"parameters": {
|
|
|
|
"density": 0.5,
|
2019-11-02 22:56:14 +01:00
|
|
|
"size": 9
|
2019-10-27 14:36:16 +01:00
|
|
|
},
|
|
|
|
"shader_model": {
|
2019-11-02 22:56:14 +01:00
|
|
|
"code": "",
|
2019-10-27 14:36:16 +01:00
|
|
|
"global": "float dots(vec2 uv, float size, float density, int seed) {\n\tvec2 seed2 = rand2(vec2(float(seed), 1.0-float(seed)));\n\tuv /= size;\n\tvec2 point_pos = floor(uv)+vec2(0.5);\n\tfloat color = step(rand(seed2+point_pos), density);\n return color;\n}",
|
2019-11-02 22:56:14 +01:00
|
|
|
"inputs": [
|
|
|
|
|
|
|
|
],
|
2019-10-27 14:36:16 +01:00
|
|
|
"instance": "\n\t\tfloat $(name)_f(vec2 uv) {\n\t\t\treturn dots(uv, 1.0/$(size), $(density), $(seed));\n\t\t}",
|
|
|
|
"name": "Noise",
|
|
|
|
"outputs": [
|
|
|
|
{
|
2019-11-02 22:56:14 +01:00
|
|
|
"f": "$(name)_f($(uv))",
|
|
|
|
"type": "f"
|
2019-10-27 14:36:16 +01:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"default": 8,
|
|
|
|
"first": 2,
|
|
|
|
"label": "Grid Size:",
|
2019-11-02 22:56:14 +01:00
|
|
|
"last": 12,
|
2019-10-27 14:36:16 +01:00
|
|
|
"name": "size",
|
|
|
|
"type": "size"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"default": 0.5,
|
|
|
|
"label": "Density:",
|
|
|
|
"max": 1,
|
|
|
|
"min": 0,
|
|
|
|
"name": "density",
|
|
|
|
"step": 0,
|
|
|
|
"type": "float"
|
|
|
|
}
|
|
|
|
]
|
2019-11-02 22:56:14 +01:00
|
|
|
},
|
|
|
|
"type": "shader"
|
2019-10-27 14:36:16 +01:00
|
|
|
}
|