Ejemplo n.º 1
0
        internal static int GetPerMaterialDataIndex(ref MyPerMaterialData data)
        {
            var key = data.CalculateKey();

            if (!HashIndex.ContainsKey(key))
            {
                HashIndex[key] = HashIndex.Count;
                Data.Add(data);
            }

            return HashIndex[key];
        }
Ejemplo n.º 2
0
        internal static void PreFrame()
        {
            TransferHashIndex.Clear();

            // bump default material as 0
            MyPerMaterialData defaultMat = new MyPerMaterialData();
            GetDrawMaterialIndex(GetPerMaterialDataIndex(ref defaultMat));

            // bump foliage material as 1 (important)
            MyPerMaterialData foliageMat = new MyPerMaterialData();
            foliageMat.Type = MyMaterialTypeEnum.FOLIAGE;
            GetDrawMaterialIndex(GetPerMaterialDataIndex(ref foliageMat));
        }
        internal static void FillPerMaterialData(ref MyPerMaterialData perMaterialData, string technique)
        {
            perMaterialData.Type = 0;

            switch(technique)
            {
                case "FOLIAGE":
                    perMaterialData.Type = MyMaterialTypeEnum.FOLIAGE;
                    break;
            }
        }