{
  "name": "Embed Area",
  "id": "ide:c35d7c1a-4d76-4df7-9121-d6adc44b1e57",
  "module": {
    "kind": "shader",
    "id": "ide:c35d7c1a-4d76-4df7-9121-d6adc44b1e57",
    "name": "Embed Area",
    "inputs": [
      {
        "id": "in",
        "label": "In",
        "type": "frame"
      },
      {
        "id": "in2",
        "label": "Embedded",
        "type": "frame"
      },
      {
        "id": "tlex",
        "label": "Top Left X",
        "type": "number"
      },
      {
        "id": "tley",
        "label": "Top Left Y",
        "type": "number"
      },
      {
        "id": "trix",
        "label": "Top Right X",
        "type": "number"
      },
      {
        "id": "triy",
        "label": "Top Right Y",
        "type": "number"
      },
      {
        "id": "blex",
        "label": "Bottom Left X",
        "type": "number"
      },
      {
        "id": "bley",
        "label": "Bottom Left Y",
        "type": "number"
      },
      {
        "id": "brix",
        "label": "Bottom Right X",
        "type": "number"
      },
      {
        "id": "briy",
        "label": "Bottom Right Y",
        "type": "number"
      }
    ],
    "outputs": [
      {
        "id": "out",
        "label": "Out",
        "type": "frame"
      }
    ],
    "fragmentSrc": "#version 300 es\nprecision highp float;\n\nin vec2 v_texCoord;\nuniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\n\nuniform float trix;\nuniform float triy;\nuniform float tlex;\nuniform float tley;\n\nuniform float brix;\nuniform float briy;\nuniform float blex;\nuniform float bley;\n\n\nout vec4 fragColor;\n\nvoid main() {\n  //vec4 c = texture(u_texture0, v_texCoord);\n  if(\n    v_texCoord.x < trix && v_texCoord.x > tlex &&\n    v_texCoord.y > briy && v_texCoord.y < triy){\n    fragColor =  texture(u_texture1, v_texCoord);\n  } else {\n    fragColor =  texture(u_texture0, v_texCoord);\n  }\n}"
  }
}
