Пример #1
0
        public static void Awake(PipelineResources resources, int resolution, int texArrayCapacity, int propertyCapacity, string mapResources)
        {
            SceneController.resolution = resolution;
            singletonReady             = true;
            SceneController.resources  = resources;
            addList          = new NativeList <ulong>(10, Allocator.Persistent);
            baseBuffer       = new PipelineBaseBuffer();
            clusterResources = Resources.Load <ClusterMatResources>("MapMat/" + mapResources);
            int clusterCount = 0;

            allScenes = new List <SceneStreaming>(clusterResources.clusterProperties.Count);
            foreach (var i in clusterResources.clusterProperties)
            {
                clusterCount += i.clusterCount;
                allScenes.Add(new SceneStreaming(i));
            }
            PipelineFunctions.InitBaseBuffer(baseBuffer, clusterResources, mapResources, clusterCount);
            pointerContainer = new NativeList <ulong>(clusterCount, Allocator.Persistent);
            commandQueue     = new LoadingCommandQueue();
            RenderTextureDescriptor desc = new RenderTextureDescriptor
            {
                autoGenerateMips   = false,
                bindMS             = false,
                colorFormat        = RenderTextureFormat.ARGB32,
                depthBufferBits    = 0,
                dimension          = TextureDimension.Tex2DArray,
                enableRandomWrite  = false,
                height             = resolution,
                width              = resolution,
                memoryless         = RenderTextureMemoryless.None,
                msaaSamples        = 1,
                vrUsage            = VRTextureUsage.None,
                volumeDepth        = texArrayCapacity,
                shadowSamplingMode = ShadowSamplingMode.None,
                sRGB      = false,
                useMipMap = false
            };

            commonData = new SceneCommonData
            {
                texDict              = new Dictionary <string, SceneCommonData.TextureIdentifier>(),
                avaiableProperties   = new NativeList <int>(propertyCapacity, Allocator.Persistent),
                avaiableTexs         = new NativeList <int>(texArrayCapacity, Allocator.Persistent),
                texCopyBuffer        = new ComputeBuffer(resolution * resolution, sizeof(int)),
                propertyBuffer       = new ComputeBuffer(propertyCapacity, sizeof(PropertyValue)),
                copyTextureMat       = new Material(resources.copyShader),
                texArray             = new RenderTexture(desc),
                clusterMaterial      = new Material(resources.clusterRenderShader),
                terrainMaterial      = new Material(resources.terrainShader),
                terrainDrawStreaming = new TerrainDrawStreaming(100, 16, resources.terrainCompute)
            };

            for (int i = 0; i < propertyCapacity; ++i)
            {
                commonData.avaiableProperties.Add(i);
            }
            for (int i = 0; i < texArrayCapacity; ++i)
            {
                commonData.avaiableTexs.Add(i);
            }
        }
Пример #2
0
 protected override void Init(PipelineResources resources)
 {
     taaMat = new Material(resources.shaders.taaShader);
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
 }
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
 }
Пример #4
0
 protected override void Init(PipelineResources resources)
 {
     targetIdentifiers = new RenderTargetIdentifier[2];
 }
Пример #5
0
 protected override void Init(PipelineResources resources)
 {
     muberMaterial = new Material(resources.shaders.uberShader);
 }
Пример #6
0
 public virtual void PrepareJob(PipelineResources resources)
 {
 }
 protected override void Init(PipelineResources resources)
 {
     linearMat       = new Material(resources.shaders.linearDepthShader);
     linearDrawerMat = new Material(resources.shaders.linearDrawerShader);
 }
Пример #8
0
 protected virtual void Init(PipelineResources resources)
 {
 }
Пример #9
0
        /* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* *//* */

        protected override void Init(PipelineResources resources)
        {
            GTAOMaterial     = new Material(resources.shaders.gtaoShader);
            propertySetEvent = RenderPipeline.GetEvent <PropertySetEvent>();
        }
 protected override void Init(PipelineResources resources)
 {
     lightingEvt      = RenderPipeline.GetEvent <LightingEvent>();
     decalCountBuffer = new ComputeBuffer(CBDRSharedData.XRES * CBDRSharedData.YRES * CBDRSharedData.ZRES * (maxDecalPerCluster + 1), sizeof(uint));
     decalBuffer      = new ComputeBuffer(decalInitCount, sizeof(DecalData));
 }
Пример #11
0
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 protected override void Init(PipelineResources resources)
 {
     proper        = RenderPipeline.GetEvent <PropertySetEvent>();
     SSGi_Material = new Material(resources.shaders.ssgiShader);
 }
Пример #12
0
 protected override void Init(PipelineResources resources)
 {
     kernelBuffer = new ComputeBuffer(11, sizeof(float4));
     rand         = new Random((uint)System.Guid.NewGuid().GetHashCode());
     mat          = new Material(resources.shaders.sssShader);
 }
Пример #13
0
 public void InitHiZ(PipelineResources resources)
 {
     sd = resources.shaders.HizLodShader;
 }
Пример #14
0
 public void Init(PipelineResources res)
 {
     constantBuffer = new ComputeBuffer(1, sizeof(CyberSetData), ComputeBufferType.Constant);
     glitchMat      = new Material(res.shaders.cyberGlitchShader);
 }
Пример #15
0
 protected override void Init(PipelineResources resources)
 {
     lightingData = RenderPipeline.GetEvent <LightingEvent>();
 }
Пример #16
0
 public void CheckInit(PipelineResources resources)
 {
     initialized = true;
     Init(resources);
 }
 protected override void Init(PipelineResources resources)
 {
     traceMat = new Material(resources.rayTracingTestShader);
 }
Пример #18
0
 protected override void Init(PipelineResources resources)
 {
     gbufferMaterial = new Material(resources.gbufferShader);
 }
Пример #19
0
 protected override void Init(PipelineResources resources)
 {
 }
Пример #20
0
 protected abstract void Init(PipelineResources resources);
Пример #21
0
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     blur.Init(resources.shaders.rapidBlurShader);
 }
 protected override void Init(PipelineResources resources)
 {
     overrideOpaqueMaterial = new Material(resources.shaders.overrideOpaqueShader);
     rand = new Random((uint)System.Guid.NewGuid().GetHashCode());
     Shader.SetGlobalMatrix(ShaderIDs._LastFrameModel, Matrix4x4.zero);
 }
Пример #23
0
 protected override void Init(PipelineResources resources)
 {
     taaMat = new Material(resources.shaders.taaShader);
 }
 protected override void Init(PipelineResources resources)
 {
     lightingData = RenderPipeline.GetEvent <LightingEvent>();
     reflectData  = RenderPipeline.GetEvent <ReflectionEvent>();
     lightingMat  = new Material(resources.shaders.lightingShader);
 }
 public void Init(PipelineResources res)
 {
     getDataFunc = (c) => new SSRCameraData(new Vector2Int(c.cam.pixelWidth, c.cam.pixelHeight), (int)RayCastingResolution);
     StochasticScreenSpaceReflectionMaterial = new Material(res.shaders.ssrShader);
 }
Пример #26
0
 protected override void Init(PipelineResources resources)
 {
     reflectMaterial = new Material(resources.reflectionShader);
     block           = new MaterialPropertyBlock();
 }
Пример #27
0
        public CBDRSharedData(PipelineResources res)
        {
            dirLightShadowmap  = null;
            useFroxel          = false;
            availiableDistance = 0;
            spotShadowCount    = 0;
            pointshadowCount   = 0;
            lightFlag          = 0;
            cbdrShader         = res.shaders.cbdrShader;
            RenderTextureDescriptor desc = new RenderTextureDescriptor
            {
                autoGenerateMips   = false,
                bindMS             = false,
                colorFormat        = RenderTextureFormat.ARGBFloat,
                depthBufferBits    = 0,
                enableRandomWrite  = true,
                dimension          = TextureDimension.Tex3D,
                width              = XRES,
                height             = YRES,
                volumeDepth        = 4,
                memoryless         = RenderTextureMemoryless.None,
                msaaSamples        = 1,
                shadowSamplingMode = ShadowSamplingMode.None,
                sRGB      = false,
                useMipMap = false,
                vrUsage   = VRTextureUsage.None
            };

            cubeArrayMap = new RenderTexture(new RenderTextureDescriptor
            {
                autoGenerateMips   = false,
                bindMS             = false,
                colorFormat        = RenderTextureFormat.RHalf,
                depthBufferBits    = 16,
                dimension          = TextureDimension.CubeArray,
                volumeDepth        = 6 * MAXIMUMPOINTLIGHTCOUNT,
                enableRandomWrite  = false,
                height             = MLight.cubemapShadowResolution,
                width              = MLight.cubemapShadowResolution,
                memoryless         = RenderTextureMemoryless.None,
                msaaSamples        = 1,
                shadowSamplingMode = ShadowSamplingMode.None,
                sRGB      = false,
                useMipMap = false,
                vrUsage   = VRTextureUsage.None
            });
            cubeArrayMap.filterMode = FilterMode.Bilinear;
            cubeArrayMap.Create();
            spotArrayMap = new RenderTexture(new RenderTextureDescriptor
            {
                autoGenerateMips   = false,
                bindMS             = false,
                colorFormat        = RenderTextureFormat.Shadowmap,
                depthBufferBits    = 16,
                dimension          = TextureDimension.Tex2DArray,
                enableRandomWrite  = false,
                height             = MLight.perspShadowResolution,
                memoryless         = RenderTextureMemoryless.None,
                msaaSamples        = 1,
                shadowSamplingMode = ShadowSamplingMode.CompareDepths,
                sRGB        = false,
                useMipMap   = false,
                volumeDepth = MAXIMUMSPOTLIGHTCOUNT,
                vrUsage     = VRTextureUsage.None,
                width       = MLight.perspShadowResolution
            });
            spotArrayMap.filterMode = FilterMode.Bilinear;
            spotArrayMap.Create();
            xyPlaneTexture            = new RenderTexture(desc);
            xyPlaneTexture.filterMode = FilterMode.Point;
            xyPlaneTexture.Create();
            desc.dimension   = TextureDimension.Tex2D;
            desc.volumeDepth = 1;
            desc.width       = ZRES;
            desc.height      = 2;
            zPlaneTexture    = new RenderTexture(desc);
            zPlaneTexture.Create();
            pointlightIndexBuffer = new ComputeBuffer(XRES * YRES * ZRES * (MAXLIGHTPERCLUSTER + 1), sizeof(int));
            spotlightIndexBuffer  = new ComputeBuffer(XRES * YRES * ZRES * (MAXLIGHTPERCLUSTER + 1), sizeof(int));
            allPointLightBuffer   = new ComputeBuffer(pointLightInitCapacity, sizeof(PointLightStruct));
            allSpotLightBuffer    = new ComputeBuffer(pointLightInitCapacity, sizeof(SpotLight));
            desc.width            = XRES;
            desc.height           = YRES;
            desc.volumeDepth      = MAXPOINTLIGHTPERTILE;
            desc.colorFormat      = RenderTextureFormat.RInt;
            desc.dimension        = TextureDimension.Tex3D;
            pointTileLightList    = new RenderTexture(desc);
            pointTileLightList.Create();
            desc.volumeDepth  = MAXSPOTLIGHTPERTILE;
            spotTileLightList = new RenderTexture(desc);
            spotTileLightList.Create();
            desc.volumeDepth         = FROXELMAXPOINTLIGHTPERTILE;
            froxelpointTileLightList = new RenderTexture(desc);
            froxelpointTileLightList.Create();
            desc.volumeDepth        = FROXELMAXSPOTLIGHTPERTILE;
            froxelSpotTileLightList = new RenderTexture(desc);
            froxelSpotTileLightList.Create();
            allFogVolumeBuffer = new ComputeBuffer(30, sizeof(FogVolume));
        }
 protected override void Init(PipelineResources resources)
 {
     hizDepth = new HizDepth();
     hizDepth.InitHiZ(resources);
     linearMat = new Material(resources.shaders.linearDepthShader);
 }