Beispiel #1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="model">从模型到buffer的renderer</param>
 /// <param name="allShaderCodes">shader代码</param>
 /// <param name="propertyNameMap">vertex shader中的in变量与<see cref="propertyBufferPointers"/>中的元素名字的对应关系。</param>
 public ModernRenderer(IConvert2BufferPointer model, CodeShader[] allShaderCodes, PropertyNameMap propertyNameMap, UniformNameMap uniformNameMap)
 {
     this.model           = model;
     this.allShaderCodes  = allShaderCodes;
     this.propertyNameMap = propertyNameMap;
     this.uniformNameMap  = uniformNameMap;
 }
Beispiel #2
0
        public static UniformNameMap Parse(XElement xElement)
        {
            if (xElement.Name != typeof(UniformNameMap).Name)
            {
                throw new Exception();
            }

            UniformNameMap result = new UniformNameMap();

            //result.RendererType = xElement.Attribute(strRendererType).Value;
            //result.DumperType = xElement.Attribute(strDumperType).Value;

            foreach (var item in xElement.Elements(typeof(NamePair).Name))
            {
                var pair = NamePair.Parse(item);
                result.namesInIConvert2BufferRenderer.Add(pair.NameInIConvert2BufferRenderer);
                result.namesInShader.Add(pair.UniformNameInShader);
            }

            return(result);
        }