{
  "Name": "RasterizerState",
  "_id": "62b35be8-a620-4a2a-a3d9-8d42392e79f3",
  "Namespace": "lib.3d.material",
  "Description": "Sets a new rasterizer state.",
  "Inputs": [
    {
      "Name": "SceneInput",
      "MetaInstanceID": "c17be31a-912e-4e88-b2a4-da04465f5d35",
      "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": "FillMode",
      "MetaInstanceID": "8fd16239-7aa6-44e6-bdfa-c0934a2a78b1",
      "DefaultValue": {
        "Type": "Float",
        "Value": "3"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "2",
      "Max": "3",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Wireframe",
          "Value": "2"
        },
        {
          "Name": "Solid",
          "Value": "3"
        }
      ]
    },
    {
      "Name": "CullMode",
      "MetaInstanceID": "8bec1ec1-6364-40bd-b4e8-c2f20a53fcf0",
      "DefaultValue": {
        "Type": "Float",
        "Value": "3"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "1",
      "Max": "3",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "None",
          "Value": "1"
        },
        {
          "Name": "Front",
          "Value": "2"
        },
        {
          "Name": "Back",
          "Value": "3"
        }
      ]
    },
    {
      "Name": "FrontCounterClockwise",
      "MetaInstanceID": "1b41a6ab-31e4-4dcb-94bc-8c4903cfed3a",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "False",
          "Value": "0"
        },
        {
          "Name": "True",
          "Value": "1"
        }
      ]
    },
    {
      "Name": "DepthBias",
      "MetaInstanceID": "3db722aa-bef7-44ef-8b5d-0a65401bace6",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-1000",
      "Max": "1000",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "DepthBiasClamp",
      "MetaInstanceID": "d3f5e9e1-ee11-4f6a-808f-fcdfd73e2d0b",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-1000",
      "Max": "1000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "SlopeScaledDepthBias",
      "MetaInstanceID": "d59bd9fa-5337-4ac7-aa24-32062a7e185d",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "-1000",
      "Max": "1000",
      "Scale": "0.1",
      "ScaleType": "Linear",
      "EnumValues": []
    },
    {
      "Name": "DepthClipEnable",
      "MetaInstanceID": "5faaf900-5d59-4e0b-9187-7862be900ff0",
      "DefaultValue": {
        "Type": "Float",
        "Value": "1"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Off",
          "Value": "0"
        },
        {
          "Name": "On",
          "Value": "1"
        }
      ]
    },
    {
      "Name": "ScissorEnable",
      "MetaInstanceID": "6a3873f5-1ce1-41d6-a922-817c9838a7b6",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Off",
          "Value": "0"
        },
        {
          "Name": "On",
          "Value": "1"
        }
      ]
    },
    {
      "Name": "MultisampleEnable",
      "MetaInstanceID": "1a97e70b-58b4-41d1-ae50-65e1d967af02",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Off",
          "Value": "0"
        },
        {
          "Name": "On",
          "Value": "1"
        }
      ]
    },
    {
      "Name": "AntialiasedLineEnable",
      "MetaInstanceID": "a211bc8e-6343-46ec-9cbe-d5b318132c15",
      "DefaultValue": {
        "Type": "Float",
        "Value": "0"
      },
      "MetaID": "3f76dee3-3897-44ac-82d6-25ce9f53a506",
      "IsMultiInput": "False",
      "Relevance": "Optional",
      "Description": "",
      "Min": "0",
      "Max": "1",
      "Scale": "1",
      "ScaleType": "Linear",
      "EnumValues": [
        {
          "Name": "Off",
          "Value": "0"
        },
        {
          "Name": "On",
          "Value": "1"
        }
      ]
    }
  ],
  "Outputs": [
    {
      "Name": "SceneTransformOut",
      "MetaInstanceID": "c399025b-e505-403b-a8d6-de0ce5440108",
      "MetaID": "79122951-7bc4-4c68-b085-866eab828248"
    }
  ],
  "OperatorParts": [
    {
      "MetaInstanceID": "794b51ba-85a4-44ab-9bb0-70feb509cfff",
      "MetaID": "3ed47ad6-e6e7-423f-811b-bfa03aa3b71c",
      "Name": "RasterizerStateFunc",
      "Version": "d43c9a03-988f-4e59-af0a-a8559c4c52ab",
      "Type": "Scene",
      "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.ID3ed47ad6_e6e7_423f_811b_bfa03aa3b71c",
        "{",
        "    public class Class_RasterizerState : OperatorPart.Function",
        "    {",
        "        //>>> _inputids",
        "        private enum InputId",
        "        {",
        "            SceneInput = 0,",
        "            FillMode = 1,",
        "            CullMode = 2,",
        "            FrontCounterClockwise = 3,",
        "            DepthBias = 4,",
        "            DepthBiasClamp = 5,",
        "            SlopeScaledDepthBias = 6,",
        "            DepthClipEnable = 7,",
        "            ScissorEnable = 8,",
        "            MultisampleEnable = 9,",
        "            AntialiasedLineEnable = 10",
        "        }",
        "        //<<< _inputids",
        "",
        "        public override OperatorPartContext Eval(OperatorPartContext context, List<OperatorPart> inputs, int outputIdx)",
        "        {",
        "            //>>> _params",
        "            var SceneInput = inputs[(int)InputId.SceneInput];",
        "            var FillMode = (int) inputs[(int)InputId.FillMode].Eval(context).Value;",
        "            var CullMode = (int) inputs[(int)InputId.CullMode].Eval(context).Value;",
        "            var FrontCounterClockwise = (int) inputs[(int)InputId.FrontCounterClockwise].Eval(context).Value;",
        "            var DepthBias = inputs[(int)InputId.DepthBias].Eval(context).Value;",
        "            var DepthBiasClamp = inputs[(int)InputId.DepthBiasClamp].Eval(context).Value;",
        "            var SlopeScaledDepthBias = inputs[(int)InputId.SlopeScaledDepthBias].Eval(context).Value;",
        "            var DepthClipEnable = (int) inputs[(int)InputId.DepthClipEnable].Eval(context).Value;",
        "            var ScissorEnable = (int) inputs[(int)InputId.ScissorEnable].Eval(context).Value;",
        "            var MultisampleEnable = (int) inputs[(int)InputId.MultisampleEnable].Eval(context).Value;",
        "            var AntialiasedLineEnable = (int) inputs[(int)InputId.AntialiasedLineEnable].Eval(context).Value;",
        "            //<<< _params",
        "",
        "            if (Changed)",
        "            {",
        "                var rasterizerDescription = new RasterizerStateDescription();",
        "                rasterizerDescription.FillMode = (FillMode) FillMode;",
        "                rasterizerDescription.CullMode = (CullMode) CullMode;",
        "                rasterizerDescription.IsFrontCounterClockwise = FrontCounterClockwise == 1.0 ? true : false;",
        "                rasterizerDescription.DepthBias = (int) DepthBias;",
        "                rasterizerDescription.DepthBiasClamp = DepthBiasClamp;",
        "                rasterizerDescription.SlopeScaledDepthBias = SlopeScaledDepthBias;",
        "                rasterizerDescription.IsDepthClipEnabled = DepthClipEnable == 1.0 ? true : false;",
        "                rasterizerDescription.IsScissorEnabled = ScissorEnable == 1.0 ? true : false;",
        "                rasterizerDescription.IsMultisampleEnabled = MultisampleEnable == 1.0 ? true : false;",
        "                rasterizerDescription.IsAntialiasedLineEnabled = AntialiasedLineEnable == 1.0 ? true : false;",
        "",
        "                Utilities.DisposeObj(ref _rasterizerState);",
        "                _rasterizerState = new RasterizerState(context.D3DDevice, rasterizerDescription);",
        "                Changed = false;",
        "            }",
        "",
        "            var prevRasterizerState = context.RasterizerState;",
        "            context.RasterizerState = _rasterizerState;",
        "            SceneInput.Eval(context);",
        "            context.RasterizerState = prevRasterizerState;",
        "",
        "            return context;",
        "        }",
        "",
        "        private RasterizerState _rasterizerState = null;",
        "    }",
        "}",
        "",
        ""
      ],
      "AdditionalAssemblies": []
    }
  ],
  "Operators": [],
  "Connections": [
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "c17be31a-912e-4e88-b2a4-da04465f5d35",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8fd16239-7aa6-44e6-bdfa-c0934a2a78b1",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "8bec1ec1-6364-40bd-b4e8-c2f20a53fcf0",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "1b41a6ab-31e4-4dcb-94bc-8c4903cfed3a",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "3db722aa-bef7-44ef-8b5d-0a65401bace6",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d3f5e9e1-ee11-4f6a-808f-fcdfd73e2d0b",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "d59bd9fa-5337-4ac7-aa24-32062a7e185d",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "5faaf900-5d59-4e0b-9187-7862be900ff0",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "6a3873f5-1ce1-41d6-a922-817c9838a7b6",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "1a97e70b-58b4-41d1-ae50-65e1d967af02",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "a211bc8e-6343-46ec-9cbe-d5b318132c15",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff"
    },
    {
      "SourceOp": "00000000-0000-0000-0000-000000000000",
      "SourceOpPart": "794b51ba-85a4-44ab-9bb0-70feb509cfff",
      "TargetOp": "00000000-0000-0000-0000-000000000000",
      "TargetOpPart": "c399025b-e505-403b-a8d6-de0ce5440108"
    }
  ]
}