From 92e5185dd1bc52fbf5627896052efee50df32e81 Mon Sep 17 00:00:00 2001 From: Cosmo Myzrail Gorynych aka Comigo Date: Thu, 24 Jan 2019 19:14:25 +1200 Subject: [PATCH] :bento: Add "Rocks" example, update old filters --- app/sampleFilters/Adjustments.fjs | 42 +--- app/sampleFilters/Normals.fjs | 70 +++--- app/sampleFilters/Rocks.fjs | 377 ++++++++++++++++++++++++++++++ 3 files changed, 420 insertions(+), 69 deletions(-) create mode 100644 app/sampleFilters/Rocks.fjs diff --git a/app/sampleFilters/Adjustments.fjs b/app/sampleFilters/Adjustments.fjs index 2986eb6..74d594f 100644 --- a/app/sampleFilters/Adjustments.fjs +++ b/app/sampleFilters/Adjustments.fjs @@ -6,8 +6,8 @@ "inputLinks": [ { "inputKey": "image", - "outBlock": 3, - "outKey": "canvas" + "outBlock": 6, + "outKey": "output" } ], "x": 560, @@ -42,20 +42,6 @@ "template": "gammaCorrection", "tagValues": {} }, - { - "id": 3, - "inputLinks": [ - { - "inputKey": "pixels", - "outBlock": 6, - "outKey": "output" - } - ], - "x": 400, - "y": -60, - "template": "pixelsToCanvas", - "tagValues": {} - }, { "id": 5, "inputLinks": [], @@ -63,7 +49,7 @@ "y": 60, "template": "numberInput", "tagValues": { - "number": 1.4 + "number": 1.2 } }, { @@ -76,8 +62,8 @@ }, { "inputKey": "input", - "outBlock": 8, - "outKey": "pixels" + "outBlock": 2, + "outKey": "output" } ], "x": 120, @@ -94,25 +80,11 @@ "tagValues": { "number": 1.2 } - }, - { - "id": 8, - "inputLinks": [ - { - "inputKey": "canvas", - "outBlock": 2, - "outKey": "output" - } - ], - "x": -20, - "y": -60, - "template": "canvasToPixels", - "tagValues": {} } ], "view": { - "x": -162, - "y": -5 + "x": -69, + "y": -8 }, "lastId": 9, "seed": 0 diff --git a/app/sampleFilters/Normals.fjs b/app/sampleFilters/Normals.fjs index 98c809f..5614b34 100644 --- a/app/sampleFilters/Normals.fjs +++ b/app/sampleFilters/Normals.fjs @@ -6,8 +6,8 @@ "inputLinks": [ { "inputKey": "image", - "outBlock": 10, - "outKey": "canvas" + "outBlock": 14, + "outKey": "normals" } ], "x": 720, @@ -18,8 +18,8 @@ { "id": 1, "inputLinks": [], - "x": -440, - "y": -40, + "x": 720, + "y": -100, "template": "inputImage", "tagValues": {} }, @@ -145,20 +145,6 @@ "number": 1 } }, - { - "id": 10, - "inputLinks": [ - { - "inputKey": "pixels", - "outBlock": 12, - "outKey": "normals" - } - ], - "x": 560, - "y": 0, - "template": "pixelsToCanvas", - "tagValues": {} - }, { "id": 11, "inputLinks": [], @@ -170,12 +156,22 @@ } }, { - "id": 12, + "id": 13, + "inputLinks": [], + "x": -40, + "y": -100, + "template": "numberInput", + "tagValues": { + "number": 10 + } + }, + { + "id": 14, "inputLinks": [ { "inputKey": "height", - "outBlock": 2, - "outKey": "pixels" + "outBlock": 15, + "outKey": "canvas" }, { "inputKey": "intensity", @@ -183,26 +179,32 @@ "outKey": "number" } ], - "x": 280, + "x": 420, "y": 0, "template": "computeNormals", - "tagValues": {} - }, - { - "id": 13, - "inputLinks": [], - "x": -40, - "y": -100, - "template": "numberInput", "tagValues": { - "number": 10 + "flip": false } + }, + { + "id": 15, + "inputLinks": [ + { + "inputKey": "pixels", + "outBlock": 2, + "outKey": "pixels" + } + ], + "x": 240, + "y": 80, + "template": "pixelsToCanvas", + "tagValues": {} } ], "view": { - "x": -160, - "y": -256 + "x": -369, + "y": -185 }, - "lastId": 14, + "lastId": 16, "seed": 0 } \ No newline at end of file diff --git a/app/sampleFilters/Rocks.fjs b/app/sampleFilters/Rocks.fjs new file mode 100644 index 0000000..793b4ff --- /dev/null +++ b/app/sampleFilters/Rocks.fjs @@ -0,0 +1,377 @@ +{ + "name": "New filter", + "graph": [ + { + "id": 0, + "inputLinks": [ + { + "inputKey": "image", + "outBlock": 30, + "outKey": "result" + } + ], + "x": 1100, + "y": -500, + "template": "outputImage", + "tagValues": {} + }, + { + "id": 1, + "inputLinks": [], + "x": 1100, + "y": -620, + "template": "inputImage", + "tagValues": {} + }, + { + "id": 3, + "inputLinks": [ + { + "inputKey": "normals", + "outBlock": 14, + "outKey": "normals" + } + ], + "x": 380, + "y": -40, + "template": "simpleShader", + "tagValues": { + "light": [ + -0.5, + -0.5, + 1 + ] + } + }, + { + "id": 6, + "inputLinks": [ + { + "inputKey": "lowestValue", + "outBlock": 9, + "outKey": "pixels" + }, + { + "inputKey": "highestValue", + "outBlock": 10, + "outKey": "pixels" + }, + { + "inputKey": "sizeY", + "outBlock": 16, + "outKey": "number" + }, + { + "inputKey": "sizeX", + "outBlock": 16, + "outKey": "number" + }, + { + "inputKey": "repeat", + "outBlock": 21, + "outKey": "number" + } + ], + "x": -520, + "y": -40, + "template": "perlinNoise", + "tagValues": { + "seed": 0 + } + }, + { + "id": 7, + "inputLinks": [ + { + "inputKey": "color", + "outBlock": 12, + "outKey": "color" + } + ], + "x": -900, + "y": 120, + "template": "fillColor", + "tagValues": {} + }, + { + "id": 8, + "inputLinks": [ + { + "inputKey": "color", + "outBlock": 13, + "outKey": "color" + } + ], + "x": -880, + "y": 0, + "template": "fillColor", + "tagValues": {} + }, + { + "id": 9, + "inputLinks": [ + { + "inputKey": "canvas", + "outBlock": 8, + "outKey": "canvas" + } + ], + "x": -660, + "y": 0, + "template": "canvasToPixels", + "tagValues": {} + }, + { + "id": 10, + "inputLinks": [ + { + "inputKey": "canvas", + "outBlock": 7, + "outKey": "canvas" + } + ], + "x": -660, + "y": 100, + "template": "canvasToPixels", + "tagValues": {} + }, + { + "id": 12, + "inputLinks": [], + "x": -1180, + "y": 160, + "template": "colorInput", + "tagValues": { + "color": "#ffffff" + } + }, + { + "id": 13, + "inputLinks": [], + "x": -1180, + "y": -40, + "template": "colorInput", + "tagValues": { + "color": "#000000" + } + }, + { + "id": 14, + "inputLinks": [ + { + "inputKey": "height", + "outBlock": 15, + "outKey": "canvas" + }, + { + "inputKey": "intensity", + "outBlock": 20, + "outKey": "number" + } + ], + "x": 40, + "y": -40, + "template": "computeNormals", + "tagValues": { + "flip": false + } + }, + { + "id": 15, + "inputLinks": [ + { + "inputKey": "pixels", + "outBlock": 6, + "outKey": "pixels" + } + ], + "x": -200, + "y": -40, + "template": "pixelsToCanvas", + "tagValues": {} + }, + { + "id": 16, + "inputLinks": [], + "x": -980, + "y": -340, + "template": "numberInput", + "tagValues": { + "number": 3.8 + } + }, + { + "id": 20, + "inputLinks": [], + "x": -260, + "y": 140, + "template": "numberInput", + "tagValues": { + "number": 5 + } + }, + { + "id": 21, + "inputLinks": [], + "x": -980, + "y": -180, + "template": "numberInput", + "tagValues": { + "number": 5 + } + }, + { + "id": 22, + "inputLinks": [ + { + "inputKey": "repeat", + "outBlock": 21, + "outKey": "number" + }, + { + "inputKey": "sizeY", + "outBlock": 16, + "outKey": "number" + }, + { + "inputKey": "sizeX", + "outBlock": 16, + "outKey": "number" + }, + { + "inputKey": "lowestValue", + "outBlock": 25, + "outKey": "pixels" + }, + { + "inputKey": "highestValue", + "outBlock": 26, + "outKey": "pixels" + } + ], + "x": -500, + "y": -580, + "template": "perlinNoise", + "tagValues": { + "seed": 0 + } + }, + { + "id": 23, + "inputLinks": [ + { + "inputKey": "color", + "outBlock": 28, + "outKey": "color" + } + ], + "x": -860, + "y": -520, + "template": "fillColor", + "tagValues": {} + }, + { + "id": 24, + "inputLinks": [ + { + "inputKey": "color", + "outBlock": 29, + "outKey": "color" + } + ], + "x": -860, + "y": -620, + "template": "fillColor", + "tagValues": {} + }, + { + "id": 25, + "inputLinks": [ + { + "inputKey": "canvas", + "outBlock": 24, + "outKey": "canvas" + } + ], + "x": -660, + "y": -620, + "template": "canvasToPixels", + "tagValues": {} + }, + { + "id": 26, + "inputLinks": [ + { + "inputKey": "canvas", + "outBlock": 23, + "outKey": "canvas" + } + ], + "x": -660, + "y": -520, + "template": "canvasToPixels", + "tagValues": {} + }, + { + "id": 28, + "inputLinks": [], + "x": -1140, + "y": -480, + "template": "colorInput", + "tagValues": { + "color": "#e8e8e8" + } + }, + { + "id": 29, + "inputLinks": [], + "x": -1140, + "y": -640, + "template": "colorInput", + "tagValues": { + "color": "#1b1612" + } + }, + { + "id": 30, + "inputLinks": [ + { + "inputKey": "bottom", + "outBlock": 31, + "outKey": "canvas" + }, + { + "inputKey": "top", + "outBlock": 3, + "outKey": "output" + } + ], + "x": 740, + "y": -500, + "template": "blend", + "tagValues": { + "mode": "multiply" + } + }, + { + "id": 31, + "inputLinks": [ + { + "inputKey": "pixels", + "outBlock": 22, + "outKey": "pixels" + } + ], + "x": 80, + "y": -500, + "template": "pixelsToCanvas", + "tagValues": {} + } + ], + "view": { + "x": 502, + "y": 265 + }, + "lastId": 32, + "seed": 0 +} \ No newline at end of file