Example #1
0
        public void Render(ref PipelineCommandData data, PipelineCamera cam, ReflectionEvent parentEvent)
        {
            RandomSampler = GenerateRandomOffset();
            SSRCameraData cameraData = IPerCameraData.GetProperty(cam, getDataFunc, parentEvent);

            SSR_UpdateVariable(cameraData, cam.cam, ref data);
            RenderScreenSpaceReflection(data.buffer, cameraData, cam);
        }
 protected override void Init(PipelineResources resources)
 {
     linearMat       = new Material(resources.shaders.linearDepthShader);
     linearDrawerMat = new Material(resources.shaders.linearDrawerShader);
     motionVecMat    = new Material(resources.shaders.motionVectorShader);
     if (useHiZ)
     {
         hizDepth.InitHiZ(resources, new Vector2(Screen.width, Screen.height));
         clusterMat = new Material(resources.shaders.clusterRenderShader);
     }
     ao            = RenderPipeline.GetEvent <AOEvents>();
     reflection    = RenderPipeline.GetEvent <ReflectionEvent>();
     proper        = RenderPipeline.GetEvent <PropertySetEvent>();
     downSampleMat = new Material(resources.shaders.depthDownSample);
 }
Example #3
0
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     if (useEmissionGeometry)
     {
         geometry.Init();
     }
     if (useNoiseEvents)
     {
         noiseEvents.Init(resources);
     }
     lightingData       = RenderPipeline.GetEvent <LightingEvent>();
     reflectData        = RenderPipeline.GetEvent <ReflectionEvent>();
     lightingMat        = new Material(resources.shaders.volumetricShader);
     cameraNormalBuffer = new ComputeBuffer(3, sizeof(float3));
 }
Example #4
0
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     if (useEmissionGeometry)
     {
         geometry.Init();
     }
     if (useNoiseEvents)
     {
         noiseEvents.Init(resources);
     }
     lightingData       = RenderPipeline.GetEvent <LightingEvent>();
     reflectData        = RenderPipeline.GetEvent <ReflectionEvent>();
     lightingMat        = new Material(resources.shaders.volumetricShader);
     cameraNormalBuffer = new ComputeBuffer(3, sizeof(float3));
     blackCB            = new Cubemap(1, TextureFormat.ARGB32, false);
     blackCB.SetPixel(CubemapFace.NegativeX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.NegativeY, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.NegativeZ, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
     volumeDesc = new RenderTextureDescriptor
     {
         autoGenerateMips   = false,
         bindMS             = false,
         colorFormat        = RenderTextureFormat.ARGBHalf,
         depthBufferBits    = 0,
         dimension          = TextureDimension.Tex3D,
         enableRandomWrite  = true,
         height             = downSampledSize.y,
         width              = downSampledSize.x,
         memoryless         = RenderTextureMemoryless.None,
         msaaSamples        = 1,
         shadowSamplingMode = ShadowSamplingMode.None,
         sRGB        = false,
         useMipMap   = false,
         volumeDepth = downSampledSize.z,
         vrUsage     = VRTextureUsage.None
     };
     volumeTex            = new RenderTexture(volumeDesc);
     volumeTex.filterMode = FilterMode.Bilinear;
     volumeTex.wrapMode   = TextureWrapMode.Clamp;
     volumeTex.Create();
 }
        protected override void Init(PipelineResources resources)
        {
            decalEvt.Init(resources);
            linearMat       = new Material(resources.shaders.linearDepthShader);
            linearDrawerMat = new Material(resources.shaders.linearDrawerShader);
            if (useHiZ)
            {
#if UNITY_EDITOR
                if (Application.isPlaying)
                {
#endif
                hizDepth.InitHiZ(resources);
                clusterMat = new Material(resources.shaders.clusterRenderShader);
#if UNITY_EDITOR
            }
#endif
            }
            ao         = RenderPipeline.GetEvent <AOEvents>();
            reflection = RenderPipeline.GetEvent <ReflectionEvent>();
            proper     = RenderPipeline.GetEvent <PropertySetEvent>();
        }
        protected override void Init(PipelineResources resources)
        {
            decalEvt.Init(resources);
            linearMat       = new Material(resources.shaders.linearDepthShader);
            linearDrawerMat = new Material(resources.shaders.linearDrawerShader);
            motionVecMat    = new Material(resources.shaders.motionVectorShader);
            if (useHiZ)
            {
#if UNITY_EDITOR
                if (Application.isPlaying)
                {
#endif
                hizDepth.InitHiZ(resources, new Vector2(Screen.width, Screen.height));
                clusterMat = new Material(resources.shaders.clusterRenderShader);
#if UNITY_EDITOR
            }
#endif
            }
            ao            = RenderPipeline.GetEvent <AOEvents>();
            reflection    = RenderPipeline.GetEvent <ReflectionEvent>();
            proper        = RenderPipeline.GetEvent <PropertySetEvent>();
            downSampleMat = new Material(resources.shaders.depthDownSample);
        }
 protected override void Init(PipelineResources resources)
 {
     proper = RenderPipeline.GetEvent <PropertySetEvent>();
     if (useEmissionGeometry)
     {
         geometry.Init();
     }
     if (useNoiseEvents)
     {
         noiseEvents.Init(resources);
     }
     lightingData       = RenderPipeline.GetEvent <LightingEvent>();
     reflectData        = RenderPipeline.GetEvent <ReflectionEvent>();
     lightingMat        = new Material(resources.shaders.volumetricShader);
     cameraNormalBuffer = new ComputeBuffer(3, sizeof(float3));
     blackCB            = new Cubemap(1, TextureFormat.ARGB32, false);
     blackCB.SetPixel(CubemapFace.NegativeX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.NegativeY, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.NegativeZ, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
     blackCB.SetPixel(CubemapFace.PositiveX, 0, 0, Color.black);
 }
 protected override void Init(PipelineResources resources)
 {
     lightingData = RenderPipeline.GetEvent <LightingEvent>();
     reflectData  = RenderPipeline.GetEvent <ReflectionEvent>();
     lightingMat  = new Material(resources.shaders.lightingShader);
 }