diff --git a/addons/material_maker/doc/base_library.rst b/addons/material_maker/doc/base_library.rst index fb8309e..4774df5 100644 --- a/addons/material_maker/doc/base_library.rst +++ b/addons/material_maker/doc/base_library.rst @@ -13,4 +13,5 @@ to describe procedural materials. nodes_noise nodes_filter nodes_transform + nodes_workflow nodes_miscellaneous diff --git a/addons/material_maker/doc/conf.py b/addons/material_maker/doc/conf.py index 1aee5d7..cfbe359 100644 --- a/addons/material_maker/doc/conf.py +++ b/addons/material_maker/doc/conf.py @@ -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 = '' diff --git a/addons/material_maker/doc/images/node_3d_box.png b/addons/material_maker/doc/images/node_3d_box.png new file mode 100644 index 0000000..1cb5f73 Binary files /dev/null and b/addons/material_maker/doc/images/node_3d_box.png differ diff --git a/addons/material_maker/doc/images/node_3d_box_samples.png b/addons/material_maker/doc/images/node_3d_box_samples.png new file mode 100644 index 0000000..f130b4c Binary files /dev/null and b/addons/material_maker/doc/images/node_3d_box_samples.png differ diff --git a/addons/material_maker/doc/images/node_3d_sphere.png b/addons/material_maker/doc/images/node_3d_sphere.png new file mode 100644 index 0000000..ffc48f9 Binary files /dev/null and b/addons/material_maker/doc/images/node_3d_sphere.png differ diff --git a/addons/material_maker/doc/images/node_3d_sphere_samples.png b/addons/material_maker/doc/images/node_3d_sphere_samples.png new file mode 100644 index 0000000..aa03a35 Binary files /dev/null and b/addons/material_maker/doc/images/node_3d_sphere_samples.png differ diff --git a/addons/material_maker/doc/images/node_bricks.png b/addons/material_maker/doc/images/node_bricks.png index 0ee39bd..b3abdb2 100644 Binary files a/addons/material_maker/doc/images/node_bricks.png and b/addons/material_maker/doc/images/node_bricks.png differ diff --git a/addons/material_maker/doc/images/node_customuv.png b/addons/material_maker/doc/images/node_customuv.png new file mode 100644 index 0000000..5d37ead Binary files /dev/null and b/addons/material_maker/doc/images/node_customuv.png differ diff --git a/addons/material_maker/doc/images/node_greyscale.png b/addons/material_maker/doc/images/node_greyscale.png new file mode 100644 index 0000000..ddc83a4 Binary files /dev/null and b/addons/material_maker/doc/images/node_greyscale.png differ diff --git a/addons/material_maker/doc/images/node_greyscale_samples.png b/addons/material_maker/doc/images/node_greyscale_samples.png new file mode 100644 index 0000000..ffe5aad Binary files /dev/null and b/addons/material_maker/doc/images/node_greyscale_samples.png differ diff --git a/addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png b/addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png index e6d2ce3..abca6a6 100644 Binary files a/addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png and b/addons/material_maker/doc/images/node_sdf3d_cylinder_sample.png differ diff --git a/addons/material_maker/doc/images/node_sdf3d_morph.png b/addons/material_maker/doc/images/node_sdf3d_morph.png new file mode 100644 index 0000000..2c64791 Binary files /dev/null and b/addons/material_maker/doc/images/node_sdf3d_morph.png differ diff --git a/addons/material_maker/doc/images/node_sdf3d_morph_sample.png b/addons/material_maker/doc/images/node_sdf3d_morph_sample.png new file mode 100644 index 0000000..a070f99 Binary files /dev/null and b/addons/material_maker/doc/images/node_sdf3d_morph_sample.png differ diff --git a/addons/material_maker/doc/images/node_sdmorph.png b/addons/material_maker/doc/images/node_sdmorph.png new file mode 100644 index 0000000..1199b2f Binary files /dev/null and b/addons/material_maker/doc/images/node_sdmorph.png differ diff --git a/addons/material_maker/doc/images/node_sdmorph_sample.png b/addons/material_maker/doc/images/node_sdmorph_sample.png new file mode 100644 index 0000000..416dd43 Binary files /dev/null and b/addons/material_maker/doc/images/node_sdmorph_sample.png differ diff --git a/addons/material_maker/doc/images/node_workflow_applymap.png b/addons/material_maker/doc/images/node_workflow_applymap.png new file mode 100644 index 0000000..31b4102 Binary files /dev/null and b/addons/material_maker/doc/images/node_workflow_applymap.png differ diff --git a/addons/material_maker/doc/images/node_workflow_createmap.png b/addons/material_maker/doc/images/node_workflow_createmap.png new file mode 100644 index 0000000..8510171 Binary files /dev/null and b/addons/material_maker/doc/images/node_workflow_createmap.png differ diff --git a/addons/material_maker/doc/images/node_workflow_mix.png b/addons/material_maker/doc/images/node_workflow_mix.png new file mode 100644 index 0000000..8b088d3 Binary files /dev/null and b/addons/material_maker/doc/images/node_workflow_mix.png differ diff --git a/addons/material_maker/doc/images/node_workflow_mixmaps.png b/addons/material_maker/doc/images/node_workflow_mixmaps.png new file mode 100644 index 0000000..f7f6c2b Binary files /dev/null and b/addons/material_maker/doc/images/node_workflow_mixmaps.png differ diff --git a/addons/material_maker/doc/images/node_workflow_output.png b/addons/material_maker/doc/images/node_workflow_output.png new file mode 100644 index 0000000..255b288 Binary files /dev/null and b/addons/material_maker/doc/images/node_workflow_output.png differ diff --git a/addons/material_maker/doc/images/workflow_applied_map.png b/addons/material_maker/doc/images/workflow_applied_map.png new file mode 100644 index 0000000..935964f Binary files /dev/null and b/addons/material_maker/doc/images/workflow_applied_map.png differ diff --git a/addons/material_maker/doc/images/workflow_base_material.png b/addons/material_maker/doc/images/workflow_base_material.png new file mode 100644 index 0000000..85517d1 Binary files /dev/null and b/addons/material_maker/doc/images/workflow_base_material.png differ diff --git a/addons/material_maker/doc/images/workflow_final.png b/addons/material_maker/doc/images/workflow_final.png new file mode 100644 index 0000000..48b3fab Binary files /dev/null and b/addons/material_maker/doc/images/workflow_final.png differ diff --git a/addons/material_maker/doc/images/workflow_map.png b/addons/material_maker/doc/images/workflow_map.png new file mode 100644 index 0000000..9664421 Binary files /dev/null and b/addons/material_maker/doc/images/workflow_map.png differ diff --git a/addons/material_maker/doc/images/workflow_mix.png b/addons/material_maker/doc/images/workflow_mix.png new file mode 100644 index 0000000..67cc83a Binary files /dev/null and b/addons/material_maker/doc/images/workflow_mix.png differ diff --git a/addons/material_maker/doc/images/workflow_mixed_maps.png b/addons/material_maker/doc/images/workflow_mixed_maps.png new file mode 100644 index 0000000..cce2f5e Binary files /dev/null and b/addons/material_maker/doc/images/workflow_mixed_maps.png differ diff --git a/addons/material_maker/doc/node_3d_box.rst b/addons/material_maker/doc/node_3d_box.rst new file mode 100644 index 0000000..af61ba8 --- /dev/null +++ b/addons/material_maker/doc/node_3d_box.rst @@ -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 diff --git a/addons/material_maker/doc/node_3d_sdf.rst b/addons/material_maker/doc/node_3d_sdf.rst index bf7093c..1f0e9c0 100644 --- a/addons/material_maker/doc/node_3d_sdf.rst +++ b/addons/material_maker/doc/node_3d_sdf.rst @@ -51,6 +51,7 @@ Operators node_3d_sdf_operators_circlerepeat node_3d_sdf_operators_extrusion node_3d_sdf_operators_revolution + node_3d_sdf_operators_morph Transforms ++++++++++ diff --git a/addons/material_maker/doc/node_3d_sdf_operators_morph.rst b/addons/material_maker/doc/node_3d_sdf_operators_morph.rst new file mode 100644 index 0000000..1d562e0 --- /dev/null +++ b/addons/material_maker/doc/node_3d_sdf_operators_morph.rst @@ -0,0 +1,30 @@ +Morph node +.......... + +The **Morph** node generates a 3D signed distance function obtained by mixing two input +3D signed distance functions. + +.. image:: images/node_sdf3d_morph.png + :align: center + +Inputs +:::::: + +The **Morph** node accepts 2 inputs in 3D signed distance function format. + +Outputs +::::::: + +The **Morph** node generates a signed distance function of the +combination of its inputs. + +Parameters +:::::::::: + +The **Morph** node accepts *the mix factor* as parameter. + +Example images +:::::::::::::: + +.. image:: images/node_sdf3d_morph_sample.png + :align: center diff --git a/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst b/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst index 15dc04d..0fe3831 100644 --- a/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst +++ b/addons/material_maker/doc/node_3d_sdf_shapes_cone.rst @@ -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 diff --git a/addons/material_maker/doc/node_3d_sphere.rst b/addons/material_maker/doc/node_3d_sphere.rst new file mode 100644 index 0000000..6dbc2d7 --- /dev/null +++ b/addons/material_maker/doc/node_3d_sphere.rst @@ -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 diff --git a/addons/material_maker/doc/node_filter_greyscale.rst b/addons/material_maker/doc/node_filter_greyscale.rst new file mode 100644 index 0000000..442d813 --- /dev/null +++ b/addons/material_maker/doc/node_filter_greyscale.rst @@ -0,0 +1,29 @@ +Greyscale node +~~~~~~~~~~~~~~ + +The **Greyscale** node converts a color image into greyscale. + +.. image:: images/node_greyscale.png + :align: center + +Inputs +++++++ + +The **Greyscale** node requires a color input texture. + +Outputs ++++++++ + +The **Greyscale** node provides a single greyscale texture. + +Parameters +++++++++++ + +The **Greyscale** node accepts the *conversion algorithm* (*lightness*, *average*, +*luminosity*, *min* or *max*) as parameter. + +Example images +++++++++++++++ + +.. image:: images/node_greyscale_samples.png + :align: center diff --git a/addons/material_maker/doc/node_pattern_bricks.rst b/addons/material_maker/doc/node_pattern_bricks.rst index f44dff2..515e505 100644 --- a/addons/material_maker/doc/node_pattern_bricks.rst +++ b/addons/material_maker/doc/node_pattern_bricks.rst @@ -23,6 +23,12 @@ The **Bricks** node provides the following textures: * The 3rd and 4th textures are greyscale images of the X and Y position of the center of each brick. +* The 5th texture is an UV map texture for each brick (and can be used with the **CustomUV** + node to apply a texture on each brick) + +* the 6th texture is an UV map for each corner of each brick (and can be used with the + **CustomUV** node to apply a texture on each corner) + Those images can be used together to create complex materials that show for example bricks of different colors. @@ -47,6 +53,10 @@ The **Bricks** node accepts the following parameters: * the *Bevel* parameter defines the relative thickness of brick bevel in patterns. +* the *Round* parameter defines the radius of each round corner. + +* the *Corner* parameter defines the size of each corner (for the 6th output texture). + Notes +++++ diff --git a/addons/material_maker/doc/node_simple_sdf.rst b/addons/material_maker/doc/node_simple_sdf.rst index 8c789c3..1e290b6 100644 --- a/addons/material_maker/doc/node_simple_sdf.rst +++ b/addons/material_maker/doc/node_simple_sdf.rst @@ -16,6 +16,11 @@ All Signed Distance Functions nodes are based on code written by Inigo Quilez th __ sdf2dpage_ +.. toctree:: + :maxdepth: 1 + + node_simple_sdf_operators_sdshow + Shapes ++++++ @@ -37,7 +42,7 @@ Operators node_simple_sdf_operators_sdsmoothboolean node_simple_sdf_operators_sdroundedshape node_simple_sdf_operators_sdannularshape - node_simple_sdf_operators_sdshow + node_simple_sdf_operators_sdmorph Example images ++++++++++++++ diff --git a/addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst b/addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst new file mode 100644 index 0000000..fdff1ee --- /dev/null +++ b/addons/material_maker/doc/node_simple_sdf_operators_sdmorph.rst @@ -0,0 +1,30 @@ +sdMorph node +............ + +The **sdMorph** node generates a signed distance image obtained by mixing two input +2D signed distance functions. + +.. image:: images/node_sdmorph.png + :align: center + +Inputs +:::::: + +The **sdMorph** node accepts 2 inputs in signed distance function format. + +Outputs +::::::: + +The **sdMorph** node generates a signed distance function of the +combination of its inputs. + +Parameters +:::::::::: + +The **sdMorph** node accepts accepts *the mix factor* as parameter. + +Example images +:::::::::::::: + +.. image:: images/node_sdmorph_sample.png + :align: center diff --git a/addons/material_maker/doc/node_transform_customuv.rst b/addons/material_maker/doc/node_transform_customuv.rst new file mode 100644 index 0000000..833af99 --- /dev/null +++ b/addons/material_maker/doc/node_transform_customuv.rst @@ -0,0 +1,26 @@ +CustomUV node +~~~~~~~~~~~~~ + +The **CustomUV** node deforms an input image according to a custom UV map given as input. + +.. image:: images/node_customuv.png + +Inputs +++++++ + +The **CustomUV** node accepts two inputs: + +* The *Source* inputs is the image to be deformed. + +* The *UV* input is a color image whose red and green channels are used as + U and V (X and Y in texture space) coordinates. + +Outputs ++++++++ + +The **CustomUV** node outputs the deformed image. + +Parameters +++++++++++ + +The **CustomUV** node does not have any parameter. diff --git a/addons/material_maker/doc/node_workflow_applymap.rst b/addons/material_maker/doc/node_workflow_applymap.rst new file mode 100644 index 0000000..b67974a --- /dev/null +++ b/addons/material_maker/doc/node_workflow_applymap.rst @@ -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. diff --git a/addons/material_maker/doc/node_workflow_createmap.rst b/addons/material_maker/doc/node_workflow_createmap.rst new file mode 100644 index 0000000..8560ef2 --- /dev/null +++ b/addons/material_maker/doc/node_workflow_createmap.rst @@ -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 diff --git a/addons/material_maker/doc/node_workflow_mix.rst b/addons/material_maker/doc/node_workflow_mix.rst new file mode 100644 index 0000000..c86333a --- /dev/null +++ b/addons/material_maker/doc/node_workflow_mix.rst @@ -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. diff --git a/addons/material_maker/doc/node_workflow_mixmaps.rst b/addons/material_maker/doc/node_workflow_mixmaps.rst new file mode 100644 index 0000000..d98bb0a --- /dev/null +++ b/addons/material_maker/doc/node_workflow_mixmaps.rst @@ -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. diff --git a/addons/material_maker/doc/node_workflow_output.rst b/addons/material_maker/doc/node_workflow_output.rst new file mode 100644 index 0000000..5b999c5 --- /dev/null +++ b/addons/material_maker/doc/node_workflow_output.rst @@ -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) + diff --git a/addons/material_maker/doc/nodes_3d.rst b/addons/material_maker/doc/nodes_3d.rst index 31c3f90..f52e10a 100644 --- a/addons/material_maker/doc/nodes_3d.rst +++ b/addons/material_maker/doc/nodes_3d.rst @@ -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 \ No newline at end of file diff --git a/addons/material_maker/doc/nodes_filter.rst b/addons/material_maker/doc/nodes_filter.rst index 2f9eb73..9b6db14 100644 --- a/addons/material_maker/doc/nodes_filter.rst +++ b/addons/material_maker/doc/nodes_filter.rst @@ -9,6 +9,7 @@ The filter nodes accept one or several inputs and generate one or several images node_filter_invert node_filter_brightness_contrast node_filter_adjust_hsv + node_filter_greyscale node_filter_colorize node_filter_combine node_filter_decompose diff --git a/addons/material_maker/doc/nodes_transform.rst b/addons/material_maker/doc/nodes_transform.rst index fc4bf9b..05f4fce 100644 --- a/addons/material_maker/doc/nodes_transform.rst +++ b/addons/material_maker/doc/nodes_transform.rst @@ -10,3 +10,4 @@ The transform nodes are nodes that affect the geometry of their input. node_transform_kaleidoscope node_transform_mirror node_transform_warp + node_transform_customuv diff --git a/addons/material_maker/doc/nodes_workflow.rst b/addons/material_maker/doc/nodes_workflow.rst new file mode 100644 index 0000000..7e5d39f --- /dev/null +++ b/addons/material_maker/doc/nodes_workflow.rst @@ -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 diff --git a/addons/material_maker/engine/gen_convolution.gd b/addons/material_maker/engine/gen_convolution.gd index da12ec0..ad9b89b 100644 --- a/addons/material_maker/engine/gen_convolution.gd +++ b/addons/material_maker/engine/gen_convolution.gd @@ -169,7 +169,8 @@ func _get_shader_code(uv : String, output_index : int, context : MMGenContext) - coef_str = "vec3(%.9f, %.9f, %.9f)" % [ coef[0] * sum[0], coef[1] * sum[1], coef[2] * sum[2] ] "rgba": coef_str = "vec4(%.9f, %.9f, %.9f, %.9f)" % [ coef[0] * sum[0], coef[1] * sum[1], coef[2] * sum[2], coef[3] * sum[3] ] - rv.code += "%s_%d += %s*%s;\n" % [ genname, variant_index, coef_str, src_code[convolution_params.input_type] ] + if src_code.has(convolution_params.input_type): + rv.code += "%s_%d += %s*%s;\n" % [ genname, variant_index, coef_str, src_code[convolution_params.input_type] ] for t in src_code.textures.keys(): rv.textures[t] = src_code.textures[t] rv[convolution_params.output_type] = "%s_%d" % [ genname, variant_index ] @@ -181,4 +182,5 @@ func _serialize(data: Dictionary) -> Dictionary: return data func _deserialize(data : Dictionary) -> void: - set_convolution_params(data.convolution_params) + if data.has("convolution_params"): + set_convolution_params(data.convolution_params) diff --git a/addons/material_maker/engine/gen_material.gd b/addons/material_maker/engine/gen_material.gd index b6b41ba..c1fb41b 100644 --- a/addons/material_maker/engine/gen_material.gd +++ b/addons/material_maker/engine/gen_material.gd @@ -200,7 +200,7 @@ func update_spatial_material(m, file_prefix = null) -> void: m.ao_enabled = false # Depth texture = get_generated_texture("depth", file_prefix) - if texture != null: + if texture != null and parameters.depth_scale > 0: m.depth_enabled = true m.depth_deep_parallax = true m.depth_scale = parameters.depth_scale * 0.2 diff --git a/addons/material_maker/engine/gen_remote.gd b/addons/material_maker/engine/gen_remote.gd index fd831f9..ea1da41 100644 --- a/addons/material_maker/engine/gen_remote.gd +++ b/addons/material_maker/engine/gen_remote.gd @@ -80,11 +80,15 @@ func get_parameter_defs() -> Array: for w in widgets: match w.type: "config_control": - var p : Dictionary = { name=w.name, label=w.label, type="enum", values=[] } + var p : Dictionary = { name=w.name, label=w.label, type="enum" } var configurations = w.configurations.keys() configurations.sort() - for c in configurations: - p.values.push_back({ name=c, value=c }) + if configurations == [ "False", "True" ]: + p.type = "boolean" + else: + p.values=[] + for c in configurations: + p.values.push_back({ name=c, value=c }) rv.append(p) i += 1 "linked_control": @@ -119,6 +123,8 @@ func set_parameter(p : String, v) -> void: if node != null: node.set_parameter(w.widget, v) "config_control": + if v is bool: + v = 1 if v else 0 if v < widget.configurations.size(): var configurations = widget.configurations.keys() configurations.sort() diff --git a/addons/material_maker/examples/3d_shapes.ptex b/addons/material_maker/examples/3d_shapes.ptex new file mode 100644 index 0000000..2d7284d --- /dev/null +++ b/addons/material_maker/examples/3d_shapes.ptex @@ -0,0 +1,641 @@ +{ + "connections": [ + { + "from": "graph", + "from_port": 0, + "to": "Material", + "to_port": 4 + }, + { + "from": "graph", + "from_port": 2, + "to": "Material", + "to_port": 6 + }, + { + "from": "graph", + "from_port": 1, + "to": "Material", + "to_port": 5 + }, + { + "from": "transform", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "graph", + "to_port": 0 + }, + { + "from": "graph", + "from_port": 0, + "to": "edge_detect_1", + "to_port": 0 + }, + { + "from": "edge_detect_1", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "Material", + "to_port": 0 + }, + { + "from": "box", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "sphere", + "from_port": 0, + "to": "transform", + "to_port": 0 + } + ], + "label": "Graph", + "name": "49", + "node_position": { + "x": 0, + "y": 0 + }, + "nodes": [ + { + "name": "Material", + "node_position": { + "x": -165, + "y": 7 + }, + "parameters": { + "albedo_color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "ao_light_affect": 1, + "depth_scale": 1, + "emission_energy": 1, + "metallic": 1, + "normal_scale": 1, + "roughness": 1, + "size": 11, + "subsurf_scatter_strength": 0 + }, + "type": "material" + }, + { + "name": "transform", + "node_position": { + "x": -997.5, + "y": -141 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 0.5, + "scale_y": 0.5, + "translate_x": 0.25, + "translate_y": 0.25 + }, + "type": "transform" + }, + { + "connections": [ + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "occlusion", + "to_port": 0 + }, + { + "from": "occlusion", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + } + ], + "label": "NOD", + "name": "graph", + "node_position": { + "x": -431.27063, + "y": 70.5 + }, + "nodes": [ + { + "connections": [ + { + "from": "nm_convolution", + "from_port": 0, + "to": "nm_postprocess", + "to_port": 0 + }, + { + "from": "nm_postprocess", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "nm_convolution", + "to_port": 0 + } + ], + "label": "Normal Map", + "name": "normal_map", + "node_position": { + "x": -57.5, + "y": -41 + }, + "nodes": [ + { + "name": "buffer", + "node_position": { + "x": -694.663818, + "y": 98.60614 + }, + "parameters": { + "lod": 0, + "size": 11 + }, + "type": "buffer" + }, + { + "convolution_params": { + "input_type": "f", + "matrix": [ + [ + [ + -1, + -1, + 0 + ], + [ + 0, + -2, + 0 + ], + [ + 1, + -1, + 0 + ] + ], + [ + [ + -2, + 0, + 0 + ], + 0, + [ + 2, + 0, + 0 + ] + ], + [ + [ + -1, + 1, + 0 + ], + [ + 0, + 2, + 0 + ], + [ + 1, + 1, + 0 + ] + ] + ], + "output_type": "rgb", + "x": 1, + "y": 1 + }, + "name": "nm_convolution", + "node_position": { + "x": -690.25, + "y": 174.25 + }, + "parameters": { + "size": 11 + }, + "type": "convolution" + }, + { + "name": "nm_postprocess", + "node_position": { + "x": -690.25, + "y": 222.25 + }, + "parameters": { + "amount": 2, + "format": 0, + "size": 11, + "type": 0 + }, + "shader_model": { + "code": "", + "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", + "inputs": [ + { + "default": "vec3(0.0)", + "label": "", + "name": "in", + "type": "rgb" + } + ], + "instance": "", + "name": "NormalMapPostProcess", + "outputs": [ + { + "rgb": "process_normal_$format($in($uv).xyz, $amount*$size/128.0)", + "type": "rgb" + } + ], + "parameters": [ + { + "default": 0, + "label": "", + "name": "format", + "type": "enum", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "OpenGL", + "value": "opengl" + }, + { + "name": "DirectX", + "value": "directx" + } + ] + }, + { + "default": 9, + "first": 4, + "label": "", + "last": 11, + "name": "size", + "type": "size" + }, + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "amount", + "step": 0.005, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -698.910156, + "y": -42.916687 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "size": 4 + }, + "type": "remote", + "widgets": [ + { + "label": "", + "linked_widgets": [ + { + "node": "nm_postprocess", + "widget": "format" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "", + "linked_widgets": [ + { + "node": "buffer", + "widget": "size" + }, + { + "node": "nm_convolution", + "widget": "size" + }, + { + "node": "nm_postprocess", + "widget": "size" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "", + "linked_widgets": [ + { + "node": "nm_postprocess", + "widget": "amount" + } + ], + "name": "param1", + "type": "linked_control" + } + ] + }, + { + "name": "gen_outputs", + "node_position": { + "x": -407.663818, + "y": 151.047363 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -870.910156, + "y": 157.047363 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + } + ], + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "size": 4 + }, + "type": "graph" + }, + { + "name": "occlusion", + "node_position": { + "x": -81.811829, + "y": 56.5 + }, + "parameters": { + "param0": 8, + "param1": 50, + "param2": 5 + }, + "type": "occlusion" + }, + { + "name": "colorize", + "node_position": { + "x": -58.5, + "y": 130 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -381.811829, + "y": 49.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 244.5, + "y": 49.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + }, + { + "name": "port2", + "type": "rgba" + }, + { + "name": "port1", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -27.270599, + "y": -117 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + } + ], + "parameters": { + + }, + "type": "graph" + }, + { + "name": "colorize", + "node_position": { + "x": -486.598755, + "y": -27.262512 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.027273, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "blend", + "node_position": { + "x": -718.608398, + "y": 67.325012 + }, + "parameters": { + "amount": 1, + "blend_type": 9 + }, + "type": "blend" + }, + { + "name": "edge_detect_1", + "node_position": { + "x": -497.608398, + "y": -80.674988 + }, + "parameters": { + "size": 7 + }, + "type": "edge_detect_1" + }, + { + "name": "box", + "node_position": { + "x": -988.422119, + "y": 68.460938 + }, + "parameters": { + "cx": 0.5, + "cy": 0.5, + "cz": 0.5, + "r": 0.5, + "rx": 40, + "ry": 40, + "rz": 90, + "sx": 0.25, + "sy": 0.25, + "sz": 0.25 + }, + "type": "box" + }, + { + "name": "sphere", + "node_position": { + "x": -989.422119, + "y": -246.039063 + }, + "parameters": { + "cx": 0.5, + "cy": 0.5, + "r": 0.5 + }, + "type": "sphere" + } + ], + "parameters": { + + }, + "type": "graph" +} \ No newline at end of file diff --git a/addons/material_maker/examples/beehive.ptex b/addons/material_maker/examples/beehive.ptex new file mode 100644 index 0000000..40ee775 --- /dev/null +++ b/addons/material_maker/examples/beehive.ptex @@ -0,0 +1,340 @@ +{ + "connections": [ + { + "from": "colorize_2", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "Material", + "to_port": 4 + }, + { + "from": "blend", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_3", + "to_port": 0 + }, + { + "from": "colorize_3", + "from_port": 0, + "to": "Material", + "to_port": 6 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "Material", + "to_port": 1 + }, + { + "from": "colorize_4", + "from_port": 0, + "to": "Material", + "to_port": 2 + }, + { + "from": "colorize_5", + "from_port": 0, + "to": "Material", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_5", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_4", + "to_port": 0 + }, + { + "from": "beehive_2", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "beehive_2", + "from_port": 1, + "to": "colorize", + "to_port": 0 + } + ], + "label": "Graph", + "name": "49", + "node_position": { + "x": 0, + "y": 0 + }, + "nodes": [ + { + "name": "Material", + "node_position": { + "x": 134, + "y": -22 + }, + "parameters": { + "albedo_color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "ao_light_affect": 1, + "depth_scale": 0.2, + "emission_energy": 1, + "metallic": 1, + "normal_scale": 1, + "roughness": 1, + "size": 11, + "subsurf_scatter_strength": 0 + }, + "type": "material" + }, + { + "name": "colorize", + "node_position": { + "x": -489.5, + "y": 20 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.225431, + "g": 0.225431, + "pos": 0.583818, + "r": 0.225431 + }, + { + "a": 1, + "b": 0.96875, + "g": 0.96875, + "pos": 0.672727, + "r": 0.96875 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize_2", + "node_position": { + "x": -493.5, + "y": -42 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0.947917, + "g": 0.947917, + "pos": 0.049912, + "r": 0.947917 + }, + { + "a": 1, + "b": 0.115584, + "g": 0.115584, + "pos": 0.106977, + "r": 0.115584 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.290909, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "blend", + "node_position": { + "x": -528.009644, + "y": 89 + }, + "parameters": { + "amount": 1, + "blend_type": 9 + }, + "type": "blend" + }, + { + "name": "normal_map", + "node_position": { + "x": -138.009644, + "y": 78 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 1.02, + "param2": 0, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "colorize_3", + "node_position": { + "x": -132.009644, + "y": 208.5 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -98.009644, + "y": -64.5 + }, + "parameters": { + "color": 0.16 + }, + "type": "uniform_greyscale" + }, + { + "name": "colorize_4", + "node_position": { + "x": -153.009644, + "y": 10 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.65625, + "g": 0.65625, + "pos": 0.518182, + "r": 0.65625 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.890909, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize_5", + "node_position": { + "x": -106.009644, + "y": -151 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0.068034, + "pos": 0, + "r": 0.098958 + }, + { + "a": 1, + "b": 0, + "g": 0.6875, + "pos": 0.881818, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "beehive_2", + "node_position": { + "x": -496.732483, + "y": -162.254547 + }, + "parameters": { + "sx": 20, + "sy": 12 + }, + "type": "beehive" + } + ], + "parameters": { + + }, + "type": "graph" +} \ No newline at end of file diff --git a/addons/material_maker/examples/bricks.ptex b/addons/material_maker/examples/bricks.ptex index 0a81afb..b709f71 100644 --- a/addons/material_maker/examples/bricks.ptex +++ b/addons/material_maker/examples/bricks.ptex @@ -141,11 +141,11 @@ { "from": "blend_2", "from_port": 0, - "to": "normal_map", + "to": "normal_map_2", "to_port": 0 }, { - "from": "normal_map", + "from": "normal_map_2", "from_port": 0, "to": "Material", "to_port": 4 @@ -642,9 +642,11 @@ "parameters": { "bevel": 0.2, "columns": 2, + "corner": 0, "mortar": 0.05, "pattern": 3, "repeat": 2, + "round": 0, "row_offset": 0.5, "rows": 2 }, @@ -660,7 +662,9 @@ "intensity": 1, "randomness": 1, "scale_x": 8, - "scale_y": 8 + "scale_y": 8, + "stretch_x": 1, + "stretch_y": 1 }, "type": "voronoi" }, @@ -977,252 +981,21 @@ "type": "graph" }, { - "connections": [ - { - "from": "nm_convolution", - "from_port": 0, - "to": "nm_postprocess", - "to_port": 0 - }, - { - "from": "nm_postprocess", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "nm_convolution", - "to_port": 0 - } - ], - "label": "Normal Map", - "name": "normal_map", + "name": "normal_map_2", "node_position": { - "x": 960.584229, - "y": 273.420258 + "x": 986.357788, + "y": 281.520294 }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -687.663818, - "y": 125.60614 - }, - "parameters": { - "lod": 0, - "size": 11 - }, - "type": "buffer" - }, - { - "convolution_params": { - "input_type": "f", - "matrix": [ - [ - [ - -1, - -1, - 0 - ], - [ - 0, - -2, - 0 - ], - [ - 1, - -1, - 0 - ] - ], - [ - [ - -2, - 0, - 0 - ], - 0, - [ - 2, - 0, - 0 - ] - ], - [ - [ - -1, - 1, - 0 - ], - [ - 0, - 2, - 0 - ], - [ - 1, - 1, - 0 - ] - ] - ], - "output_type": "rgb", - "x": 1, - "y": 1 - }, - "name": "nm_convolution", - "node_position": { - "x": -690.25, - "y": 174.25 - }, - "parameters": { - "size": 11 - }, - "type": "convolution" - }, - { - "name": "nm_postprocess", - "node_position": { - "x": -690.25, - "y": 222.25 - }, - "parameters": { - "amount": 0.995, - "size": 11 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "NormalMapPostProcess", - "outputs": [ - { - "rgb": "0.5*normalize($in($uv)*$amount*vec3(-1.0, 1.0, 1.0)*$size/128.0-vec3(0.0, 0.0, 1.0))+vec3(0.5)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 9, - "first": 4, - "label": "", - "last": 11, - "name": "size", - "type": "size" - }, - { - "default": 1, - "label": "", - "max": 2, - "min": 0, - "name": "amount", - "step": 0.005, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -718.910156, - "y": 26.083313 - }, - "parameters": { - "param0": 11, - "param1": 0.995 - }, - "type": "remote", - "widgets": [ - { - "label": "Size", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "nm_convolution", - "widget": "size" - }, - { - "node": "nm_postprocess", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "Amount", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "amount" - } - ], - "name": "param1", - "type": "linked_control" - } - ] - }, - { - "name": "gen_outputs", - "node_position": { - "x": -407.663818, - "y": 151.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -870.910156, - "y": 157.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - } - ], "parameters": { + "amount": 0.5, "param0": 11, - "param1": 0.995 + "param1": 1.02, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 }, - "type": "graph" + "type": "normal_map" } ], "parameters": { diff --git a/addons/material_maker/examples/doc_tools.ptex b/addons/material_maker/examples/doc_tools.ptex index bbb597c..1e8ac9a 100644 --- a/addons/material_maker/examples/doc_tools.ptex +++ b/addons/material_maker/examples/doc_tools.ptex @@ -1,17 +1,5 @@ { "connections": [ - { - "from": "bricks", - "from_port": 0, - "to": "warp", - "to_port": 0 - }, - { - "from": "perlin", - "from_port": 0, - "to": "warp", - "to_port": 1 - }, { "from": "graph_2", "from_port": 0, @@ -24,18 +12,6 @@ "to": "blend_2", "to_port": 1 }, - { - "from": "bricks", - "from_port": 0, - "to": "blend", - "to_port": 0 - }, - { - "from": "warp", - "from_port": 0, - "to": "blend", - "to_port": 1 - }, { "from": "graph_3", "from_port": 0, @@ -43,9 +19,9 @@ "to_port": 2 }, { - "from": "graph", + "from": "sdf3d_cylinder", "from_port": 0, - "to": "Material", + "to": "raymarching", "to_port": 0 }, { @@ -54,12 +30,6 @@ "to": "graph", "to_port": 0 }, - { - "from": "raymarching_2", - "from_port": 1, - "to": "graph", - "to_port": 1 - }, { "from": "raymarching_2_2", "from_port": 0, @@ -67,25 +37,61 @@ "to_port": 2 }, { - "from": "raymarching_2_2", - "from_port": 1, + "from": "uniform_greyscale", + "from_port": 0, + "to": "graph", + "to_port": 1 + }, + { + "from": "uniform_greyscale", + "from_port": 0, "to": "graph", "to_port": 3 }, { - "from": "graph_3_2", + "from": "sdf3d_sphere", + "from_port": 0, + "to": "sdf3d_morph", + "to_port": 0 + }, + { + "from": "sdf3d_box", + "from_port": 0, + "to": "sdf3d_morph", + "to_port": 1 + }, + { + "from": "sdf3d_sphere", "from_port": 0, "to": "raymarching_2", "to_port": 0 }, { - "from": "graph_4", + "from": "sdf3d_box", "from_port": 0, - "to": "sdf3d_rotate_2", + "to": "raymarching_2_2", "to_port": 0 }, { - "from": "sdf3d_rotate_2", + "from": "graph", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "raymarching_2_2_2", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "sdf3d_scale_2", + "from_port": 0, + "to": "raymarching_2_2_2", + "to_port": 0 + }, + { + "from": "sdf3d_morph", "from_port": 0, "to": "sdf3d_translate_3_2", "to_port": 0 @@ -93,7 +99,13 @@ { "from": "sdf3d_translate_3_2", "from_port": 0, - "to": "raymarching_2_2", + "to": "sdf3d_scale_2", + "to_port": 0 + }, + { + "from": "blend_2", + "from_port": 0, + "to": "Material", "to_port": 0 } ], @@ -107,8 +119,8 @@ { "name": "Material", "node_position": { - "x": 576.544006, - "y": 29.080002 + "x": 501.544006, + "y": 288.080017 }, "parameters": { "albedo_color": { @@ -124,7 +136,7 @@ "metallic": 1, "normal_scale": 1, "roughness": 1, - "size": 8, + "size": 9, "subsurf_scatter_strength": 0 }, "type": "material" @@ -249,8 +261,8 @@ "label": "Tile Inputs", "name": "graph", "node_position": { - "x": 237.541992, - "y": 78.266541 + "x": -73.458008, + "y": 146.266541 }, "nodes": [ { @@ -489,12 +501,6 @@ "to": "sdboolean_3", "to_port": 1 }, - { - "from": "sdboolean_3", - "from_port": 0, - "to": "sdshow_2", - "to_port": 0 - }, { "from": "sdboolean_3_2", "from_port": 0, @@ -513,24 +519,30 @@ "to": "sdboolean_3_2", "to_port": 0 }, - { - "from": "sdshow_2", - "from_port": 0, - "to": "colorize", - "to_port": 0 - }, { "from": "colorize", "from_port": 0, "to": "gen_outputs", "to_port": 0 + }, + { + "from": "sdboolean_3", + "from_port": 0, + "to": "sdshow", + "to_port": 0 + }, + { + "from": "sdshow", + "from_port": 0, + "to": "colorize", + "to_port": 0 } ], "label": "Arrow", "name": "graph_2", "node_position": { - "x": 206.827515, - "y": 279.753479 + "x": 196.827515, + "y": 248.753479 }, "nodes": [ { @@ -540,11 +552,11 @@ "y": 387.121552 }, "parameters": { - "cx": -0.09, + "cx": -0.07, "cy": 0, "h": 0.04, "r": 0.3, - "w": 0.07 + "w": 0.08 }, "type": "sdbox" }, @@ -552,10 +564,10 @@ "name": "sdrhombus_2", "node_position": { "x": 235.398682, - "y": 251.121552 + "y": 252.121552 }, "parameters": { - "cx": -0.1, + "cx": -0.02, "cy": 0, "h": 0.12, "r": 0.3, @@ -566,11 +578,11 @@ { "name": "sdbox_3_2", "node_position": { - "x": 238.086548, - "y": 121.972382 + "x": 220.086548, + "y": 108.972382 }, "parameters": { - "cx": -0.41, + "cx": -0.23, "cy": 0, "h": 0.35, "r": 0.3, @@ -612,53 +624,6 @@ }, "type": "sdboolean" }, - { - "name": "sdshow_2", - "node_position": { - "x": 602.836609, - "y": 376.603577 - }, - "parameters": { - "bevel": 0.01, - "cx": 0, - "cy": 0, - "h": 0.08, - "r": 0.3, - "w": 0.28 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "sdShow", - "outputs": [ - { - "f": "clamp(-$in($uv)/max($bevel, 0.00001), 0.0, 1.0)", - "type": "f" - } - ], - "parameters": [ - { - "default": 0, - "label": "Bevel", - "max": 1, - "min": 0, - "name": "bevel", - "step": 0.01, - "type": "float" - } - ] - }, - "type": "shader" - }, { "name": "colorize", "node_position": { @@ -733,6 +698,22 @@ "widgets": [ ] + }, + { + "name": "sdshow", + "node_position": { + "x": 631.060425, + "y": 365.52536 + }, + "parameters": { + "bevel": 0.01, + "cx": 0, + "cy": 0, + "h": 0.08, + "r": 0.3, + "w": 0.28 + }, + "type": "sdshow" } ], "parameters": { @@ -764,8 +745,8 @@ "label": "Gradient", "name": "graph_3", "node_position": { - "x": -228.787903, - "y": 631.143799 + "x": -226.787903, + "y": 711.143799 }, "nodes": [ { @@ -954,50 +935,6 @@ }, "type": "graph" }, - { - "name": "bricks", - "node_position": { - "x": -209.473175, - "y": 327.099731 - }, - "parameters": { - "bevel": 0.1, - "columns": 3, - "mortar": 0.1, - "pattern": 0, - "repeat": 1, - "row_offset": 0.5, - "rows": 6 - }, - "type": "bricks" - }, - { - "name": "warp", - "node_position": { - "x": -185.473175, - "y": 528.099731 - }, - "parameters": { - "amount": 0.1, - "eps": 0.1, - "epsilon": 0 - }, - "type": "warp" - }, - { - "name": "perlin", - "node_position": { - "x": -436.473175, - "y": 324.099731 - }, - "parameters": { - "iterations": 3, - "persistence": 0.5, - "scale_x": 4, - "scale_y": 4 - }, - "type": "perlin" - }, { "name": "blend", "node_position": { @@ -1025,8 +962,8 @@ { "name": "raymarching", "node_position": { - "x": 242.468536, - "y": 27.145508 + "x": 380.468536, + "y": 2.145508 }, "parameters": { @@ -1043,11 +980,11 @@ "type": "sdf3d" } ], - "instance": "float input_$name(vec3 p) {\n\tif (p.z > 0.0) {\n\t\treturn $sdf(p);\n\t} else {\n\t\treturn p.z;\n\t}\n}\n\nfloat raymarch_$name(vec3 ro, vec3 rd) {\n\tfloat dO=0.; \n for (int i=0; i < 25; i++) {\n \tvec3 p = ro + rd*dO;\n float dS = input_$name(p);\n dO += dS;\n if (dO > 1.0 || dS < 0.0001) break;\n }\n \n return dO;\n}\n\nvec3 normal_$name(vec3 p) {\n\tfloat d = input_$name(p);\n float e = .001;\n \n vec3 n = d - vec3(input_$name(p-vec3(e, 0.0, 0.0)), input_$name(p-vec3(0.0, e, 0.0)), input_$name(p-vec3(0.0, 0.0, e)));\n return vec3(-1.0, -1.0, -1.0)*normalize(n);\n}\n\nvec3 render_$name(vec2 uv) {\n\tvec3 p = vec3(uv, 2.0-raymarch(vec3(uv, 2.0), vec3(0.0, 0.0, -1.0)));\n\tvec3 n = normal(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(l, -ld), length(l-p)-0.01);\n\tfloat light = 0.3+0.7*dot(n, ld)*shadow;\n\treturnvec3(0.8+0.2*o, 0.8+0.2*o, 1.0)*light;\n}\n", + "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": "Render3d", "outputs": [ { - "rgb": "render_$name($uv-vec2(0.5));\n", + "rgb": "render_$name($uv-vec2(0.5))", "type": "rgb" } ], @@ -1057,28 +994,6 @@ }, "type": "shader" }, - { - "name": "raymarching_2", - "node_position": { - "x": 24.010315, - "y": 37.457581 - }, - "parameters": { - - }, - "type": "raymarching" - }, - { - "name": "raymarching_2_2", - "node_position": { - "x": 26.265625, - "y": 127.457581 - }, - "parameters": { - - }, - "type": "raymarching" - }, { "connections": [ { @@ -2155,223 +2070,221 @@ "type": "graph" }, { - "connections": [ - { - "from": "sdf3d_box", - "from_port": 0, - "to": "sdf3d_boolean", - "to_port": 1 - }, - { - "from": "sdf3d_box_2", - "from_port": 0, - "to": "sdf3d_translate_3_2", - "to_port": 0 - }, - { - "from": "sdf3d_translate_3_2", - "from_port": 0, - "to": "sdf3d_boolean", - "to_port": 0 - }, - { - "from": "sdf3d_translate_3_2_2", - "from_port": 0, - "to": "sdf3d_boolean_2", - "to_port": 0 - }, - { - "from": "sdf3d_boolean", - "from_port": 0, - "to": "sdf3d_boolean_2", - "to_port": 1 - }, - { - "from": "sdf3d_box_2", - "from_port": 0, - "to": "sdf3d_translate_3_2_2", - "to_port": 0 - }, - { - "from": "sdf3d_boolean_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Brick", - "name": "graph_4", + "name": "sdf3d_extrusion", "node_position": { - "x": -209.947205, - "y": 122.904633 - }, - "nodes": [ - { - "name": "sdf3d_box", - "node_position": { - "x": -564.5, - "y": -63 - }, - "parameters": { - "r": 0.01, - "sx": 0.26, - "sy": 0.15, - "sz": 0.1 - }, - "type": "sdf3d_box" - }, - { - "name": "sdf3d_translate_3_2", - "node_position": { - "x": -554.5, - "y": -166 - }, - "parameters": { - "x": 0, - "y": 0, - "z": 0.45 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_box_2", - "node_position": { - "x": -570.5, - "y": -294.5 - }, - "parameters": { - "r": 0, - "sx": 0.21, - "sy": 0.1, - "sz": 0.36 - }, - "type": "sdf3d_box" - }, - { - "name": "sdf3d_boolean", - "node_position": { - "x": -358.5, - "y": -118 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "sdf3d_translate_3_2_2", - "node_position": { - "x": -343.333344, - "y": -224.333344 - }, - "parameters": { - "x": 0, - "y": 0, - "z": -0.45 - }, - "type": "sdf3d_translate" - }, - { - "name": "sdf3d_boolean_2", - "node_position": { - "x": -147.333344, - "y": -168.333344 - }, - "parameters": { - "bevel": 0, - "cx": 0, - "cy": 0, - "h": 0.08, - "op": 1, - "r": 0.3, - "w": 0.28 - }, - "type": "sdf3d_boolean" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -748.5, - "y": -159.361115 - }, - "parameters": { - - }, - "ports": [ - - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 60.666656, - "y": -165.361115 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "sdf3d" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -488.111115, - "y": -466.5 - }, - "parameters": { - - }, - "type": "remote", - "widgets": [ - - ] - } - ], - "parameters": { - - }, - "type": "graph" - }, - { - "name": "sdf3d_rotate_2", - "node_position": { - "x": -241.447205, - "y": 169.404633 + "x": -69.41095, + "y": -191.970337 }, "parameters": { "a": 0, - "ax": 25, - "ay": 23, - "az": -8, + "d": -0.53, + "s": 1, "x": 0.35, "y": 0, "z": 0 }, - "type": "sdf3d_rotate" + "type": "sdf3d_extrusion" + }, + { + "name": "sdf3d_cylinder", + "node_position": { + "x": 115.056458, + "y": -125.498108 + }, + "parameters": { + "l": 0.25, + "r": 0.25, + "sx": 0.25, + "sy": 0.25, + "sz": 0.5 + }, + "type": "sdf3d_cylinder" + }, + { + "name": "sdf3d_sphere", + "node_position": { + "x": -405.972748, + "y": 257.444763 + }, + "parameters": { + "r": 0.4 + }, + "type": "sdf3d_sphere" + }, + { + "name": "sdf3d_box", + "node_position": { + "x": -446.972748, + "y": 316.444763 + }, + "parameters": { + "r": 0.01, + "sx": 0.3, + "sy": 0.25, + "sz": 0.25 + }, + "type": "sdf3d_box" + }, + { + "name": "raymarching_2", + "node_position": { + "x": -233.972748, + "y": 263.944763 + }, + "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": "Render3d", + "outputs": [ + { + "rgb": "render_$name($uv-vec2(0.5))", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "name": "raymarching_2_2", + "node_position": { + "x": -233.972748, + "y": 320.944763 + }, + "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": "Render3d", + "outputs": [ + { + "rgb": "render_$name($uv-vec2(0.5))", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -343.972748, + "y": 181.944778 + }, + "parameters": { + "color": 0.5 + }, + "type": "uniform_greyscale" + }, + { + "name": "sdf3d_morph", + "node_position": { + "x": -239.972748, + "y": 388.694763 + }, + "parameters": { + "Amount": 0.5, + "amount": 0.5, + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "type": "sdf3d_morph" + }, + { + "name": "raymarching_2_2_2", + "node_position": { + "x": -229.972748, + "y": 604.694763 + }, + "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": "Render3d", + "outputs": [ + { + "rgb": "render_$name($uv-vec2(0.5))", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" + }, + { + "name": "sdf3d_scale_2", + "node_position": { + "x": -242.972748, + "y": 556.694763 + }, + "parameters": { + "a": 0, + "s": 0.5, + "x": 0.35, + "y": 0, + "z": 0 + }, + "type": "sdf3d_scale" }, { "name": "sdf3d_translate_3_2", "node_position": { - "x": -233.447205, - "y": 270.404633 + "x": -246.972748, + "y": 455.694763 }, "parameters": { - "x": 0, + "x": 0.5, "y": 0, - "z": 0.25 + "z": 0 }, "type": "sdf3d_translate" } diff --git a/addons/material_maker/examples/doc_tools_albedo.png.import b/addons/material_maker/examples/doc_tools_albedo.png.import new file mode 100644 index 0000000..5cbd9c8 --- /dev/null +++ b/addons/material_maker/examples/doc_tools_albedo.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/doc_tools_albedo.png-7c4191d26c2e3665ccb8c2f5268f0b3d.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/material_maker/examples/doc_tools_albedo.png" +dest_files=[ "res://.import/doc_tools_albedo.png-7c4191d26c2e3665ccb8c2f5268f0b3d.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/addons/material_maker/examples/marble.ptex b/addons/material_maker/examples/marble.ptex index d8c9628..97a613e 100644 --- a/addons/material_maker/examples/marble.ptex +++ b/addons/material_maker/examples/marble.ptex @@ -1,235 +1,264 @@ { "connections": [ { - "from": "perlin_0", + "from": "graph", "from_port": 0, - "to": "warp_0", + "to": "invert", + "to_port": 0 + }, + { + "from": "mwf_map", + "from_port": 0, + "to": "mwf_mix", + "to_port": 0 + }, + { + "from": "graph", + "from_port": 0, + "to": "mwf_map", + "to_port": 0 + }, + { + "from": "invert", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 0 + }, + { + "from": "mwf_map", + "from_port": 1, + "to": "mwf_mix", "to_port": 1 }, { - "from": "warp_0", + "from": "mwf_map", + "from_port": 2, + "to": "mwf_mix", + "to_port": 2 + }, + { + "from": "mwf_map", + "from_port": 3, + "to": "mwf_mix", + "to_port": 3 + }, + { + "from": "mwf_map", + "from_port": 4, + "to": "mwf_mix", + "to_port": 4 + }, + { + "from": "mwf_map_2", "from_port": 0, - "to": "colorize_0", + "to": "mwf_mix", + "to_port": 5 + }, + { + "from": "mwf_map_2", + "from_port": 1, + "to": "mwf_mix", + "to_port": 6 + }, + { + "from": "mwf_map_2", + "from_port": 2, + "to": "mwf_mix", + "to_port": 7 + }, + { + "from": "mwf_map_2", + "from_port": 3, + "to": "mwf_mix", + "to_port": 8 + }, + { + "from": "mwf_map_2", + "from_port": 4, + "to": "mwf_mix", + "to_port": 9 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "mwf_mix_2", "to_port": 0 }, { - "from": "pattern_1", + "from": "graph_2", "from_port": 0, - "to": "warp_1", - "to_port": 0 - }, - { - "from": "perlin_0", - "from_port": 0, - "to": "warp_1", + "to": "mwf_mix_2", "to_port": 1 }, { - "from": "warp_1", - "from_port": 0, - "to": "colorize_1", - "to_port": 0 + "from": "graph_2", + "from_port": 1, + "to": "mwf_mix_2", + "to_port": 2 }, { - "from": "colorize_0", + "from": "mwf_mix", "from_port": 0, - "to": "blend_0", - "to_port": 0 + "to": "mwf_mix_2", + "to_port": 5 }, { - "from": "colorize_1", + "from": "mwf_mix", + "from_port": 1, + "to": "mwf_mix_2", + "to_port": 6 + }, + { + "from": "mwf_mix", + "from_port": 2, + "to": "mwf_mix_2", + "to_port": 7 + }, + { + "from": "mwf_mix", + "from_port": 3, + "to": "mwf_mix_2", + "to_port": 8 + }, + { + "from": "mwf_mix", + "from_port": 4, + "to": "mwf_mix_2", + "to_port": 9 + }, + { + "from": "graph_3_3_2", "from_port": 0, - "to": "blend_0", + "to": "mwf_map", "to_port": 1 }, { - "from": "blend_0", + "from": "graph_3_3_2", + "from_port": 1, + "to": "mwf_map", + "to_port": 2 + }, + { + "from": "graph_3_3_2", + "from_port": 2, + "to": "mwf_map", + "to_port": 3 + }, + { + "from": "graph_3_3_2", + "from_port": 3, + "to": "mwf_map", + "to_port": 4 + }, + { + "from": "graph_3_3_2_2", "from_port": 0, - "to": "colorize_2", + "to": "mwf_map_2", + "to_port": 1 + }, + { + "from": "graph_3_3_2_2", + "from_port": 1, + "to": "mwf_map_2", + "to_port": 2 + }, + { + "from": "graph_3_3_2_2", + "from_port": 2, + "to": "mwf_map_2", + "to_port": 3 + }, + { + "from": "graph_3_3_2_2", + "from_port": 3, + "to": "mwf_map_2", + "to_port": 4 + }, + { + "from": "mwf_mix_2", + "from_port": 0, + "to": "mwf_output", "to_port": 0 }, { - "from": "colorize_2", + "from": "mwf_mix_2", + "from_port": 1, + "to": "mwf_output", + "to_port": 1 + }, + { + "from": "mwf_mix_2", + "from_port": 2, + "to": "mwf_output", + "to_port": 2 + }, + { + "from": "mwf_mix_2", + "from_port": 3, + "to": "mwf_output", + "to_port": 3 + }, + { + "from": "mwf_mix_2", + "from_port": 4, + "to": "mwf_output", + "to_port": 4 + }, + { + "from": "mwf_output", "from_port": 0, "to": "Material", "to_port": 0 }, { - "from": "colorize_3", - "from_port": 0, + "from": "mwf_output", + "from_port": 1, + "to": "Material", + "to_port": 1 + }, + { + "from": "mwf_output", + "from_port": 2, "to": "Material", "to_port": 2 }, { - "from": "uniform_0", - "from_port": 0, + "from": "mwf_output", + "from_port": 3, "to": "Material", - "to_port": 1 + "to_port": 3 }, { - "from": "blend_1", - "from_port": 0, - "to": "colorize_3", - "to_port": 0 + "from": "mwf_output", + "from_port": 4, + "to": "Material", + "to_port": 4 }, { - "from": "blend_0", - "from_port": 0, - "to": "blend_1", - "to_port": 1 + "from": "mwf_output", + "from_port": 5, + "to": "Material", + "to_port": 5 }, { - "from": "perlin_1", - "from_port": 0, - "to": "colorize_4", - "to_port": 0 - }, - { - "from": "colorize_4", - "from_port": 0, - "to": "blend_1", - "to_port": 0 - }, - { - "from": "voronoi_0", - "from_port": 0, - "to": "warp_0", - "to_port": 0 + "from": "mwf_output", + "from_port": 6, + "to": "Material", + "to_port": 6 } ], "label": "Graph", - "name": "297", + "name": "835", "node_position": { "x": 0, "y": 0 }, "nodes": [ - { - "name": "pattern_1", - "node_position": { - "x": 15, - "y": 492 - }, - "parameters": { - "mix": 0, - "x_scale": 8, - "x_wave": 0, - "y_scale": 0, - "y_wave": 4 - }, - "type": "pattern" - }, - { - "name": "colorize_1", - "node_position": { - "x": 349, - "y": 386 - }, - "parameters": { - "gradient": { - "points": [ - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.035714, - "r": 1 - }, - { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.142857, - "r": 0 - }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.258929, - "r": 1 - }, - { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.535714, - "r": 0 - }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.723214, - "r": 1 - }, - { - "a": 1, - "b": 0, - "g": 0, - "pos": 0.848214, - "r": 0 - }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.982143, - "r": 1 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "warp_1", - "node_position": { - "x": 257, - "y": 418 - }, - "parameters": { - "amount": 1, - "eps": 0.045, - "epsilon": 0 - }, - "type": "warp" - }, - { - "name": "uniform_0", - "node_position": { - "x": 484, - "y": 126 - }, - "parameters": { - "color": { - "a": 1, - "b": 0, - "g": 0, - "r": 0, - "type": "Color" - } - }, - "type": "uniform" - }, - { - "name": "blend_1", - "node_position": { - "x": 249, - "y": 45 - }, - "parameters": { - "amount": 0.9, - "blend_type": 0 - }, - "type": "blend" - }, { "name": "Material", "node_position": { - "x": 676, - "y": 101 + "x": 424, + "y": -252 }, "parameters": { "albedo_color": { @@ -239,262 +268,1871 @@ "r": 1, "type": "Color" }, - "ao_light_affect": 1, - "depth_scale": 1, + "ao_light_affect": 0.95, + "depth_scale": 0, "emission_energy": 1, "metallic": 1, "normal_scale": 1, - "resolution": 1, "roughness": 1, - "size": 11 + "size": 11, + "subsurf_scatter_strength": 0 }, "type": "material" }, { - "name": "voronoi_0", + "name": "invert", "node_position": { - "x": 8, - "y": 178 + "x": -731.150024, + "y": 34.016663 }, "parameters": { - "intensity": 1, - "randomness": 1, - "scale_x": 8, - "scale_y": 4 + "steps": 6 }, - "type": "voronoi" + "type": "invert" }, { - "name": "colorize_0", + "name": "uniform_greyscale_2", "node_position": { - "x": 349, - "y": 309 + "x": -351.336792, + "y": -311.983337 }, "parameters": { - "gradient": { - "points": [ + "color": 0.98 + }, + "type": "uniform_greyscale" + }, + { + "connections": [ + { + "from": "bricks", + "from_port": 0, + "to": "invert_2", + "to_port": 0 + }, + { + "from": "pattern", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "invert_2", + "from_port": 0, + "to": "blend", + "to_port": 2 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "_2_2_2_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "bricks", + "from_port": 1, + "to": "_2_2_2_2", + "to_port": 1 + }, + { + "from": "blend", + "from_port": 0, + "to": "_2_2_2_2", + "to_port": 0 + } + ], + "label": "Tiles", + "name": "graph", + "node_position": { + "x": -1057.472778, + "y": -138.536682 + }, + "nodes": [ + { + "name": "uniform_greyscale", + "node_position": { + "x": -765.741089, + "y": -213.233337 + }, + "parameters": { + "color": 0.5 + }, + "type": "uniform_greyscale" + }, + { + "name": "invert_2", + "node_position": { + "x": -727.741089, + "y": -369.233337 + }, + "parameters": { + "steps": 6 + }, + "type": "invert" + }, + { + "name": "pattern", + "node_position": { + "x": -803.5, + "y": -326 + }, + "parameters": { + "mix": 4, + "x_scale": 2, + "x_wave": 2, + "y_scale": 2, + "y_wave": 2 + }, + "type": "pattern" + }, + { + "name": "bricks", + "node_position": { + "x": -773.64032, + "y": -616.983337 + }, + "parameters": { + "bevel": 0.01, + "columns": 2, + "corner": 0, + "mortar": 0, + "pattern": 0, + "repeat": 2, + "round": 0.03, + "row_offset": 0, + "rows": 2 + }, + "type": "bricks" + }, + { + "name": "blend", + "node_position": { + "x": -796.741089, + "y": -162.233337 + }, + "parameters": { + "amount": 1, + "blend_type": 0 + }, + "type": "blend" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1103.5, + "y": -337.536682 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -244.741089, + "y": -342.536682 + }, + "parameters": { + + }, + "ports": [ { + "name": "port0", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -731.472778, + "y": -703.983337 + }, + "parameters": { + "param0": 2 + }, + "type": "remote", + "widgets": [ + { + "label": "", + "linked_widgets": [ + { + "node": "bricks", + "widget": "repeat" + }, + { + "node": "pattern", + "widget": "x_scale" + }, + { + "node": "pattern", + "widget": "y_scale" + } + ], + "name": "param0", + "type": "linked_control" + } + ] + }, + { + "name": "_2_2_2_2", + "node_position": { + "x": -467.634766, + "y": -373.905029 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "seed_value": -41854, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + }, + { + "default": "0.0", + "label": "", + "name": "rand", + "type": "f" + } + ], + "instance": "", + "name": "Create Map", + "outputs": [ + { + "rgb": "vec3($height*$in($uv), $angle*0.01745329251, rand(vec2($seed.0+$rand($uv))))", + "type": "rgb" + } + ], + "parameters": [ + { + "control": "None", + "default": 1, + "label": "Height", + "max": 1, + "min": 0, + "name": "height", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Angle", + "max": 180, + "min": -180, + "name": "angle", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -498.801514, + "y": -512.460571 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + } + ], + "parameters": { + "param0": 2 + }, + "type": "graph" + }, + { + "connections": [ + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "uniform_greyscale_4", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + } + ], + "label": "Gold", + "name": "graph_2", + "node_position": { + "x": -302.736786, + "y": -223.983353 + }, + "nodes": [ + { + "name": "combine", + "node_position": { + "x": -249.336792, + "y": -230.983337 + }, + "parameters": { + "color": { "a": 1, "b": 1, "g": 1, - "pos": 0.017857, - "r": 1 + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform_greyscale_3_2", + "node_position": { + "x": -455.336792, + "y": -257.983337 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_4", + "node_position": { + "x": -455.336792, + "y": -155.983337 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -455.336792, + "y": -206.983337 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform", + "node_position": { + "x": -251.336792, + "y": -280.983337 + }, + "parameters": { + "color": { + "a": 1, + "b": 0.231373, + "g": 0.568627, + "r": 0.666667, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -755.336792, + "y": -226.983353 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 56.663208, + "y": -226.983353 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" }, { + "name": "ORM", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -571.736816, + "y": -582.983337 + }, + "parameters": { + + }, + "type": "remote", + "widgets": [ + + ] + } + ], + "parameters": { + + }, + "type": "graph" + }, + { + "name": "mwf_map", + "node_position": { + "x": -501.998169, + "y": -145.620453 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_mix", + "node_position": { + "x": -295.998169, + "y": -114.620453 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "name": "mwf_map_2", + "node_position": { + "x": -515.088684, + "y": 51.50412 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_mix_2", + "node_position": { + "x": -71.507507, + "y": -200.99588 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "connections": [ + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "noise", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "scratches", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "colorize", + "to_port": 0 + } + ], + "label": "Marble", + "name": "graph_3_3_2", + "node_position": { + "x": -797.098999, + "y": -92.344482 + }, + "nodes": [ + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -325.5, + "y": 82.5 + }, + "parameters": { + "color": 0.15 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -325.5, + "y": 133 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "_2", + "node_position": { + "x": -327.611084, + "y": -48.388885 + }, + "parameters": { + "c1": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "c2": { "a": 1, "b": 0, "g": 0, - "pos": 0.125, - "r": 0 - }, - { + "r": 0, + "type": "Color" + } + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "$uv.x", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "Simple Gradient", + "outputs": [ + { + "rgba": "mix($c1, $c2, $in($uv))", + "type": "rgba" + } + ], + "parameters": [ + { + "default": { + "a": 1, + "b": 0, + "g": 0, + "r": 0 + }, + "label": "Color 1", + "name": "c1", + "type": "color" + }, + { + "default": { + "a": 1, + "b": 1, + "g": 1, + "r": 1 + }, + "label": "Color 2", + "name": "c2", + "type": "color" + } + ] + }, + "type": "shader" + }, + { + "name": "colorize", + "node_position": { + "x": -346.5, + "y": -112 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.090909, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.336364, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.390909, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.436364, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -483.845703, + "y": -241.932098 + }, + "parameters": { + "param0": { "a": 1, "b": 1, "g": 1, - "pos": 0.241071, - "r": 1 + "r": 1, + "type": "Color" }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.455357, - "r": 1 - }, - { + "param1": { "a": 1, "b": 0, "g": 0, - "pos": 0.616071, - "r": 0 + "r": 0, + "type": "Color" + }, + "param2": 2 + }, + "type": "remote", + "widgets": [ + { + "label": "Color 1", + "linked_widgets": [ + { + "node": "_2", + "widget": "c1" + } + ], + "name": "param0", + "type": "linked_control" }, { + "label": "Color 2", + "linked_widgets": [ + { + "node": "_2", + "widget": "c2" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Scratches", + "linked_widgets": [ + { + "node": "normal_map", + "widget": "param1" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -894.5, + "y": -0.352623 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 218.388916, + "y": 18.647377 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "combine", + "node_position": { + "x": -87.22229, + "y": 39.197388 + }, + "parameters": { + "color": { "a": 1, "b": 1, "g": 1, - "pos": 0.723214, - "r": 1 + "r": 1, + "type": "Color" }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.857143, - "r": 1 - }, - { + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -325.100708, + "y": 31.197388 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "normal_map", + "node_position": { + "x": -85.707123, + "y": 186.780701 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "uniform", + "node_position": { + "x": 52.203369, + "y": 83.780701 + }, + "parameters": { + "color": { "a": 1, "b": 0, "g": 0, - "pos": 0.946429, - "r": 0 + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "scratches", + "node_position": { + "x": -751.885315, + "y": 149.637848 + }, + "parameters": { + "Randomness": 0.5, + "angle": -1, + "layers": 10, + "length": 0.05, + "randomness": 1, + "waviness": 0.29, + "width": 0.002 + }, + "type": "scratches" + }, + { + "name": "colorize_2", + "node_position": { + "x": -322.733154, + "y": 194.637848 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.015625, + "g": 0.015625, + "pos": 1, + "r": 0.015625 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "noise", + "node_position": { + "x": -742.733154, + "y": 335.637848 + }, + "parameters": { + "density": 0.5, + "size": 10 + }, + "type": "noise" + }, + { + "name": "blend", + "node_position": { + "x": -461.733154, + "y": 255.887848 + }, + "parameters": { + "amount": 0.99, + "blend_type": 0 + }, + "type": "blend" + }, + { + "connections": [ + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 1 }, { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.982143, - "r": 1 + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 2 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 0 + }, + { + "from": "transform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 } ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "perlin_1", - "node_position": { - "x": -264, - "y": 25 - }, - "parameters": { - "iterations": 6, - "persistence": 1, - "scale_x": 8, - "scale_y": 8 - }, - "type": "perlin" - }, - { - "name": "colorize_4", - "node_position": { - "x": 24, - "y": 81 - }, - "parameters": { - "gradient": { - "points": [ + "label": "Warp1", + "name": "graph_2", + "node_position": { + "x": -685.717468, + "y": -63.5793 + }, + "nodes": [ { + "name": "transform", + "node_position": { + "x": -259.25, + "y": -658 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.5, + "translate_y": 0.5 + }, + "type": "transform" + }, + { + "name": "perlin", + "node_position": { + "x": -502.25, + "y": -653 + }, + "parameters": { + "iterations": 8, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8 + }, + "type": "perlin" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -670.25, + "y": -647.5 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 18.75, + "y": -657.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -315.75, + "y": -893 + }, + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "remote", + "widgets": [ + { + "label": "Scale X", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_x" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Scale Y", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_y" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Iterations", + "linked_widgets": [ + { + "node": "perlin", + "widget": "iterations" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Persistance", + "linked_widgets": [ + { + "node": "perlin", + "widget": "persistence" + } + ], + "name": "param3", + "type": "linked_control" + }, + { + "label": "Warp X", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_x" + } + ], + "name": "param4", + "type": "linked_control" + }, + { + "label": "Warp Y", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_y" + } + ], + "name": "param5", + "type": "linked_control" + } + ] + } + ], + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "graph" + } + ], + "parameters": { + "param0": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "param1": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + }, + "param2": 2 + }, + "type": "graph" + }, + { + "connections": [ + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "noise", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "scratches", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "colorize", + "to_port": 0 + } + ], + "label": "Marble", + "name": "graph_3_3_2_2", + "node_position": { + "x": -793.098999, + "y": 98.155518 + }, + "nodes": [ + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -325.5, + "y": 82.5 + }, + "parameters": { + "color": 0.15 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -325.5, + "y": 133 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "_2", + "node_position": { + "x": -327.611084, + "y": -48.388885 + }, + "parameters": { + "c1": { "a": 1, "b": 0, "g": 0, - "pos": 0.190909, - "r": 0 + "r": 0, + "type": "Color" }, - { + "c2": { "a": 1, "b": 1, "g": 1, - "pos": 0.463636, - "r": 1 + "r": 1, + "type": "Color" } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "perlin_0", - "node_position": { - "x": 15, - "y": 328 - }, - "parameters": { - "iterations": 4, - "persistence": 0.5, - "scale_x": 4, - "scale_y": 4 - }, - "type": "perlin" - }, - { - "name": "warp_0", - "node_position": { - "x": 246, - "y": 306 - }, - "parameters": { - "amount": 0.8, - "eps": 0.045, - "epsilon": 0 - }, - "type": "warp" - }, - { - "name": "colorize_3", - "node_position": { - "x": 272, - "y": 171 - }, - "parameters": { - "gradient": { - "points": [ - { - "a": 1, - "b": 0.484375, - "g": 0.484375, - "pos": 0, - "r": 1 - }, - { - "a": 1, - "b": 0.744792, - "g": 0.744792, - "pos": 0.390909, - "r": 0.744792 - }, - { - "a": 1, - "b": 0.4375, - "g": 0.4375, - "pos": 1, - "r": 0.4375 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "$uv.x", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "Simple Gradient", + "outputs": [ + { + "rgba": "mix($c1, $c2, $in($uv))", + "type": "rgba" + } + ], + "parameters": [ + { + "default": { + "a": 1, + "b": 0, + "g": 0, + "r": 0 + }, + "label": "Color 1", + "name": "c1", + "type": "color" + }, + { + "default": { + "a": 1, + "b": 1, + "g": 1, + "r": 1 + }, + "label": "Color 2", + "name": "c2", + "type": "color" + } + ] + }, + "type": "shader" + }, + { + "name": "colorize", + "node_position": { + "x": -346.5, + "y": -112 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.090909, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.336364, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.390909, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.436364, + "r": 0 + } + ], + "type": "Gradient" } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "blend_0", - "node_position": { - "x": 544, - "y": 339 - }, - "parameters": { - "amount": 0.65, - "blend_type": 0 - }, - "type": "blend" - }, - { - "name": "colorize_2", - "node_position": { - "x": 765, - "y": 404 - }, - "parameters": { - "gradient": { - "points": [ - { + }, + "type": "colorize" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -483.845703, + "y": -241.932098 + }, + "parameters": { + "param0": { "a": 1, - "b": 0.791667, - "g": 0.908854, - "pos": 0, - "r": 1 + "b": 0, + "g": 0, + "r": 0, + "type": "Color" }, - { - "a": 1, - "b": 0.84375, - "g": 0.931641, - "pos": 0.236364, - "r": 1 - }, - { + "param1": { "a": 1, "b": 1, "g": 1, - "pos": 1, - "r": 1 + "r": 1, + "type": "Color" + }, + "param2": 2 + }, + "type": "remote", + "widgets": [ + { + "label": "Color 1", + "linked_widgets": [ + { + "node": "_2", + "widget": "c1" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Color 2", + "linked_widgets": [ + { + "node": "_2", + "widget": "c2" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Scratches", + "linked_widgets": [ + { + "node": "normal_map", + "widget": "param1" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -894.5, + "y": -0.352623 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 218.388916, + "y": 18.647377 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" } ], - "type": "Gradient" + "type": "ios" + }, + { + "name": "combine", + "node_position": { + "x": -87.22229, + "y": 39.197388 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -325.100708, + "y": 31.197388 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "normal_map", + "node_position": { + "x": -85.707123, + "y": 186.780701 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "uniform", + "node_position": { + "x": 52.203369, + "y": 83.780701 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "scratches", + "node_position": { + "x": -751.885315, + "y": 149.637848 + }, + "parameters": { + "Randomness": 0.5, + "angle": -1, + "layers": 10, + "length": 0.05, + "randomness": 1, + "waviness": 0.29, + "width": 0.002 + }, + "type": "scratches" + }, + { + "name": "colorize_2", + "node_position": { + "x": -322.733154, + "y": 194.637848 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.015625, + "g": 0.015625, + "pos": 1, + "r": 0.015625 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "noise", + "node_position": { + "x": -742.733154, + "y": 335.637848 + }, + "parameters": { + "density": 0.5, + "size": 10 + }, + "type": "noise" + }, + { + "name": "blend", + "node_position": { + "x": -461.733154, + "y": 255.887848 + }, + "parameters": { + "amount": 0.99, + "blend_type": 0 + }, + "type": "blend" + }, + { + "connections": [ + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 1 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 2 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 0 + }, + { + "from": "transform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Warp1", + "name": "graph_2", + "node_position": { + "x": -685.717468, + "y": -63.5793 + }, + "nodes": [ + { + "name": "transform", + "node_position": { + "x": -259.25, + "y": -658 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.5, + "translate_y": 0.5 + }, + "type": "transform" + }, + { + "name": "perlin", + "node_position": { + "x": -502.25, + "y": -653 + }, + "parameters": { + "iterations": 8, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8 + }, + "type": "perlin" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -670.25, + "y": -647.5 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 18.75, + "y": -657.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -315.75, + "y": -893 + }, + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "remote", + "widgets": [ + { + "label": "Scale X", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_x" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Scale Y", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_y" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Iterations", + "linked_widgets": [ + { + "node": "perlin", + "widget": "iterations" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Persistance", + "linked_widgets": [ + { + "node": "perlin", + "widget": "persistence" + } + ], + "name": "param3", + "type": "linked_control" + }, + { + "label": "Warp X", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_x" + } + ], + "name": "param4", + "type": "linked_control" + }, + { + "label": "Warp Y", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_y" + } + ], + "name": "param5", + "type": "linked_control" + } + ] + } + ], + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "graph" } + ], + "parameters": { + "param0": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + }, + "param1": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "param2": 2 }, - "type": "colorize" + "type": "graph" + }, + { + "name": "mwf_output", + "node_position": { + "x": 147.45108, + "y": -210.844482 + }, + "parameters": { + "param0": 1, + "param1": 10, + "param2": 1 + }, + "type": "mwf_output" } ], "parameters": { diff --git a/addons/material_maker/examples/materials.ptex b/addons/material_maker/examples/materials.ptex index bd51e45..4ebbeea 100644 --- a/addons/material_maker/examples/materials.ptex +++ b/addons/material_maker/examples/materials.ptex @@ -1,82 +1,148 @@ { "connections": [ { - "from": "normal_map", + "from": "graph_6", "from_port": 0, "to": "Material", + "to_port": 0 + }, + { + "from": "graph_6", + "from_port": 1, + "to": "Material", + "to_port": 1 + }, + { + "from": "graph_6", + "from_port": 2, + "to": "Material", + "to_port": 2 + }, + { + "from": "graph_6", + "from_port": 4, + "to": "Material", "to_port": 4 }, { - "from": "graph_3", - "from_port": 3, - "to": "switch", - "to_port": 7 - }, - { - "from": "graph_3", - "from_port": 2, - "to": "switch", - "to_port": 6 - }, - { - "from": "graph_3", - "from_port": 1, - "to": "switch", + "from": "graph_6", + "from_port": 5, + "to": "Material", "to_port": 5 }, { - "from": "graph_3", - "from_port": 0, - "to": "switch", - "to_port": 4 + "from": "graph_6", + "from_port": 6, + "to": "Material", + "to_port": 6 }, { - "from": "graph_2", + "from": "graph_6", + "from_port": 3, + "to": "Material", + "to_port": 3 + }, + { + "from": "graph_2_2", + "from_port": 0, + "to": "switch", + "to_port": 0 + }, + { + "from": "graph_2_2", + "from_port": 1, + "to": "switch", + "to_port": 1 + }, + { + "from": "graph_2_2", + "from_port": 2, + "to": "switch", + "to_port": 2 + }, + { + "from": "graph_2_2", "from_port": 3, "to": "switch", "to_port": 3 }, { - "from": "graph_2", - "from_port": 2, - "to": "switch", - "to_port": 2 - }, - { - "from": "graph_2", - "from_port": 1, - "to": "switch", + "from": "switch", + "from_port": 0, + "to": "graph_6", "to_port": 1 }, { - "from": "graph_2", - "from_port": 0, - "to": "switch", - "to_port": 0 + "from": "switch", + "from_port": 1, + "to": "graph_6", + "to_port": 2 + }, + { + "from": "switch", + "from_port": 2, + "to": "graph_6", + "to_port": 3 }, { "from": "switch", "from_port": 3, - "to": "normal_map", - "to_port": 0 + "to": "graph_6", + "to_port": 4 }, { - "from": "switch", - "from_port": 2, - "to": "Material", - "to_port": 2 - }, - { - "from": "switch", - "from_port": 1, - "to": "Material", - "to_port": 1 - }, - { - "from": "switch", + "from": "graph_3_3_2", "from_port": 0, - "to": "Material", + "to": "switch", + "to_port": 4 + }, + { + "from": "graph_3_3_2", + "from_port": 1, + "to": "switch", + "to_port": 5 + }, + { + "from": "graph_3_3_2", + "from_port": 2, + "to": "switch", + "to_port": 6 + }, + { + "from": "graph_3_3_2", + "from_port": 3, + "to": "switch", + "to_port": 7 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "graph_6", "to_port": 0 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "switch", + "to_port": 8 + }, + { + "from": "graph_2", + "from_port": 1, + "to": "switch", + "to_port": 9 + }, + { + "from": "graph_2", + "from_port": 2, + "to": "switch", + "to_port": 10 + }, + { + "from": "graph_2", + "from_port": 3, + "to": "switch", + "to_port": 11 } ], "label": "Graph", @@ -89,8 +155,8 @@ { "name": "Material", "node_position": { - "x": 76, - "y": -254 + "x": 12, + "y": -391 }, "parameters": { "albedo_color": { @@ -111,293 +177,6 @@ }, "type": "material" }, - { - "connections": [ - { - "from": "nm_convolution", - "from_port": 0, - "to": "nm_postprocess", - "to_port": 0 - }, - { - "from": "nm_postprocess", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "nm_convolution", - "to_port": 0 - } - ], - "label": "Normal Map", - "name": "normal_map", - "node_position": { - "x": -171.5, - "y": -122 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -687.663818, - "y": 125.60614 - }, - "parameters": { - "lod": 0, - "size": 11 - }, - "type": "buffer" - }, - { - "convolution_params": { - "input_type": "f", - "matrix": [ - [ - [ - -1, - -1, - 0 - ], - [ - 0, - -2, - 0 - ], - [ - 1, - -1, - 0 - ] - ], - [ - [ - -2, - 0, - 0 - ], - 0, - [ - 2, - 0, - 0 - ] - ], - [ - [ - -1, - 1, - 0 - ], - [ - 0, - 2, - 0 - ], - [ - 1, - 1, - 0 - ] - ] - ], - "output_type": "rgb", - "x": 1, - "y": 1 - }, - "name": "nm_convolution", - "node_position": { - "x": -690.25, - "y": 174.25 - }, - "parameters": { - "size": 11 - }, - "type": "convolution" - }, - { - "name": "nm_postprocess", - "node_position": { - "x": -690.25, - "y": 222.25 - }, - "parameters": { - "amount": 0.025, - "format": 0, - "size": 11, - "type": 0 - }, - "shader_model": { - "code": "", - "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "NormalMapPostProcess", - "outputs": [ - { - "rgb": "process_normal_$format($in($uv).xyz, $amount*$size/128.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "format", - "type": "enum", - "values": [ - { - "name": "Default", - "value": "default" - }, - { - "name": "OpenGL", - "value": "opengl" - }, - { - "name": "DirectX", - "value": "directx" - } - ] - }, - { - "default": 9, - "first": 4, - "label": "", - "last": 11, - "name": "size", - "type": "size" - }, - { - "default": 1, - "label": "", - "max": 2, - "min": 0, - "name": "amount", - "step": 0.005, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -729.910156, - "y": -5.916687 - }, - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 0.025, - "param2": 0, - "size": 4 - }, - "type": "remote", - "widgets": [ - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "format" - } - ], - "name": "param2", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "nm_convolution", - "widget": "size" - }, - { - "node": "nm_postprocess", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "amount" - } - ], - "name": "param1", - "type": "linked_control" - } - ] - }, - { - "name": "gen_outputs", - "node_position": { - "x": -407.663818, - "y": 151.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -870.910156, - "y": 157.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - } - ], - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 0.025, - "param2": 0, - "size": 4 - }, - "type": "graph" - }, { "connections": [ { @@ -406,18 +185,6 @@ "to": "colorize", "to_port": 0 }, - { - "from": "uniform_greyscale_3", - "from_port": 0, - "to": "gen_outputs", - "to_port": 1 - }, - { - "from": "uniform_greyscale_3_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 2 - }, { "from": "colorize_2", "from_port": 0, @@ -520,9 +287,39 @@ "to": "blend_3", "to_port": 1 }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, { "from": "blend", "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, "to": "gen_outputs", "to_port": 3 } @@ -530,8 +327,8 @@ "label": "Wood simple", "name": "graph_2", "node_position": { - "x": -807.345703, - "y": -266.932098 + "x": -1260.345703, + "y": -185.932098 }, "nodes": [ { @@ -595,8 +392,8 @@ { "name": "colorize", "node_position": { - "x": -608.5, - "y": 133 + "x": -605.5, + "y": 130 }, "parameters": { "gradient": { @@ -634,17 +431,17 @@ "points": [ { "a": 1, - "b": 0, - "g": 0.117188, + "b": 0.476183, + "g": 0.62638, "pos": 0, - "r": 0.208333 + "r": 0.697917 }, { "a": 1, - "b": 0.089111, - "g": 0.289241, + "b": 0.719754, + "g": 0.830067, "pos": 1, - "r": 0.380208 + "r": 0.880208 } ], "type": "Gradient" @@ -696,8 +493,8 @@ { "name": "uniform_greyscale_3", "node_position": { - "x": -312.030396, - "y": -117.502716 + "x": -304.030396, + "y": -69.502716 }, "parameters": { "color": 0.3 @@ -707,8 +504,8 @@ { "name": "uniform_greyscale_3_2", "node_position": { - "x": -311.030396, - "y": -65.502716 + "x": -305.030396, + "y": -124.502716 }, "parameters": { "color": 0.8 @@ -722,7 +519,7 @@ "y": -378.799133 }, "parameters": { - "amount": 0.1664, + "amount": 0.207725, "blend_type": 0 }, "type": "blend" @@ -755,8 +552,8 @@ { "name": "scratches", "node_position": { - "x": -635.5, - "y": -44 + "x": -634.5, + "y": -49 }, "parameters": { "Randomness": 0.5, @@ -772,11 +569,11 @@ { "name": "blend", "node_position": { - "x": -331.280884, - "y": -7.549149 + "x": -375.280884, + "y": 4.450851 }, "parameters": { - "amount": 0.072975, + "amount": 0.322625, "blend_type": 0 }, "type": "blend" @@ -793,23 +590,23 @@ "points": [ { "a": 1, - "b": 0, - "g": 0.117188, + "b": 0.476183, + "g": 0.62638, "pos": 0, - "r": 0.208333 + "r": 0.697917 }, { "a": 1, - "b": 0.089111, - "g": 0.289241, + "b": 0.719754, + "g": 0.830067, "pos": 1, - "r": 0.380208 + "r": 0.880208 } ], "type": "Gradient" }, - "param1": 0.1664, - "param2": 0.072975 + "param1": 0.207725, + "param2": 0.322625 }, "type": "remote", "widgets": [ @@ -865,8 +662,8 @@ { "name": "gen_outputs", "node_position": { - "x": -0.030396, - "y": -144.650482 + "x": 192.969604, + "y": -125.650482 }, "parameters": { @@ -874,19 +671,19 @@ "ports": [ { "name": "Albedo", - "type": "rgba" + "type": "rgb" }, { - "name": "Metallic", - "type": "rgba" + "name": "ORM", + "type": "rgb" }, { - "name": "Roughness", - "type": "rgba" + "name": "Emission", + "type": "rgb" }, { - "name": "Bump", - "type": "rgba" + "name": "Normal", + "type": "rgb" } ], "type": "ios" @@ -954,8 +751,8 @@ { "name": "voronoi", "node_position": { - "x": -1162.120483, - "y": -809.473999 + "x": -1137.120483, + "y": -855.473999 }, "parameters": { "intensity": 1, @@ -1091,6 +888,58 @@ } }, "type": "colorize" + }, + { + "name": "combine", + "node_position": { + "x": -102.834259, + "y": -117.463135 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform", + "node_position": { + "x": 28.165741, + "y": -71.463135 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "normal_map", + "node_position": { + "x": -71.142059, + "y": 4.536865 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 1, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" } ], "parameters": { @@ -1099,227 +948,363 @@ "points": [ { "a": 1, - "b": 0, - "g": 0.117188, + "b": 0.476183, + "g": 0.62638, "pos": 0, - "r": 0.208333 + "r": 0.697917 }, { "a": 1, - "b": 0.089111, - "g": 0.289241, + "b": 0.719754, + "g": 0.830067, "pos": 1, - "r": 0.380208 + "r": 0.880208 } ], "type": "Gradient" }, - "param1": 0.1664, - "param2": 0.072975 + "param1": 0.207725, + "param2": 0.322625 }, "type": "graph" }, { "connections": [ { - "from": "graph", + "from": "colorize_3", "from_port": 0, - "to": "colorize", + "to": "gen_outputs", + "to_port": 6 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "colorize_3", "to_port": 0 }, { - "from": "uniform_greyscale", + "from": "gen_inputs", "from_port": 0, - "to": "gen_outputs", - "to_port": 1 - }, - { - "from": "colorize_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 3 - }, - { - "from": "perlin", - "from_port": 0, - "to": "colorize_2", + "to": "gaussian_blur", "to_port": 0 }, { - "from": "uniform_greyscale_2", + "from": "gaussian_blur", "from_port": 0, "to": "gen_outputs", + "to_port": 5 + }, + { + "from": "gen_inputs", + "from_port": 2, + "to": "decompose", + "to_port": 0 + }, + { + "from": "decompose", + "from_port": 1, + "to": "gen_outputs", "to_port": 2 }, { - "from": "colorize", + "from": "decompose", + "from_port": 2, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "gen_inputs", "from_port": 0, - "to": "_2", + "to": "normal_map", "to_port": 0 }, { - "from": "_2", + "from": "blend_2", "from_port": 0, "to": "gen_outputs", + "to_port": 4 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "blend_2", + "to_port": 1 + }, + { + "from": "gen_inputs", + "from_port": 1, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 3, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "gen_inputs", + "from_port": 4, + "to": "blend_2", "to_port": 0 } ], - "label": "Marble", - "name": "graph_3", + "label": "MWF Output", + "name": "graph_6", "node_position": { - "x": -771.182129, - "y": -126.352631 + "x": -277.408173, + "y": -384.583069 }, "nodes": [ - { - "name": "perlin", - "node_position": { - "x": -586.5, - "y": 111 - }, - "parameters": { - "iterations": 8, - "persistence": 1, - "scale_x": 4, - "scale_y": 4 - }, - "type": "perlin" - }, - { - "name": "colorize_2", - "node_position": { - "x": -353.5, - "y": 171 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 0.989583, - "g": 0.989583, - "pos": 0.472727, - "r": 0.989583 - }, - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0.563636, - "r": 1 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "uniform_greyscale_2", - "node_position": { - "x": -342.5, - "y": 108.5 - }, - "parameters": { - "color": 0.07 - }, - "type": "uniform_greyscale" - }, - { - "name": "uniform_greyscale", - "node_position": { - "x": -342.5, - "y": 47 - }, - "parameters": { - "color": 0 - }, - "type": "uniform_greyscale" - }, { "connections": [ { - "from": "perlin", + "from": "nm_convolution", "from_port": 0, - "to": "transform", - "to_port": 1 - }, - { - "from": "perlin", - "from_port": 0, - "to": "transform", - "to_port": 2 - }, - { - "from": "perlin", - "from_port": 0, - "to": "transform", + "to": "nm_postprocess", "to_port": 0 }, { - "from": "transform", + "from": "nm_postprocess", "from_port": 0, "to": "gen_outputs", "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "buffer", + "from_port": 0, + "to": "nm_convolution", + "to_port": 0 } ], - "label": "Warp1", - "name": "graph", + "label": "Normal Map", + "name": "normal_map", "node_position": { - "x": -594.5, - "y": -88 + "x": -1208.637451, + "y": 541.842468 }, "nodes": [ { - "name": "transform", + "name": "buffer", "node_position": { - "x": -259.25, - "y": -658 + "x": -691.663818, + "y": 98.60614 }, "parameters": { - "repeat": false, - "rotate": 0, - "scale_x": 1, - "scale_y": 1, - "translate_x": 0.5, - "translate_y": 0.5 + "lod": 0, + "size": 11 }, - "type": "transform" + "type": "buffer" }, { - "name": "perlin", + "convolution_params": { + "input_type": "f", + "matrix": [ + [ + [ + -1, + -1, + 0 + ], + [ + 0, + -2, + 0 + ], + [ + 1, + -1, + 0 + ] + ], + [ + [ + -2, + 0, + 0 + ], + 0, + [ + 2, + 0, + 0 + ] + ], + [ + [ + -1, + 1, + 0 + ], + [ + 0, + 2, + 0 + ], + [ + 1, + 1, + 0 + ] + ] + ], + "output_type": "rgb", + "x": 1, + "y": 1 + }, + "name": "nm_convolution", "node_position": { - "x": -571.25, - "y": -630 + "x": -689.25, + "y": 175.25 }, "parameters": { - "iterations": 8, - "persistence": 0.5, - "scale_x": 8, - "scale_y": 8 + "size": 11 }, - "type": "perlin" + "type": "convolution" }, { - "name": "gen_inputs", + "name": "nm_postprocess", "node_position": { - "x": -670.25, - "y": -647.5 + "x": -689.25, + "y": 228.25 }, "parameters": { - + "amount": 1, + "format": 0, + "size": 11, + "type": 0 }, - "ports": [ - - ], - "type": "ios" + "shader_model": { + "code": "", + "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", + "inputs": [ + { + "default": "vec3(0.0)", + "label": "", + "name": "in", + "type": "rgb" + } + ], + "instance": "", + "name": "NormalMapPostProcess", + "outputs": [ + { + "rgb": "process_normal_$format($in($uv).xyz, $amount*$size/128.0)", + "type": "rgb" + } + ], + "parameters": [ + { + "default": 0, + "label": "", + "name": "format", + "type": "enum", + "values": [ + { + "name": "Default", + "value": "default" + }, + { + "name": "OpenGL", + "value": "opengl" + }, + { + "name": "DirectX", + "value": "directx" + } + ] + }, + { + "default": 9, + "first": 4, + "label": "", + "last": 11, + "name": "size", + "type": "size" + }, + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "amount", + "step": 0.005, + "type": "float" + } + ] + }, + "type": "shader" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -696.910156, + "y": -29.916687 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 1, + "param2": 0, + "param3": 1, + "size": 4 + }, + "type": "remote", + "widgets": [ + { + "label": "", + "linked_widgets": [ + { + "node": "nm_postprocess", + "widget": "format" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "", + "linked_widgets": [ + { + "node": "buffer", + "widget": "size" + }, + { + "node": "nm_convolution", + "widget": "size" + }, + { + "node": "nm_postprocess", + "widget": "size" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "", + "linked_widgets": [ + { + "node": "nm_postprocess", + "widget": "amount" + } + ], + "name": "param1", + "type": "linked_control" + } + ] }, { "name": "gen_outputs", "node_position": { - "x": 18.75, - "y": -657.5 + "x": -425.663818, + "y": 163.047363 }, "parameters": { @@ -1333,105 +1318,1024 @@ "type": "ios" }, { - "name": "gen_parameters", + "name": "gen_inputs", "node_position": { - "x": -357.75, - "y": -887 + "x": -843.910156, + "y": 178.047363 }, "parameters": { - "param0": 8, - "param1": 8, - "param2": 8, - "param3": 0.5, - "param4": 0.5, - "param5": 0.5 + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + } + ], + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 1, + "param2": 0, + "param3": 1, + "size": 4 + }, + "type": "graph" + }, + { + "name": "colorize_3", + "node_position": { + "x": -939.637451, + "y": 871.842407 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "connections": [ + { + "from": "buffer", + "from_port": 0, + "to": "blurx_convolution", + "to_port": 0 + }, + { + "from": "buffer_2", + "from_port": 0, + "to": "blurx_convolution_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "blurx_convolution", + "from_port": 0, + "to": "buffer_2", + "to_port": 0 + }, + { + "from": "blurx_convolution_2", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "buffer", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Occlusion", + "name": "gaussian_blur", + "node_position": { + "x": -994.845825, + "y": 786.968262 + }, + "nodes": [ + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(x/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 50, + "y": 0 + }, + "name": "blurx_convolution", + "node_position": { + "x": -407.5, + "y": -192.5 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer_2", + "node_position": { + "x": -404.875, + "y": -116.625 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(y/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 0, + "y": 50 + }, + "name": "blurx_convolution_2", + "node_position": { + "x": -407.125, + "y": -44.375 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer", + "node_position": { + "x": -408.25, + "y": -265.75 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -447.666626, + "y": -370.666656 + }, + "parameters": { + "param0": 10, + "param1": 50, + "param2": 1 }, "type": "remote", "widgets": [ { - "label": "Scale X", + "label": "Grid size:", "linked_widgets": [ { - "node": "perlin", - "widget": "scale_x" + "node": "buffer", + "widget": "size" + }, + { + "node": "blurx_convolution", + "widget": "size" + }, + { + "node": "buffer_2", + "widget": "size" + }, + { + "node": "blurx_convolution_2", + "widget": "size" } ], "name": "param0", "type": "linked_control" }, { - "label": "Scale Y", + "label": "Strength", "linked_widgets": [ { - "node": "perlin", - "widget": "scale_y" - } - ], - "name": "param1", - "type": "linked_control" - }, - { - "label": "Iterations", - "linked_widgets": [ - { - "node": "perlin", - "widget": "iterations" + "node": "_2", + "widget": "g" } ], "name": "param2", "type": "linked_control" - }, - { - "label": "Persistance", - "linked_widgets": [ - { - "node": "perlin", - "widget": "persistence" - } - ], - "name": "param3", - "type": "linked_control" - }, - { - "label": "Warp X", - "linked_widgets": [ - { - "node": "transform", - "widget": "translate_x" - } - ], - "name": "param4", - "type": "linked_control" - }, - { - "label": "Warp Y", - "linked_widgets": [ - { - "node": "transform", - "widget": "translate_y" - } - ], - "name": "param5", - "type": "linked_control" } ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -585.666626, + "y": -112.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 55.547607, + "y": -133.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "blend", + "node_position": { + "x": -420.79895, + "y": 27.16272 + }, + "parameters": { + "amount": 1, + "blend_type": 11 + }, + "type": "blend" + }, + { + "name": "colorize", + "node_position": { + "x": -167.79895, + "y": -178.83728 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "_2", + "node_position": { + "x": -134.403687, + "y": -110.29187 + }, + "parameters": { + "g": 1 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "", + "outputs": [ + { + "f": "pow($in($uv), $g)", + "type": "f" + } + ], + "parameters": [ + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "g", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" } ], "parameters": { - "param0": 8, - "param1": 8, - "param2": 8, - "param3": 0.5, - "param4": 0.5, - "param5": 0.5 + "param0": 10, + "param1": 50, + "param2": 1 }, "type": "graph" }, + { + "name": "decompose", + "node_position": { + "x": -907.371338, + "y": 443.25 + }, + "parameters": { + + }, + "type": "decompose" + }, + { + "name": "blend_2", + "node_position": { + "x": -920.305542, + "y": 691.328491 + }, + "parameters": { + "amount": 0.25, + "blend_type": 4 + }, + "type": "blend" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1458.805542, + "y": 606.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Height", + "type": "f" + }, + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -563.305542, + "y": 627.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "Metallic", + "type": "f" + }, + { + "name": "Roughness", + "type": "f" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + }, + { + "name": "Occlusion", + "type": "f" + }, + { + "name": "Depth", + "type": "f" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -925.881836, + "y": 309.25 + }, + "parameters": { + "param0": 0.25, + "param1": 10, + "param2": 1 + }, + "type": "remote", + "widgets": [ + { + "label": "Occlusion", + "linked_widgets": [ + { + "node": "gaussian_blur", + "widget": "param2" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Mat Normal", + "linked_widgets": [ + { + "node": "blend_2", + "widget": "amount" + } + ], + "name": "param0", + "type": "linked_control" + } + ] + } + ], + "parameters": { + "param0": 0.25, + "param1": 10, + "param2": 1 + }, + "type": "graph" + }, + { + "connections": [ + { + "from": "uniform_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "uniform_greyscale_4", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + } + ], + "label": "Metal", + "name": "graph_2_2", + "node_position": { + "x": -1257.244629, + "y": -432.490662 + }, + "nodes": [ + { + "name": "uniform_greyscale_3_2", + "node_position": { + "x": -712.322693, + "y": -216.48642 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_4", + "node_position": { + "x": -712.322693, + "y": -114.48642 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -712.322693, + "y": -165.48642 + }, + "parameters": { + "color": 0.1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_2", + "node_position": { + "x": -674.908142, + "y": -0.333069 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.501961, + "r": 0.501961, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_3", + "node_position": { + "x": -676.322693, + "y": -271.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 0.554, + "g": 0.556, + "r": 0.55, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "combine", + "node_position": { + "x": -514.322693, + "y": -176.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -847.322693, + "y": -143.585464 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -206.322693, + "y": -144.585464 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -739.30249, + "y": -408.925568 + }, + "parameters": { + "param0": 1, + "param1": 0.1 + }, + "type": "remote", + "widgets": [ + { + "configurations": { + "Aluminum": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.925, + "g": 0.921, + "r": 0.913, + "type": "Color" + }, + "widget": "color" + } + ], + "Chromium": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.554, + "g": 0.556, + "r": 0.55, + "type": "Color" + }, + "widget": "color" + } + ], + "Cobalt": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.634, + "g": 0.655, + "r": 0.662, + "type": "Color" + }, + "widget": "color" + } + ], + "Copper": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.538, + "g": 0.637, + "r": 0.955, + "type": "Color" + }, + "widget": "color" + } + ], + "Gold": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.336, + "g": 0.766, + "r": 1, + "type": "Color" + }, + "widget": "color" + } + ], + "Iron": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.58, + "g": 0.57, + "r": 0.56, + "type": "Color" + }, + "widget": "color" + } + ], + "Nickel": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.526, + "g": 0.609, + "r": 0.66, + "type": "Color" + }, + "widget": "color" + } + ], + "Platinum": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.585, + "g": 0.637, + "r": 0.672, + "type": "Color" + }, + "widget": "color" + } + ], + "Silver": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.915, + "g": 0.96, + "r": 0.972, + "type": "Color" + }, + "widget": "color" + } + ], + "Titanium": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.449, + "g": 0.497, + "r": 0.542, + "type": "Color" + }, + "widget": "color" + } + ] + }, + "label": "Metal", + "linked_widgets": [ + { + "node": "uniform_3", + "widget": "color" + } + ], + "name": "param0", + "type": "config_control" + }, + { + "label": "Roughness", + "linked_widgets": [ + { + "node": "uniform_greyscale_3", + "widget": "color" + } + ], + "name": "param1", + "type": "linked_control" + } + ] + }, + { + "name": "uniform", + "node_position": { + "x": -673.80249, + "y": -56.425568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + } + ], + "parameters": { + "param0": 1, + "param1": 0.1 + }, + "type": "graph" + }, + { + "name": "switch", + "node_position": { + "x": -670.527832, + "y": -352.071716 + }, + "parameters": { + "choices": 3, + "outputs": 4, + "source": 0 + }, + "type": "switch" + }, + { + "connections": [ + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "noise", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "scratches", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "colorize", + "to_port": 0 + } + ], + "label": "Marble", + "name": "graph_3_3_2", + "node_position": { + "x": -1254.027832, + "y": -320.571716 + }, + "nodes": [ + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -325.5, + "y": 82.5 + }, + "parameters": { + "color": 0.15 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -325.5, + "y": 133 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, { "name": "_2", "node_position": { - "x": -332.611084, - "y": -34.388885 + "x": -327.611084, + "y": -48.388885 }, "parameters": { "c1": { @@ -1443,9 +2347,9 @@ }, "c2": { "a": 1, - "b": 0.078431, - "g": 0.035294, - "r": 0.035294, + "b": 0, + "g": 0, + "r": 0, "type": "Color" } }, @@ -1562,11 +2466,12 @@ }, "param1": { "a": 1, - "b": 0.078431, - "g": 0.035294, - "r": 0.035294, + "b": 0, + "g": 0, + "r": 0, "type": "Color" - } + }, + "param2": 2 }, "type": "remote", "widgets": [ @@ -1591,6 +2496,17 @@ ], "name": "param1", "type": "linked_control" + }, + { + "label": "Scratches", + "linked_widgets": [ + { + "node": "normal_map", + "widget": "param1" + } + ], + "name": "param2", + "type": "linked_control" } ] }, @@ -1611,8 +2527,8 @@ { "name": "gen_outputs", "node_position": { - "x": -32.611084, - "y": -0.352623 + "x": 218.388916, + "y": 18.647377 }, "parameters": { @@ -1620,22 +2536,346 @@ "ports": [ { "name": "Albedo", - "type": "rgba" + "type": "rgb" }, { - "name": "Metallic", - "type": "rgba" + "name": "ORM", + "type": "rgb" }, { - "name": "Roughness", - "type": "rgba" + "name": "Emission", + "type": "rgb" }, { - "name": "Bump", - "type": "rgba" + "name": "Normal", + "type": "rgb" } ], "type": "ios" + }, + { + "name": "combine", + "node_position": { + "x": -87.22229, + "y": 39.197388 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -325.100708, + "y": 31.197388 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "normal_map", + "node_position": { + "x": -85.707123, + "y": 186.780701 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "uniform", + "node_position": { + "x": 52.203369, + "y": 83.780701 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "scratches", + "node_position": { + "x": -751.885315, + "y": 149.637848 + }, + "parameters": { + "Randomness": 0.5, + "angle": -1, + "layers": 10, + "length": 0.05, + "randomness": 1, + "waviness": 0.29, + "width": 0.002 + }, + "type": "scratches" + }, + { + "name": "colorize_2", + "node_position": { + "x": -322.733154, + "y": 194.637848 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.015625, + "g": 0.015625, + "pos": 1, + "r": 0.015625 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "noise", + "node_position": { + "x": -742.733154, + "y": 335.637848 + }, + "parameters": { + "density": 0.5, + "size": 10 + }, + "type": "noise" + }, + { + "name": "blend", + "node_position": { + "x": -461.733154, + "y": 255.887848 + }, + "parameters": { + "amount": 0.99, + "blend_type": 0 + }, + "type": "blend" + }, + { + "connections": [ + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 1 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 2 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 0 + }, + { + "from": "transform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Warp1", + "name": "graph_2", + "node_position": { + "x": -685.717468, + "y": -63.5793 + }, + "nodes": [ + { + "name": "transform", + "node_position": { + "x": -259.25, + "y": -658 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.5, + "translate_y": 0.5 + }, + "type": "transform" + }, + { + "name": "perlin", + "node_position": { + "x": -502.25, + "y": -653 + }, + "parameters": { + "iterations": 8, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8 + }, + "type": "perlin" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -670.25, + "y": -647.5 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 18.75, + "y": -657.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -315.75, + "y": -893 + }, + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "remote", + "widgets": [ + { + "label": "Scale X", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_x" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Scale Y", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_y" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Iterations", + "linked_widgets": [ + { + "node": "perlin", + "widget": "iterations" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Persistance", + "linked_widgets": [ + { + "node": "perlin", + "widget": "persistence" + } + ], + "name": "param3", + "type": "linked_control" + }, + { + "label": "Warp X", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_x" + } + ], + "name": "param4", + "type": "linked_control" + }, + { + "label": "Warp Y", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_y" + } + ], + "name": "param5", + "type": "linked_control" + } + ] + } + ], + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "graph" } ], "parameters": { @@ -1648,26 +2888,25 @@ }, "param1": { "a": 1, - "b": 0.078431, - "g": 0.035294, - "r": 0.035294, + "b": 0, + "g": 0, + "r": 0, "type": "Color" - } + }, + "param2": 2 }, "type": "graph" }, { - "name": "switch", + "name": "uniform_greyscale", "node_position": { - "x": -413.506958, - "y": -191.071167 + "x": -486.94574, + "y": -385.608154 }, "parameters": { - "choices": 2, - "outputs": 4, - "source": 0 + "color": 1 }, - "type": "switch" + "type": "uniform_greyscale" } ], "parameters": { diff --git a/addons/material_maker/examples/medieval_wall.ptex b/addons/material_maker/examples/medieval_wall.ptex index ceee96c..a687fb0 100644 --- a/addons/material_maker/examples/medieval_wall.ptex +++ b/addons/material_maker/examples/medieval_wall.ptex @@ -1,11 +1,5 @@ { "connections": [ - { - "from": "graph_6", - "from_port": 5, - "to": "Material", - "to_port": 6 - }, { "from": "graph", "from_port": 0, @@ -24,114 +18,6 @@ "to": "blend_2_2_2", "to_port": 0 }, - { - "from": "graph_3", - "from_port": 0, - "to": "_2_2", - "to_port": 0 - }, - { - "from": "graph_2", - "from_port": 0, - "to": "_2_2_2_2", - "to_port": 0 - }, - { - "from": "graph_4", - "from_port": 0, - "to": "_2_3", - "to_port": 0 - }, - { - "from": "_2_2_2_2", - "from_port": 0, - "to": "_2", - "to_port": 0 - }, - { - "from": "_2_2_2", - "from_port": 0, - "to": "_2", - "to_port": 1 - }, - { - "from": "_2_2", - "from_port": 0, - "to": "_2", - "to_port": 2 - }, - { - "from": "_2_3", - "from_port": 0, - "to": "_2", - "to_port": 3 - }, - { - "from": "_2", - "from_port": 0, - "to": "_3", - "to_port": 0 - }, - { - "from": "graph_10", - "from_port": 0, - "to": "_3", - "to_port": 1 - }, - { - "from": "blend_2_2_2", - "from_port": 0, - "to": "_2_2_2", - "to_port": 0 - }, - { - "from": "_3", - "from_port": 0, - "to": "_4", - "to_port": 0 - }, - { - "from": "colorize_6", - "from_port": 0, - "to": "_3_2", - "to_port": 1 - }, - { - "from": "_3_2", - "from_port": 0, - "to": "_4", - "to_port": 4 - }, - { - "from": "graph_10", - "from_port": 1, - "to": "_3", - "to_port": 2 - }, - { - "from": "graph_10", - "from_port": 2, - "to": "_3", - "to_port": 3 - }, - { - "from": "_3", - "from_port": 2, - "to": "_4", - "to_port": 2 - }, - { - "from": "_3_2", - "from_port": 2, - "to": "_4", - "to_port": 6 - }, - { - "from": "colorize", - "from_port": 0, - "to": "_3_2", - "to_port": 3 - }, { "from": "voronoi", "from_port": 0, @@ -150,66 +36,6 @@ "to": "transform", "to_port": 2 }, - { - "from": "graph_5", - "from_port": 0, - "to": "_3_2", - "to_port": 0 - }, - { - "from": "_3_2", - "from_port": 1, - "to": "_4", - "to_port": 5 - }, - { - "from": "_3_2", - "from_port": 3, - "to": "_4", - "to_port": 7 - }, - { - "from": "_3", - "from_port": 3, - "to": "_4", - "to_port": 3 - }, - { - "from": "_3", - "from_port": 1, - "to": "_4", - "to_port": 1 - }, - { - "from": "graph_6", - "from_port": 4, - "to": "Material", - "to_port": 5 - }, - { - "from": "_4", - "from_port": 2, - "to": "graph_6", - "to_port": 2 - }, - { - "from": "graph_6", - "from_port": 2, - "to": "Material", - "to_port": 2 - }, - { - "from": "graph_6", - "from_port": 1, - "to": "Material", - "to_port": 1 - }, - { - "from": "uniform", - "from_port": 0, - "to": "_3_2", - "to_port": 2 - }, { "from": "transform", "from_port": 0, @@ -217,33 +43,261 @@ "to_port": 0 }, { - "from": "_4", + "from": "mwf_output", "from_port": 0, - "to": "graph_6", + "to": "Material", "to_port": 0 }, { - "from": "_4", + "from": "mwf_output", + "from_port": 1, + "to": "Material", + "to_port": 1 + }, + { + "from": "mwf_output", + "from_port": 2, + "to": "Material", + "to_port": 2 + }, + { + "from": "mwf_output", "from_port": 3, - "to": "graph_6", + "to": "Material", "to_port": 3 }, { - "from": "graph_6", - "from_port": 3, + "from": "mwf_output", + "from_port": 4, "to": "Material", "to_port": 4 }, { - "from": "_4", + "from": "mwf_output", + "from_port": 5, + "to": "Material", + "to_port": 5 + }, + { + "from": "mwf_output", + "from_port": 6, + "to": "Material", + "to_port": 6 + }, + { + "from": "mwf_mix", + "from_port": 0, + "to": "mwf_output", + "to_port": 0 + }, + { + "from": "mwf_mix", "from_port": 1, - "to": "graph_6", + "to": "mwf_output", "to_port": 1 }, { - "from": "graph_6", + "from": "mwf_mix", + "from_port": 2, + "to": "mwf_output", + "to_port": 2 + }, + { + "from": "mwf_mix", + "from_port": 3, + "to": "mwf_output", + "to_port": 3 + }, + { + "from": "mwf_mix", + "from_port": 4, + "to": "mwf_output", + "to_port": 4 + }, + { + "from": "mwf_map", "from_port": 0, - "to": "Material", + "to": "mwf_mix", + "to_port": 5 + }, + { + "from": "mwf_map", + "from_port": 1, + "to": "mwf_mix", + "to_port": 6 + }, + { + "from": "mwf_map", + "from_port": 2, + "to": "mwf_mix", + "to_port": 7 + }, + { + "from": "mwf_map", + "from_port": 3, + "to": "mwf_mix", + "to_port": 8 + }, + { + "from": "mwf_map", + "from_port": 4, + "to": "mwf_mix", + "to_port": 9 + }, + { + "from": "mwf_map_2", + "from_port": 0, + "to": "mwf_mix", + "to_port": 0 + }, + { + "from": "mwf_map_2", + "from_port": 1, + "to": "mwf_mix", + "to_port": 1 + }, + { + "from": "mwf_map_2", + "from_port": 2, + "to": "mwf_mix", + "to_port": 2 + }, + { + "from": "mwf_map_2", + "from_port": 3, + "to": "mwf_mix", + "to_port": 3 + }, + { + "from": "mwf_map_2", + "from_port": 4, + "to": "mwf_mix", + "to_port": 4 + }, + { + "from": "graph_10", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 1 + }, + { + "from": "graph_10", + "from_port": 1, + "to": "mwf_map_2", + "to_port": 2 + }, + { + "from": "graph_10", + "from_port": 3, + "to": "mwf_map_2", + "to_port": 4 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "mwf_create_map", + "to_port": 0 + }, + { + "from": "blend_2_2_2", + "from_port": 0, + "to": "mwf_create_map_2", + "to_port": 0 + }, + { + "from": "graph_3", + "from_port": 0, + "to": "mwf_create_map_2_2", + "to_port": 0 + }, + { + "from": "graph_4", + "from_port": 0, + "to": "mwf_create_map_2_2_2", + "to_port": 0 + }, + { + "from": "colorize_6", + "from_port": 0, + "to": "mwf_map", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "mwf_map", + "to_port": 2 + }, + { + "from": "colorize", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "mwf_map", + "to_port": 4 + }, + { + "from": "uniform_2", + "from_port": 0, + "to": "mwf_map", + "to_port": 3 + }, + { + "from": "mwf_mix_maps", + "from_port": 0, + "to": "mwf_map_2", + "to_port": 0 + }, + { + "from": "mwf_create_map", + "from_port": 0, + "to": "mwf_mix_maps", + "to_port": 0 + }, + { + "from": "mwf_create_map_2", + "from_port": 0, + "to": "mwf_mix_maps", + "to_port": 1 + }, + { + "from": "mwf_create_map_2_2", + "from_port": 0, + "to": "mwf_mix_maps", + "to_port": 2 + }, + { + "from": "mwf_create_map_2_2_2", + "from_port": 0, + "to": "mwf_mix_maps", + "to_port": 3 + }, + { + "from": "graph_5", + "from_port": 0, + "to": "mwf_create_map_3", + "to_port": 0 + }, + { + "from": "graph_5", + "from_port": 1, + "to": "mwf_create_map_3", + "to_port": 1 + }, + { + "from": "mwf_create_map_3", + "from_port": 0, + "to": "mwf_map", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "brightness_contrast", "to_port": 0 } ], @@ -257,8 +311,8 @@ { "name": "Material", "node_position": { - "x": -960.008057, - "y": 439.047974 + "x": -863.008057, + "y": 430.047974 }, "parameters": { "albedo_color": { @@ -269,7 +323,7 @@ "type": "Color" }, "ao_light_affect": 1, - "depth_scale": 0.3, + "depth_scale": 0.2, "emission_energy": 1, "metallic": 1, "normal_scale": 1, @@ -528,9 +582,11 @@ "parameters": { "bevel": 0.025, "columns": 14, + "corner": 0, "mortar": 0.02, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 1 }, @@ -838,7 +894,7 @@ "name": "blend_2_2_2", "node_position": { "x": -2142.726318, - "y": 309.274261 + "y": 305.274261 }, "parameters": { "amount": 1, @@ -849,14 +905,14 @@ { "name": "perlin_2", "node_position": { - "x": -2285.716797, - "y": 723.284668 + "x": -2335.716797, + "y": 782.284668 }, "parameters": { - "iterations": 5, + "iterations": 6, "persistence": 0.85, - "scale_x": 8, - "scale_y": 8 + "scale_x": 16, + "scale_y": 16 }, "seed_value": -20372, "type": "perlin" @@ -864,8 +920,8 @@ { "name": "colorize_6", "node_position": { - "x": -1964.129272, - "y": 660.170837 + "x": -2015.129272, + "y": 737.170837 }, "parameters": { "gradient": { @@ -935,12 +991,6 @@ "to": "blend", "to_port": 1 }, - { - "from": "blend", - "from_port": 0, - "to": "gen_outputs", - "to_port": 2 - }, { "from": "uniform_greyscale_3", "from_port": 0, @@ -964,13 +1014,31 @@ "from_port": 0, "to": "gen_outputs", "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "blend", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 } ], "label": "Wood", "name": "graph_10", "node_position": { - "x": -1648.024292, - "y": 469.649658 + "x": -1666.024292, + "y": 472.649658 }, "nodes": [ { @@ -1000,9 +1068,9 @@ { "a": 1, "b": 0, - "g": 0.123698, + "g": 0.080404, "pos": 0, - "r": 0.208333 + "r": 0.135417 }, { "a": 1, @@ -1014,9 +1082,9 @@ { "a": 1, "b": 0, - "g": 0.123698, + "g": 0.071126, "pos": 0.381818, - "r": 0.208333 + "r": 0.119792 }, { "a": 1, @@ -1028,9 +1096,9 @@ { "a": 1, "b": 0, - "g": 0.123698, + "g": 0.092774, "pos": 0.811052, - "r": 0.208333 + "r": 0.15625 }, { "a": 1, @@ -1048,8 +1116,8 @@ { "name": "transform", "node_position": { - "x": -1017.07251, - "y": -638.934875 + "x": -1025.07251, + "y": -641.934875 }, "parameters": { "repeat": true, @@ -1064,8 +1132,8 @@ { "name": "colorize_7", "node_position": { - "x": -1000.07251, - "y": -376.934875 + "x": -1006.07251, + "y": -379.934875 }, "parameters": { "gradient": { @@ -1073,17 +1141,17 @@ "points": [ { "a": 1, - "b": 1, - "g": 1, + "b": 0, + "g": 0, "pos": 0, - "r": 1 + "r": 0 }, { "a": 1, - "b": 0, - "g": 0, - "pos": 0.018182, - "r": 0 + "b": 1, + "g": 1, + "pos": 0.036364, + "r": 1 } ], "type": "Gradient" @@ -1116,16 +1184,20 @@ }, "ports": [ { - "name": "color", - "type": "rgba" + "name": "Color", + "type": "rgb" }, { - "name": "orm", - "type": "rgba" + "name": "ORM", + "type": "rgb" }, { - "name": "height", - "type": "rgba" + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" } ], "type": "ios" @@ -1153,10 +1225,10 @@ "parameters": { "intensity": 1, "randomness": 0.75, - "scale_x": 3, - "scale_y": 19, + "scale_x": 15, + "scale_y": 94, "stretch_x": 1, - "stretch_y": 0.09 + "stretch_y": 0.05 }, "type": "voronoi" }, @@ -1208,19 +1280,19 @@ "name": "blend", "node_position": { "x": -793.12207, - "y": -410.25 + "y": -408.25 }, "parameters": { "amount": 0.6864, - "blend_type": 0 + "blend_type": 2 }, "type": "blend" }, { "name": "uniform_greyscale", "node_position": { - "x": -781.432495, - "y": -481.5 + "x": -767.432495, + "y": -514.5 }, "parameters": { "color": 0.1 @@ -1230,19 +1302,19 @@ { "name": "uniform_greyscale_2", "node_position": { - "x": -781.432495, - "y": -535.5 + "x": -767.432495, + "y": -568.5 }, "parameters": { - "color": 0.79 + "color": 0.85 }, "type": "uniform_greyscale" }, { "name": "uniform_greyscale_3", "node_position": { - "x": -782.764038, - "y": -588 + "x": -768.764038, + "y": -621 }, "parameters": { "color": 1 @@ -1252,8 +1324,8 @@ { "name": "combine", "node_position": { - "x": -565.764038, - "y": -553 + "x": -551.764038, + "y": -586 }, "parameters": { "color": { @@ -1266,6 +1338,40 @@ "name": 0 }, "type": "combine" + }, + { + "name": "uniform", + "node_position": { + "x": -576.309631, + "y": -477 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "normal_map", + "node_position": { + "x": -539.205322, + "y": -417 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 1.5, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" } ], "parameters": { @@ -1775,7 +1881,7 @@ { "name": "transform_4", "node_position": { - "x": -444.025391, + "x": -454.025391, "y": -199.0625 }, "parameters": { @@ -1784,7 +1890,7 @@ "scale_x": 1, "scale_y": 0.075, "translate_x": 0, - "translate_y": -0.465 + "translate_y": -0.47 }, "type": "transform" }, @@ -1795,7 +1901,7 @@ "y": -341.020813 }, "parameters": { - "edge": 0.1, + "edge": 0.08, "radius": 1, "shape": 1, "sides": 4 @@ -1878,7 +1984,7 @@ { "name": "transform", "node_position": { - "x": -716.829407, + "x": -715.829407, "y": -582.992554 }, "parameters": { @@ -2123,27 +2229,35 @@ "from_port": 0, "to": "colorize_4", "to_port": 0 + }, + { + "from": "bricks_2", + "from_port": 1, + "to": "gen_outputs", + "to_port": 1 } ], "label": "Bricks", "name": "graph_5", "node_position": { - "x": -1931.514526, - "y": 591.125061 + "x": -1962.514526, + "y": 593.125061 }, "nodes": [ { "name": "bricks_2", "node_position": { - "x": 611.874512, - "y": -790.245544 + "x": 640.874512, + "y": -780.245544 }, "parameters": { "bevel": 0.04, "columns": 3, + "corner": 0, "mortar": 0.02, "pattern": 0, "repeat": 3, + "round": 0, "row_offset": 0.5, "rows": 6 }, @@ -2152,8 +2266,8 @@ { "name": "colorize_4", "node_position": { - "x": 881.814941, - "y": -686.245544 + "x": 924.814941, + "y": -802.245544 }, "parameters": { "gradient": { @@ -2189,8 +2303,8 @@ { "name": "blend", "node_position": { - "x": 846.98291, - "y": -783.245544 + "x": 899.98291, + "y": -893.245544 }, "parameters": { "amount": 1, @@ -2215,8 +2329,8 @@ { "name": "gen_outputs", "node_position": { - "x": 1167.814941, - "y": -768.578857 + "x": 1132.814941, + "y": -778.578857 }, "parameters": { @@ -2224,7 +2338,11 @@ "ports": [ { "name": "port0", - "type": "rgba" + "type": "f" + }, + { + "name": "unnamed", + "type": "f" } ], "type": "ios" @@ -2232,8 +2350,8 @@ { "name": "gen_parameters", "node_position": { - "x": 767.557434, - "y": -896.245605 + "x": 976.557434, + "y": -981.245605 }, "parameters": { @@ -2250,489 +2368,11 @@ "seed_value": -59752, "type": "graph" }, - { - "name": "_2", - "node_position": { - "x": -1645.411377, - "y": 337.220764 - }, - "parameters": { - "angle": 45, - "height": 0.8 - }, - "shader_model": { - "code": "", - "global": "vec3 matmap_mix(vec3 in1, vec3 in2) {\n\tfloat is_in1 = step(in2.x, in1.x);\n\treturn vec3(max(in1.x, in2.x), in1.yz*is_in1+in2.yz*(1.0-is_in1));\n}", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "name": "in2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "name": "in3", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "", - "name": "in4", - "type": "rgb" - } - ], - "instance": "", - "name": "MatMap Mix", - "outputs": [ - { - "rgb": "matmap_mix(matmap_mix($in1($uv), $in2($uv)), matmap_mix($in3($uv), $in4($uv)))", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "_2_2", - "node_position": { - "x": -1889.203369, - "y": 400.764771 - }, - "parameters": { - "angle": -45, - "height": 0.8 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "MatMap", - "outputs": [ - { - "rgb": "vec3($height*$in($uv), $angle*0.01745329251, 0.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 1, - "label": "Height", - "max": 1, - "min": 0, - "name": "height", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "_2_2_2", - "node_position": { - "x": -1890.203247, - "y": 313.014801 - }, - "parameters": { - "angle": 90, - "height": 1 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "MatMap", - "outputs": [ - { - "rgb": "vec3($height*$in($uv), $angle*0.01745329251, 0.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 1, - "label": "Height", - "max": 1, - "min": 0, - "name": "height", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "_2_2_2_2", - "node_position": { - "x": -1889.403198, - "y": 226.964798 - }, - "parameters": { - "angle": 0, - "height": 1 - }, - "seed_value": -57630, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "MatMap", - "outputs": [ - { - "rgb": "vec3($height*$in($uv), $angle*0.01745329251, rand(vec2($seed)))", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 1, - "label": "Height", - "max": 1, - "min": 0, - "name": "height", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "_2_3", - "node_position": { - "x": -1890.967651, - "y": 484.514771 - }, - "parameters": { - "angle": 45, - "height": 0.8 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "MatMap", - "outputs": [ - { - "rgb": "vec3($height*$in($uv), $angle*0.01745329251, 0.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 1, - "label": "Height", - "max": 1, - "min": 0, - "name": "height", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Angle", - "max": 180, - "min": -180, - "name": "angle", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "_3", - "node_position": { - "x": -1489.123413, - "y": 470.010742 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "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", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "Map", - "name": "map", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatCol", - "name": "mat1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatORM", - "name": "mat2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatFoo", - "name": "mat3", - "type": "rgb" - } - ], - "instance": "", - "name": "MatMap Map", - "outputs": [ - { - "f": "$map($uv).x", - "type": "f" - }, - { - "rgb": "$mat1(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - }, - { - "rgb": "$mat2(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - }, - { - "rgb": "$mat3(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "_4", - "node_position": { - "x": -1330.391357, - "y": 473.579987 - }, - "parameters": { - - }, - "shader_model": { - "code": "float $(name_uv)_a1 = step($h2($uv), $h1($uv));\nfloat $(name_uv)_a2 = 1.0-$(name_uv)_a1;", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "Height 1", - "name": "h1", - "type": "f" - }, - { - "default": "vec3(0.0)", - "label": "Color 1", - "name": "c1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "ORM 1", - "name": "orm1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "Foo 1", - "name": "foo1", - "type": "rgb" - }, - { - "default": "0.0", - "label": "Height 2", - "name": "h2", - "type": "f" - }, - { - "default": "vec3(0.0)", - "label": "Color 2", - "name": "c2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "ORM 2", - "name": "orm2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "Foo 2", - "name": "foo2", - "type": "rgb" - } - ], - "instance": "", - "name": "MatMix", - "outputs": [ - { - "f": "max($h1($uv), $h2($uv))", - "type": "f" - }, - { - "rgb": "$(name_uv)_a1*$c1($uv)+$(name_uv)_a2*$c2($uv)", - "type": "rgb" - }, - { - "rgb": "$(name_uv)_a1*$orm1($uv)+$(name_uv)_a2*$orm2($uv)", - "type": "rgb" - }, - { - "rgb": "$(name_uv)_a1*$foo1($uv)+$(name_uv)_a2*$foo2($uv)", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, - { - "name": "_3_2", - "node_position": { - "x": -1489.627563, - "y": 569.117004 - }, - "parameters": { - - }, - "shader_model": { - "code": "", - "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", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "Map", - "name": "map", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatCol", - "name": "mat1", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatORM", - "name": "mat2", - "type": "rgb" - }, - { - "default": "vec3(0.0)", - "label": "MatFoo", - "name": "mat3", - "type": "rgb" - } - ], - "instance": "", - "name": "MatMap Map", - "outputs": [ - { - "f": "$map($uv).x", - "type": "f" - }, - { - "rgb": "$mat1(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - }, - { - "rgb": "$mat2(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - }, - { - "rgb": "$mat3(matmap_uv($uv, $map($uv).y, $map($uv).z))", - "type": "rgb" - } - ], - "parameters": [ - - ] - }, - "type": "shader" - }, { "name": "colorize", "node_position": { - "x": -1724.740356, - "y": 795.5 + "x": -1781.740356, + "y": 960.5 }, "parameters": { "gradient": { @@ -2761,8 +2401,8 @@ { "name": "voronoi", "node_position": { - "x": -2262.383301, - "y": 849.75 + "x": -2312.383301, + "y": 908.75 }, "parameters": { "intensity": 1, @@ -2778,8 +2418,8 @@ { "name": "transform", "node_position": { - "x": -1981.383301, - "y": 797.75 + "x": -2022.383301, + "y": 812.75 }, "parameters": { "repeat": false, @@ -2794,8 +2434,8 @@ { "name": "uniform", "node_position": { - "x": -1745.16626, - "y": 722.75 + "x": -1793.16626, + "y": 709.75 }, "parameters": { "color": { @@ -2808,1130 +2448,6 @@ }, "type": "uniform" }, - { - "connections": [ - { - "from": "colorize_3", - "from_port": 0, - "to": "gen_outputs", - "to_port": 5 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "colorize_3", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "gaussian_blur", - "to_port": 0 - }, - { - "from": "gaussian_blur", - "from_port": 0, - "to": "gen_outputs", - "to_port": 4 - }, - { - "from": "gen_inputs", - "from_port": 2, - "to": "decompose", - "to_port": 0 - }, - { - "from": "decompose", - "from_port": 1, - "to": "gen_outputs", - "to_port": 2 - }, - { - "from": "decompose", - "from_port": 2, - "to": "gen_outputs", - "to_port": 1 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "normal_map", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 3, - "to": "normal_map_2", - "to_port": 0 - }, - { - "from": "blend_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 3 - }, - { - "from": "normal_map", - "from_port": 0, - "to": "blend_2", - "to_port": 1 - }, - { - "from": "normal_map_2", - "from_port": 0, - "to": "blend_2", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 1, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Output Material", - "name": "graph_6", - "node_position": { - "x": -1140.881836, - "y": 472.758606 - }, - "nodes": [ - { - "connections": [ - { - "from": "nm_convolution", - "from_port": 0, - "to": "nm_postprocess", - "to_port": 0 - }, - { - "from": "nm_postprocess", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "nm_convolution", - "to_port": 0 - } - ], - "label": "Normal Map", - "name": "normal_map", - "node_position": { - "x": -1065.637451, - "y": 563.842468 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -691.663818, - "y": 98.60614 - }, - "parameters": { - "lod": 0, - "size": 11 - }, - "type": "buffer" - }, - { - "convolution_params": { - "input_type": "f", - "matrix": [ - [ - [ - -1, - -1, - 0 - ], - [ - 0, - -2, - 0 - ], - [ - 1, - -1, - 0 - ] - ], - [ - [ - -2, - 0, - 0 - ], - 0, - [ - 2, - 0, - 0 - ] - ], - [ - [ - -1, - 1, - 0 - ], - [ - 0, - 2, - 0 - ], - [ - 1, - 1, - 0 - ] - ] - ], - "output_type": "rgb", - "x": 1, - "y": 1 - }, - "name": "nm_convolution", - "node_position": { - "x": -689.25, - "y": 175.25 - }, - "parameters": { - "size": 11 - }, - "type": "convolution" - }, - { - "name": "nm_postprocess", - "node_position": { - "x": -689.25, - "y": 228.25 - }, - "parameters": { - "amount": 1.02, - "format": 0, - "size": 11, - "type": 0 - }, - "shader_model": { - "code": "", - "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "NormalMapPostProcess", - "outputs": [ - { - "rgb": "process_normal_$format($in($uv).xyz, $amount*$size/128.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "format", - "type": "enum", - "values": [ - { - "name": "Default", - "value": "default" - }, - { - "name": "OpenGL", - "value": "opengl" - }, - { - "name": "DirectX", - "value": "directx" - } - ] - }, - { - "default": 9, - "first": 4, - "label": "", - "last": 11, - "name": "size", - "type": "size" - }, - { - "default": 1, - "label": "", - "max": 2, - "min": 0, - "name": "amount", - "step": 0.005, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -696.910156, - "y": -29.916687 - }, - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 1.02, - "param2": 0, - "param3": 1, - "size": 4 - }, - "type": "remote", - "widgets": [ - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "format" - } - ], - "name": "param2", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "nm_convolution", - "widget": "size" - }, - { - "node": "nm_postprocess", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "amount" - } - ], - "name": "param1", - "type": "linked_control" - } - ] - }, - { - "name": "gen_outputs", - "node_position": { - "x": -425.663818, - "y": 163.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -843.910156, - "y": 178.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - } - ], - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 1.02, - "param2": 0, - "param3": 1, - "size": 4 - }, - "type": "graph" - }, - { - "name": "colorize_3", - "node_position": { - "x": -939.637451, - "y": 871.842407 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0, - "r": 1 - }, - { - "a": 1, - "b": 0, - "g": 0, - "pos": 1, - "r": 0 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "connections": [ - { - "from": "buffer", - "from_port": 0, - "to": "blurx_convolution", - "to_port": 0 - }, - { - "from": "buffer_2", - "from_port": 0, - "to": "blurx_convolution_2", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "blend", - "from_port": 0, - "to": "colorize", - "to_port": 0 - }, - { - "from": "blurx_convolution", - "from_port": 0, - "to": "buffer_2", - "to_port": 0 - }, - { - "from": "blurx_convolution_2", - "from_port": 0, - "to": "blend", - "to_port": 1 - }, - { - "from": "buffer", - "from_port": 0, - "to": "blend", - "to_port": 0 - }, - { - "from": "colorize", - "from_port": 0, - "to": "_2", - "to_port": 0 - }, - { - "from": "_2", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - } - ], - "label": "Occlusion", - "name": "gaussian_blur", - "node_position": { - "x": -969.845825, - "y": 787.968262 - }, - "nodes": [ - { - "convolution_params": { - "input_type": "rgba", - "matrix_function": "exp(-0.5*(pow(x/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", - "normalized": true, - "output_type": "rgba", - "parameters": [ - { - "max": 50, - "min": 0.05, - "name": "sigma", - "type": "float" - } - ], - "x": 50, - "y": 0 - }, - "name": "blurx_convolution", - "node_position": { - "x": -407.5, - "y": -192.5 - }, - "parameters": { - "sigma": 50, - "size": 10 - }, - "type": "convolution" - }, - { - "name": "buffer_2", - "node_position": { - "x": -404.875, - "y": -116.625 - }, - "parameters": { - "lod": 0, - "size": 10 - }, - "type": "buffer" - }, - { - "convolution_params": { - "input_type": "rgba", - "matrix_function": "exp(-0.5*(pow(y/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", - "normalized": true, - "output_type": "rgba", - "parameters": [ - { - "max": 50, - "min": 0.05, - "name": "sigma", - "type": "float" - } - ], - "x": 0, - "y": 50 - }, - "name": "blurx_convolution_2", - "node_position": { - "x": -407.125, - "y": -44.375 - }, - "parameters": { - "sigma": 50, - "size": 10 - }, - "type": "convolution" - }, - { - "name": "buffer", - "node_position": { - "x": -408.25, - "y": -265.75 - }, - "parameters": { - "lod": 0, - "size": 10 - }, - "type": "buffer" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -447.666626, - "y": -370.666656 - }, - "parameters": { - "param0": 10, - "param1": 50, - "param2": 2 - }, - "type": "remote", - "widgets": [ - { - "label": "Grid size:", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "blurx_convolution", - "widget": "size" - }, - { - "node": "buffer_2", - "widget": "size" - }, - { - "node": "blurx_convolution_2", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "Strength", - "linked_widgets": [ - { - "node": "_2", - "widget": "g" - } - ], - "name": "param2", - "type": "linked_control" - } - ] - }, - { - "name": "gen_inputs", - "node_position": { - "x": -585.666626, - "y": -112.392853 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": 55.547607, - "y": -133.392853 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "blend", - "node_position": { - "x": -420.79895, - "y": 27.16272 - }, - "parameters": { - "amount": 1, - "blend_type": 11 - }, - "type": "blend" - }, - { - "name": "colorize", - "node_position": { - "x": -167.79895, - "y": -178.83728 - }, - "parameters": { - "gradient": { - "interpolation": 1, - "points": [ - { - "a": 1, - "b": 1, - "g": 1, - "pos": 0, - "r": 1 - }, - { - "a": 1, - "b": 0, - "g": 0, - "pos": 1, - "r": 0 - } - ], - "type": "Gradient" - } - }, - "type": "colorize" - }, - { - "name": "_2", - "node_position": { - "x": -134.403687, - "y": -110.29187 - }, - "parameters": { - "g": 2 - }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in", - "type": "f" - } - ], - "instance": "", - "name": "", - "outputs": [ - { - "f": "pow($in($uv), $g)", - "type": "f" - } - ], - "parameters": [ - { - "default": 1, - "label": "", - "max": 2, - "min": 0, - "name": "g", - "step": 0.1, - "type": "float" - } - ] - }, - "type": "shader" - } - ], - "parameters": { - "param0": 10, - "param1": 50, - "param2": 2 - }, - "type": "graph" - }, - { - "name": "decompose", - "node_position": { - "x": -920.371338, - "y": 456.25 - }, - "parameters": { - - }, - "type": "decompose" - }, - { - "connections": [ - { - "from": "nm_convolution", - "from_port": 0, - "to": "nm_postprocess", - "to_port": 0 - }, - { - "from": "nm_postprocess", - "from_port": 0, - "to": "gen_outputs", - "to_port": 0 - }, - { - "from": "gen_inputs", - "from_port": 0, - "to": "buffer", - "to_port": 0 - }, - { - "from": "buffer", - "from_port": 0, - "to": "nm_convolution", - "to_port": 0 - } - ], - "label": "Normal Map", - "name": "normal_map_2", - "node_position": { - "x": -1065.805542, - "y": 686.828491 - }, - "nodes": [ - { - "name": "buffer", - "node_position": { - "x": -691.663818, - "y": 98.60614 - }, - "parameters": { - "lod": 0, - "size": 11 - }, - "type": "buffer" - }, - { - "convolution_params": { - "input_type": "f", - "matrix": [ - [ - [ - -1, - -1, - 0 - ], - [ - 0, - -2, - 0 - ], - [ - 1, - -1, - 0 - ] - ], - [ - [ - -2, - 0, - 0 - ], - 0, - [ - 2, - 0, - 0 - ] - ], - [ - [ - -1, - 1, - 0 - ], - [ - 0, - 2, - 0 - ], - [ - 1, - 1, - 0 - ] - ] - ], - "output_type": "rgb", - "x": 1, - "y": 1 - }, - "name": "nm_convolution", - "node_position": { - "x": -689.25, - "y": 175.25 - }, - "parameters": { - "size": 11 - }, - "type": "convolution" - }, - { - "name": "nm_postprocess", - "node_position": { - "x": -689.25, - "y": 228.25 - }, - "parameters": { - "amount": 1.02, - "format": 0, - "size": 11, - "type": 0 - }, - "shader_model": { - "code": "", - "global": "vec3 process_normal_default(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, -1.0))+vec3(0.5);\n}\n\nvec3 process_normal_opengl(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n\nvec3 process_normal_directx(vec3 v, float multiplier) {\n\treturn 0.5*normalize(v.xyz*vec3(1.0, -1.0, 1.0)*multiplier+vec3(0.0, 0.0, 1.0))+vec3(0.5);\n}\n", - "inputs": [ - { - "default": "vec3(0.0)", - "label": "", - "name": "in", - "type": "rgb" - } - ], - "instance": "", - "name": "NormalMapPostProcess", - "outputs": [ - { - "rgb": "process_normal_$format($in($uv).xyz, $amount*$size/128.0)", - "type": "rgb" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "format", - "type": "enum", - "values": [ - { - "name": "Default", - "value": "default" - }, - { - "name": "OpenGL", - "value": "opengl" - }, - { - "name": "DirectX", - "value": "directx" - } - ] - }, - { - "default": 9, - "first": 4, - "label": "", - "last": 11, - "name": "size", - "type": "size" - }, - { - "default": 1, - "label": "", - "max": 2, - "min": 0, - "name": "amount", - "step": 0.005, - "type": "float" - } - ] - }, - "type": "shader" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -696.910156, - "y": -29.916687 - }, - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 1.02, - "param2": 0, - "param3": 1, - "size": 4 - }, - "type": "remote", - "widgets": [ - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "format" - } - ], - "name": "param2", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "buffer", - "widget": "size" - }, - { - "node": "nm_convolution", - "widget": "size" - }, - { - "node": "nm_postprocess", - "widget": "size" - } - ], - "name": "param0", - "type": "linked_control" - }, - { - "label": "", - "linked_widgets": [ - { - "node": "nm_postprocess", - "widget": "amount" - } - ], - "name": "param1", - "type": "linked_control" - } - ] - }, - { - "name": "gen_outputs", - "node_position": { - "x": -425.663818, - "y": 163.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -843.910156, - "y": 178.047363 - }, - "parameters": { - - }, - "ports": [ - { - "name": "port0", - "type": "rgba" - } - ], - "type": "ios" - } - ], - "parameters": { - "amount": 0.5, - "param0": 11, - "param1": 1.02, - "param2": 0, - "param3": 1, - "size": 4 - }, - "type": "graph" - }, - { - "name": "blend_2", - "node_position": { - "x": -865.305542, - "y": 675.328491 - }, - "parameters": { - "amount": 0.2686, - "blend_type": 4 - }, - "type": "blend" - }, - { - "name": "gen_inputs", - "node_position": { - "x": -1341.805542, - "y": 623.758606 - }, - "parameters": { - - }, - "ports": [ - { - "name": "height", - "type": "rgba" - }, - { - "name": "color", - "type": "rgba" - }, - { - "name": "orm", - "type": "rgba" - }, - { - "name": "carve", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_outputs", - "node_position": { - "x": -563.305542, - "y": 627.758606 - }, - "parameters": { - - }, - "ports": [ - { - "name": "albedo", - "type": "rgba" - }, - { - "name": "metallic", - "type": "rgba" - }, - { - "name": "roughness", - "type": "rgba" - }, - { - "name": "normal", - "type": "rgba" - }, - { - "name": "occlusion", - "type": "rgba" - }, - { - "name": "depth", - "type": "rgba" - } - ], - "type": "ios" - }, - { - "name": "gen_parameters", - "node_position": { - "x": -1168.881836, - "y": 72.25 - }, - "parameters": { - - }, - "type": "remote", - "widgets": [ - - ] - } - ], - "parameters": { - - }, - "type": "graph" - }, { "name": "comment", "node_position": { @@ -3983,8 +2499,8 @@ { "name": "comment_2_2_2", "node_position": { - "x": -1481.280762, - "y": 663.200073 + "x": -1491.280762, + "y": 697.200073 }, "parameters": { "size": 4 @@ -4027,6 +2543,171 @@ }, "text": "This node converts material+shapes data into what Material expects", "type": "comment" + }, + { + "name": "mwf_mix", + "node_position": { + "x": -1348.120117, + "y": 476.266724 + }, + "parameters": { + + }, + "type": "mwf_mix" + }, + { + "name": "mwf_output", + "node_position": { + "x": -1143.120117, + "y": 478.266724 + }, + "parameters": { + "param0": 0.5, + "param1": 10, + "param2": 2 + }, + "type": "mwf_output" + }, + { + "name": "mwf_map", + "node_position": { + "x": -1508.537354, + "y": 583.016724 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_map_2", + "node_position": { + "x": -1508.037354, + "y": 465.516724 + }, + "parameters": { + + }, + "type": "mwf_map" + }, + { + "name": "mwf_create_map", + "node_position": { + "x": -1890.537354, + "y": 218.516724 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_create_map_2", + "node_position": { + "x": -1887.537354, + "y": 308.516724 + }, + "parameters": { + "angle": 90, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_create_map_2_2", + "node_position": { + "x": -1893.537354, + "y": 398.516724 + }, + "parameters": { + "angle": -45, + "height": 0.8 + }, + "type": "mwf_create_map" + }, + { + "name": "mwf_create_map_2_2_2", + "node_position": { + "x": -1893.537354, + "y": 481.516724 + }, + "parameters": { + "angle": 45, + "height": 0.8 + }, + "type": "mwf_create_map" + }, + { + "name": "normal_map", + "node_position": { + "x": -1773.537354, + "y": 831.766724 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 0.78, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "uniform_2", + "node_position": { + "x": -1768.022705, + "y": 765.25 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "mwf_mix_maps", + "node_position": { + "x": -1664.032715, + "y": 345.945251 + }, + "parameters": { + "angle": 45, + "height": 0.8 + }, + "type": "mwf_mix_maps" + }, + { + "name": "mwf_create_map_3", + "node_position": { + "x": -1823.445557, + "y": 586.679321 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "type": "mwf_create_map" + }, + { + "name": "brightness_contrast", + "node_position": { + "x": -1468.755005, + "y": 754.429321 + }, + "parameters": { + "brightness": 0, + "contrast": 1, + "steps": 6 + }, + "type": "brightness_contrast" } ], "parameters": { diff --git a/addons/material_maker/graph_edit.gd b/addons/material_maker/graph_edit.gd index bd28cd9..a511ff8 100644 --- a/addons/material_maker/graph_edit.gd +++ b/addons/material_maker/graph_edit.gd @@ -74,6 +74,9 @@ func remove_node(node) -> void: for c in get_connection_list(): if c.from == node_name or c.to == node_name: disconnect_node(c.from, c.from_port, c.to, c.to_port) + if node == last_selected: + set_last_selected(null) + remove_child(node) node.queue_free() send_changed_signal() @@ -106,6 +109,8 @@ func clear_view() -> void: clear_connections() for c in get_children(): if c is GraphNode: + if c == last_selected: + set_last_selected(null) remove_child(c) c.free() @@ -358,14 +363,19 @@ func _on_ButtonTransmitsSeed_toggled(button_pressed) -> void: generator.transmits_seed = button_pressed func _on_GraphEdit_node_selected(node) -> void: - last_selected = node + set_last_selected(node) + +func set_last_selected(node) -> void: + if node is GraphNode: + last_selected = node + else: + last_selected = null func _on_GraphEdit_gui_input(event) -> void: if event is InputEventMouseButton: call_deferred("check_last_selected") func check_last_selected() -> void: - if last_selected != null and !(is_instance_valid(last_selected) && last_selected.selected): - print("Unselected") + if last_selected != null and !(is_instance_valid(last_selected) and last_selected.selected): last_selected = null - emit_signal("node_selected", null) \ No newline at end of file + emit_signal("node_selected", null) diff --git a/addons/material_maker/graph_edit.tscn b/addons/material_maker/graph_edit.tscn index 9319a45..b7ce5c6 100644 --- a/addons/material_maker/graph_edit.tscn +++ b/addons/material_maker/graph_edit.tscn @@ -36,14 +36,13 @@ one_shot = true [node name="GraphUI" type="HBoxContainer" parent="."] anchor_left = 1.0 anchor_right = 1.0 -margin_left = -592.0 +margin_left = -262.0 margin_right = -16.0 margin_bottom = 24.0 alignment = 2 [node name="SubGraphUI" type="HBoxContainer" parent="GraphUI"] -margin_left = 330.0 -margin_right = 544.0 +margin_right = 214.0 margin_bottom = 24.0 size_flags_horizontal = 9 @@ -71,8 +70,8 @@ size_flags_horizontal = 9 icon = SubResource( 3 ) [node name="ButtonShowTree" type="Button" parent="GraphUI"] -margin_left = 548.0 -margin_right = 576.0 +margin_left = 218.0 +margin_right = 246.0 margin_bottom = 24.0 hint_tooltip = "Show hierarchy" icon = SubResource( 4 ) diff --git a/addons/material_maker/library/base.json b/addons/material_maker/library/base.json index ee289d6..c5ee289 100644 --- a/addons/material_maker/library/base.json +++ b/addons/material_maker/library/base.json @@ -857,6 +857,23 @@ "tree_item": "Simple/SDF/Operators/sdAnnularShape", "type": "sdannularshape" }, + { + "collapsed": true, + "icon": "simple_sdf_operators_sdmorph", + "name": "sdmorph", + "parameters": { + "amount": 0.5, + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "tree_item": "Simple/SDF/Operators/sdMorph", + "type": "sdmorph" + }, { "collapsed": false, "tree_item": "Simple/SDF/Transforms" @@ -904,6 +921,37 @@ "collapsed": false, "tree_item": "3D" }, + { + "collapsed": true, + "icon": "3d_box", + "name": "box", + "parameters": { + "cx": 0.5, + "cy": 0.5, + "cz": 0.5, + "r": 0.5, + "rx": 0, + "ry": 0, + "rz": 0, + "sx": 0.25, + "sy": 0.25, + "sz": 0.25 + }, + "tree_item": "3D/Box", + "type": "box" + }, + { + "collapsed": true, + "icon": "3d_sphere", + "name": "sphere", + "parameters": { + "cx": 0.5, + "cy": 0.5, + "r": 0.5 + }, + "tree_item": "3D/Sphere", + "type": "sphere" + }, { "collapsed": true, "icon": "3d_sdf_render", @@ -1116,6 +1164,24 @@ "tree_item": "3D/SDF/Operators/Revolution", "type": "sdf3d_revolution" }, + { + "collapsed": true, + "icon": "3d_sdf_operators_morph", + "name": "sdf3d_morph", + "parameters": { + "Amount": 0.5, + "amount": 0.5, + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "tree_item": "3D/SDF/Operators/Morph", + "type": "sdf3d_morph" + }, { "collapsed": false, "tree_item": "3D/SDF/Transforms" @@ -1622,7 +1688,7 @@ "y": -658 }, "parameters": { - "repeat": false, + "repeat": true, "rotate": 0, "scale_x": 1, "scale_y": 1, @@ -1829,7 +1895,7 @@ "y": -629 }, "parameters": { - "repeat": false, + "repeat": true, "rotate": 0, "scale_x": 1, "scale_y": 1, @@ -1982,7 +2048,7 @@ "y": -714.099976 }, "parameters": { - "repeat": false, + "repeat": true, "rotate": 0, "scale_x": 1, "scale_y": 1, @@ -2059,6 +2125,19 @@ "tree_item": "Filter/AdjustHSV", "type": "adjust_hsv" }, + { + "collapsed": true, + "icon": "filter_greyscale", + "name": "greyscale", + "parameters": { + "brightness": 0, + "contrast": 1, + "mode": 2, + "steps": 6 + }, + "tree_item": "Filter/Greyscale", + "type": "greyscale" + }, { "collapsed": true, "icon": "filter_colorize", @@ -2297,6 +2376,2192 @@ "tree_item": "Transform/CircleMap", "type": "circle_map" }, + { + "collapsed": true, + "icon": "transform_customuv", + "name": "custom_uv", + "parameters": { + + }, + "tree_item": "Transform/CustomUV", + "type": "custom_uv" + }, + { + "collapsed": false, + "tree_item": "Workflow" + }, + { + "collapsed": true, + "icon": "workflow_createmap", + "name": "mwf_create_map", + "parameters": { + "angle": 0, + "height": 1 + }, + "tree_item": "Workflow/CreateMap", + "type": "mwf_create_map" + }, + { + "collapsed": true, + "icon": "workflow_mixmap", + "name": "mwf_mix_maps", + "parameters": { + "angle": 45, + "height": 0.8 + }, + "tree_item": "Workflow/MixMap", + "type": "mwf_mix_maps" + }, + { + "collapsed": true, + "icon": "workflow_applymap", + "name": "mwf_map", + "parameters": { + + }, + "tree_item": "Workflow/ApplyMap", + "type": "mwf_map" + }, + { + "collapsed": true, + "icon": "workflow_mix", + "name": "mwf_mix", + "parameters": { + + }, + "tree_item": "Workflow/Mix", + "type": "mwf_mix" + }, + { + "collapsed": true, + "icon": "workflow_output", + "name": "mwf_output", + "parameters": { + "param0": 1, + "param1": 10, + "param2": 1 + }, + "tree_item": "Workflow/Output", + "type": "mwf_output" + }, + { + "collapsed": true, + "connections": [ + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "noise", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "scratches", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "graph_2", + "from_port": 0, + "to": "colorize", + "to_port": 0 + } + ], + "icon": "workflow_materials_marble", + "label": "Marble", + "name": "graph_3_3_2", + "nodes": [ + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -325.5, + "y": 82.5 + }, + "parameters": { + "color": 0.15 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -325.5, + "y": 133 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "_2", + "node_position": { + "x": -327.611084, + "y": -48.388885 + }, + "parameters": { + "c1": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "c2": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "$uv.x", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "Simple Gradient", + "outputs": [ + { + "rgba": "mix($c1, $c2, $in($uv))", + "type": "rgba" + } + ], + "parameters": [ + { + "default": { + "a": 1, + "b": 0, + "g": 0, + "r": 0 + }, + "label": "Color 1", + "name": "c1", + "type": "color" + }, + { + "default": { + "a": 1, + "b": 1, + "g": 1, + "r": 1 + }, + "label": "Color 2", + "name": "c2", + "type": "color" + } + ] + }, + "type": "shader" + }, + { + "name": "colorize", + "node_position": { + "x": -346.5, + "y": -112 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.090909, + "r": 0 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.336364, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.390909, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.436364, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -483.845703, + "y": -241.932098 + }, + "parameters": { + "param0": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "param1": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + }, + "param2": 2 + }, + "type": "remote", + "widgets": [ + { + "label": "Color 1", + "linked_widgets": [ + { + "node": "_2", + "widget": "c1" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Color 2", + "linked_widgets": [ + { + "node": "_2", + "widget": "c2" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Scratches", + "linked_widgets": [ + { + "node": "normal_map", + "widget": "param1" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -894.5, + "y": -0.352623 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 218.388916, + "y": 18.647377 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "combine", + "node_position": { + "x": -87.22229, + "y": 39.197388 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -325.100708, + "y": 31.197388 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "normal_map", + "node_position": { + "x": -85.707123, + "y": 186.780701 + }, + "parameters": { + "amount": 0.5, + "param0": 11, + "param1": 2, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" + }, + { + "name": "uniform", + "node_position": { + "x": 52.203369, + "y": 83.780701 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "scratches", + "node_position": { + "x": -751.885315, + "y": 149.637848 + }, + "parameters": { + "Randomness": 0.5, + "angle": -1, + "layers": 10, + "length": 0.05, + "randomness": 1, + "waviness": 0.29, + "width": 0.002 + }, + "type": "scratches" + }, + { + "name": "colorize_2", + "node_position": { + "x": -322.733154, + "y": 194.637848 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 0.015625, + "g": 0.015625, + "pos": 1, + "r": 0.015625 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "noise", + "node_position": { + "x": -742.733154, + "y": 335.637848 + }, + "parameters": { + "density": 0.5, + "size": 10 + }, + "type": "noise" + }, + { + "name": "blend", + "node_position": { + "x": -461.733154, + "y": 255.887848 + }, + "parameters": { + "amount": 0.99, + "blend_type": 0 + }, + "type": "blend" + }, + { + "connections": [ + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 1 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 2 + }, + { + "from": "perlin", + "from_port": 0, + "to": "transform", + "to_port": 0 + }, + { + "from": "transform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Warp1", + "name": "graph_2", + "node_position": { + "x": -685.717468, + "y": -63.5793 + }, + "nodes": [ + { + "name": "transform", + "node_position": { + "x": -259.25, + "y": -658 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.5, + "translate_y": 0.5 + }, + "type": "transform" + }, + { + "name": "perlin", + "node_position": { + "x": -502.25, + "y": -653 + }, + "parameters": { + "iterations": 8, + "persistence": 0.5, + "scale_x": 8, + "scale_y": 8 + }, + "type": "perlin" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -670.25, + "y": -647.5 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 18.75, + "y": -657.5 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -315.75, + "y": -893 + }, + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "remote", + "widgets": [ + { + "label": "Scale X", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_x" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Scale Y", + "linked_widgets": [ + { + "node": "perlin", + "widget": "scale_y" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Iterations", + "linked_widgets": [ + { + "node": "perlin", + "widget": "iterations" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Persistance", + "linked_widgets": [ + { + "node": "perlin", + "widget": "persistence" + } + ], + "name": "param3", + "type": "linked_control" + }, + { + "label": "Warp X", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_x" + } + ], + "name": "param4", + "type": "linked_control" + }, + { + "label": "Warp Y", + "linked_widgets": [ + { + "node": "transform", + "widget": "translate_y" + } + ], + "name": "param5", + "type": "linked_control" + } + ] + } + ], + "parameters": { + "param0": 8, + "param1": 8, + "param2": 8, + "param3": 0.5, + "param4": 0.5, + "param5": 0.5 + }, + "type": "graph" + } + ], + "parameters": { + "param0": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "param1": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + }, + "param2": 2 + }, + "tree_item": "Workflow/Materials/Marble", + "type": "graph" + }, + { + "collapsed": true, + "connections": [ + { + "from": "uniform_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "uniform_greyscale_4", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + } + ], + "icon": "workflow_materials_metal", + "label": "Metal", + "name": "graph_2_2", + "nodes": [ + { + "name": "uniform_greyscale_3_2", + "node_position": { + "x": -712.322693, + "y": -216.48642 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_4", + "node_position": { + "x": -712.322693, + "y": -114.48642 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -712.322693, + "y": -165.48642 + }, + "parameters": { + "color": 0.1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_2", + "node_position": { + "x": -674.908142, + "y": -0.333069 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.501961, + "r": 0.501961, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_3", + "node_position": { + "x": -676.322693, + "y": -271.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 0.554, + "g": 0.556, + "r": 0.55, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "combine", + "node_position": { + "x": -514.322693, + "y": -176.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -847.322693, + "y": -143.585464 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -206.322693, + "y": -144.585464 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -739.30249, + "y": -408.925568 + }, + "parameters": { + "param0": 1, + "param1": 0.1 + }, + "type": "remote", + "widgets": [ + { + "configurations": { + "Aluminum": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.925, + "g": 0.921, + "r": 0.913, + "type": "Color" + }, + "widget": "color" + } + ], + "Chromium": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.554, + "g": 0.556, + "r": 0.55, + "type": "Color" + }, + "widget": "color" + } + ], + "Cobalt": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.634, + "g": 0.655, + "r": 0.662, + "type": "Color" + }, + "widget": "color" + } + ], + "Copper": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.538, + "g": 0.637, + "r": 0.955, + "type": "Color" + }, + "widget": "color" + } + ], + "Gold": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.336, + "g": 0.766, + "r": 1, + "type": "Color" + }, + "widget": "color" + } + ], + "Iron": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.58, + "g": 0.57, + "r": 0.56, + "type": "Color" + }, + "widget": "color" + } + ], + "Nickel": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.526, + "g": 0.609, + "r": 0.66, + "type": "Color" + }, + "widget": "color" + } + ], + "Platinum": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.585, + "g": 0.637, + "r": 0.672, + "type": "Color" + }, + "widget": "color" + } + ], + "Silver": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.915, + "g": 0.96, + "r": 0.972, + "type": "Color" + }, + "widget": "color" + } + ], + "Titanium": [ + { + "node": "uniform_3", + "value": { + "a": 1, + "b": 0.449, + "g": 0.497, + "r": 0.542, + "type": "Color" + }, + "widget": "color" + } + ] + }, + "label": "Metal", + "linked_widgets": [ + { + "node": "uniform_3", + "widget": "color" + } + ], + "name": "param0", + "type": "config_control" + }, + { + "label": "Roughness", + "linked_widgets": [ + { + "node": "uniform_greyscale_3", + "widget": "color" + } + ], + "name": "param1", + "type": "linked_control" + } + ] + }, + { + "name": "uniform", + "node_position": { + "x": -673.80249, + "y": -56.425568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + } + ], + "parameters": { + "param0": 1, + "param1": 0.1 + }, + "tree_item": "Workflow/Materials/Metal", + "type": "graph" + }, + { + "collapsed": true, + "connections": [ + { + "from": "scratches", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "colorize_2", + "from_port": 0, + "to": "colorize_3", + "to_port": 0 + }, + { + "from": "colorize_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "transform", + "from_port": 0, + "to": "colorize_2", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "uniform_greyscale", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "perlin_2", + "from_port": 0, + "to": "blend_2", + "to_port": 0 + }, + { + "from": "blend_2", + "from_port": 0, + "to": "transform", + "to_port": 2 + }, + { + "from": "uniform_greyscale_2", + "from_port": 0, + "to": "blend_2", + "to_port": 1 + }, + { + "from": "colorize_4", + "from_port": 0, + "to": "warp", + "to_port": 1 + }, + { + "from": "blend_3", + "from_port": 0, + "to": "transform", + "to_port": 0 + }, + { + "from": "voronoi", + "from_port": 0, + "to": "transform_2", + "to_port": 0 + }, + { + "from": "transform_2", + "from_port": 0, + "to": "colorize_4", + "to_port": 0 + }, + { + "from": "transform_2", + "from_port": 0, + "to": "colorize_5", + "to_port": 0 + }, + { + "from": "perlin", + "from_port": 0, + "to": "colorize_6", + "to_port": 0 + }, + { + "from": "colorize_6", + "from_port": 0, + "to": "warp", + "to_port": 0 + }, + { + "from": "colorize_5", + "from_port": 0, + "to": "blend_3", + "to_port": 0 + }, + { + "from": "warp", + "from_port": 0, + "to": "blend_3", + "to_port": 1 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "blend", + "from_port": 0, + "to": "normal_map", + "to_port": 0 + }, + { + "from": "normal_map", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + } + ], + "icon": "workflow_materials_wood", + "label": "Wood", + "name": "graph_2", + "nodes": [ + { + "name": "colorize_2", + "node_position": { + "x": -502.779297, + "y": -230.133209 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.204676, + "r": 1 + }, + { + "a": 1, + "b": 0.151042, + "g": 0.151042, + "pos": 0.413767, + "r": 0.151042 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.595585, + "r": 1 + }, + { + "a": 1, + "b": 0.197917, + "g": 0.197917, + "pos": 0.786495, + "r": 0.197917 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.986495, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize", + "node_position": { + "x": -605.5, + "y": 130 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.15625, + "g": 0.15625, + "pos": 0.072727, + "r": 0.15625 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "colorize_3", + "node_position": { + "x": -504.264893, + "y": -169.658966 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.163818, + "g": 0.402123, + "pos": 0, + "r": 0.515625 + }, + { + "a": 1, + "b": 0.377604, + "g": 0.54769, + "pos": 1, + "r": 0.625 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "transform", + "node_position": { + "x": -520.979492, + "y": -423.665527 + }, + "parameters": { + "repeat": false, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0, + "translate_y": 0.1 + }, + "type": "transform" + }, + { + "name": "perlin", + "node_position": { + "x": -519.5, + "y": -819 + }, + "parameters": { + "iterations": 2, + "persistence": 0.8, + "scale_x": 1, + "scale_y": 64 + }, + "type": "perlin" + }, + { + "name": "uniform_greyscale", + "node_position": { + "x": -601.280884, + "y": 198.450867 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -304.030396, + "y": -69.502716 + }, + "parameters": { + "color": 0.3 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3_2", + "node_position": { + "x": -305.030396, + "y": -124.502716 + }, + "parameters": { + "color": 0.8 + }, + "type": "uniform_greyscale" + }, + { + "name": "blend_2", + "node_position": { + "x": -792.692017, + "y": -378.799133 + }, + "parameters": { + "amount": 0.2, + "blend_type": 0 + }, + "type": "blend" + }, + { + "name": "perlin_2", + "node_position": { + "x": -1081.780762, + "y": -422.665527 + }, + "parameters": { + "iterations": 2, + "persistence": 0.5, + "scale_x": 4, + "scale_y": 4 + }, + "type": "perlin" + }, + { + "name": "uniform_greyscale_2", + "node_position": { + "x": -1054.058716, + "y": -292.799133 + }, + "parameters": { + "color": 0.5 + }, + "type": "uniform_greyscale" + }, + { + "name": "scratches", + "node_position": { + "x": -634.5, + "y": -49 + }, + "parameters": { + "Randomness": 0.5, + "angle": 0, + "layers": 5, + "length": 0.02, + "randomness": 0.06, + "waviness": 0.05, + "width": 0.05 + }, + "type": "scratches" + }, + { + "name": "blend", + "node_position": { + "x": -375.280884, + "y": 4.450851 + }, + "parameters": { + "amount": 0.3, + "blend_type": 0 + }, + "type": "blend" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -555.280884, + "y": -959.799133 + }, + "parameters": { + "param0": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.163818, + "g": 0.402123, + "pos": 0, + "r": 0.515625 + }, + { + "a": 1, + "b": 0.377604, + "g": 0.54769, + "pos": 1, + "r": 0.625 + } + ], + "type": "Gradient" + }, + "param1": 0.2, + "param2": 0.3 + }, + "type": "remote", + "widgets": [ + { + "label": "Color", + "linked_widgets": [ + { + "node": "colorize_3", + "widget": "gradient" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Waviness", + "linked_widgets": [ + { + "node": "blend_2", + "widget": "amount" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Scratches", + "linked_widgets": [ + { + "node": "blend", + "widget": "amount" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1378.780762, + "y": -198.650482 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 192.969604, + "y": -125.650482 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "warp", + "node_position": { + "x": -485.120483, + "y": -600.473999 + }, + "parameters": { + "amount": 0.04, + "eps": 0.03, + "epsilon": 0 + }, + "shader_model": { + "global": "", + "inputs": [ + { + "default": "vec4(sin($uv.x*20.0)*0.5+0.5, sin($uv.y*20.0)*0.5+0.5, 0, 1)", + "label": "", + "name": "in", + "type": "rgba" + }, + { + "default": "0.0", + "label": "", + "name": "d", + "type": "f" + } + ], + "instance": "", + "name": "Warp", + "outputs": [ + { + "rgba": "$in($uv+$amount*vec2($d(fract($uv+vec2($eps, 0.0)))-$d(fract($uv-vec2($eps, 0.0))), $d(fract($uv+vec2(0.0, $eps)))-$d(fract($uv-vec2(0.0, $eps)))))", + "type": "rgba" + } + ], + "parameters": [ + { + "default": 0, + "label": "", + "max": 1, + "min": 0, + "name": "amount", + "step": 0.005, + "type": "float", + "widget": "spinbox" + }, + { + "default": 0, + "label": "", + "max": 0.2, + "min": 0.005, + "name": "eps", + "step": 0.005, + "type": "float", + "widget": "spinbox" + } + ] + }, + "type": "shader" + }, + { + "name": "voronoi", + "node_position": { + "x": -1137.120483, + "y": -855.473999 + }, + "parameters": { + "intensity": 1, + "randomness": 1, + "scale_x": 2, + "scale_y": 2, + "stretch_x": 1, + "stretch_y": 1 + }, + "type": "voronoi" + }, + { + "name": "colorize_4", + "node_position": { + "x": -876.015137, + "y": -678.105591 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0.46875, + "g": 0.46875, + "pos": 0.318182, + "r": 0.46875 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "blend_3", + "node_position": { + "x": -526.015137, + "y": -516.105591 + }, + "parameters": { + "amount": 1, + "blend_type": 10 + }, + "type": "blend" + }, + { + "name": "colorize_5", + "node_position": { + "x": -876.015137, + "y": -614.105591 + }, + "parameters": { + "gradient": { + "interpolation": 2, + "points": [ + { + "a": 1, + "b": 0, + "g": 0, + "pos": 0.063636, + "r": 0 + }, + { + "a": 1, + "b": 0.072917, + "g": 0.072917, + "pos": 0.118182, + "r": 0.072917 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0.118182, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "transform_2", + "node_position": { + "x": -1135.610352, + "y": -670.105591 + }, + "parameters": { + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 0.5, + "translate_x": 0, + "translate_y": 0 + }, + "type": "transform" + }, + { + "name": "colorize_6", + "node_position": { + "x": -494.895752, + "y": -689.355591 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.140625, + "g": 0.140625, + "pos": 0, + "r": 0.140625 + }, + { + "a": 1, + "b": 1, + "g": 1, + "pos": 1, + "r": 1 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "combine", + "node_position": { + "x": -102.834259, + "y": -117.463135 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "uniform", + "node_position": { + "x": 28.165741, + "y": -71.463135 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "normal_map", + "node_position": { + "x": -71.142059, + "y": 4.536865 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 1, + "param2": 0, + "param3": 0, + "param4": 0, + "size": 4 + }, + "type": "normal_map" + } + ], + "parameters": { + "param0": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 0.163818, + "g": 0.402123, + "pos": 0, + "r": 0.515625 + }, + { + "a": 1, + "b": 0.377604, + "g": 0.54769, + "pos": 1, + "r": 0.625 + } + ], + "type": "Gradient" + }, + "param1": 0.2, + "param2": 0.3 + }, + "tree_item": "Workflow/Materials/Wood", + "type": "graph" + }, + { + "collapsed": true, + "connections": [ + { + "from": "uniform_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "uniform_greyscale_3_2", + "from_port": 0, + "to": "combine", + "to_port": 0 + }, + { + "from": "uniform_greyscale_3", + "from_port": 0, + "to": "combine", + "to_port": 1 + }, + { + "from": "uniform_greyscale_4", + "from_port": 0, + "to": "combine", + "to_port": 2 + }, + { + "from": "uniform_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "combine", + "from_port": 0, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "uniform", + "from_port": 0, + "to": "gen_outputs", + "to_port": 2 + } + ], + "icon": "workflow_materials_template", + "label": "Material template", + "name": "graph_2_2_2", + "nodes": [ + { + "name": "uniform_greyscale_3_2", + "node_position": { + "x": -608.322693, + "y": -181.48642 + }, + "parameters": { + "color": 1 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_4", + "node_position": { + "x": -608.322693, + "y": -79.48642 + }, + "parameters": { + "color": 0 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_greyscale_3", + "node_position": { + "x": -608.322693, + "y": -130.48642 + }, + "parameters": { + "color": 0.5 + }, + "type": "uniform_greyscale" + }, + { + "name": "uniform_2", + "node_position": { + "x": -570.908142, + "y": 34.666931 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0.501961, + "r": 0.501961, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "uniform_3", + "node_position": { + "x": -572.322693, + "y": -236.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 0.494118, + "g": 0.494118, + "r": 0.494118, + "type": "Color" + } + }, + "type": "uniform" + }, + { + "name": "combine", + "node_position": { + "x": -410.322693, + "y": -141.48642 + }, + "parameters": { + "color": { + "a": 1, + "b": 1, + "g": 1, + "r": 1, + "type": "Color" + }, + "name": 0 + }, + "type": "combine" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -743.322693, + "y": -145.585464 + }, + "parameters": { + + }, + "ports": [ + + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -206.322693, + "y": -144.585464 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -652.30249, + "y": -398.925568 + }, + "parameters": { + "param0": { + "a": 1, + "b": 0.494118, + "g": 0.494118, + "r": 0.494118, + "type": "Color" + }, + "param1": 0.5, + "param2": 0, + "param3": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "remote", + "widgets": [ + { + "label": "Albedo", + "linked_widgets": [ + { + "node": "uniform_3", + "widget": "color" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Roughness", + "linked_widgets": [ + { + "node": "uniform_greyscale_3", + "widget": "color" + } + ], + "name": "param1", + "type": "linked_control" + }, + { + "label": "Metallic", + "linked_widgets": [ + { + "node": "uniform_greyscale_4", + "widget": "color" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Emission", + "linked_widgets": [ + { + "node": "uniform", + "widget": "color" + } + ], + "name": "param3", + "type": "linked_control" + } + ] + }, + { + "name": "uniform", + "node_position": { + "x": -569.80249, + "y": -21.425568 + }, + "parameters": { + "color": { + "a": 1, + "b": 0, + "g": 0, + "r": 0, + "type": "Color" + } + }, + "type": "uniform" + } + ], + "parameters": { + "param0": { + "a": 1, + "b": 0.494118, + "g": 0.494118, + "r": 0.494118, + "type": "Color" + }, + "param1": 0.5, + "param2": 0 + }, + "tree_item": "Workflow/Materials/Template", + "type": "graph" + }, { "collapsed": false, "tree_item": "Miscellaneous" diff --git a/addons/material_maker/library/base/3d_box.png b/addons/material_maker/library/base/3d_box.png new file mode 100644 index 0000000..ad72eb3 Binary files /dev/null and b/addons/material_maker/library/base/3d_box.png differ diff --git a/addons/material_maker/library/base/3d_sdf_operators_morph.png b/addons/material_maker/library/base/3d_sdf_operators_morph.png new file mode 100644 index 0000000..ac7bba8 Binary files /dev/null and b/addons/material_maker/library/base/3d_sdf_operators_morph.png differ diff --git a/addons/material_maker/library/base/3d_sphere.png b/addons/material_maker/library/base/3d_sphere.png new file mode 100644 index 0000000..8aa6e49 Binary files /dev/null and b/addons/material_maker/library/base/3d_sphere.png differ diff --git a/addons/material_maker/library/base/filter_greyscale.png b/addons/material_maker/library/base/filter_greyscale.png new file mode 100644 index 0000000..eab7eee Binary files /dev/null and b/addons/material_maker/library/base/filter_greyscale.png differ diff --git a/addons/material_maker/library/base/simple_sdf_operators_sdmorph.png b/addons/material_maker/library/base/simple_sdf_operators_sdmorph.png new file mode 100644 index 0000000..eb64156 Binary files /dev/null and b/addons/material_maker/library/base/simple_sdf_operators_sdmorph.png differ diff --git a/addons/material_maker/library/base/workflow_applymap.png b/addons/material_maker/library/base/workflow_applymap.png new file mode 100644 index 0000000..3b30391 Binary files /dev/null and b/addons/material_maker/library/base/workflow_applymap.png differ diff --git a/addons/material_maker/library/base/workflow_createmap.png b/addons/material_maker/library/base/workflow_createmap.png new file mode 100644 index 0000000..ff20a06 Binary files /dev/null and b/addons/material_maker/library/base/workflow_createmap.png differ diff --git a/addons/material_maker/library/base/workflow_materials_marble.png b/addons/material_maker/library/base/workflow_materials_marble.png new file mode 100644 index 0000000..2f348ae Binary files /dev/null and b/addons/material_maker/library/base/workflow_materials_marble.png differ diff --git a/addons/material_maker/library/base/workflow_materials_metal.png b/addons/material_maker/library/base/workflow_materials_metal.png new file mode 100644 index 0000000..bddac38 Binary files /dev/null and b/addons/material_maker/library/base/workflow_materials_metal.png differ diff --git a/addons/material_maker/library/base/workflow_materials_template.png b/addons/material_maker/library/base/workflow_materials_template.png new file mode 100644 index 0000000..978ae92 Binary files /dev/null and b/addons/material_maker/library/base/workflow_materials_template.png differ diff --git a/addons/material_maker/library/base/workflow_materials_wood.png b/addons/material_maker/library/base/workflow_materials_wood.png new file mode 100644 index 0000000..17e46d3 Binary files /dev/null and b/addons/material_maker/library/base/workflow_materials_wood.png differ diff --git a/addons/material_maker/library/base/workflow_mix.png b/addons/material_maker/library/base/workflow_mix.png new file mode 100644 index 0000000..54823c8 Binary files /dev/null and b/addons/material_maker/library/base/workflow_mix.png differ diff --git a/addons/material_maker/library/base/workflow_mixmap.png b/addons/material_maker/library/base/workflow_mixmap.png new file mode 100644 index 0000000..ca9ba96 Binary files /dev/null and b/addons/material_maker/library/base/workflow_mixmap.png differ diff --git a/addons/material_maker/library/base/workflow_output.png b/addons/material_maker/library/base/workflow_output.png new file mode 100644 index 0000000..aec38f0 Binary files /dev/null and b/addons/material_maker/library/base/workflow_output.png differ diff --git a/addons/material_maker/main_window.gd b/addons/material_maker/main_window.gd index 0139047..686ed6a 100644 --- a/addons/material_maker/main_window.gd +++ b/addons/material_maker/main_window.gd @@ -513,7 +513,8 @@ func _on_Projects_tab_changed(tab) -> void: if c.method_name == "update_preview" or c.method_name == "update_preview_2d": c.source.disconnect(c.signal_name, self, c.method_name) new_tab.connect("graph_changed", self, "update_preview") - new_tab.connect("node_selected", self, "on_selected_node_change") + if !new_tab.is_connected("node_selected", self, "on_selected_node_change"): + new_tab.connect("node_selected", self, "on_selected_node_change") current_tab = new_tab update_preview() diff --git a/addons/material_maker/nodes/beehive.mmg b/addons/material_maker/nodes/beehive.mmg new file mode 100644 index 0000000..15f901f --- /dev/null +++ b/addons/material_maker/nodes/beehive.mmg @@ -0,0 +1,55 @@ +{ + "name": "beehive", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "sx": 4, + "sy": 4 + }, + "shader_model": { + "code": "vec2 $(name_uv)_uv = $uv*vec2($sx, $sy*1.73205080757);\nvec4 $(name_uv)_center = beehive_center($(name_uv)_uv);", + "global": "float beehive_dist(vec2 p){\n\tvec2 s = vec2(1.0, 1.73205080757);\n p = abs(p);\n return max(dot(p, s*.5), p.x);\n}\n\nvec4 beehive_center(vec2 p) {\n\tvec2 s = vec2(1.0, 1.73205080757);\n vec4 hC = floor(vec4(p, p - vec2(.5, 1))/vec4(s,s)) + .5;\n vec4 h = vec4(p - hC.xy*s, p - (hC.zw + .5)*s);\n return dot(h.xy, h.xy)tF || tF<0.0) return 1.0;\n return tN;\n}", + "inputs": [ + + ], + "instance": "", + "name": "Box", + "outputs": [ + { + "f": "1.0-box($uv, vec3($cx, $cy, $cz), vec3($sx, $sy, $sz), 0.01745329251*vec3($rx, $ry, $rz))", + "type": "f" + } + ], + "parameters": [ + { + "default": 0.5, + "label": "Center X", + "max": 1, + "min": 0, + "name": "cx", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Center Y", + "max": 1, + "min": 0, + "name": "cy", + "step": 0.01, + "type": "float" + }, + { + "default": 0, + "label": "Center Z", + "max": 0.5, + "min": -0.5, + "name": "cz", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Size X", + "max": 1, + "min": 0, + "name": "sx", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Size Y", + "max": 1, + "min": 0, + "name": "sy", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Size Z", + "max": 1, + "min": 0, + "name": "sz", + "step": 0.01, + "type": "float" + }, + { + "default": 0, + "label": "Rot X", + "max": 180, + "min": -180, + "name": "rx", + "step": 0.1, + "type": "float" + }, + { + "default": 0, + "label": "Rot Y", + "max": 180, + "min": -180, + "name": "ry", + "step": 0.1, + "type": "float" + }, + { + "default": 0, + "label": "Rot Z", + "max": 180, + "min": -180, + "name": "rz", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/bricks.mmg b/addons/material_maker/nodes/bricks.mmg index 4680cf9..7246a9e 100644 --- a/addons/material_maker/nodes/bricks.mmg +++ b/addons/material_maker/nodes/bricks.mmg @@ -7,19 +7,21 @@ "parameters": { "bevel": 0.1, "columns": 3, + "corner": 0, "mortar": 0.1, "pattern": 0, "repeat": 1, + "round": 0, "row_offset": 0.5, "rows": 6 }, "shader_model": { - "code": "vec4 $(name_uv) = $(name)_xyzw($(uv));\n", - "global": "vec4 brick(vec2 uv, vec2 bmin, vec2 bmax, float mortar, float bevel) {\n\tfloat color;\n\tvec2 c1 = (uv-bmin-vec2(mortar))/bevel;\n\tvec2 c2 = (bmax-uv-vec2(mortar))/bevel;\n\tvec2 c = min(c1, c2);\n\tcolor = clamp(min(c.x, c.y), 0.0, 1.0);\n\tvec2 tiled_brick_pos = mod(bmin, vec2(1.0, 1.0));\n\treturn vec4(color, 0.5*(bmin+bmax), tiled_brick_pos.x+7.0*tiled_brick_pos.y);\n}\n\nvec4 bricks_rb(vec2 uv, vec2 count, float repeat, float offset, float mortar, float bevel) {\n\tcount *= repeat;\n\tmortar /= max(count.x, count.y);\n\tbevel /= max(count.x, count.y);\n\tfloat x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));\n\tvec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));\n\tbmin.x += x_offset;\n\tbmin /= count;\n\treturn brick(uv, bmin, bmin+vec2(1.0)/count, mortar, bevel);\n}\n\nvec4 bricks_rb2(vec2 uv, vec2 count, float repeat, float offset, float mortar, float bevel) {\n\tcount *= repeat;\n\tmortar /= max(2.0*count.x, count.y);\n\tbevel /= max(2.0*count.x, count.y);\n\tfloat x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));\n\tcount.x = count.x*(1.0+step(0.5, fract(uv.y*count.y*0.5)));\n\tvec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));\n\tbmin.x += x_offset;\n\tbmin /= count;\n\treturn brick(uv, bmin, bmin+vec2(1.0)/count, mortar, bevel);\n}\n\nvec4 bricks_hb(vec2 uv, vec2 count, float repeat, float offset, float mortar, float bevel) {\n\tfloat pc = count.x+count.y;\n\tfloat c = pc*repeat;\n\tmortar /= c;\n\tbevel /= c;\n\tvec2 corner = floor(uv*c);\n\tfloat cdiff = mod(corner.x-corner.y, pc);\n\tif (cdiff < count.x) {\n\t\treturn brick(uv, (corner-vec2(cdiff, 0.0))/c, (corner-vec2(cdiff, 0.0)+vec2(count.x, 1.0))/c, mortar, bevel);\n\t} else {\n\t\treturn brick(uv, (corner-vec2(0.0, pc-cdiff-1.0))/c, (corner-vec2(0.0, pc-cdiff-1.0)+vec2(1.0, count.y))/c, mortar, bevel);\n\t}\n}\n\nvec4 bricks_bw(vec2 uv, vec2 count, float repeat, float offset, float mortar, float bevel) {\n\tvec2 c = 2.0*count*repeat;\n\tfloat mc = max(c.x, c.y);\n\tmortar /= mc;\n\tbevel /= mc;\n\tvec2 corner1 = floor(uv*c);\n\tvec2 corner2 = count*floor(repeat*2.0*uv);\n\tfloat cdiff = mod(dot(floor(repeat*2.0*uv), vec2(1.0)), 2.0);\n\tvec2 corner;\n\tvec2 size;\n\tif (cdiff == 0.0) {\n\t\tcorner = vec2(corner1.x, corner2.y);\n\t\tsize = vec2(1.0, count.y);\n\t} else {\n\t\tcorner = vec2(corner2.x, corner1.y);\n\t\tsize = vec2(count.x, 1.0);\n\t}\n\treturn brick(uv, corner/c, (corner+size)/c, mortar, bevel);\n}\n\nvec4 bricks_sb(vec2 uv, vec2 count, float repeat, float offset, float mortar, float bevel) {\n\tvec2 c = (count+vec2(1.0))*repeat;\n\tfloat mc = max(c.x, c.y);\n\tmortar /= mc;\n\tbevel /= mc;\n\tvec2 corner1 = floor(uv*c);\n\tvec2 corner2 = (count+vec2(1.0))*floor(repeat*uv);\n\tvec2 rcorner = corner1 - corner2;\n\tvec2 corner;\n\tvec2 size;\n\tif (rcorner.x == 0.0 && rcorner.y < count.y) {\n\t\tcorner = corner2;\n\t\tsize = vec2(1.0, count.y);\n\t} else if (rcorner.y == 0.0) {\n\t\tcorner = corner2+vec2(1.0, 0.0);\n\t\tsize = vec2(count.x, 1.0);\n\t} else if (rcorner.x == count.x) {\n\t\tcorner = corner2+vec2(count.x, 1.0);\n\t\tsize = vec2(1.0, count.y);\n\t} else if (rcorner.y == count.y) {\n\t\tcorner = corner2+vec2(0.0, count.y);\n\t\tsize = vec2(count.x, 1.0);\n\t} else {\n\t\tcorner = corner2+vec2(1.0);\n\t\tsize = vec2(count.x-1.0, count.y-1.0);\n\t}\n\treturn brick(uv, corner/c, (corner+size)/c, mortar, bevel);\n}", + "code": "vec4 $(name_uv)_rect = bricks_$pattern($uv, vec2($columns, $rows), $repeat, $row_offset);\nvec4 $(name_uv) = brick($uv, $(name_uv)_rect.xy, $(name_uv)_rect.zw, $mortar, $round, max(0.001, $bevel));\n", + "global": "vec4 brick(vec2 uv, vec2 bmin, vec2 bmax, float mortar, float round, float bevel) {\n\tfloat color;\n\tvec2 size = bmax - bmin;\n\tfloat min_size = min(size.x, size.y);\n\tmortar *= min_size;\n\tbevel *= min_size;\n\tround *= min_size;\n\tvec2 center = 0.5*(bmin+bmax);\n vec2 d = abs(uv-center)-0.5*(size)+vec2(round+mortar);\n color = length(max(d,vec2(0))) + min(max(d.x,d.y),0.0)-round;\n\tcolor = clamp(-color/bevel, 0.0, 1.0);\n\tvec2 tiled_brick_pos = mod(bmin, vec2(1.0, 1.0));\n\treturn vec4(color, center, tiled_brick_pos.x+7.0*tiled_brick_pos.y);\n}\n\nvec3 brick_uv(vec2 uv, vec2 bmin, vec2 bmax) {\n\tvec2 center = 0.5*(bmin + bmax);\n\tvec2 size = bmax - bmin;\n\tfloat max_size = max(size.x, size.y);\n\treturn vec3(0.5+(uv-center)/max_size, 0.0);\n}\n\nvec3 brick_corner_uv(vec2 uv, vec2 bmin, vec2 bmax, float mortar, float corner) {\n\tvec2 center = 0.5*(bmin + bmax);\n\tvec2 size = bmax - bmin;\n\tfloat max_size = max(size.x, size.y);\n\tfloat min_size = min(size.x, size.y);\n\tmortar *= min_size;\n\tcorner *= min_size;\n\treturn vec3(clamp((0.5*size-vec2(mortar)-abs(uv-center))/corner, vec2(0.0), vec2(1.0)), 0.0);\n}\n\nvec4 bricks_rb(vec2 uv, vec2 count, float repeat, float offset) {\n\tcount *= repeat;\n\tfloat x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));\n\tvec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));\n\tbmin.x += x_offset;\n\tbmin /= count;\n\treturn vec4(bmin, bmin+vec2(1.0)/count);\n}\n\nvec4 bricks_rb2(vec2 uv, vec2 count, float repeat, float offset) {\n\tcount *= repeat;\n\tfloat x_offset = offset*step(0.5, fract(uv.y*count.y*0.5));\n\tcount.x = count.x*(1.0+step(0.5, fract(uv.y*count.y*0.5)));\n\tvec2 bmin = floor(vec2(uv.x*count.x-x_offset, uv.y*count.y));\n\tbmin.x += x_offset;\n\tbmin /= count;\n\treturn vec4(bmin, bmin+vec2(1.0)/count);\n}\n\nvec4 bricks_hb(vec2 uv, vec2 count, float repeat, float offset) {\n\tfloat pc = count.x+count.y;\n\tfloat c = pc*repeat;\n\tvec2 corner = floor(uv*c);\n\tfloat cdiff = mod(corner.x-corner.y, pc);\n\tif (cdiff < count.x) {\n\t\treturn vec4((corner-vec2(cdiff, 0.0))/c, (corner-vec2(cdiff, 0.0)+vec2(count.x, 1.0))/c);\n\t} else {\n\t\treturn vec4((corner-vec2(0.0, pc-cdiff-1.0))/c, (corner-vec2(0.0, pc-cdiff-1.0)+vec2(1.0, count.y))/c);\n\t}\n}\n\nvec4 bricks_bw(vec2 uv, vec2 count, float repeat, float offset) {\n\tvec2 c = 2.0*count*repeat;\n\tfloat mc = max(c.x, c.y);\n\tvec2 corner1 = floor(uv*c);\n\tvec2 corner2 = count*floor(repeat*2.0*uv);\n\tfloat cdiff = mod(dot(floor(repeat*2.0*uv), vec2(1.0)), 2.0);\n\tvec2 corner;\n\tvec2 size;\n\tif (cdiff == 0.0) {\n\t\tcorner = vec2(corner1.x, corner2.y);\n\t\tsize = vec2(1.0, count.y);\n\t} else {\n\t\tcorner = vec2(corner2.x, corner1.y);\n\t\tsize = vec2(count.x, 1.0);\n\t}\n\treturn vec4(corner/c, (corner+size)/c);\n}\n\nvec4 bricks_sb(vec2 uv, vec2 count, float repeat, float offset) {\n\tvec2 c = (count+vec2(1.0))*repeat;\n\tfloat mc = max(c.x, c.y);\n\tvec2 corner1 = floor(uv*c);\n\tvec2 corner2 = (count+vec2(1.0))*floor(repeat*uv);\n\tvec2 rcorner = corner1 - corner2;\n\tvec2 corner;\n\tvec2 size;\n\tif (rcorner.x == 0.0 && rcorner.y < count.y) {\n\t\tcorner = corner2;\n\t\tsize = vec2(1.0, count.y);\n\t} else if (rcorner.y == 0.0) {\n\t\tcorner = corner2+vec2(1.0, 0.0);\n\t\tsize = vec2(count.x, 1.0);\n\t} else if (rcorner.x == count.x) {\n\t\tcorner = corner2+vec2(count.x, 1.0);\n\t\tsize = vec2(1.0, count.y);\n\t} else if (rcorner.y == count.y) {\n\t\tcorner = corner2+vec2(0.0, count.y);\n\t\tsize = vec2(count.x, 1.0);\n\t} else {\n\t\tcorner = corner2+vec2(1.0);\n\t\tsize = vec2(count.x-1.0, count.y-1.0);\n\t}\n\treturn vec4(corner/c, (corner+size)/c);\n}", "inputs": [ ], - "instance": "vec4 $(name)_xyzw(vec2 uv) {\n return bricks_$(pattern)(uv, vec2($(columns), $(rows)), $(repeat), $(row_offset), $(mortar), max(0.001, $(bevel)));\n}", + "instance": "", "name": "Bricks", "outputs": [ { @@ -37,6 +39,18 @@ { "f": "$(name_uv).z", "type": "f" + }, + { + "rgb": "brick_uv($uv, $(name_uv)_rect.xy, $(name_uv)_rect.zw)", + "type": "rgb" + }, + { + "rgb": "brick_corner_uv($uv, $(name_uv)_rect.xy, $(name_uv)_rect.zw, $mortar, $corner)", + "type": "rgb" + }, + { + "f": "0.5*(sign($(name_uv)_rect.z-$(name_uv)_rect.x-$(name_uv)_rect.w+$(name_uv)_rect.y)+1.0)", + "type": "f" } ], "parameters": [ @@ -69,6 +83,7 @@ ] }, { + "control": "None", "default": 1, "label": "Repeat:", "max": 8, @@ -78,6 +93,7 @@ "type": "float" }, { + "control": "None", "default": 6, "label": "Rows:", "max": 64, @@ -87,6 +103,7 @@ "type": "float" }, { + "control": "None", "default": 3, "label": "Columns:", "max": 64, @@ -96,6 +113,7 @@ "type": "float" }, { + "control": "None", "default": 0.5, "label": "Offset:", "max": 1, @@ -105,21 +123,43 @@ "type": "float" }, { + "control": "None", "default": 0.1, "label": "Mortar:", "max": 0.5, "min": 0, "name": "mortar", - "step": 0, + "step": 0.01, "type": "float" }, { + "control": "None", "default": 0.1, "label": "Bevel:", "max": 0.5, "min": 0, "name": "bevel", - "step": 0, + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Round:", + "max": 0.5, + "min": 0, + "name": "round", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0.1, + "label": "Corner:", + "max": 0.5, + "min": 0, + "name": "corner", + "step": 0.01, "type": "float" } ] diff --git a/addons/material_maker/nodes/custom_uv.mmg b/addons/material_maker/nodes/custom_uv.mmg new file mode 100644 index 0000000..0d51dc8 --- /dev/null +++ b/addons/material_maker/nodes/custom_uv.mmg @@ -0,0 +1,40 @@ +{ + "name": "custom_uv", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec4(1.0)", + "label": "Input", + "name": "in", + "type": "rgba" + }, + { + "default": "0.0", + "label": "UV", + "name": "map", + "type": "rgb" + } + ], + "instance": "", + "name": "Custom UV", + "outputs": [ + { + "rgba": "$in($map($uv).xy)", + "type": "rgba" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/edge_detect_1.mmg b/addons/material_maker/nodes/edge_detect_1.mmg new file mode 100644 index 0000000..b68429c --- /dev/null +++ b/addons/material_maker/nodes/edge_detect_1.mmg @@ -0,0 +1 @@ +{"convolution_params":{"name":"Edge detect 1","input_type":"rgb","matrix":[[-1,-1,-1],[-1,8,-1],[-1,-1,-1]],"output_type":"rgb","x":1,"y":1},"name":"edge_detect","node_position":{"x":0,"y":0},"parameters":{"size":10},"type":"convolution"} \ No newline at end of file diff --git a/addons/material_maker/nodes/edge_detect_2.mmg b/addons/material_maker/nodes/edge_detect_2.mmg new file mode 100644 index 0000000..764882b --- /dev/null +++ b/addons/material_maker/nodes/edge_detect_2.mmg @@ -0,0 +1 @@ +{"convolution_params":{"name":"Edge detect 2","input_type":"rgb","matrix":[[0,-1,0],[-1,4,-1],[0,-1,0]],"output_type":"rgb","x":1,"y":1},"name":"edge_detect","node_position":{"x":0,"y":0},"parameters":{"size":10},"type":"convolution"} \ No newline at end of file diff --git a/addons/material_maker/nodes/edge_detect_3.mmg b/addons/material_maker/nodes/edge_detect_3.mmg new file mode 100644 index 0000000..1cfeca7 --- /dev/null +++ b/addons/material_maker/nodes/edge_detect_3.mmg @@ -0,0 +1 @@ +{"convolution_params":{"name":"Edge detect 3","input_type":"rgb","matrix":[[1,0,-1],[0,0,0],[-1,0,1]],"output_type":"rgb","x":1,"y":1},"name":"edge_detect","node_position":{"x":0,"y":0},"parameters":{"size":10},"type":"convolution"} \ No newline at end of file diff --git a/addons/material_maker/nodes/generic.gd b/addons/material_maker/nodes/generic.gd index 1257c89..fbdb36c 100644 --- a/addons/material_maker/nodes/generic.gd +++ b/addons/material_maker/nodes/generic.gd @@ -14,13 +14,13 @@ var preview_timer : Timer = null func set_generator(g) -> void: .set_generator(g) generator.connect("parameter_changed", self, "on_parameter_changed") - call_deferred("update_node") + update_node() func on_parameter_changed(p, v) -> void: if ignore_parameter_change == p: return if p == "__update_all__": - call_deferred("update_node") + update_node() elif controls.has(p): var o = controls[p] if o is MMFloatEdit: @@ -158,6 +158,7 @@ func restore_preview_widget() -> void: func update_node() -> void: # Clean node var custom_node_buttons = null + clear_all_slots() save_preview_widget() for c in get_children(): remove_child(c) @@ -327,7 +328,7 @@ func do_load_generator(file_name : String) -> void: var parent_generator = generator.get_parent() parent_generator.replace_generator(generator, new_generator) generator = new_generator - call_deferred("update_node") + update_node() func save_generator() -> void: var dialog = FileDialog.new() diff --git a/addons/material_maker/nodes/greyscale.mmg b/addons/material_maker/nodes/greyscale.mmg new file mode 100644 index 0000000..7941ae8 --- /dev/null +++ b/addons/material_maker/nodes/greyscale.mmg @@ -0,0 +1,64 @@ +{ + "name": "greyscale", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "brightness": 0, + "contrast": 1, + "mode": 2, + "steps": 6 + }, + "shader_model": { + "code": "", + "global": "float gs_min(vec3 c) {\n\treturn min(c.r, min(c.g, c.b));\n}\nfloat gs_max(vec3 c) {\n\treturn max(c.r, max(c.g, c.b));\n}\nfloat gs_lightness(vec3 c) {\n\treturn 0.5*(max(c.r, max(c.g, c.b)) + min(c.r, min(c.g, c.b)));\n}\nfloat gs_average(vec3 c) {\n\treturn 0.333333333333*(c.r + c.g + c.b);\n}\nfloat gs_luminosity(vec3 c) {\n\treturn 0.21 * c.r + 0.72 * c.g + 0.07 * c.b;\n}\n", + "inputs": [ + { + "default": "vec3(0.0)", + "label": "", + "name": "in", + "type": "rgb" + } + ], + "instance": "", + "name": "Greyscale", + "outputs": [ + { + "f": "gs_$mode($in($uv))", + "type": "f" + } + ], + "parameters": [ + { + "default": 4, + "label": "", + "name": "mode", + "type": "enum", + "values": [ + { + "name": "Lightness", + "value": "lightness" + }, + { + "name": "Average", + "value": "average" + }, + { + "name": "Luminosity", + "value": "luminosity" + }, + { + "name": "Min", + "value": "min" + }, + { + "name": "Max", + "value": "max" + } + ] + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/invert.mmg b/addons/material_maker/nodes/invert.mmg index 372758e..2285af8 100644 --- a/addons/material_maker/nodes/invert.mmg +++ b/addons/material_maker/nodes/invert.mmg @@ -12,7 +12,7 @@ "global": "", "inputs": [ { - "default": "0.0", + "default": "vec4(1.0, 1.0, 1.0, 1.0)", "label": "", "name": "in", "type": "rgba" diff --git a/addons/material_maker/nodes/mwf_create_map.mmg b/addons/material_maker/nodes/mwf_create_map.mmg new file mode 100644 index 0000000..4aa319b --- /dev/null +++ b/addons/material_maker/nodes/mwf_create_map.mmg @@ -0,0 +1,60 @@ +{ + "name": "mwf_create_map", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "angle": 0, + "height": 1 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "1.0", + "label": "", + "name": "h", + "type": "f" + }, + { + "default": "0.0", + "label": "", + "name": "o", + "type": "f" + } + ], + "instance": "", + "name": "Create Map", + "outputs": [ + { + "rgb": "vec3($height*$h($uv), $angle*0.00277777777+0.5, rand(vec2(float($seed)+$o($uv))))", + "type": "rgb" + } + ], + "parameters": [ + { + "control": "None", + "default": 1, + "label": "Height", + "max": 1, + "min": 0, + "name": "height", + "step": 0.01, + "type": "float" + }, + { + "control": "None", + "default": 0, + "label": "Angle", + "max": 180, + "min": -180, + "name": "angle", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/mwf_map.mmg b/addons/material_maker/nodes/mwf_map.mmg new file mode 100644 index 0000000..77a56b5 --- /dev/null +++ b/addons/material_maker/nodes/mwf_map.mmg @@ -0,0 +1,74 @@ +{ + "name": "mwf_map", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "float $(name_uv)_angle = 6.28318530718*($map($uv).y-0.5);\nvec2 $(name_uv)_uv = matmap_uv($uv, $(name_uv)_angle, $map($uv).z);\n", + "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(1.0, 0.5, 0.0)", + "label": "Map", + "name": "map", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "Albedo", + "name": "mat1", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "ORM", + "name": "mat2", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "Emission", + "name": "mat3", + "type": "rgb" + }, + { + "default": "vec3(0.5, 0.5, 1.0)", + "label": "Normal", + "name": "mat4", + "type": "rgb" + } + ], + "instance": "", + "name": "Apply Map", + "outputs": [ + { + "f": "$map($uv).x", + "type": "f" + }, + { + "rgb": "$mat1($(name_uv)_uv)", + "type": "rgb" + }, + { + "rgb": "$mat2($(name_uv)_uv)", + "type": "rgb" + }, + { + "rgb": "$mat3($(name_uv)_uv)", + "type": "rgb" + }, + { + "rgb": "matmap_rotate_nm($mat4($(name_uv)_uv), -$(name_uv)_angle)", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/mwf_mix.mmg b/addons/material_maker/nodes/mwf_mix.mmg new file mode 100644 index 0000000..28f3341 --- /dev/null +++ b/addons/material_maker/nodes/mwf_mix.mmg @@ -0,0 +1,104 @@ +{ + "name": "mwf_mix", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + + }, + "shader_model": { + "code": "float $(name_uv)_a1 = step($h1($uv), $h2($uv));", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "Height 1", + "name": "h1", + "type": "f" + }, + { + "default": "vec3(0.0)", + "label": "Color 1", + "name": "c1", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "ORM 1", + "name": "orm1", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "Emission 1", + "name": "em1", + "type": "rgb" + }, + { + "default": "vec3(0.5, 0.5, 1.0)", + "label": "Normal 1", + "name": "nm1", + "type": "rgb" + }, + { + "default": "0.0", + "label": "Height 2", + "name": "h2", + "type": "f" + }, + { + "default": "vec3(0.0)", + "label": "Color 2", + "name": "c2", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "ORM 2", + "name": "orm2", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "Emission 2", + "name": "em2", + "type": "rgb" + }, + { + "default": "vec3(0.5, 0.5, 1.0)", + "label": "Normal 2", + "name": "nm2", + "type": "rgb" + } + ], + "instance": "", + "name": "Mix", + "outputs": [ + { + "f": "max($h1($uv), $h2($uv))", + "type": "f" + }, + { + "rgb": "mix($c1($uv), $c2($uv), $(name_uv)_a1)", + "type": "rgb" + }, + { + "rgb": "mix($orm1($uv), $orm2($uv), $(name_uv)_a1)", + "type": "rgb" + }, + { + "rgb": "mix($em1($uv), $em2($uv), $(name_uv)_a1)", + "type": "rgb" + }, + { + "rgb": "mix($nm1($uv), $nm2($uv), $(name_uv)_a1)", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/mwf_mix_maps.mmg b/addons/material_maker/nodes/mwf_mix_maps.mmg new file mode 100644 index 0000000..44d99c9 --- /dev/null +++ b/addons/material_maker/nodes/mwf_mix_maps.mmg @@ -0,0 +1,53 @@ +{ + "name": "mwf_mix_maps", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "angle": 45, + "height": 0.8 + }, + "shader_model": { + "code": "", + "global": "vec3 matmap_mix(vec3 in1, vec3 in2) {\n\tfloat is_in1 = step(in2.x, in1.x);\n\t//return vec3(max(in1.x, in2.x), in1.yz*is_in1+in2.yz*(1.0-is_in1));\n\treturn vec3(max(in1.x, in2.x), mix(in2.yz, in1.yz, is_in1));\n}", + "inputs": [ + { + "default": "vec3(0.0)", + "label": "", + "name": "in1", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "", + "name": "in2", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "", + "name": "in3", + "type": "rgb" + }, + { + "default": "vec3(0.0)", + "label": "", + "name": "in4", + "type": "rgb" + } + ], + "instance": "", + "name": "Mix maps", + "outputs": [ + { + "rgb": "matmap_mix(matmap_mix($in1($uv), $in2($uv)), matmap_mix($in3($uv), $in4($uv)))", + "type": "rgb" + } + ], + "parameters": [ + + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/mwf_output.mmg b/addons/material_maker/nodes/mwf_output.mmg new file mode 100644 index 0000000..eebd38c --- /dev/null +++ b/addons/material_maker/nodes/mwf_output.mmg @@ -0,0 +1,615 @@ +{ + "connections": [ + { + "from": "colorize_3", + "from_port": 0, + "to": "gen_outputs", + "to_port": 6 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "colorize_3", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "gaussian_blur", + "to_port": 0 + }, + { + "from": "gaussian_blur", + "from_port": 0, + "to": "gen_outputs", + "to_port": 5 + }, + { + "from": "gen_inputs", + "from_port": 2, + "to": "decompose", + "to_port": 0 + }, + { + "from": "decompose", + "from_port": 1, + "to": "gen_outputs", + "to_port": 2 + }, + { + "from": "decompose", + "from_port": 2, + "to": "gen_outputs", + "to_port": 1 + }, + { + "from": "blend_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 4 + }, + { + "from": "gen_inputs", + "from_port": 1, + "to": "gen_outputs", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 3, + "to": "gen_outputs", + "to_port": 3 + }, + { + "from": "brightness_contrast", + "from_port": 0, + "to": "blend_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 4, + "to": "brightness_contrast", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "normal_map_2", + "to_port": 0 + }, + { + "from": "normal_map_2", + "from_port": 0, + "to": "blend_2", + "to_port": 1 + } + ], + "label": "Output", + "name": "mwf_output", + "node_position": { + "x": 0, + "y": 0 + }, + "nodes": [ + { + "name": "colorize_3", + "node_position": { + "x": -939.637451, + "y": 871.842407 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "connections": [ + { + "from": "buffer", + "from_port": 0, + "to": "blurx_convolution", + "to_port": 0 + }, + { + "from": "buffer_2", + "from_port": 0, + "to": "blurx_convolution_2", + "to_port": 0 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "buffer", + "to_port": 0 + }, + { + "from": "blend", + "from_port": 0, + "to": "colorize", + "to_port": 0 + }, + { + "from": "blurx_convolution", + "from_port": 0, + "to": "buffer_2", + "to_port": 0 + }, + { + "from": "blurx_convolution_2", + "from_port": 0, + "to": "blend", + "to_port": 1 + }, + { + "from": "buffer", + "from_port": 0, + "to": "blend", + "to_port": 0 + }, + { + "from": "colorize", + "from_port": 0, + "to": "_2", + "to_port": 0 + }, + { + "from": "_2", + "from_port": 0, + "to": "gen_outputs", + "to_port": 0 + } + ], + "label": "Occlusion", + "name": "gaussian_blur", + "node_position": { + "x": -994.845825, + "y": 786.968262 + }, + "nodes": [ + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(x/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 50, + "y": 0 + }, + "name": "blurx_convolution", + "node_position": { + "x": -407.5, + "y": -192.5 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer_2", + "node_position": { + "x": -404.875, + "y": -116.625 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "convolution_params": { + "input_type": "rgba", + "matrix_function": "exp(-0.5*(pow(y/sigma, 2.0)))/(6.28318530718 *sigma*sigma)", + "normalized": true, + "output_type": "rgba", + "parameters": [ + { + "max": 50, + "min": 0.05, + "name": "sigma", + "type": "float" + } + ], + "x": 0, + "y": 50 + }, + "name": "blurx_convolution_2", + "node_position": { + "x": -407.125, + "y": -44.375 + }, + "parameters": { + "sigma": 50, + "size": 10 + }, + "type": "convolution" + }, + { + "name": "buffer", + "node_position": { + "x": -408.25, + "y": -265.75 + }, + "parameters": { + "lod": 0, + "size": 10 + }, + "type": "buffer" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -447.666626, + "y": -370.666656 + }, + "parameters": { + "param0": 10, + "param1": 50, + "param2": 1 + }, + "type": "remote", + "widgets": [ + { + "label": "Grid size:", + "linked_widgets": [ + { + "node": "buffer", + "widget": "size" + }, + { + "node": "blurx_convolution", + "widget": "size" + }, + { + "node": "buffer_2", + "widget": "size" + }, + { + "node": "blurx_convolution_2", + "widget": "size" + } + ], + "name": "param0", + "type": "linked_control" + }, + { + "label": "Strength", + "linked_widgets": [ + { + "node": "_2", + "widget": "g" + } + ], + "name": "param2", + "type": "linked_control" + } + ] + }, + { + "name": "gen_inputs", + "node_position": { + "x": -585.666626, + "y": -112.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": 55.547607, + "y": -133.392853 + }, + "parameters": { + + }, + "ports": [ + { + "name": "port0", + "type": "rgba" + } + ], + "type": "ios" + }, + { + "name": "blend", + "node_position": { + "x": -420.79895, + "y": 27.16272 + }, + "parameters": { + "amount": 1, + "blend_type": 11 + }, + "type": "blend" + }, + { + "name": "colorize", + "node_position": { + "x": -167.79895, + "y": -178.83728 + }, + "parameters": { + "gradient": { + "interpolation": 1, + "points": [ + { + "a": 1, + "b": 1, + "g": 1, + "pos": 0, + "r": 1 + }, + { + "a": 1, + "b": 0, + "g": 0, + "pos": 1, + "r": 0 + } + ], + "type": "Gradient" + } + }, + "type": "colorize" + }, + { + "name": "_2", + "node_position": { + "x": -134.403687, + "y": -110.29187 + }, + "parameters": { + "g": 1 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "f" + } + ], + "instance": "", + "name": "", + "outputs": [ + { + "f": "pow($in($uv), $g)", + "type": "f" + } + ], + "parameters": [ + { + "default": 1, + "label": "", + "max": 2, + "min": 0, + "name": "g", + "step": 0.1, + "type": "float" + } + ] + }, + "type": "shader" + } + ], + "parameters": { + "param0": 10, + "param1": 50, + "param2": 1 + }, + "type": "graph" + }, + { + "name": "decompose", + "node_position": { + "x": -924.371338, + "y": 570.25 + }, + "parameters": { + + }, + "type": "decompose" + }, + { + "name": "blend_2", + "node_position": { + "x": -931.305542, + "y": 677.328491 + }, + "parameters": { + "amount": 0.5, + "blend_type": 4 + }, + "type": "blend" + }, + { + "name": "gen_inputs", + "node_position": { + "x": -1336.805542, + "y": 597.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Height", + "type": "f" + }, + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "ORM", + "type": "rgb" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + } + ], + "type": "ios" + }, + { + "name": "gen_outputs", + "node_position": { + "x": -635.305542, + "y": 597.758606 + }, + "parameters": { + + }, + "ports": [ + { + "name": "Albedo", + "type": "rgb" + }, + { + "name": "Metallic", + "type": "f" + }, + { + "name": "Roughness", + "type": "f" + }, + { + "name": "Emission", + "type": "rgb" + }, + { + "name": "Normal", + "type": "rgb" + }, + { + "name": "Occlusion", + "type": "f" + }, + { + "name": "Depth", + "type": "f" + } + ], + "type": "ios" + }, + { + "name": "gen_parameters", + "node_position": { + "x": -1100.881836, + "y": 438.25 + }, + "parameters": { + "param0": 0.5, + "param1": 10, + "param2": 1 + }, + "type": "remote", + "widgets": [ + { + "label": "Occlusion", + "linked_widgets": [ + { + "node": "gaussian_blur", + "widget": "param2" + } + ], + "name": "param2", + "type": "linked_control" + }, + { + "label": "Mat Normal", + "linked_widgets": [ + { + "node": "blend_2", + "widget": "amount" + } + ], + "name": "param0", + "type": "linked_control" + } + ] + }, + { + "name": "brightness_contrast", + "node_position": { + "x": -1177.223877, + "y": 677.062317 + }, + "parameters": { + "brightness": 0, + "contrast": 1, + "steps": 6 + }, + "type": "brightness_contrast" + }, + { + "name": "normal_map_2", + "node_position": { + "x": -1152.5, + "y": 544.75 + }, + "parameters": { + "amount": 0.5, + "param0": 10, + "param1": 1.02, + "param2": 0, + "param3": 0, + "param4": 1, + "size": 4 + }, + "type": "normal_map" + } + ], + "parameters": { + "param0": 0.5, + "param1": 10, + "param2": 1 + }, + "type": "graph" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/normal_map.mmg b/addons/material_maker/nodes/normal_map.mmg index cd1f18f..7bfcb14 100644 --- a/addons/material_maker/nodes/normal_map.mmg +++ b/addons/material_maker/nodes/normal_map.mmg @@ -21,6 +21,18 @@ { "from": "buffer", "from_port": 0, + "to": "switch", + "to_port": 1 + }, + { + "from": "gen_inputs", + "from_port": 0, + "to": "switch", + "to_port": 0 + }, + { + "from": "switch", + "from_port": 0, "to": "nm_convolution", "to_port": 0 } @@ -36,9 +48,10 @@ "name": "buffer", "node_position": { "x": -687.663818, - "y": 125.60614 + "y": 39.60614 }, "parameters": { + "lod": 0, "size": 10 }, "type": "buffer" @@ -101,8 +114,8 @@ }, "name": "nm_convolution", "node_position": { - "x": -690.25, - "y": 174.25 + "x": -695.25, + "y": 175.25 }, "parameters": { "size": 10 @@ -112,7 +125,7 @@ { "name": "nm_postprocess", "node_position": { - "x": -690.25, + "x": -693.25, "y": 222.25 }, "parameters": { @@ -185,14 +198,16 @@ { "name": "gen_parameters", "node_position": { - "x": -729.910156, - "y": -5.916687 + "x": -718.910156, + "y": -118.916687 }, "parameters": { "amount": 0.5, "param0": 10, "param1": 1.02, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "remote", @@ -237,21 +252,48 @@ ], "name": "param1", "type": "linked_control" + }, + { + "configurations": { + "False": [ + { + "node": "switch", + "value": 0, + "widget": "source" + } + ], + "True": [ + { + "node": "switch", + "value": 1, + "widget": "source" + } + ] + }, + "label": "Buffer", + "linked_widgets": [ + { + "node": "switch", + "widget": "source" + } + ], + "name": "param4", + "type": "config_control" } ] }, { "name": "gen_outputs", "node_position": { - "x": -407.663818, - "y": 151.047363 + "x": -416.663818, + "y": 228.047363 }, "parameters": { }, "ports": [ { - "name": "port0", + "name": "Normal", "type": "rgba" } ], @@ -260,19 +302,32 @@ { "name": "gen_inputs", "node_position": { - "x": -870.910156, - "y": 157.047363 + "x": -868.910156, + "y": 71.047363 }, "parameters": { }, "ports": [ { - "name": "port0", + "name": "Bump", "type": "rgba" } ], "type": "ios" + }, + { + "name": "switch", + "node_position": { + "x": -673.5, + "y": 113.297363 + }, + "parameters": { + "choices": 2, + "outputs": 1, + "source": 1 + }, + "type": "switch" } ], "parameters": { @@ -280,6 +335,8 @@ "param0": 10, "param1": 1.02, "param2": 0, + "param3": 0, + "param4": 1, "size": 4 }, "type": "graph" diff --git a/addons/material_maker/nodes/raymarching_preview.mmg b/addons/material_maker/nodes/raymarching_preview.mmg new file mode 100644 index 0000000..7dbe9a8 --- /dev/null +++ b/addons/material_maker/nodes/raymarching_preview.mmg @@ -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" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/remote.gd b/addons/material_maker/nodes/remote.gd index 0476ad7..d7b0f11 100644 --- a/addons/material_maker/nodes/remote.gd +++ b/addons/material_maker/nodes/remote.gd @@ -40,9 +40,9 @@ func update_node() -> void: control.name = p.name controls[control.name] = control add_control(generator.get_widget(p.name).label, control) - if generator.widgets[i].type == "config_control": + if generator.widgets[i].type == "config_control" and control is OptionButton: var current = null - if control.get_item_count() > 0: + if control.get_item_count() > 0 and generator.parameters.has(p.name): control.selected = generator.parameters[p.name] current = control.get_item_text(control.selected) control.add_separator() @@ -60,30 +60,31 @@ func _on_value_changed(new_value, variable : String) -> void: if widget.type == "config_control": var configuration_count = widget.configurations.size() var control = controls[variable] - if new_value < configuration_count: - ._on_value_changed(new_value, variable) - var current = control.get_item_text(new_value) - control.set_item_text(configuration_count+3, "") - control.set_item_text(configuration_count+4, "") - else: - var current = control.get_item_text(generator.parameters[variable]) - var command = new_value - widget.configurations.size() - match command: - 1: - var dialog = preload("res://addons/material_maker/widgets/line_dialog.tscn").instance() - add_child(dialog) - dialog.set_texts("Configuration", "Enter a name for the new configuration") - dialog.connect("ok", self, "do_add_configuration", [ variable ]) - dialog.popup_centered() - 3: - generator.update_configuration(variable, current) - 4: - generator.parameters[variable] = 0 - generator.remove_configuration(variable, current) - _: - print(command) - else: - ._on_value_changed(new_value, variable) + if control is OptionButton: + if new_value < configuration_count: + ._on_value_changed(new_value, variable) + var current = control.get_item_text(new_value) + control.set_item_text(configuration_count+3, "") + control.set_item_text(configuration_count+4, "") + else: + var current = control.get_item_text(generator.parameters[variable]) + var command = new_value - widget.configurations.size() + match command: + 1: + var dialog = preload("res://addons/material_maker/widgets/line_dialog.tscn").instance() + add_child(dialog) + dialog.set_texts("Configuration", "Enter a name for the new configuration") + dialog.connect("ok", self, "do_add_configuration", [ variable ]) + dialog.popup_centered() + 3: + generator.update_configuration(variable, current) + 4: + generator.parameters[variable] = 0 + generator.remove_configuration(variable, current) + _: + print(command) + return + ._on_value_changed(new_value, variable) func do_add_configuration(config_name : String, param_name : String) -> void: generator.add_configuration(param_name, config_name) @@ -109,7 +110,8 @@ func _on_AddConfig_pressed() -> void: func _on_Link_pressed(param_name) -> void: var link = MMNodeLink.new(get_parent()) - link.pick(controls[param_name], generator, param_name) + if controls.has(param_name): + link.pick(controls[param_name], generator, param_name) func _on_Remote_resize_request(new_minsize) -> void: rect_size = new_minsize diff --git a/addons/material_maker/nodes/sdelongation.mmg b/addons/material_maker/nodes/sdelongation.mmg new file mode 100644 index 0000000..adc95c5 --- /dev/null +++ b/addons/material_maker/nodes/sdelongation.mmg @@ -0,0 +1,62 @@ +{ + "name": "sdelongation", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "k": 0.15, + "op": 0, + "r": 0.08, + "w": 0.28, + "x": 0, + "y": 0 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in", + "type": "sdf2d" + } + ], + "instance": "", + "name": "sdElongation", + "outputs": [ + { + "sdf2d": "$in($uv-clamp($uv-vec2(0.5), -vec2($x, $y), vec2($x, $y)))", + "type": "sdf2d" + } + ], + "parameters": [ + { + "control": "Rect1.x", + "default": 0, + "label": "X", + "max": 1, + "min": 0, + "name": "x", + "step": 0.01, + "type": "float" + }, + { + "control": "Rect1.y", + "default": 0, + "label": "Y", + "max": 1, + "min": 0, + "name": "y", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/sdf3d_morph.mmg b/addons/material_maker/nodes/sdf3d_morph.mmg new file mode 100644 index 0000000..e9c3192 --- /dev/null +++ b/addons/material_maker/nodes/sdf3d_morph.mmg @@ -0,0 +1,57 @@ +{ + "name": "sdf3d_morph", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "Amount": 0.5, + "amount": 0.5, + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in1", + "type": "sdf3d" + }, + { + "default": "0.0", + "label": "", + "name": "in2", + "type": "sdf3d" + } + ], + "instance": "", + "name": "Morph", + "outputs": [ + { + "sdf3d": "mix($in1($uv), $in2($uv), $amount)", + "type": "sdf3d" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "", + "max": 1, + "min": 0, + "name": "amount", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/sdmorph.mmg b/addons/material_maker/nodes/sdmorph.mmg new file mode 100644 index 0000000..ea79825 --- /dev/null +++ b/addons/material_maker/nodes/sdmorph.mmg @@ -0,0 +1,56 @@ +{ + "name": "sdmorph", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "amount": 0.5, + "bevel": 0, + "cx": 0, + "cy": 0, + "h": 0.08, + "op": 0, + "r": 0.3, + "w": 0.28 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "0.0", + "label": "", + "name": "in1", + "type": "sdf2d" + }, + { + "default": "0.0", + "label": "", + "name": "in2", + "type": "sdf2d" + } + ], + "instance": "", + "name": "sdMorph", + "outputs": [ + { + "sdf2d": "mix($in1($uv), $in2($uv), $amount)", + "type": "sdf2d" + } + ], + "parameters": [ + { + "control": "None", + "default": 0.5, + "label": "", + "max": 1, + "min": 0, + "name": "amount", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/sharpen.mmg b/addons/material_maker/nodes/sharpen.mmg new file mode 100644 index 0000000..2e06f5b --- /dev/null +++ b/addons/material_maker/nodes/sharpen.mmg @@ -0,0 +1 @@ +{"convolution_params":{"name":"Sharpen","input_type":"rgb","matrix":[[0,-1,0],[-1,5,-1],[0,-1,0]],"output_type":"rgb","x":1,"y":1},"name":"edge_detect","node_position":{"x":0,"y":0},"parameters":{"size":10},"type":"convolution"} \ No newline at end of file diff --git a/addons/material_maker/nodes/sphere.mmg b/addons/material_maker/nodes/sphere.mmg new file mode 100644 index 0000000..ffb633c --- /dev/null +++ b/addons/material_maker/nodes/sphere.mmg @@ -0,0 +1,57 @@ +{ + "name": "sphere", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "cx": 0.5, + "cy": 0.5, + "r": 0.5 + }, + "shader_model": { + "code": "", + "global": "float sphere(vec2 uv, vec2 c, float r) {\n\tuv -= c;\n\tuv /= r;\n\treturn 2.0*r*sqrt(max(0.0, 1.0-dot(uv, uv)));\n}\n", + "inputs": [ + + ], + "instance": "", + "name": "Sphere", + "outputs": [ + { + "f": "sphere($uv, vec2($cx, $cy), $r)", + "type": "f" + } + ], + "parameters": [ + { + "default": 0.5, + "label": "Center X", + "max": 1, + "min": 0, + "name": "cx", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Center Y", + "max": 1, + "min": 0, + "name": "cy", + "step": 0.01, + "type": "float" + }, + { + "default": 0.5, + "label": "Radius", + "max": 1, + "min": 0, + "name": "r", + "step": 0.01, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/swap_channels.mmg b/addons/material_maker/nodes/swap_channels.mmg new file mode 100644 index 0000000..562316a --- /dev/null +++ b/addons/material_maker/nodes/swap_channels.mmg @@ -0,0 +1,228 @@ +{ + "name": "swap_channels", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "out_a": 8, + "out_b": 6, + "out_g": 4, + "out_r": 2 + }, + "shader_model": { + "code": "", + "global": "", + "inputs": [ + { + "default": "vec4(1.0)", + "label": "", + "name": "in", + "type": "rgba" + } + ], + "instance": "", + "name": "Swap channels", + "outputs": [ + { + "rgba": "vec4($out_r,$out_g,$out_b,$out_a)", + "type": "rgba" + } + ], + "parameters": [ + { + "default": 2, + "label": "R", + "name": "out_r", + "type": "enum", + "values": [ + { + "name": "0", + "value": "0.0" + }, + { + "name": "1", + "value": "1.0" + }, + { + "name": "R", + "value": "$in($uv).r" + }, + { + "name": "-R", + "value": "1.0-$in($uv).r" + }, + { + "name": "G", + "value": "$in($uv).g" + }, + { + "name": "-G", + "value": "1.0-$in($uv).g" + }, + { + "name": "B", + "value": "$in($uv).b" + }, + { + "name": "-B", + "value": "1.0-$in($uv).b" + }, + { + "name": "A", + "value": "$in($uv).a" + }, + { + "name": "-A", + "value": "1.0-$in($uv).a" + } + ] + }, + { + "default": 4, + "label": "G", + "name": "out_g", + "type": "enum", + "values": [ + { + "name": "0", + "value": "0.0" + }, + { + "name": "1", + "value": "1.0" + }, + { + "name": "R", + "value": "$in($uv).r" + }, + { + "name": "-R", + "value": "1.0-$in($uv).r" + }, + { + "name": "G", + "value": "$in($uv).g" + }, + { + "name": "-G", + "value": "1.0-$in($uv).g" + }, + { + "name": "B", + "value": "$in($uv).b" + }, + { + "name": "-B", + "value": "1.0-$in($uv).b" + }, + { + "name": "A", + "value": "$in($uv).a" + }, + { + "name": "-A", + "value": "1.0-$in($uv).a" + } + ] + }, + { + "default": 6, + "label": "B", + "name": "out_b", + "type": "enum", + "values": [ + { + "name": "0", + "value": "0.0" + }, + { + "name": "1", + "value": "1.0" + }, + { + "name": "R", + "value": "$in($uv).r" + }, + { + "name": "-R", + "value": "1.0-$in($uv).r" + }, + { + "name": "G", + "value": "$in($uv).g" + }, + { + "name": "-G", + "value": "1.0-$in($uv).g" + }, + { + "name": "B", + "value": "$in($uv).b" + }, + { + "name": "-B", + "value": "1.0-$in($uv).b" + }, + { + "name": "A", + "value": "$in($uv).a" + }, + { + "name": "-A", + "value": "1.0-$in($uv).a" + } + ] + }, + { + "default": 8, + "label": "A", + "name": "out_a", + "type": "enum", + "values": [ + { + "name": "0", + "value": "0.0" + }, + { + "name": "1", + "value": "1.0" + }, + { + "name": "R", + "value": "$in($uv).r" + }, + { + "name": "-R", + "value": "1.0-$in($uv).r" + }, + { + "name": "G", + "value": "$in($uv).g" + }, + { + "name": "-G", + "value": "1.0-$in($uv).g" + }, + { + "name": "B", + "value": "$in($uv).b" + }, + { + "name": "-B", + "value": "1.0-$in($uv).b" + }, + { + "name": "A", + "value": "$in($uv).a" + }, + { + "name": "-A", + "value": "1.0-$in($uv).a" + } + ] + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/nodes/truchet_generic.mmg b/addons/material_maker/nodes/truchet_generic.mmg new file mode 100644 index 0000000..1bbd527 --- /dev/null +++ b/addons/material_maker/nodes/truchet_generic.mmg @@ -0,0 +1,45 @@ +{ + "name": "truchet_generic", + "node_position": { + "x": 0, + "y": 0 + }, + "parameters": { + "Size": 4, + "shape": 0, + "size": 6, + "type": 1 + }, + "shader_model": { + "code": "", + "global": "vec2 truchet_generic_uv(vec2 uv, vec2 seed) {\n vec2 i = floor(uv);\n vec2 f = fract(uv);\n\tvec2 invert = step(rand2(seed+i), vec2(0.5));\n return f*(vec2(1.0)-invert)+(vec2(1.0)-f)*invert;\n}\n", + "inputs": [ + { + "default": "vec4(1.0)", + "label": "", + "name": "in", + "type": "rgba" + } + ], + "instance": "", + "name": "Generic Truchet", + "outputs": [ + { + "rgba": "$in(truchet_generic_uv($uv*$size, vec2($seed, $seed)))", + "type": "rgba" + } + ], + "parameters": [ + { + "default": 4, + "label": "Size", + "max": 64, + "min": 2, + "name": "size", + "step": 1, + "type": "float" + } + ] + }, + "type": "shader" +} \ No newline at end of file diff --git a/addons/material_maker/preview/panoramas/epping_forest_01.hdr b/addons/material_maker/preview/panoramas/epping_forest_01.hdr index 0307bff..ff69199 100644 Binary files a/addons/material_maker/preview/panoramas/epping_forest_01.hdr and b/addons/material_maker/preview/panoramas/epping_forest_01.hdr differ diff --git a/addons/material_maker/preview/panoramas/moonless_golf.hdr b/addons/material_maker/preview/panoramas/moonless_golf.hdr index cc60dc8..432de58 100644 Binary files a/addons/material_maker/preview/panoramas/moonless_golf.hdr and b/addons/material_maker/preview/panoramas/moonless_golf.hdr differ diff --git a/addons/material_maker/preview/preview_2d.gd b/addons/material_maker/preview/preview_2d.gd index d1d14e6..bfcd9f3 100644 --- a/addons/material_maker/preview/preview_2d.gd +++ b/addons/material_maker/preview/preview_2d.gd @@ -1,4 +1,3 @@ -tool extends ColorRect var generator = null diff --git a/addons/material_maker/preview/preview_2d.tscn b/addons/material_maker/preview/preview_2d.tscn index 337910a..9b94942 100644 --- a/addons/material_maker/preview/preview_2d.tscn +++ b/addons/material_maker/preview/preview_2d.tscn @@ -14,7 +14,8 @@ void fragment() { float ms = max(size.x, size.y); vec2 uv = fract(0.5+1.2*(UV-vec2(0.5))*ms/size.yx); vec2 m2 = min(fract(uv), 1.0-fract(uv)); - COLOR = mix(texture(tex, uv), vec4(0.0, 1.0, 0.0, 1.0), step(min(m2.x, m2.y), 1.0/min(size.x, size.y))); + float color = 0.5*(cos(5.0*TIME+100.0*(UV.x+UV.y))+1.0); + COLOR = mix(texture(tex, uv), vec4(vec3(color), 1.0), step(min(m2.x, m2.y), 1.0/min(size.x, size.y))); }" [sub_resource type="ShaderMaterial" id=2] diff --git a/addons/material_maker/preview/preview_3d_scene.tscn b/addons/material_maker/preview/preview_3d_scene.tscn index 348f57e..a22968e 100644 --- a/addons/material_maker/preview/preview_3d_scene.tscn +++ b/addons/material_maker/preview/preview_3d_scene.tscn @@ -8,6 +8,7 @@ [sub_resource type="PanoramaSky" id=1] resource_local_to_scene = true +radiance_size = 5 panorama = ExtResource( 2 ) [sub_resource type="Environment" id=2] @@ -32,6 +33,7 @@ tracks/0/keys = { [sub_resource type="PanoramaSky" id=4] resource_local_to_scene = true +radiance_size = 5 panorama = ExtResource( 4 ) [sub_resource type="Environment" id=5] diff --git a/export_presets.cfg b/export_presets.cfg index c2f9574..289482f 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -8,7 +8,7 @@ export_filter="resources" export_files=PoolStringArray( "res://addons/material_maker/common.shader", "res://addons/material_maker/engine/gen_base.gd", "res://addons/material_maker/engine/gen_buffer.gd", "res://addons/material_maker/engine/gen_comment.gd", "res://addons/material_maker/engine/gen_context.gd", "res://addons/material_maker/engine/gen_convolution.gd", "res://addons/material_maker/engine/gen_debug.gd", "res://addons/material_maker/engine/gen_export.gd", "res://addons/material_maker/engine/gen_graph.gd", "res://addons/material_maker/engine/gen_image.gd", "res://addons/material_maker/engine/gen_ios.gd", "res://addons/material_maker/engine/gen_material.gd", "res://addons/material_maker/engine/gen_remote.gd", "res://addons/material_maker/engine/gen_shader.gd", "res://addons/material_maker/engine/gen_switch.gd", "res://addons/material_maker/engine/gen_texture.gd", "res://addons/material_maker/engine/loader.gd", "res://addons/material_maker/engine/renderer.gd", "res://addons/material_maker/engine/renderer.tscn", "res://addons/material_maker/environment.gd", "res://addons/material_maker/fonts/hack.ttf", "res://addons/material_maker/graph_edit.gd", "res://addons/material_maker/graph_edit.tscn", "res://addons/material_maker/icons/add.png", "res://addons/material_maker/icons/add_config.png", "res://addons/material_maker/icons/add_link.png", "res://addons/material_maker/icons/config.png", "res://addons/material_maker/icons/edit.png", "res://addons/material_maker/icons/icon.png", "res://addons/material_maker/icons/icons.svg", "res://addons/material_maker/icons/link.png", "res://addons/material_maker/icons/link.tres", "res://addons/material_maker/icons/load.png", "res://addons/material_maker/icons/minus.png", "res://addons/material_maker/icons/plus.png", "res://addons/material_maker/icons/randomness_locked.tres", "res://addons/material_maker/icons/randomness_unlocked.tres", "res://addons/material_maker/icons/remove.png", "res://addons/material_maker/icons/remove.tres", "res://addons/material_maker/icons/save.png", "res://addons/material_maker/library.gd", "res://addons/material_maker/library.tscn", "res://addons/material_maker/library_tree.gd", "res://addons/material_maker/main_window.gd", "res://addons/material_maker/main_window.tscn", "res://addons/material_maker/models/Material.material", "res://addons/material_maker/new.ptex", "res://addons/material_maker/node_base.gd", "res://addons/material_maker/node_factory.gd", "res://addons/material_maker/nodes/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv.tscn", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.gd", "res://addons/material_maker/nodes/adjust_hsv/adjust_hsv.tscn", "res://addons/material_maker/nodes/base.gd", "res://addons/material_maker/nodes/blend.gd", "res://addons/material_maker/nodes/blend.tscn", "res://addons/material_maker/nodes/blend/blend.gd", "res://addons/material_maker/nodes/blend/blend.tscn", "res://addons/material_maker/nodes/blur.gd", "res://addons/material_maker/nodes/blur.tscn", "res://addons/material_maker/nodes/bricks.gd", "res://addons/material_maker/nodes/bricks.tscn", "res://addons/material_maker/nodes/bricks/bricks.gd", "res://addons/material_maker/nodes/bricks/bricks.tscn", "res://addons/material_maker/nodes/colorize.gd", "res://addons/material_maker/nodes/colorize.tscn", "res://addons/material_maker/nodes/colorize/colorize.gd", "res://addons/material_maker/nodes/colorize/colorize.tscn", "res://addons/material_maker/nodes/combine.gd", "res://addons/material_maker/nodes/combine.tscn", "res://addons/material_maker/nodes/combine/combine.gd", "res://addons/material_maker/nodes/combine/combine.tscn", "res://addons/material_maker/nodes/comment.gd", "res://addons/material_maker/nodes/comment.tscn", "res://addons/material_maker/nodes/compound.tscn", "res://addons/material_maker/nodes/custom/custom.gd", "res://addons/material_maker/nodes/custom/custom.tscn", "res://addons/material_maker/nodes/debug.gd", "res://addons/material_maker/nodes/debug.tscn", "res://addons/material_maker/nodes/debug/debug_popup.gd", "res://addons/material_maker/nodes/debug/debug_popup.tscn", "res://addons/material_maker/nodes/decompose.gd", "res://addons/material_maker/nodes/decompose.tscn", "res://addons/material_maker/nodes/decompose/decompose.gd", "res://addons/material_maker/nodes/decompose/decompose.tscn", "res://addons/material_maker/nodes/edit_buttons.gd", "res://addons/material_maker/nodes/edit_buttons.tscn", "res://addons/material_maker/nodes/emboss.gd", "res://addons/material_maker/nodes/emboss.tscn", "res://addons/material_maker/nodes/export.gd", "res://addons/material_maker/nodes/export.tscn", "res://addons/material_maker/nodes/generic.gd", "res://addons/material_maker/nodes/generic.tscn", "res://addons/material_maker/nodes/godot_logo.png", "res://addons/material_maker/nodes/image.gd", "res://addons/material_maker/nodes/image.tscn", "res://addons/material_maker/nodes/image/godot_logo.png", "res://addons/material_maker/nodes/image/image.gd", "res://addons/material_maker/nodes/image/image.tscn", "res://addons/material_maker/nodes/ios.gd", "res://addons/material_maker/nodes/ios.tscn", "res://addons/material_maker/nodes/ios/add.tscn", "res://addons/material_maker/nodes/ios/port.gd", "res://addons/material_maker/nodes/ios/port.tscn", "res://addons/material_maker/nodes/material.gd", "res://addons/material_maker/nodes/material.tscn", "res://addons/material_maker/nodes/material/material.gd", "res://addons/material_maker/nodes/material/material.tscn", "res://addons/material_maker/nodes/noise.gd", "res://addons/material_maker/nodes/noise.tscn", "res://addons/material_maker/nodes/noise/noise.gd", "res://addons/material_maker/nodes/noise/noise.tscn", "res://addons/material_maker/nodes/normal_map.gd", "res://addons/material_maker/nodes/normal_map.tscn", "res://addons/material_maker/nodes/normal_map/normal_map.gd", "res://addons/material_maker/nodes/normal_map/normal_map.tscn", "res://addons/material_maker/nodes/pattern.gd", "res://addons/material_maker/nodes/pattern.tscn", "res://addons/material_maker/nodes/pattern/pattern.gd", "res://addons/material_maker/nodes/pattern/pattern.tscn", "res://addons/material_maker/nodes/perlin.gd", "res://addons/material_maker/nodes/perlin.tscn", "res://addons/material_maker/nodes/perlin/perlin.gd", "res://addons/material_maker/nodes/perlin/perlin.tscn", "res://addons/material_maker/nodes/remote.gd", "res://addons/material_maker/nodes/remote.tscn", "res://addons/material_maker/nodes/remote/remote.gd", "res://addons/material_maker/nodes/remote/remote.tscn", "res://addons/material_maker/nodes/shape/shape.gd", "res://addons/material_maker/nodes/shape/shape.tscn", "res://addons/material_maker/nodes/switch.gd", "res://addons/material_maker/nodes/switch.tscn", "res://addons/material_maker/nodes/switch/switch.gd", "res://addons/material_maker/nodes/switch/switch.tscn", "res://addons/material_maker/nodes/transform.gd", "res://addons/material_maker/nodes/transform.tscn", "res://addons/material_maker/nodes/transform/transform.gd", "res://addons/material_maker/nodes/transform/transform.tscn", "res://addons/material_maker/nodes/uniform.gd", "res://addons/material_maker/nodes/uniform.tscn", "res://addons/material_maker/nodes/uniform/uniform.gd", "res://addons/material_maker/nodes/uniform/uniform.tscn", "res://addons/material_maker/nodes/voronoi.gd", "res://addons/material_maker/nodes/voronoi.tscn", "res://addons/material_maker/nodes/voronoi/voronoi.gd", "res://addons/material_maker/nodes/voronoi/voronoi.tscn", "res://addons/material_maker/nodes/warp.gd", "res://addons/material_maker/nodes/warp.tscn", "res://addons/material_maker/nodes/warp/warp.gd", "res://addons/material_maker/nodes/warp/warp.tscn", "res://addons/material_maker/panoramas/experiment.hdr", "res://addons/material_maker/panoramas/lobby.hdr", "res://addons/material_maker/panoramas/night.hdr", "res://addons/material_maker/panoramas/park.hdr", "res://addons/material_maker/panoramas/schelde.hdr", "res://addons/material_maker/plugin.gd", "res://addons/material_maker/pm_editor.gd", "res://addons/material_maker/pm_editor.tscn", "res://addons/material_maker/preview.gd", "res://addons/material_maker/preview.tscn", "res://addons/material_maker/preview/panoramas/epping_forest_01.hdr", "res://addons/material_maker/preview/panoramas/moonless_golf.hdr", "res://addons/material_maker/preview/panoramas/studio_sky.tres", "res://addons/material_maker/preview/preview.gd", "res://addons/material_maker/preview/preview.tscn", "res://addons/material_maker/preview/preview_3d.tscn", "res://addons/material_maker/preview/preview_light.gd", "res://addons/material_maker/preview/preview_light.tscn", "res://addons/material_maker/preview/preview_objects.tscn", "res://addons/material_maker/preview_3d.tscn", "res://addons/material_maker/preview_objects.tscn", "res://addons/material_maker/preview_world.tres", "res://addons/material_maker/renderer.gd", "res://addons/material_maker/renderer.tscn", "res://addons/material_maker/types/gradient.gd", "res://addons/material_maker/types/types.gd", "res://addons/material_maker/widgets/about.gd", "res://addons/material_maker/widgets/about.tscn", "res://addons/material_maker/widgets/about/about.gd", "res://addons/material_maker/widgets/about/about.tscn", "res://addons/material_maker/widgets/about/facebook.png", "res://addons/material_maker/widgets/about/github.png", "res://addons/material_maker/widgets/about/itchio.png", "res://addons/material_maker/widgets/about/twitter.png", "res://addons/material_maker/widgets/about/youtube.png", "res://addons/material_maker/widgets/facebook.png", "res://addons/material_maker/widgets/float_edit.gd", "res://addons/material_maker/widgets/float_edit.tscn", "res://addons/material_maker/widgets/github.png", "res://addons/material_maker/widgets/gradient_editor.gd", "res://addons/material_maker/widgets/gradient_editor.tscn", "res://addons/material_maker/widgets/gradient_popup.gd", "res://addons/material_maker/widgets/gradient_popup.tscn", "res://addons/material_maker/widgets/graph_tree/graph_tree.gd", "res://addons/material_maker/widgets/graph_tree/graph_tree.tscn", "res://addons/material_maker/widgets/hslider.gd", "res://addons/material_maker/widgets/hslider.tscn", "res://addons/material_maker/widgets/icon.png", "res://addons/material_maker/widgets/line_dialog.gd", "res://addons/material_maker/widgets/line_dialog.tscn", "res://addons/material_maker/widgets/linked_widgets/config_control.gd", "res://addons/material_maker/widgets/linked_widgets/config_control.tscn", "res://addons/material_maker/widgets/linked_widgets/editable_label.gd", "res://addons/material_maker/widgets/linked_widgets/editable_label.tscn", "res://addons/material_maker/widgets/linked_widgets/link.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control.tscn", "res://addons/material_maker/widgets/linked_widgets/linked_control_base.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.gd", "res://addons/material_maker/widgets/linked_widgets/linked_control_buttons.tscn", "res://addons/material_maker/widgets/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/enum_editor.gd", "res://addons/material_maker/widgets/node_editor/enum_editor.tscn", "res://addons/material_maker/widgets/node_editor/input.gd", "res://addons/material_maker/widgets/node_editor/input.tscn", "res://addons/material_maker/widgets/node_editor/node_editor.gd", "res://addons/material_maker/widgets/node_editor/node_editor.tscn", "res://addons/material_maker/widgets/node_editor/node_editor_item_list.gd", "res://addons/material_maker/widgets/node_editor/output.gd", "res://addons/material_maker/widgets/node_editor/output.tscn", "res://addons/material_maker/widgets/node_editor/parameter.gd", "res://addons/material_maker/widgets/node_editor/parameter.tscn", "res://addons/material_maker/widgets/node_editor/parameter_boolean.gd", "res://addons/material_maker/widgets/node_editor/parameter_boolean.tscn", "res://addons/material_maker/widgets/node_editor/parameter_color.gd", "res://addons/material_maker/widgets/node_editor/parameter_color.tscn", "res://addons/material_maker/widgets/node_editor/parameter_enum.gd", "res://addons/material_maker/widgets/node_editor/parameter_enum.tscn", "res://addons/material_maker/widgets/node_editor/parameter_float.gd", "res://addons/material_maker/widgets/node_editor/parameter_float.tscn", "res://addons/material_maker/widgets/node_editor/parameter_gradient.gd", "res://addons/material_maker/widgets/node_editor/parameter_gradient.tscn", "res://addons/material_maker/widgets/node_editor/parameter_size.gd", "res://addons/material_maker/widgets/node_editor/parameter_size.tscn", "res://addons/material_maker/widgets/preview_button.tscn", "res://addons/material_maker/widgets/size_option_button.gd", "res://addons/material_maker/widgets/tabs.gd", "res://addons/material_maker/widgets/text_dialog.gd", "res://addons/material_maker/widgets/text_dialog.tscn", "res://addons/material_maker/widgets/twitter.png", "res://addons/material_maker/widgets/youtube.png", "res://addons/material_maker/window_dialog.tscn", "res://default_env.tres", "res://icon.png", "res://rodz_labs_logo.png" ) include_filter="*.json,res://addons/material_maker/library/base/*.png" exclude_filter="*.ptex,*.mmn,*.mmg" -export_path="D:/Dev/Releases/material_maker_0.7_windows/material_maker.exe" +export_path="D:/Dev/Releases/material_maker_0.8_windows/material_maker.exe" patch_list=PoolStringArray( ) script_export_mode=1 script_encryption_key=""