예제 #1
0
 public TerrainRenderer()
 {
     _detailManager = new GpuInstancingDetailOnTerrain(
         (ComputeShader)Resources.Load(Constants.CsPath.DetailInstantiationInResource),
         (ComputeShader)Resources.Load(Constants.CsPath.MergeBufferInResource),
         (ComputeShader)Resources.Load(Constants.CsPath.VisibilityDeterminationInResource));
 }
예제 #2
0
        public TerrainRenderer()
        {
            var detailInstantiation = (ComputeShader)Resources.Load(Constants.CsPath.DetailInstantiationInResource);
            var treeInstantiation   = (ComputeShader)Resources.Load(Constants.CsPath.TreeInstantiationInResource);
            var merge      = (ComputeShader)Resources.Load(Constants.CsPath.MergeBufferInResource);
            var visibility = (ComputeShader)Resources.Load(Constants.CsPath.VisibilityDeterminationInResource);
            var sort       = (ComputeShader)Resources.Load(Constants.CsPath.GpuSortInResource);

            if (merge != null && visibility != null)
            {
                if (detailInstantiation != null)
                {
                    _detailManager = new GpuInstancingDetailOnTerrain(detailInstantiation, merge, visibility, sort);
                }

//                if (treeInstantiation != null)
//                    _treeManager = new GpuInstancingTreeOnTerrain(treeInstantiation, merge, visibility);
            }
        }