Exemple #1
0
        public void Init(PipelineResources res)
        {
            blitNormalMat = new Material(res.shaders.blitNormalShader);
            msbForCluster = new MStringBuilder(100);
            for (int i = 0; i < clusterProperties.Count; ++i)
            {
                var cur = clusterProperties[i];
                cur.Init(i, msbForCluster, this);
            }

            rgbaPool.Init(0, RenderTextureFormat.ARGB32, (int)fixedTextureSize, this, false);
            normalPool.Init(1, RenderTextureFormat.RGHalf, (int)fixedTextureSize, this, true);
            emissionPool.Init(2, RenderTextureFormat.ARGBHalf, (int)fixedTextureSize, this, false);
            heightPool.Init(3, RenderTextureFormat.R8, (int)fixedTextureSize, this, true);
            vmManager = new VirtualMaterialManager(materialPoolSize, maximumMaterialCount, res.shaders.streamingShader);
        }
        public void Init(PipelineResources res)
        {
            current            = this;
            referenceCacheDict = new NativeDictionary <int4x4, int, Int4x4Equal>(200, Allocator.Persistent, new Int4x4Equal());
            mipIDs             = new NativeArray <int>(2, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
            mipIDs[0]          = Shader.PropertyToID("_Mip0");
            mipIDs[1]          = Shader.PropertyToID("_Mip1");

            /*mipIDs[2] = Shader.PropertyToID("_Mip2");
            *  mipIDs[3] = Shader.PropertyToID("_Mip3");
            *  mipIDs[4] = Shader.PropertyToID("_Mip4");
            *  mipIDs[5] = Shader.PropertyToID("_Mip5");*/
            rgbaPool.Init(0, GraphicsFormat.R8G8B8A8_UNorm, (int)fixedTextureSize, this);
            emissionPool.Init(2, GraphicsFormat.R16G16B16A16_SFloat, (int)fixedTextureSize, this);
            heightPool.Init(3, GraphicsFormat.R8_UNorm, (int)fixedTextureSize, this);
            vmManager = new VirtualMaterialManager(materialPoolSize, maximumMaterialCount, res.shaders.streamingShader);
            SceneStreaming.loading = false;
        }
        public void Init(PipelineResources res)
        {
            allScenes     = new List <SceneStreaming>(clusterProperties.Count);
            msbForCluster = new MStringBuilder(100);
            msbForTex     = new MStringBuilder(100);
            for (int i = 0; i < clusterProperties.Count; ++i)
            {
                var cur = clusterProperties[i];
                allScenes.Add(new SceneStreaming(cur, i, msbForCluster, this));
            }
            NativeArray <TextureFormat> allFormats = new NativeArray <TextureFormat>(4, Allocator.Temp, NativeArrayOptions.UninitializedMemory);

            allFormats[0] = TextureFormat.RGBA32;
            allFormats[1] = TextureFormat.RGHalf;
            allFormats[2] = TextureFormat.RGBAHalf;
            allFormats[3] = TextureFormat.R8;
            texStreaming.Init(allFormats, res);
            rgbaPool.Init(texStreaming, 0, RenderTextureFormat.ARGB32, msbForTex);
            normalPool.Init(texStreaming, 1, RenderTextureFormat.RGHalf, msbForTex);
            emissionPool.Init(texStreaming, 2, RenderTextureFormat.ARGBHalf, msbForTex);
            heightPool.Init(texStreaming, 3, RenderTextureFormat.R8, msbForTex);
            vmManager = new VirtualMaterialManager(materialPoolSize, maximumMaterialCount, res.shaders.streamingShader);
        }
        public void Init(PipelineResources res)
        {
            referenceCacheDict = new NativeDictionary <int4x4, int, Int4x4Equal>(200, Allocator.Persistent, new Int4x4Equal());
            mipIDs             = new NativeArray <int>(2, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
            mipIDs[0]          = Shader.PropertyToID("_Mip0");
            mipIDs[1]          = Shader.PropertyToID("_Mip1");

            /*mipIDs[2] = Shader.PropertyToID("_Mip2");
            *  mipIDs[3] = Shader.PropertyToID("_Mip3");
            *  mipIDs[4] = Shader.PropertyToID("_Mip4");
            *  mipIDs[5] = Shader.PropertyToID("_Mip5");*/
            msbForCluster = new MStringBuilder(100);
            for (int i = 0; i < clusterProperties.Count; ++i)
            {
                var cur = clusterProperties[i];
                cur.Init(msbForCluster, this);
            }

            rgbaPool.Init(0, GraphicsFormat.R8G8B8A8_UNorm, (int)fixedTextureSize, this);
            emissionPool.Init(2, GraphicsFormat.R16G16B16A16_SFloat, (int)fixedTextureSize, this);
            heightPool.Init(3, GraphicsFormat.R8_UNorm, (int)fixedTextureSize, this);
            vmManager = new VirtualMaterialManager(materialPoolSize, maximumMaterialCount, res.shaders.streamingShader);
        }