{
  "Name": "Fog",
  "_id": "9f0d8e0a-5983-4a06-b82a-e0d7a94ac3a2",
  "Namespace": "lib.3d.material",
  "Description": "Adjust the Fog-Behavior of the incoming scene. For optimal quality, use with [Phong Shader].",
  "Inputs": [
    {
      "Name": "Scene",
      "MetaInstanceID": "60e21ed5-c980-4d6f-b785-6704997bfa44",
      "DefaultValue": {
        "Type": "Scene",
        "Value": "Framefield.Core.Scene"
      },
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248",
      "IsMultiInput": "False",
      "Relevance": "Required",
      "Description": "",
      "Min": "-100000",
      "Max": "100000",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Color.R",
      "MetaInstanceID": "ca285632-d5c7-4854-ada8-1c39edbfcffb",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Color.G",
      "MetaInstanceID": "e4935741-57dc-4282-8920-494664ee8a0b",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Color.B",
      "MetaInstanceID": "421f95cf-a08e-4e86-abab-5965bcf56d0d",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Color.A",
      "MetaInstanceID": "82fc30c4-09fc-4137-8665-f5359d0de0a4",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "0.01",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Start",
      "MetaInstanceID": "7e695d64-c7c9-44ac-905e-bccd9e8485fa",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "End",
      "MetaInstanceID": "6ea373ec-d9d4-480e-8ce3-d444bf7249a4",
      "DefaultValue": {
        "Type": "Float",
        "Value": "100"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "Mode",
      "MetaInstanceID": "744b1d1c-4475-4bec-ba1c-e12735f5d44e",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-100000",
      "Max": "2",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Linear",
          "Value": "0"
        },
        {
          "Name": "Exponential",
          "Value": "1"
        },
        {
          "Name": "Exponential2",
          "Value": "2"
        }
      ]
    },
    {
      "Name": "Density",
      "MetaInstanceID": "e6cab255-aa2b-4102-a1b8-439570e2d5e3",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "100",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    }
  ],
  "Outputs": [
    {
      "Name": "Scene",
      "MetaInstanceID": "6a076ad2-b347-457b-8137-ef8c8d54baca",
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248"
    }
  ],
  "OperatorParts": [
    {
      "MetaInstanceID": "e327cc94-b7e9-4075-89e9-8ba810fc573f",
      "MetaID": "33b2f4fc-d1d5-4ee7-924c-ab80f54a0c24",
      "Name": "FogFunc",
      "Version": "76873ef6-2ac1-47f9-b0c6-2ee4df689583",
      "Type": "Float",
      "IsMultiInput": "True",
      "Script": [
        "//>>> _using",
        "using System;",
        "using System.Collections.Generic;",
        "using System.Linq;",
        "using System.Text;",
        "using SharpDX;",
        "using SharpDX.Direct3D11;",
        "using SharpDX.Windows;",
        "//<<< _using",
        "",
        "namespace Framefield.Core.ID33b2f4fc_d1d5_4ee7_924c_ab80f54a0c24",
        "{",
        "    public class Class_Fog : OperatorPart.Function, IFogSettings",
        "    {",
        "        //>>> _inputids",
        "        private enum InputId",
        "        {",
        "            Scene = 0,",
        "            ColorR = 1,",
        "            ColorG = 2,",
        "            ColorB = 3,",
        "            ColorA = 4,",
        "            Start = 5,",
        "            End = 6,",
        "            Mode = 7,",
        "            Density = 8",
        "        }",
        "        //<<< _inputids",
        "    ",
        "        public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx) {",
        "            //>>> _params",
        "            var Scene = inputs[(int)InputId.Scene];",
        "            var ColorR = inputs[(int)InputId.ColorR].Eval(context).Value;",
        "            var ColorG = inputs[(int)InputId.ColorG].Eval(context).Value;",
        "            var ColorB = inputs[(int)InputId.ColorB].Eval(context).Value;",
        "            var ColorA = inputs[(int)InputId.ColorA].Eval(context).Value;",
        "            var Color = new Color4(ColorR, ColorG, ColorB, ColorA);",
        "            var Start = inputs[(int)InputId.Start].Eval(context).Value;",
        "            var End = inputs[(int)InputId.End].Eval(context).Value;",
        "            var Mode = (int) inputs[(int)InputId.Mode].Eval(context).Value;",
        "            var Density = inputs[(int)InputId.Density].Eval(context).Value;",
        "            //<<< _params",
        "",
        "            // store values for later use of IMaterial",
        "            this.Color = Color;",
        "            this.Start = Start;",
        "            this.End = End;",
        "            this.Mode = (FogMode) Mode;",
        "            this.Density = Density;",
        "",
        "            var prevFogSettings = (IFogSettings) context.Objects[OperatorPartContext.FOG_SETTINGS_ID];",
        "            context.Objects[OperatorPartContext.FOG_SETTINGS_ID] = this;",
        "",
        "            Scene.Eval(context);",
        "",
        "            context.Objects[OperatorPartContext.FOG_SETTINGS_ID] = prevFogSettings;",
        "",
        "            return context;",
        "        }",
        "",
        "        public Color4 Color { get; private set; }",
        "        public float Start { get; private set; }",
        "        public float End { get; private set; }",
        "        public FogMode Mode { get; private set; }",
        "        public float Density { get; private set; }",
        "    }",
        "}",
        "",
        ""
      ],
      "AdditionalAssemblies": []
    }
  ],
  "Operators": [],
  "Connections": [
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "6a076ad2-b347-457b-8137-ef8c8d54baca"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "60e21ed5-c980-4d6f-b785-6704997bfa44",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "ca285632-d5c7-4854-ada8-1c39edbfcffb",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e4935741-57dc-4282-8920-494664ee8a0b",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "421f95cf-a08e-4e86-abab-5965bcf56d0d",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "82fc30c4-09fc-4137-8665-f5359d0de0a4",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "7e695d64-c7c9-44ac-905e-bccd9e8485fa",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "6ea373ec-d9d4-480e-8ce3-d444bf7249a4",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "744b1d1c-4475-4bec-ba1c-e12735f5d44e",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "e6cab255-aa2b-4102-a1b8-439570e2d5e3",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "e327cc94-b7e9-4075-89e9-8ba810fc573f"
    }
  ]
}