Exemple #1
0
    public void SpawnGrass()
    {
        if (SmoothVoxelSettings.enableGrass)
        {
            height_buffer = new ComputeBuffer(Sampler.GetSurfaceData().Length, sizeof(float));
            height_buffer.SetData(Sampler.GetSurfaceData());

            plantMap_buffer = new ComputeBuffer(((TerrainSampler)Sampler).GetPlantMap().Length, sizeof(int));
            plantMap_buffer.SetData(((TerrainSampler)Sampler).GetPlantMap());

            grassDump = ((TerrainSampler)Sampler).GetPlantMap();

            SpawnGrass(0, 0, vertex_buffers[0], grasses[0]);
            SpawnGrass(0, 1, vertex_buffers[1], grasses[1]);
            SpawnGrass(1, 0, vertex_buffers[2], grasses[2]);
            SpawnGrass(1, 1, vertex_buffers[3], grasses[3]);
        }
    }