public static VShader ParseXml(XmlElement el) { VShader shader = new VShader(); Shader.ParseXml(el, shader); return(shader); }
public static DEffect LoadEffect(XmlDocument xml) { Param.InitKnownTypes(); DEffect effect = new DEffect(); XmlElement effectEl = (XmlElement)xml.SelectSingleNode("/effect"); effect.name = effectEl.Attributes["name"].InnerText; // parse params XmlNodeList paramEls = xml.SelectNodes("/effect/param"); effect._params = new Dictionary <string, Param>(paramEls.Count); for (int i = 0; i < paramEls.Count; i++) { Param p = Param.ParseXmlElement((XmlElement)paramEls[i]); effect._params[p.Name] = p; } // parse shaders XmlNodeList shaderEls = xml.SelectSingleNode("/effect/shaders").ChildNodes; effect.shaders = new Dictionary <string, Shader>(shaderEls.Count); for (int i = 0; i < shaderEls.Count; i++) { Shader s = null; if (shaderEls[i].Name == "vshader") { s = VShader.ParseXml((XmlElement)shaderEls[i]); } else if (shaderEls[i].Name == "pshader") { s = PShader.ParseXml((XmlElement)shaderEls[i]); } effect.shaders[s.ID] = s; } // parse techniques XmlNodeList techniqueEls = effectEl.SelectNodes("technique"); effect.techniques = new Dictionary <string, Technique>(techniqueEls.Count); for (int i = 0; i < techniqueEls.Count; i++) { Technique technique = Technique.ParseXmlElement((XmlElement)techniqueEls[i], effect.shaders); effect.techniques.Add(technique.Name, technique); } effect.ProcessAndVerify(); return(effect); }
public static VShader ParseXml(XmlElement el) { VShader shader = new VShader(); Shader.ParseXml(el, shader); return shader; }
public Pass(VShader vshader, PShader pshader) { this.vShader = vshader; this.pShader = pshader; }