示例#1
0
        public void SetOutputSizeEnumTest()
        {
            Substance.Game.Substance subs  = SubstanceExtensionsTestData.Instance.TestSubstance;
            SubstanceGraph           graph = subs.graphs[0];

            int cachedSize = graph.GetInputVector2Int(SubstanceGraphExtensions.OutputSizeParameter)[0];
            SubstanceOutputSize newSize = cachedSize == 9 ? SubstanceOutputSize._1024 : SubstanceOutputSize._512;

            Debug.Log(graph.GetGeneratedTextures()[0].width);

            graph.SetOutputSize(newSize);

            //NativeFunctions.cppProcessOutputQueue();
            graph.QueueForRender();
            Substance.Game.Substance.RenderSubstancesSync();

            int width = graph.GetGeneratedTextures()[0].width;


            Debug.Log(graph.GetGeneratedTextures()[0].width);

            Assert.AreEqual(width, (newSize == SubstanceOutputSize._1024 ? 1024 : 512));

            graph.SetOutputSize(cachedSize);

            //NativeFunctions.cppProcessOutputQueue();
            graph.QueueForRender();
            Substance.Game.Substance.RenderSubstancesSync();
        }
示例#2
0
        public void SetOutputSizeTest()
        {
            Substance.Game.Substance subs  = SubstanceExtensionsTestData.Instance.TestSubstance;
            SubstanceGraph           graph = subs.graphs[0];

            int cachedSize = graph.GetInputVector2Int(SubstanceGraphExtensions.OutputSizeParameter)[0];
            int newSize    = cachedSize == 9 ? 10 : 9;

            graph.SetOutputSize(newSize);
            graph.QueueForRender();

            Substance.Game.Substance.RenderSubstancesSync();

            int width = graph.GetGeneratedTextures()[0].width;

            Debug.Log(string.Format("{0} | {1} | {2} - {3}", width, (newSize == 10 ? 1024 : 512), cachedSize, newSize));

            Assert.AreEqual(width, (newSize == 10 ? 1024 : 512));

            graph.SetOutputSize(cachedSize);
            graph.QueueForRender();

            Substance.Game.Substance.RenderSubstancesSync();
        }