From f5fe47a903c129bd700109cda60d8833420e0674 Mon Sep 17 00:00:00 2001 From: Rodolphe Suescun Date: Wed, 25 Dec 2019 12:35:00 +0100 Subject: [PATCH] Updated base library --- addons/material_maker/library/base.json | 374 ++++++++++-------- .../library/base/simple_sdf_sdshow.png | Bin 0 -> 1505 bytes .../base/simple_sdf_transforms_rotate.png | Bin 0 -> 4693 bytes .../base/simple_sdf_transforms_scale.png | Bin 0 -> 679 bytes addons/material_maker/nodes/sdscale.mmg | 8 +- 5 files changed, 215 insertions(+), 167 deletions(-) create mode 100644 addons/material_maker/library/base/simple_sdf_sdshow.png create mode 100644 addons/material_maker/library/base/simple_sdf_transforms_rotate.png create mode 100644 addons/material_maker/library/base/simple_sdf_transforms_scale.png diff --git a/addons/material_maker/library/base.json b/addons/material_maker/library/base.json index 8c75de0..0df2ef2 100644 --- a/addons/material_maker/library/base.json +++ b/addons/material_maker/library/base.json @@ -587,30 +587,7 @@ "parameters": { }, - "shader_model": { - "code": "", - "global": "", - "inputs": [ - { - "default": "vec4($uv, 0.0, 1.0)", - "label": "", - "name": "in", - "type": "rgba" - } - ], - "instance": "", - "name": "CircleMap", - "outputs": [ - { - "rgba": "$in(vec2(fract(atan($uv.y-0.5, $uv.x-0.5)*0.15915494309), 2.0*length($uv-vec2(0.5))))", - "type": "rgba" - } - ], - "parameters": [ - - ] - }, - "type": "shader" + "type": "circle_map" }, { "name": "gen_parameters", @@ -723,6 +700,25 @@ "tree_item": "Simple/Gradient/Circular", "type": "graph" }, + { + "collapsed": true, + "icon": "simple_sdf_sdshow", + "name": "sdshow", + "parameters": { + "bevel": 0.1, + "cx": 0, + "cy": 0, + "h": 0.08, + "r": 0.3, + "w": 0.28 + }, + "tree_item": "Simple/SDF/sdShow", + "type": "sdshow" + }, + { + "collapsed": false, + "tree_item": "Simple/SDF/Shapes" + }, { "collapsed": true, "icon": "simple_sdf_shapes_sdcircle", @@ -746,61 +742,8 @@ "r": 0.3, "w": 0.3 }, - "shader_model": { - "code": "vec2 $(name_uv)_d = abs($uv-0.5*vec2($cx+1.0, $cy+1.0))-vec2($w, $h);\n", - "global": "", - "inputs": [ - - ], - "instance": "", - "name": "sdBox", - "outputs": [ - { - "sdf2d": "length(max($(name_uv)_d,vec2(0)))+min(max($(name_uv)_d.x,$(name_uv)_d.y),0.0)", - "type": "sdf2d" - } - ], - "parameters": [ - { - "default": 0.5, - "label": "Width", - "max": 1, - "min": 0, - "name": "w", - "step": 0.01, - "type": "float" - }, - { - "default": 1, - "label": "Height", - "max": 1, - "min": 0, - "name": "h", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Center X", - "max": 1, - "min": -1, - "name": "cx", - "step": 0.01, - "type": "float" - }, - { - "default": 0, - "label": "Center Y", - "max": 1, - "min": -1, - "name": "cy", - "step": 0.01, - "type": "float" - } - ] - }, "tree_item": "Simple/SDF/Shapes/sdBox", - "type": "shader" + "type": "sdbox" }, { "collapsed": true, @@ -834,6 +777,10 @@ "tree_item": "Simple/SDF/Shapes/sdRhombus", "type": "sdrhombus" }, + { + "collapsed": false, + "tree_item": "Simple/SDF/Operators" + }, { "collapsed": true, "icon": "simple_sdf_operators_sdboolean", @@ -864,65 +811,8 @@ "r": 0.3, "w": 0.28 }, - "shader_model": { - "code": "", - "global": "float sdSmoothUnion( float d1, float d2, float k ) {\n float h = clamp( 0.5 + 0.5*(d2-d1)/k, 0.0, 1.0 );\n return mix( d2, d1, h ) - k*h*(1.0-h); }\n\nfloat sdSmoothSubtraction( float d1, float d2, float k ) {\n float h = clamp( 0.5 - 0.5*(d2+d1)/k, 0.0, 1.0 );\n return mix( d2, -d1, h ) + k*h*(1.0-h); }\n\nfloat sdSmoothIntersection( float d1, float d2, float k ) {\n float h = clamp( 0.5 - 0.5*(d2-d1)/k, 0.0, 1.0 );\n return mix( d2, d1, h ) + k*h*(1.0-h); }\n", - "inputs": [ - { - "default": "0.0", - "label": "", - "name": "in1", - "type": "sdf2d" - }, - { - "default": "0.0", - "label": "", - "name": "in2", - "type": "sdf2d" - } - ], - "instance": "", - "name": "sdSmoothBoolean", - "outputs": [ - { - "sdf2d": "sdSmooth$op($in1($uv), $in2($uv), $k)", - "type": "sdf2d" - } - ], - "parameters": [ - { - "default": 0, - "label": "", - "name": "op", - "type": "enum", - "values": [ - { - "name": "Union", - "value": "Union" - }, - { - "name": "Subtraction", - "value": "Subtraction" - }, - { - "name": "Intersection", - "value": "Intersection" - } - ] - }, - { - "default": 0, - "label": "", - "max": 1, - "min": 0, - "name": "k", - "step": 0.01, - "type": "float" - } - ] - }, "tree_item": "Simple/SDF/Operators/sdSmoothBoolean", - "type": "shader" + "type": "sdsmoothboolean" }, { "collapsed": true, @@ -958,21 +848,6 @@ "tree_item": "Simple/SDF/Operators/sdAnnularShape", "type": "sdannularshape" }, - { - "collapsed": true, - "icon": "simple_sdf_operators_sdshow", - "name": "sdshow_2", - "parameters": { - "bevel": 0.1, - "cx": 0, - "cy": 0, - "h": 0.08, - "r": 0.3, - "w": 0.28 - }, - "tree_item": "Simple/SDF/Operators/sdShow", - "type": "sdshow" - }, { "collapsed": false, "tree_item": "Simple/SDF/Transforms" @@ -989,10 +864,51 @@ "tree_item": "Simple/SDF/Transforms/Translate", "type": "sdtranslate" }, + { + "collapsed": true, + "icon": "simple_sdf_transforms_rotate", + "name": "sdrotate", + "parameters": { + "a": 0, + "x": 0.35, + "y": 0, + "z": 0 + }, + "tree_item": "Simple/SDF/Transforms/Rotate", + "type": "sdrotate" + }, + { + "collapsed": true, + "icon": "simple_sdf_transforms_scale", + "name": "sdscale_2", + "parameters": { + "a": 0, + "s": 1, + "x": 0.35, + "y": 0, + "z": 0 + }, + "tree_item": "Simple/SDF/Transforms/Scale", + "type": "sdscale" + }, { "collapsed": false, "tree_item": "3D" }, + { + "collapsed": true, + "icon": "3d_sdf_render", + "name": "raymarching", + "parameters": { + + }, + "tree_item": "3D/SDF/Render", + "type": "raymarching" + }, + { + "collapsed": false, + "tree_item": "3D/SDF/Shapes" + }, { "collapsed": true, "icon": "3d_sdf_shapes_sphere", @@ -1072,6 +988,10 @@ "tree_item": "3D/SDF/Shapes/Torus", "type": "sdf3d_torus" }, + { + "collapsed": false, + "tree_item": "3D/SDF/Operators" + }, { "collapsed": true, "icon": "3d_sdf_operators_boolean", @@ -1187,6 +1107,10 @@ "tree_item": "3D/SDF/Operators/Revolution", "type": "sdf3d_revolution" }, + { + "collapsed": false, + "tree_item": "3D/SDF/Transforms" + }, { "collapsed": true, "icon": "3d_sdf_transforms_translate", @@ -1229,16 +1153,6 @@ "tree_item": "3D/SDF/Transforms/Rotate", "type": "sdf3d_rotate" }, - { - "collapsed": true, - "icon": "3d_sdf_render", - "name": "raymarching", - "parameters": { - - }, - "tree_item": "3D/SDF/Render", - "type": "raymarching" - }, { "collapsed": false, "tree_item": "Pattern" @@ -1630,7 +1544,7 @@ "name": "noise", "parameters": { "density": 0.5, - "size": 4 + "size": 6 }, "tree_item": "Noise", "type": "noise" @@ -2095,7 +2009,7 @@ "name": "color_noise", "parameters": { "density": 0.5, - "size": 9 + "size": 6 }, "tree_item": "Noise/Color", "type": "color_noise" @@ -2428,6 +2342,140 @@ "icon": "miscellaneous_debug", "tree_item": "Miscellaneous/Debug", "type": "debug" + }, + { + "collapsed": true, + "connections": [ + { + "from": "pattern_0", + "from_port": 0, + "to": "colorize_0", + "to_port": 0 + }, + { + "from": "colorize_0", + "from_port": 0, + "to": "blend_0", + "to_port": 0 + }, + { + "from": "transform_0", + "from_port": 0, + "to": "blend_0", + "to_port": 1 + }, + { + "from": "colorize_0", + "from_port": 0, + "to": "transform_0", + "to_port": 0 + }, + { + "from": "blend_0", + "from_port": 0, + "to": "transform_1", + "to_port": 0 + }, + { + "from": "transform_1", + "from_port": 0, + "to": "blend_1", + "to_port": 1 + }, + { + "from": "blend_0", + "from_port": 0, + "to": "blend_1", + "to_port": 0 + } + ], + "icon": "test", + "nodes": [ + { + "name": "transform_1", + "node_position": { + "x": 6.333313, + "y": 30.75 + }, + "repeat": true, + "rotate": 90, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.06, + "translate_y": 0, + "type": "transform" + }, + { + "amount": 1, + "blend_type": 2, + "name": "blend_0", + "node_position": { + "x": 20.333313, + "y": -73.25 + }, + "type": "blend" + }, + { + "amount": 1, + "blend_type": 2, + "name": "blend_1", + "node_position": { + "x": 21.333313, + "y": -177.25 + }, + "type": "blend" + }, + { + "gradient": [ + { + "b": 0, + "g": 0, + "pos": 0, + "r": 0 + }, + { + "b": 1, + "g": 1, + "pos": 0.045455, + "r": 1 + } + ], + "name": "colorize_0", + "node_position": { + "x": -174.666687, + "y": -36.25 + }, + "type": "colorize" + }, + { + "name": "transform_0", + "node_position": { + "x": -190.666687, + "y": 24.75 + }, + "repeat": true, + "rotate": 0, + "scale_x": 1, + "scale_y": 1, + "translate_x": 0.06, + "translate_y": 0.06, + "type": "transform" + }, + { + "mix": 5, + "name": "pattern_0", + "node_position": { + "x": -205.666687, + "y": -134.25 + }, + "type": "pattern", + "x_scale": 8, + "x_wave": 0, + "y_scale": 8, + "y_wave": 0 + } + ], + "tree_item": "test" } ] } \ No newline at end of file diff --git a/addons/material_maker/library/base/simple_sdf_sdshow.png b/addons/material_maker/library/base/simple_sdf_sdshow.png new file mode 100644 index 0000000000000000000000000000000000000000..43e8b2bdc646e96b5f038afd7a21ae329807d9e7 GIT binary patch literal 1505 zcmV<71s?i|P)2BLP5QUF+i4rAm@gloL-v6nRqCgWgYAr>wto{DzB|#@CYFl(wBt8HU7;(s%k0Z_u z?I-{`d|;_V8!)u40ERYTXnlA9`rleeRaJPN2iJ9BSr$ywgsT4H-?lBvvP4l7$g&J+ znxbvnzhc+L0T_mX$z+1jXaq_rT-Sx;I4}$Ynx+8&nx;WjRmk%kS(f4X`5D{o7C(Oc zKvh*2weO+;rqd~IZf-E0PB9*j;rl*3&x7MQFirCSKv|Z^^BifKB1sbb{P`166yf{# z?}(!4Vm4j`fTn3!tyWkrmzdAzn9XK93OvsPAq1vrLf3ySU)MFtvczt;Lz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 0 HcmV?d00001 diff --git a/addons/material_maker/library/base/simple_sdf_transforms_rotate.png b/addons/material_maker/library/base/simple_sdf_transforms_rotate.png new file mode 100644 index 0000000000000000000000000000000000000000..1f0a166a7b8c5e98319aa5f98b121197f9f710b6 GIT binary patch literal 4693 zcmV-b5~}TqP)B2JlPL!-c>w;4I)IAO~m%vd;bF9H^A1I@wWpv0?lN=QiJKhtTYe52^fh!JQsanB~T9R0cwE* zKsL}B=;p?q0CWV}lO$3L&RhHMPgI{oJcBx z@(_WJM+C|SGLd*4K%BE3SPlFcv3ffAHzXPWuK|xmM#K={mx%2F<^qosFGt4`I+9AD zoYJA?LT@t&>Of1xYqstJ(7PP zrUIjYPk>24H5qW0Nkeu=O5*95iH`!Kfi6e`F9JRQO5KM9(8Vn#kl#SLCD3l=AOf{V z1j<01(?qIitRzXGz$|V9HXnu%lh9^%0bU30_VC%jOyF!}`F=qLOgH!eV)=>QgwBXK z*SLkv2A)K${dJ%RQ3CZKsr^qtBGn#=706j?MBKR>?cRI9J89l=BijA$z>C0tc=(~f zLx?kf0uqqc!L0^AGx(LkY=Z>`pBhvcG#Gqt@V3Eq zX`VCMV6DO5493RbA29fHt)sy(gGWs6d!4~{_d9O< z-46euL6L{+Yw&@|GVrlMKX1S=lWEy*Fe=RpMwrBBv0Kn$gEtJGa=Uk{!9@lI$AB2! z4IVbw;x_4JgZ44wUNmvdQ!%*v4b~elBL?}ZiPfHr!JTOEJA-`&%?4i>RJw&UxxQwD zFWs2!2A>$rch7yo?aoaG=h`>(9d0mfV4eF|AOAgrRR-%!q7}xSW3b$^3xSe z$Qyhd7y)cSHa>tdvNx5!v9MoWN(4fWOfJyo8G1zEOV(^mVnz(n|X0XfPGmCnIXFCp9VQ`X%`&T3S zus<5qxQB-OFEz>27K0(*fNlMj=N38AV2Z(G2Co?W+2oRMv!u9Ho5U|a<~h$hBF>D# zz3K>byVrky90AHqa$D^6Kjs$k+_(7gN78zltk5)*$!<1rPfpBEZ*pUNuAXADcF)G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