Exemplo n.º 1
0
        private void GetGlowTexture(PostProcessRenderContext context)
        {
            Vector2Int resolution = settings.textureResolution;

            EZPostProcessingUtility.GetTexture(ref glowDepthTexture, resolution, 16, RenderTextureFormat.Depth);
            EZPostProcessingUtility.CopyCameraSettings(context.camera, glowCamera,
                                                       settings.sourceLayer, DepthTextureMode.Depth);
            glowCamera.targetTexture = glowDepthTexture;
            glowCamera.Render();
        }
Exemplo n.º 2
0
        private void GetDistortionTexture(PostProcessRenderContext context)
        {
            Vector2Int resolution = settings.textureResolution;

            EZPostProcessingUtility.GetTexture(ref distortionTex, resolution, 0, settings.textureFormat);
            if (settings.depthTest)
            {
                EZPostProcessingUtility.GetTexture(ref distortionDepthTex, resolution, 16, RenderTextureFormat.Depth);
                EZPostProcessingUtility.CopyCameraSettings(context.camera, distortionCamera,
                                                           settings.sourceLayer, DepthTextureMode.Depth);
                distortionCamera.SetTargetBuffers(distortionTex.colorBuffer, distortionDepthTex.depthBuffer);
            }
            else
            {
                EZPostProcessingUtility.CopyCameraSettings(context.camera, distortionCamera,
                                                           settings.sourceLayer, DepthTextureMode.None);
                distortionCamera.targetTexture = distortionTex;
            }
            distortionCamera.Render();
        }