private IEnumerable <RenderBatch> _RenderBatches( ) { foreach (var sectionBuffer in sectionBuffers) { var mesh = sectionBuffer; foreach (var part in mesh.Parts) { var texcoordRange = RenderModel.CompressionInfo[0].ExtractTexcoordScaling( ); var batch = new RenderBatch { ElementStartIndex = part.StripStartIndex * sizeof(ushort), ElementLength = part.StripLength }; batch.AssignUniform("TexcoordRangeUniform", texcoordRange); batch.AssignUniform("WorldMatrixUniform", WorldMatrix); for (var i = 0; i < mesh.SectionBlock.SectionData[0].NodeMap.Length; ++i) { var inverseBindPoseMatrix = Nodes.GetInverseBindPoseTransfrom(mesh.SectionBlock.SectionData[0].NodeMap[i].NodeIndex); var poseMatrix = Nodes.GetPoseTransfrom(mesh.SectionBlock.SectionData[0].NodeMap[i].NodeIndex); var final = inverseBindPoseMatrix * poseMatrix; batch.AssignUniform(string.Format("BoneMatrices[{0}]", i), final); } batch.Shader = new ShaderReference( ShaderReference.ReferenceType.Halo2, ( int )RenderModel.Materials[part.Material].Shader.Ident); batch.PrimitiveType = PrimitiveType.TriangleStrip; batch.BatchObject = mesh.TriangleBatch; yield return(batch); } } }