Updated workflow nodes and added documentation
@ -13,4 +13,5 @@ to describe procedural materials.
|
||||
nodes_noise
|
||||
nodes_filter
|
||||
nodes_transform
|
||||
nodes_workflow
|
||||
nodes_miscellaneous
|
||||
|
@ -20,11 +20,11 @@
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = 'Material Maker'
|
||||
copyright = '2018, Rodz Labs'
|
||||
copyright = '2018-2020, Rodz Labs'
|
||||
author = 'Rodz Labs'
|
||||
|
||||
# The short X.Y version
|
||||
version = '0.7'
|
||||
version = '0.8'
|
||||
# The full version, including alpha/beta/rc tags
|
||||
release = ''
|
||||
|
||||
|
BIN
addons/material_maker/doc/images/node_3d_box.png
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
addons/material_maker/doc/images/node_3d_box_samples.png
Normal file
After Width: | Height: | Size: 5.3 KiB |
BIN
addons/material_maker/doc/images/node_3d_sphere.png
Normal file
After Width: | Height: | Size: 4.5 KiB |
BIN
addons/material_maker/doc/images/node_3d_sphere_samples.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
addons/material_maker/doc/images/node_workflow_applymap.png
Normal file
After Width: | Height: | Size: 4.8 KiB |
BIN
addons/material_maker/doc/images/node_workflow_createmap.png
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
addons/material_maker/doc/images/node_workflow_mix.png
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
addons/material_maker/doc/images/node_workflow_mixmaps.png
Normal file
After Width: | Height: | Size: 2.9 KiB |
BIN
addons/material_maker/doc/images/node_workflow_output.png
Normal file
After Width: | Height: | Size: 5.2 KiB |
BIN
addons/material_maker/doc/images/workflow_applied_map.png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
addons/material_maker/doc/images/workflow_base_material.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
addons/material_maker/doc/images/workflow_final.png
Normal file
After Width: | Height: | Size: 128 KiB |
BIN
addons/material_maker/doc/images/workflow_map.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
BIN
addons/material_maker/doc/images/workflow_mix.png
Normal file
After Width: | Height: | Size: 68 KiB |
BIN
addons/material_maker/doc/images/workflow_mixed_maps.png
Normal file
After Width: | Height: | Size: 7.0 KiB |
33
addons/material_maker/doc/node_3d_box.rst
Normal file
@ -0,0 +1,33 @@
|
||||
Box node
|
||||
~~~~~~~~
|
||||
|
||||
The **Box** node outputs a greyscale image that represents the depth of a 3D box.
|
||||
|
||||
.. image:: images/node_3d_box.png
|
||||
:align: center
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **Box** node do not accept any input.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **Box** node provides an output that generates a greyscale image showing the
|
||||
selected 3D box.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **Box** node has the following parameters:
|
||||
|
||||
* the *box center position* as X, Y and Z coordinates
|
||||
* the *box size* along X, Y and Z axes
|
||||
* the *rotation of the box* around X, Y and Z axes
|
||||
|
||||
Example images
|
||||
++++++++++++++
|
||||
|
||||
.. image:: images/node_3d_box_samples.png
|
||||
:align: center
|
@ -1,28 +1,28 @@
|
||||
Capsule node
|
||||
Cone node
|
||||
............
|
||||
|
||||
The **Capsule** node generates a 3d signed distance function for a capsule.
|
||||
The **Cone** node generates a 3d signed distance function for an infinite cone.
|
||||
|
||||
.. image:: images/node_sdf3d_capsule.png
|
||||
.. image:: images/node_sdf3d_cone.png
|
||||
:align: center
|
||||
|
||||
Inputs
|
||||
::::::
|
||||
|
||||
The **Capsule** node does not accept any input.
|
||||
The **Cone** node does not accept any input.
|
||||
|
||||
Outputs
|
||||
:::::::
|
||||
|
||||
The **Capsule** node generates a signed distance function for a capsule.
|
||||
The **Cone** node generates a signed distance function for a cone.
|
||||
|
||||
Parameters
|
||||
::::::::::
|
||||
|
||||
The **Capsule** node accepts as parameters the length of the capsule and its radius.
|
||||
The **Cone** node accepts as parameters the *angle* of the cone.
|
||||
|
||||
Example images
|
||||
::::::::::::::
|
||||
|
||||
.. image:: images/node_sdf3d_capsule_sample.png
|
||||
.. image:: images/node_sdf3d_cone_sample.png
|
||||
:align: center
|
||||
|
30
addons/material_maker/doc/node_3d_sphere.rst
Normal file
@ -0,0 +1,30 @@
|
||||
Sphere node
|
||||
~~~~~~~~~~~
|
||||
|
||||
The **Sphere** node outputs a greyscale image that represents the depth of a 3D sphere.
|
||||
|
||||
.. image:: images/node_3d_sphere.png
|
||||
:align: center
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **Sphere** node do not accept any input.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **Sphere** node provides an output that generates a greyscale image showing the
|
||||
selected 3D sphere.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **Sphere** node accepts the *sphere center position* as X and Y coordinates
|
||||
and its *radius* as parameters.
|
||||
|
||||
Example images
|
||||
++++++++++++++
|
||||
|
||||
.. image:: images/node_3d_sphere_samples.png
|
||||
:align: center
|
24
addons/material_maker/doc/node_workflow_applymap.rst
Normal file
@ -0,0 +1,24 @@
|
||||
ApplyMap node
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
The **ApplyMap** node applys a map to a simple material by adjusting its orientation and offset,
|
||||
and outputs the modified map and the height information.
|
||||
|
||||
.. image:: images/node_workflow_applymap.png
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **ApplyMap** node accepts a map (generated by the **CreateMap** node) and
|
||||
the 4 (albedo, ORM, emission and normal) components of a simple material as inputs.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **ApplyMap** node outputs the height, albedo, ORM, emission and normal components
|
||||
of the map.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **ApplyMap** node does not have any parameter.
|
36
addons/material_maker/doc/node_workflow_createmap.rst
Normal file
@ -0,0 +1,36 @@
|
||||
CreateMap node
|
||||
~~~~~~~~~~~~~~
|
||||
|
||||
The **CreateMap** node creates a map holding height, orientation and offset information
|
||||
used to combine simple materials.
|
||||
|
||||
.. image:: images/node_workflow_createmap.png
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **CreateMap** node accepts two inputs:
|
||||
|
||||
* the *height* component as a greyscale image.
|
||||
|
||||
* an optional offset map.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **CreateMap** node outputs the map in an RGB image where:
|
||||
|
||||
* the red component holds the height information
|
||||
|
||||
* the green component holds the orientation information
|
||||
|
||||
* the blue component holds the offset information
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **CreateMap** node has two parameters:
|
||||
|
||||
* *height* is the maximum height of the map
|
||||
|
||||
* *angle* is the orientation of the map
|
23
addons/material_maker/doc/node_workflow_mix.rst
Normal file
@ -0,0 +1,23 @@
|
||||
Mix node
|
||||
~~~~~~~~
|
||||
|
||||
The **Mix** node mixes two applied maps based on the height information.
|
||||
|
||||
.. image:: images/node_workflow_mix.png
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **Mix** node accepts the height, albedo, ORM, emission and normal channels of both
|
||||
applied maps as inputs.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **Mix** node outputs the height, albedo, ORM, emission and normal components
|
||||
of the combined map.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **Mix** node does not have any parameter.
|
21
addons/material_maker/doc/node_workflow_mixmaps.rst
Normal file
@ -0,0 +1,21 @@
|
||||
MixMaps node
|
||||
~~~~~~~~~
|
||||
|
||||
The **MixMaps** node combines up to 4 maps holding height, orientation and offset information.
|
||||
|
||||
.. image:: images/node_workflow_mixmaps.png
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **MixMaps** node accepts four input maps. Unconnected inputs are ignored.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **MixMaps** node outputs the combined map.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **MixMaps** node does not have any parameter.
|
30
addons/material_maker/doc/node_workflow_output.rst
Normal file
@ -0,0 +1,30 @@
|
||||
Output node
|
||||
~~~~~~~~~~~
|
||||
|
||||
The **Output** node converts an applied map into a material. It uses the height to
|
||||
generate the normal and occlusion maps.
|
||||
|
||||
.. image:: images/node_workflow_output.png
|
||||
|
||||
Inputs
|
||||
++++++
|
||||
|
||||
The **Output** node accepts accepts the height, albedo, ORM, emission and normal channels
|
||||
of the applied map inputs.
|
||||
|
||||
Outputs
|
||||
+++++++
|
||||
|
||||
The **Output** node outputs the albedo, metallic, roughness, emission, normal, occlusion
|
||||
and depth components of the material. They should be connected to the **Material** node.
|
||||
|
||||
Parameters
|
||||
++++++++++
|
||||
|
||||
The **Output** node accepts the following parameters:
|
||||
|
||||
* the amount of occlusion extracted from the height map
|
||||
|
||||
* the strength of the normal maps of the base material (when mixed with the
|
||||
normal map generated from the height map)
|
||||
|
@ -6,5 +6,7 @@ The simple nodes are nodes that do not accept any input and generate one or seve
|
||||
.. toctree::
|
||||
:maxdepth: 0
|
||||
|
||||
node_3d_box
|
||||
node_3d_sphere
|
||||
node_3d_sdf
|
||||
|
53
addons/material_maker/doc/nodes_workflow.rst
Normal file
@ -0,0 +1,53 @@
|
||||
Workflow nodes
|
||||
--------------
|
||||
|
||||
The workflow nodes can be used to organize the generation of complex materials, based
|
||||
on simple homogeneous materials and maps that describe the overall geometry of the
|
||||
whole material.
|
||||
|
||||
The **CreateMap** node is used to create a map that holds the height, orientation and
|
||||
offset of the material.
|
||||
|
||||
.. image:: images/workflow_map.png
|
||||
:align: center
|
||||
|
||||
The **MixMaps** node can be used to combine maps (based on their
|
||||
height information) that will be applied to the same material.
|
||||
|
||||
.. image:: images/workflow_mixed_maps.png
|
||||
:align: center
|
||||
|
||||
Base (flat) materials consist of albedo, ORM (ambient occlusion, roughness, metallic),
|
||||
emission and normal channels. A few example materials are provided in the
|
||||
**Workflow/Materials** section of the library.
|
||||
|
||||
.. image:: images/workflow_base_material.png
|
||||
:align: center
|
||||
|
||||
Maps are then applied to base materials using the **ApplyMap** node to generate
|
||||
new (reoriented and offset) materials (with albedo, ORM, emission and normal) associated
|
||||
to height information.
|
||||
|
||||
.. image:: images/workflow_applied_map.png
|
||||
:align: center
|
||||
|
||||
Different materials with height information can then be mixed based on their height
|
||||
using the **Mix** node to generate more complex materials.
|
||||
|
||||
.. image:: images/workflow_mix.png
|
||||
:align: center
|
||||
|
||||
The result can then be fed into the **Material** node using the **Output** node, that
|
||||
generates the overall normal and ambient occlusion maps using the height map.
|
||||
|
||||
.. image:: images/workflow_final.png
|
||||
:align: center
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
node_workflow_createmap
|
||||
node_workflow_mixmaps
|
||||
node_workflow_applymap
|
||||
node_workflow_mix
|
||||
node_workflow_output
|
@ -2337,7 +2337,7 @@
|
||||
"icon": "workflow_createmap",
|
||||
"name": "mwf_create_map",
|
||||
"parameters": {
|
||||
"angle": -73,
|
||||
"angle": 0,
|
||||
"height": 1
|
||||
},
|
||||
"tree_item": "Workflow/CreateMap",
|
||||
|
@ -12,10 +12,16 @@
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "1.0",
|
||||
"label": "",
|
||||
"name": "h",
|
||||
"type": "f"
|
||||
},
|
||||
{
|
||||
"default": "0.0",
|
||||
"label": "",
|
||||
"name": "in",
|
||||
"name": "o",
|
||||
"type": "f"
|
||||
}
|
||||
],
|
||||
@ -23,7 +29,7 @@
|
||||
"name": "Create Map",
|
||||
"outputs": [
|
||||
{
|
||||
"rgb": "vec3($height*$in($uv), $angle*0.00277777777+0.5, rand(vec2($seed)))",
|
||||
"rgb": "vec3($height*$h($uv), $angle*0.00277777777+0.5, rand(vec2(float($seed)+$o($uv))))",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
|
@ -12,7 +12,7 @@
|
||||
"global": "vec2 matmap_uv(vec2 uv, float angle, float seed) {\n\tuv -= vec2(0.5);\n\tvec2 rv;\n\trv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\trv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\treturn fract(rv + rand2(vec2(seed)));\n}\n\nvec3 matmap_rotate_nm(vec3 input, float angle) {\n\tvec2 uv = input.xy - vec2(0.5);\n\tvec2 rv;\n\trv.x = uv.x*cos(angle)+uv.y*sin(angle);\n\trv.y = -uv.x*sin(angle)+uv.y*cos(angle);\n\treturn vec3(rv + vec2(0.5), input.z);\n}\n",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "vec3(0.0)",
|
||||
"default": "vec3(1.0, 0.5, 0.0)",
|
||||
"label": "Map",
|
||||
"name": "map",
|
||||
"type": "rgb"
|
||||
|
35
addons/material_maker/nodes/raymarching_preview.mmg
Normal file
@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "raymarching_preview",
|
||||
"node_position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"parameters": {
|
||||
|
||||
},
|
||||
"shader_model": {
|
||||
"code": "",
|
||||
"global": "",
|
||||
"inputs": [
|
||||
{
|
||||
"default": "0.0",
|
||||
"function": true,
|
||||
"label": "",
|
||||
"name": "sdf",
|
||||
"type": "sdf3d"
|
||||
}
|
||||
],
|
||||
"instance": "float calcdist_$name(vec3 p) {\n return min($sdf(p), p.z);\n}\n\nfloat raymarch_$name(vec3 ro, vec3 rd) {\n\tfloat d=0.0;\n\tfor (int i = 0; i < 50; i++) {\n\t\tvec3 p = ro + rd*d;\n\t\tfloat dstep = calcdist_$name(p);\n\t\td += dstep;\n\t\tif (dstep < 0.0001) break;\n\t}\n\treturn d;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = calcdist_$name(p);\n\tfloat e = .0001;\n\tvec3 n = d - vec3(calcdist_$name(p-vec3(e, 0.0, 0.0)), calcdist_$name(p-vec3(0.0, e, 0.0)), calcdist_$name(p-vec3(0.0, 0.0, e)));\n\treturn normalize(n);\n}\n\nvec3 render_$name(vec2 uv) {\n\tvec3 p = vec3(uv, 2.0-raymarch_$name(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n\tvec3 n = normal_$name(p);\n\tvec3 l = vec3(5.0, 5.0, 10.0);\n\tvec3 ld = normalize(l-p);\n\tfloat o = step(p.z, 0.001);\n\tfloat shadow = 1.0-0.75*step(raymarch_$name(l, -ld), length(l-p)-0.01);\n\tfloat light = 0.3+0.7*dot(n, ld)*shadow;\n\treturn vec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light;\n}\n",
|
||||
"name": "Preview",
|
||||
"outputs": [
|
||||
{
|
||||
"rgb": "render_$name($uv-vec2(0.5))",
|
||||
"type": "rgb"
|
||||
}
|
||||
],
|
||||
"parameters": [
|
||||
|
||||
]
|
||||
},
|
||||
"type": "shader"
|
||||
}
|