material-maker/noise.mmn

1 line
807 B
Plaintext

{"global":"\n\t\tfloat rand(vec2 x) {\n\t\t\treturn fract(cos(dot(x, vec2(13.9898, 8.141))) * 43758.5453);\n\t\t}\n\t\tvec2 rand2(vec2 x) {\n\t\t\treturn fract(cos(vec2(dot(x, vec2(13.9898, 8.141)),\n\t\t\t\t\t\t\t\t dot(x, vec2(3.4562, 17.398)))) * 43758.5453);\n\t\t}\n\t\tvec3 rand3(vec2 x) {\n\t\t\treturn fract(cos(vec3(dot(x, vec2(13.9898, 8.141)),\n\t\t\t\t\t\t\t\t dot(x, vec2(3.4562, 17.398)),\n\t\t\t\t\t\t\t\t dot(x, vec2(13.254, 5.867)))) * 43758.5453);\n\t\t}","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":[{"f":"$(name)_f($(uv))"}],"parameters":[{"default":8,"first":2,"label":"Grid Size:","last":12,"name":"size","type":"size"},{"label":"Density:","max":1,"min":0,"name":"density","type":"float"}]}