示例#1
0
        // Load
        public static MaterialLayer load(XElement data)
        {
            MaterialLayer layer = null;

            switch (data.Attribute("type").Value)
            {
            case "root":
                layer = new MaterialGroupLayer(data);
                break;

            case "group":
                layer = new MaterialGroupLayer(data);
                break;

            case "texture":
                layer = new MaterialTextureLayer(data);
                break;

            case "perlin":
                layer = new MaterialPerlinLayer(data);
                break;

            case "worley":
                layer = new MaterialWorleyLayer(data);
                break;

            case "uniform_scatter":
                layer = new MaterialUniformScatterLayer(data);
                break;

            case "radial_scatter":
                layer = new MaterialRadialScatterLayer(data);
                break;

            case "edge_scatter":
                layer = new MaterialEdgeScatterLayer(data);
                break;

            case "leaves":
                layer = new MaterialLeavesLayer(data);
                break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return(layer);
        }
示例#2
0
        // Create
        public static MaterialLayer create(string type)
        {
            MaterialLayer layer = null;

            switch (type)
            {
            case "group":
                layer = new MaterialGroupLayer("group", true);
                break;

            case "texture":
                layer = new MaterialTextureLayer();
                break;

            case "perlin":
                layer = new MaterialPerlinLayer();
                break;

            case "worley":
                layer = new MaterialWorleyLayer();
                break;

            case "uniform_scatter":
                layer = new MaterialUniformScatterLayer();
                break;

            case "radial_scatter":
                layer = new MaterialRadialScatterLayer();
                break;

            case "edge_scatter":
                layer = new MaterialEdgeScatterLayer();
                break;

            case "leaves":
                layer = new MaterialLeavesLayer();
                break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return(layer);
        }
示例#3
0
        // Create
        public static MaterialLayer create(string type)
        {
            MaterialLayer layer = null;
            switch (type)
            {
                case "group":
                    layer = new MaterialGroupLayer("group", true);
                    break;

                case "texture":
                    layer = new MaterialTextureLayer();
                    break;

                case "perlin":
                    layer = new MaterialPerlinLayer();
                    break;

                case "worley":
                    layer = new MaterialWorleyLayer();
                    break;

                case "uniform_scatter":
                    layer = new MaterialUniformScatterLayer();
                    break;

                case "radial_scatter":
                    layer = new MaterialRadialScatterLayer();
                    break;

                case "edge_scatter":
                    layer = new MaterialEdgeScatterLayer();
                    break;

                case "leaves":
                    layer = new MaterialLeavesLayer();
                    break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return layer;
        }
示例#4
0
        // Load
        public static MaterialLayer load(XElement data)
        {
            MaterialLayer layer = null;
            switch (data.Attribute("type").Value)
            {
                case "root":
                    layer = new MaterialGroupLayer(data);
                    break;

                case "group":
                    layer = new MaterialGroupLayer(data);
                    break;

                case "texture":
                    layer = new MaterialTextureLayer(data);
                    break;

                case "perlin":
                    layer = new MaterialPerlinLayer(data);
                    break;

                case "worley":
                    layer = new MaterialWorleyLayer(data);
                    break;

                case "uniform_scatter":
                    layer = new MaterialUniformScatterLayer(data);
                    break;

                case "radial_scatter":
                    layer = new MaterialRadialScatterLayer(data);
                    break;

                case "edge_scatter":
                    layer = new MaterialEdgeScatterLayer(data);
                    break;

                case "leaves":
                    layer = new MaterialLeavesLayer(data);
                    break;
            }

            System.Diagnostics.Debug.Assert(layer != null, "Layer wasn't created (is null)");
            return layer;
        }