Example #1
0
 // Messages
 private void Awake()
 {
     _meshFilter  = GetComponent <MeshFilter>();
     _naiveMesh   = GetComponent <NaiveMesh>();
     _cullingMesh = GetComponent <CullingMesh>();
     _greedyMesh  = GetComponent <GreedyMesh>();
 }
        public static void Main(string[] args)
        {
            if (Environment.OSVersion.Platform == PlatformID.Win32NT)
            {
                Console.SetBufferSize(Console.BufferWidth, 200);
            }

            const int width  = 16;
            const int height = 16;

            ushort[] chunk = new ushort[width * height];
            PopulateChunk(chunk, width, height);

            DrawOnConsole(chunk, width, height);
            DrawVerticalLine((width - 1) * 2 + 2);
            List <MeshData> data = GreedyMesh.Reduce(chunk, width, height);

            DrawOnConsole(data, width, height);
            Console.Write("Reduced size from: " + width * height + " to " + data.Count);
            Console.ReadKey();
        }
Example #3
0
 protected override void InitializeInternal(Chunk chunk, Block[] blocks, int active, int maxBlocks)
 {
     GreedyMesh.Generate(chunk.Blocks, CreateQuad, out _vertices, out _indices);
 }