Esempio n. 1
0
        /// <summary>
        ///modify shader ealtime
        /// </summary>
        public void WatchingShader(List <string> _shader)
        {
            string cc = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
            string v  = cc + "\\" + _shader[0];

            reloadvertex = new MonitorFile(v);
            string f = cc + "\\" + _shader[1];

            reloadfragment = new MonitorFile(f);
            reloadvertex.Watch();
            reloadfragment.Watch();
        }
Esempio n. 2
0
        public void ReadTextCoord(string[] textcoord)
        {
            foreach (var item in textcoord)
            {
                if (item.Equals("//textcoord"))
                {
                    continue;
                }
                if (item.Equals("//end textcoord"))
                {
                    break;
                }
                if (!item.Contains(@"//path:"))
                {
                    float[] floatData = Array.ConvertAll(item.Split(' '), float.Parse);
                    TextCoord.AddRange(floatData);
                }
                else
                {
                    string[] epath = item.Split(':');

                    string path = epath[1];
                    ArrayListTexture.Add(new Texture(path));
                    string cc = System.IO.Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
                    string v  = cc + "\\" + path;
                    reloadNewTexture = new MonitorFile(v);
                    reloadNewTexture.Watch();
                }
            }
            shader.Use();
            for (int i = 0; i < ArrayListTexture.Count(); i++)
            {
                switch (i)
                {
                case 0:
                    shader.SetInt("texture1", 0);
                    break;

                case 1:
                    shader.SetInt("texture2", 1);
                    break;

                default:
                    break;
                }
            }
        }