Example #1
0
        /// <summary>
        /// シェーダ設定を読み込みます。
        /// </summary>
        /// <param name="lines">テキスト行配列</param>
        public void Load(string[] lines)
        {
            shader_parameters = new ShaderParameter[lines.Length];
            int i = 0;

            foreach (string line in lines)
            {
                ShaderParameter p = ShaderParameter.Parse(line);
                switch (p.name)
                {
                case "description":
                    p.system_p = true;
                    break;

                case "shader":
                    p.system_p = true;
                    break;

                case "technique":
                    p.system_p = true;
                    technique  = p.GetString();
                    break;

                case "LightDirX":
                    p.system_p = true;
                    lightDirX  = p.GetFloat();
                    break;

                case "LightDirY":
                    p.system_p = true;
                    lightDirY  = p.GetFloat();
                    break;

                case "LightDirZ":
                    p.system_p = true;
                    lightDirZ  = p.GetFloat();
                    break;

                case "LightDirW":
                    p.system_p = true;
                    lightDirW  = p.GetFloat();
                    break;

                case "LightDir":
                    p.system_p = true;
                    {
                        Vector3 v = p.GetFloat3();
                        lightDirX = v.X;
                        lightDirY = v.Y;
                        lightDirZ = v.Z;
                    }
                    break;

                case "ShadeTex":
                    p.system_p = true;
                    shadeTex   = p;
                    break;

                case "ColorTex":
                    p.system_p = true;
                    colorTex   = p;
                    break;
                }
                shader_parameters[i++] = p;
            }
            Array.Resize(ref shader_parameters, i);
        }
Example #2
0
        /// <summary>
        /// シェーダ設定を読み込みます。
        /// </summary>
        /// <param name="lines">テキスト行配列</param>
        public void Load(string[] lines)
        {
            shader_parameters = new ShaderParameter[lines.Length];
            int i = 0;

            foreach (string line in lines)
            {
                ShaderParameter p = ShaderParameter.Parse(line);
                switch (p.name)
                {
                case "description":
                    break;

                case "shader":
                    break;

                case "technique":
                    technique_name = p.GetString();
                    break;

                case "Ambient":
                    desc.Ambient = p.GetFloat();
                    break;

                case "Thickness":
                    desc.Thickness = p.GetFloat();
                    break;

                case "ColorBlend":
                    desc.ColorBlend = p.GetFloat();
                    break;

                case "ShadeBlend":
                    desc.ShadeBlend = p.GetFloat();
                    break;

                case "HighLight":
                    desc.HighLight = p.GetFloat();
                    break;

                case "HighLightBlend":
                    desc.HighLightBlend = p.GetFloat();
                    break;

                case "HighLightPower":
                    desc.HighLightPower = p.GetFloat();
                    break;

                case "UVScroll":
                    desc.UVScroll = p.GetFloat();
                    break;

                case "PenColor":
                    desc.PenColor = p.GetFloat4();
                    break;

                case "FrontLight":
                    desc.FrontLight = p.GetFloat4();
                    break;

                case "FrontLightPower":
                    desc.FrontLightPower = p.GetFloat();
                    break;

                case "BackLight":
                    desc.BackLight = p.GetFloat4();
                    break;

                case "BackLightPower":
                    desc.BackLightPower = p.GetFloat();
                    break;

                case "UVScrollX":
                    desc.UVScrollX = p.GetFloat();
                    break;

                case "UVScrollY":
                    desc.UVScrollY = p.GetFloat();
                    break;

                case "ShadeTex":
                    ShadeTexName = p.GetString();
                    break;

                case "ColorTex":
                    ColorTexName = p.GetString();
                    break;

                case "LightDirX":
                case "LightDirY":
                case "LightDirZ":
                case "LightDirW":
                case "ShadowColor":
                    break;
                }
                shader_parameters[i++] = p;
            }
            Array.Resize(ref shader_parameters, i);
        }