Beispiel #1
0
    public IEnumerator Setup()
    {
        yield return(TestUtils.LaunchNewPoolBenchmarkAsync(true, true));

        ResetFrameTime();


        //Setup SpawnPositions
        var spawns = MapGeneration.GeneratePointsScattered(0, 0, TestUtils.MAX_SPAWNS);

        for (int i = 0; i < TestUtils.MAX_SPAWNS; i++)
        {
            _collectionSpawnpoints.Add(new Vector3(spawns[i].x, spawns[i].y, spawns[i].z));

            var go = GameObject.Instantiate(Resources.Load <GameObject>(_prefabPath));
            go.SetActive(false);
            _pool.Add(go);
        }

        RenderMaster.RenderTerrain = false;


        for (int i = 0; i < m_StabilizationFrames; i++)
        {
            yield return(0);
        }
    }
Beispiel #2
0
        public GPUGrassModel(Config_Grass config)
        {
            Config        = config;
            VerticesCount = Config.Amount * config.Segments * 2;
            IndicesCount  = Config.Amount * (config.Segments - 1) * 6;

            VerticesKernelDimensions = new Vector2Int(Config.Amount, 1);
            IndicesKernelDimensions  = new Vector2Int(Config.Amount, config.Segments);
            Spawnpoints = MapGeneration.GeneratePointsScattered(config.Grasswidth, config.Grasswidth, (uint)Config.Amount, 0);               //todo: dependant on spawn config

            VerticesKernelStride = Marshal.SizeOf(typeof(GPUModelVertex));
            IndicesKernelStride  = Marshal.SizeOf(typeof(int));

            BuildDataComputeBufferType = ComputeBufferType.Append;
            UpdateType = UpdateType.None;
        }
    public IEnumerator Setup()
    {
        yield return(TestUtils.LaunchNewPoolBenchmarkAsync(true, true));

        ResetFrameTime();


        //Setup SpawnPositions
        var spawns = MapGeneration.GeneratePointsScattered(0, 0, TestUtils.MAX_SPAWNS);

        for (int i = 0; i < TestUtils.MAX_SPAWNS; i++)
        {
            _collectionSpawnpoints.Add(new Vector3(spawns[i].x, spawns[i].y, spawns[i].z));
        }

        RenderMaster.RenderTerrain = false;

        for (int i = 0; i < m_StabilizationFrames; i++)
        {
            yield return(0);
        }
    }