Added shader implementation of the gradient node.

This commit is contained in:
RodZill4 2020-05-30 14:13:25 +02:00
parent ac4398a329
commit 528182becb
1 changed files with 94 additions and 0 deletions

View File

@ -0,0 +1,94 @@
{
"name": "gradient",
"node_position": {
"x": 0,
"y": 0
},
"parameters": {
"gradient": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 0,
"g": 0,
"pos": 0,
"r": 0
},
{
"a": 1,
"b": 1,
"g": 1,
"pos": 1,
"r": 1
}
],
"type": "Gradient"
},
"repeat": 1,
"rotate": 0
},
"shader_model": {
"code": "float $(name_uv)_r = 0.5+(cos($rotate*0.01745329251)*($uv.x-0.5)+sin($rotate*0.01745329251)*($uv.y-0.5))/(cos(abs(mod($rotate, 90.0)-45.0)*0.01745329251)*1.41421356237);",
"global": "",
"inputs": [
],
"instance": "",
"name": "Gradient",
"outputs": [
{
"rgba": "$gradient(fract($(name_uv)_r*$repeat))",
"type": "rgba"
}
],
"parameters": [
{
"control": "None",
"default": 1,
"label": "Repeat",
"max": 32,
"min": 1,
"name": "repeat",
"step": 1,
"type": "float"
},
{
"control": "Radius1.a",
"default": 0,
"label": "Rotate",
"max": 180,
"min": -180,
"name": "rotate",
"step": 0.1,
"type": "float"
},
{
"default": {
"interpolation": 1,
"points": [
{
"a": 1,
"b": 0,
"g": 0,
"pos": 0,
"r": 0
},
{
"a": 1,
"b": 1,
"g": 1,
"pos": 1,
"r": 1
}
],
"type": "Gradient"
},
"label": "Gradient",
"name": "gradient",
"type": "gradient"
}
]
},
"type": "shader"
}