Esempio n. 1
0
        public void Start0()
        {
            var tonesCount  = 5;
            var levelsCount = 5;

            TaskUtils.SetGlobalMultithreading(false);
            var tones = TAMTone.CreateList(tonesCount, new Dictionary <int, TAMStrokeOrientation>()
            {
                { 0, TAMStrokeOrientation.Horizontal },
                { 3, TAMStrokeOrientation.Vertical },
                { 5, TAMStrokeOrientation.Both }
            });
            var levels = TAMMipmapLevel.CreateList(levelsCount);

            var fileManager    = new TAMPackFileManager();
            var soleImagesPack = fileManager.Load(@"C:\mgr\tmp\tam1\", tones, levels);

            var generator  = new TAMArrayGenerator();
            var tex2DArray = generator.Generate(soleImagesPack, tones, levels);

            var go       = GameObject.CreatePrimitive(PrimitiveType.Plane);
            var material = new Material(Shader.Find("Custom/Debug/TextureArrayLod"));

            material.SetTexture("_MainTex", tex2DArray);
            go.GetComponent <MeshRenderer>().material = material;
            MyAssetDatabase.CreateAndSaveAsset(tex2DArray, "Assets/Generated/TAM1.asset");
        }
Esempio n. 2
0
        public void StartDiagram()
        {
            var tonesCount  = 4;
            var levelsCount = 4;

            TaskUtils.SetGlobalMultithreading(false);

            var tones  = TAMTone.GenerateList(tonesCount, 3, 4);
            var levels = TAMMipmapLevel.CreateList(levelsCount);

            var tamPackGenerator = new TAMPackGenerator();
            var msw = new MyStopWatch();

            msw.StartSegment("Gen");
            var pack = tamPackGenerator.GenerateTamPack(GenerateDiagramConfiguration(tones, levels, 0.7f), true, Object.FindObjectOfType <ComputeShaderContainerGameObject>());

            Debug.Log(msw.CollectResults());
            var fileManager = new TAMPackFileManager();

            fileManager.Save(@"C:\mgr\tmp\tam2\", tones, levels, pack);
        }