Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variadic RGBA transform nodes #686

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/material_maker/nodes/circle_map.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
"default": "vec4($uv, 0.0, 1.0)",
"label": "",
"longdesc": "The input image to be remapped",
"name": "in",
"shortdesc": "Input",
"name": "in#",
"shortdesc": "Input#",
"type": "rgba"
}
],
Expand All @@ -28,7 +28,7 @@
"outputs": [
{
"longdesc": "Shows the remapped image",
"rgba": "$in(vec2(fract($repeat*atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), min(0.99999, 2.0/$radius*length($uv-vec2(0.5)))))",
"rgba": "$in#(vec2(fract($repeat*atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), min(0.99999, 2.0/$radius*length($uv-vec2(0.5)))))",
"shortdesc": "Output",
"type": "rgba"
}
Expand Down
6 changes: 3 additions & 3 deletions addons/material_maker/nodes/kaleidoscope.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"function": true,
"label": "",
"longdesc": "The input image",
"name": "i",
"shortdesc": "Input",
"name": "i#",
"shortdesc": "Input#",
"type": "rgba"
}
],
Expand All @@ -42,7 +42,7 @@
"outputs": [
{
"longdesc": "Shows the transformed image",
"rgba": "$i.variation($(name_uv)_kal.xy, $variations ? $(name_uv)_kal.z : 0.0)",
"rgba": "$i#.variation($(name_uv)_kal.xy, $variations ? $(name_uv)_kal.z : 0.0)",
"shortdesc": "Output",
"type": "rgba"
}
Expand Down
8 changes: 4 additions & 4 deletions addons/material_maker/nodes/mirror.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
"default": "vec4($uv, 0, 1)",
"label": "",
"longdesc": "The input image",
"name": "i",
"shortdesc": "Input",
"name": "i#",
"shortdesc": "Input#",
"type": "rgba"
}
],
Expand All @@ -37,8 +37,8 @@
"outputs": [
{
"longdesc": "Shows the mirrored image",
"rgba": "$i(uvmirror_$direction($uv, $offset, $flip_sides ? -1.0 : 1.0))",
"shortdesc": "Output",
"rgba": "$i#(uvmirror_$direction($uv, $offset, $flip_sides ? -1.0 : 1.0))",
"shortdesc": "Output#",
"type": "rgba"
}
],
Expand Down
8 changes: 4 additions & 4 deletions addons/material_maker/nodes/shear.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"default": "vec4(1.0)",
"label": "",
"longdesc": "The input image",
"name": "in",
"shortdesc": "Input",
"name": "in#",
"shortdesc": "Input#",
"type": "rgba"
}
],
Expand All @@ -29,8 +29,8 @@
"outputs": [
{
"longdesc": "Shows the transformed image",
"rgba": "$in($uv+$amount*($uv.yx-vec2($center))*vec2($direction))",
"shortdesc": "Output",
"rgba": "$in#($uv+$amount*($uv.yx-vec2($center))*vec2($direction))",
"shortdesc": "Output#",
"type": "rgba"
}
],
Expand Down
8 changes: 4 additions & 4 deletions addons/material_maker/nodes/swirl.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"default": "vec4($uv, 0.0, 1.0)",
"label": "",
"longdesc": "The input image",
"name": "i",
"shortdesc": "Input",
"name": "i#",
"shortdesc": "Input#",
"type": "rgba"
}
],
Expand All @@ -54,8 +54,8 @@
"outputs": [
{
"longdesc": "Shows the swirled image",
"rgba": "$i(swirl_tile_$tile($uv, vec2(0.5+$cx, 0.5+$cy), $radius, $angle*0.01745329251))",
"shortdesc": "Output",
"rgba": "$i#(swirl_tile_$tile($uv, vec2(0.5+$cx, 0.5+$cy), $radius, $angle*0.01745329251))",
"shortdesc": "Output#",
"type": "rgba"
}
],
Expand Down
8 changes: 4 additions & 4 deletions addons/material_maker/nodes/tonality.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"default": "$uv.x",
"label": "",
"longdesc": "The input greyscale image",
"name": "input",
"shortdesc": "Input",
"name": "input#",
"shortdesc": "Input#",
"type": "f"
}
],
Expand All @@ -42,9 +42,9 @@
"name": "Tonality",
"outputs": [
{
"f": "$curve($input($uv))",
"f": "$curve($input#($uv))",
"longdesc": "The remapped greyscale image",
"shortdesc": "Output",
"shortdesc": "Output#",
"type": "f"
}
],
Expand Down
8 changes: 4 additions & 4 deletions addons/material_maker/nodes/warp.mmg
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)",
"label": "",
"longdesc": "The input image to be warped",
"name": "in",
"shortdesc": "Input",
"name": "in#",
"shortdesc": "Input#",
"type": "rgba"
},
{
Expand All @@ -45,8 +45,8 @@
"outputs": [
{
"longdesc": "Shows the warped image",
"rgba": "$in($uv+$amount*$(name_uv)_warp)",
"shortdesc": "Output",
"rgba": "$in#($uv+$amount*$(name_uv)_warp)",
"shortdesc": "Output#",
"type": "rgba"
}
],
Expand Down
6 changes: 3 additions & 3 deletions material_maker/doc/node_filter_tonality.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Tonality node
~~~~~~~~~~~~~

The **Tonality** node applies a user-defined curve to a greyscale image.
The **Tonality** node is variadic and applies a user-defined curve to greyscale images.

.. image:: images/node_filter_tonality.png
:align: center

Inputs
++++++

The **Tonality** node requires a greyscale input texture.
The **Tonality** node accepts one or more greyscale input textures.

Outputs
+++++++

The **Tonality** node provides a single greyscale texture.
The **Tonality** node outputs greyscale textures.

Parameters
++++++++++
Expand Down
6 changes: 3 additions & 3 deletions material_maker/doc/node_transform_circlemap.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Circle Map node
~~~~~~~~~~~~~~~

The **Circle Map** node maps an input image in a circle into the output.
The **Circle Map** node is variadic and map input images in a circle into the outputs.

.. image:: images/node_transform_circlemap.png
:align: center

Inputs
++++++

The **Circle Map** node accepts a single RGBA input.
The **Circle Map** node accepts one or more RGBA inputs.

Outputs
+++++++

The **Circle Map** node outputs the deformed image.
The **Circle Map** node outputs the deformed images.

Parameters
++++++++++
Expand Down
8 changes: 4 additions & 4 deletions material_maker/doc/node_transform_kaleidoscope.rst
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
Kaleidoscope node
~~~~~~~~~~~~~~~~~

The **Kaleidoscope** node applies a kaleidoscope effect, i.e. copies an angle (by default the
upper one) all around the image to its input.
The **Kaleidoscope** node is variadic and applies a kaleidoscope effect, i.e. copies
an angle (by default the upper one) all around the image to its inputs.

.. image:: images/node_transform_kaleidoscope.png
:align: center

Inputs
++++++

The **Kaleidoscope** node accepts a single RGBA input.
The **Kaleidoscope** node accepts one or more RGBA inputs.

Outputs
+++++++

The **Kaleidoscope** node outputs the result as RGBA.
The **Kaleidoscope** node outputs the results as RGBA.

Parameters
++++++++++
Expand Down
6 changes: 3 additions & 3 deletions material_maker/doc/node_transform_mirror.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Mirror node
~~~~~~~~~~~

The **Mirror** node applies a mirror filter on its input.
The **Mirror** node is variadic and applies a mirror filter on its inputs.

.. image:: images/node_transform_mirror.png
:align: center

Inputs
++++++

The **Mirror** node accepts a single RGBA input.
The **Mirror** node accepts one or more RGBA inputs.

Outputs
+++++++

The **Mirror** node outputs the mirrored image as RGBA.
The **Mirror** node outputs the mirrored images as RGBA.

Parameters
++++++++++
Expand Down
6 changes: 3 additions & 3 deletions material_maker/doc/node_transform_shear.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Shear node
~~~~~~~~~~

The **Shear** node bends its input along te X or Y axis.
The **Shear** node is variadic and bends inputs along te X or Y axis.

.. image:: images/node_transform_shear.png
:align: center

Inputs
++++++

The **Shear** node accepts a single RGBA input.
The **Shear** node accepts one or more RGBA inputs.

Outputs
+++++++

The **Shear** node outputs the shear stressed image as RGBA.
The **Shear** node outputs the shear stressed images as RGBA.

Parameters
++++++++++
Expand Down
6 changes: 3 additions & 3 deletions material_maker/doc/node_transform_swirl.rst
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
Swirl node
~~~~~~~~~~

The **Swirl** node applies a swirl effect on its input.
The **Swirl** node is variadic and applies a swirl effect on its inputs.

.. image:: images/node_transform_swirl.png
:align: center

Inputs
++++++

The **Swirl** node accepts a single RGBA input, interpreted as a heightmap.
The **Swirl** node accepts one or more RGBA inputs, interpreted as a heightmap.

Outputs
+++++++

The **Swirl** node outputs the transformed image as RGBA.
The **Swirl** node outputs the transformed images as RGBA.

Parameters
++++++++++
Expand Down
5 changes: 3 additions & 2 deletions material_maker/doc/node_transform_warp.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Warp node
~~~~~~~~~

The **Warp** node deforms an input image according to the derivative of the second input image.
The **Warp** node is variadic and deform one or more input images according to the
derivative of a greyscale image.

.. image:: images/node_transform_warp.png
:align: center
Expand All @@ -11,7 +12,7 @@ Inputs

The **Warp** node accepts two inputs:

* The *Source* inputs is the image to be deformed.
* The *Source* input is the image to be deformed.

* The *Displace* input is a greyscale image whose derivative will be used to deform the source.

Expand Down
Loading