예제 #1
0
        public void Start()
        {
            TaskUtils.SetGlobalMultithreading(false);
            TextureRendererServiceConfiguration textureRendererServiceConfiguration = new TextureRendererServiceConfiguration();

            textureRendererServiceConfiguration.StepSize = new Vector2(10, 10);

            UTTextureRendererProxy utTextureRenderer = new UTTextureRendererProxy(new TextureRendererService(
                                                                                      new MultistepTextureRenderer(Object.FindObjectOfType <ComputeShaderContainerGameObject>()), textureRendererServiceConfiguration));

            TextureConcieverUTProxy utTextureConciever = new TextureConcieverUTProxy();

            LateAssignFactory <BaseTerrainDetailProvider> terrainDetailProviderFactory = new LateAssignFactory <BaseTerrainDetailProvider>(() => _mockProvider);

            _merger = new TerrainDetailCornerMerger(terrainDetailProviderFactory, new TerrainDetailAlignmentCalculator(240), utTextureRenderer, utTextureConciever, new CommonExecutorUTProxy(), new TerrainDetailCornerMergerConfiguration());

            //TaskUtils.DebuggerAwareWait(Test1());
            //TaskUtils.DebuggerAwareWait(Test2());
            //TaskUtils.DebuggerAwareWait(Test3());
            //TaskUtils.DebuggerAwareWait(Test4());
            //TaskUtils.DebuggerAwareWait(Test5());
            //TaskUtils.DebuggerAwareWait(Test6());
            //TaskUtils.DebuggerAwareWait(Test7());
            TaskUtils.DebuggerAwareWait(Test8());
        }
        public static GRing2PatchesCreator CreateRing2PatchesCreator(UltraUpdatableContainer updatableContainer, Dictionary <int, float> intensityPatternPixelsPerUnit)
        {
            TextureConcieverUTProxy conciever = new TextureConcieverUTProxy();

            updatableContainer.Add(conciever);

            Ring2RandomFieldFigureGenerator figureGenerator = new Ring2RandomFieldFigureGenerator(new TextureRenderer(),
                                                                                                  new Ring2RandomFieldFigureGeneratorConfiguration()
            {
                PixelsPerUnit = new Vector2(1, 1)
            });
            var utFigureGenerator = new RandomFieldFigureGeneratorUTProxy(figureGenerator);

            updatableContainer.Add(utFigureGenerator);

            var randomFieldFigureRepository = new Ring2RandomFieldFigureRepository(utFigureGenerator,
                                                                                   new Ring2RandomFieldFigureRepositoryConfiguration(2, new Vector2(20, 20)));

            Quadtree <Ring2Region> regionsTree = Ring2TestUtils.CreateRegionsTreeWithPath3(randomFieldFigureRepository);

            return(new GRing2PatchesCreator(
                       new MonoliticRing2RegionsDatabase(regionsTree),
                       new GRing2RegionsToPatchTemplateConventer(),
                       new Ring2PatchTemplateCombiner(),
                       new Ring2PatchCreator(),
                       new Ring2IntensityPatternProvider(conciever),
                       new GRing2Deviser(),
                       new Ring2PatchesOverseerConfiguration()
            {
                IntensityPatternPixelsPerUnit = intensityPatternPixelsPerUnit
            }
                       ));
        }
예제 #3
0
 public HabitatTexturesGenerator(HabitatMapDbProxy habitatDbProxy,
                                 HabitatTexturesGeneratorConfiguration configuration,
                                 TextureConcieverUTProxy textureConciever)
 {
     _habitatDbProxy   = habitatDbProxy;
     _configuration    = configuration;
     _textureConciever = textureConciever;
 }
 public TerrainDetailCornerMerger(LateAssignFactory <BaseTerrainDetailProvider> terrainDetailProviderFactory,
                                  TerrainDetailAlignmentCalculator alignmentCalculator, UTTextureRendererProxy renderer, TextureConcieverUTProxy textureConciever,
                                  CommonExecutorUTProxy commonExecutor, TerrainDetailCornerMergerConfiguration configuration)
 {
     _terrainDetailProviderFactory = terrainDetailProviderFactory;
     _alignmentCalculator          = alignmentCalculator;
     _renderer            = renderer;
     _textureConciever    = textureConciever;
     this._commonExecutor = commonExecutor;
     _configuration       = configuration;
 }
예제 #5
0
        private GRing2PatchesCreator CreateRing2PatchesCreator()
        {
            var ring2ShaderRepository = Ring2PlateShaderRepository.Create();

            TextureConcieverUTProxy conciever = new TextureConcieverUTProxy();

            _updatableContainer.AddUpdatableElement(conciever);

            _ring2PatchesPainterUtProxy = new Ring2PatchesPainterUTProxy(
                new Ring2PatchesPainter(
                    new Ring2MultishaderMaterialRepository(ring2ShaderRepository, Ring2ShaderNames.ShaderNames)));
            _updatableContainer.AddUpdatableElement(_ring2PatchesPainterUtProxy);

            Ring2RandomFieldFigureGenerator figureGenerator = new Ring2RandomFieldFigureGenerator(new TextureRenderer(),
                                                                                                  new Ring2RandomFieldFigureGeneratorConfiguration()
            {
                PixelsPerUnit = new Vector2(2, 2)
            });
            var utFigureGenerator = new RandomFieldFigureGeneratorUTProxy(figureGenerator);

            _updatableContainer.AddUpdatableElement(utFigureGenerator);

            var randomFieldFigureRepository = new Ring2RandomFieldFigureRepository(utFigureGenerator,
                                                                                   new Ring2RandomFieldFigureRepositoryConfiguration(2, new Vector2(20, 20)));

            Quadtree <Ring2Region> regionsTree = Ring2TestUtils.CreateRegionsTreeWithPath3(randomFieldFigureRepository);

            return(new GRing2PatchesCreator(
                       new MonoliticRing2RegionsDatabase(regionsTree),
                       new GRing2RegionsToPatchTemplateConventer(),
                       new Ring2PatchTemplateCombiner(),
                       new Ring2PatchCreator(),
                       new Ring2IntensityPatternProvider(conciever),
                       new GRing2Deviser(),
                       new Ring2PatchesOverseerConfiguration()
            {
                IntensityPatternPixelsPerUnit = new Dictionary <int, float>()
                {
                    { 1, 1 }
                }
                //PatchSize = new Vector2(90, 90)
            }
                       ));
        }
        public static ESurfacePatchProvider ConstructProvider(UltraUpdatableContainer updatableContainer, Dictionary <int, float> intensityPatternPixelsPerUnit,
                                                              ComputeShaderContainerGameObject shaderContainerGO, int mipmapLevelToExtract, Dictionary <int, float> plateStampPixelsPerUnit)
        {
            var ring2ShaderRepository         = Ring2PlateShaderRepository.Create();
            TextureConcieverUTProxy conciever = new TextureConcieverUTProxy();

            updatableContainer.Add(conciever);

            var ring2PatchesPainterUtProxy = new Ring2PatchesPainterUTProxy(
                new Ring2PatchesPainter(
                    new Ring2MultishaderMaterialRepository(ring2ShaderRepository, Ring2ShaderNames.ShaderNames)));

            updatableContainer.Add(ring2PatchesPainterUtProxy);

            UTRing2PlateStamperProxy stamperProxy = new UTRing2PlateStamperProxy(
                new Ring2PlateStamper(new Ring2PlateStamperConfiguration()
            {
                PlateStampPixelsPerUnit = plateStampPixelsPerUnit
            }, shaderContainerGO));

            updatableContainer.Add(stamperProxy);

            UTTextureRendererProxy textureRendererProxy = new UTTextureRendererProxy(new TextureRendererService(
                                                                                         new MultistepTextureRenderer(shaderContainerGO), new TextureRendererServiceConfiguration()
            {
                StepSize = new Vector2(500, 500)
            }));

            updatableContainer.Add(textureRendererProxy);

            CommonExecutorUTProxy commonExecutorUtProxy = new CommonExecutorUTProxy(); //todo

            updatableContainer.Add(commonExecutorUtProxy);

            Ring2PatchStamplingOverseerFinalizer patchStamperOverseerFinalizer =
                new Ring2PatchStamplingOverseerFinalizer(stamperProxy, textureRendererProxy, commonExecutorUtProxy);

            MipmapExtractor mipmapExtractor     = new MipmapExtractor(textureRendererProxy);
            var             patchesCreatorProxy = new GRing2PatchesCreatorProxy(CreateRing2PatchesCreator(updatableContainer, intensityPatternPixelsPerUnit));

            return(new ESurfacePatchProvider(patchesCreatorProxy, patchStamperOverseerFinalizer, commonExecutorUtProxy, mipmapExtractor, mipmapLevelToExtract));
        }