Beispiel #1
0
        public XmlElement Save(XmlDocument doc)
        {
            XmlElement me = doc.CreateElement("pass");

            me.SetAttribute("name", Name);
            if (IsSM3.HasValue)
            {
                me.SetAttribute("sm3", IsSM3.Value ? "true" : "false");
            }
            if (IsDesktop.HasValue)
            {
                me.SetAttribute("desktop", IsDesktop.Value ? "true" : "false");
            }
            if (VS != null && VS.Length > 0)
            {
                me.SetAttribute("vs", VS);
            }
            if (PS != null && PS.Length > 0)
            {
                me.SetAttribute("ps", PS);
            }
            if (VSDefines.Count > 0)
            {
                me.SetAttribute("vsdefines", string.Join(" ", VSDefines.ToArray()));
            }
            if (PSDefines.Count > 0)
            {
                me.SetAttribute("psdefines", string.Join(" ", PSDefines.ToArray()));
            }

            me.SetAttribute("lighting", LightMode.ToString().ToLower());
            me.SetAttribute("blend", BlendMode.ToString().ToLower());
            me.SetAttribute("depthtest", DepthTest.ToString().ToLower());
            me.SetAttribute("depthwrite", DepthWrite ? "true" : "false");
            me.SetAttribute("alphamask", AlphaMask ? "true" : "false");

            return(me);
        }
Beispiel #2
0
 public string GetDepthTestString()
 {
     return("ZTest " + depthTest.ToString());
 }