Ejemplo n.º 1
0
        private void OnDisable()
        {
            // use pre-render to give all other pre-cull scripts a chance to set properties, state, etc.

#if UNITY_LWRP
            RenderPipelineManager.beginCameraRendering -= CameraBeginRendering;
            RenderPipelineManager.endCameraRendering   -= CameraEndRendering;
            RenderPipelineManager.beginFrameRendering  -= CameraBeginFrameRendering;
            RenderPipelineManager.endFrameRendering    -= CameraEndFrameRendering;
#else
            Camera.onPreCull    -= CameraPreCull;
            Camera.onPreRender  -= CameraPreRender;
            Camera.onPostRender -= CameraPostRender;
#endif

            CleanupDepthTextures();

#if ENABLE_FORWARD_OPAQUE_CAPTURE
            if (AfterOpaqueBuffer != null)
            {
                AfterOpaqueBuffer.Release();
                Destroy(AfterOpaqueBuffer);
                AfterOpaqueBuffer = null;
            }
            AfterOpaqueBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(AfterOpaqueBuffer);
#endif
        }
Ejemplo n.º 2
0
 private static void DestroyInscatteringTextures()
 {
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT2);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT2);
 }
Ejemplo n.º 3
0
 private void CleanupDepthTextures()
 {
     HalfDepthBuffer      = WeatherMakerFullScreenEffect.DestroyRenderTexture(HalfDepthBuffer);
     QuarterDepthBuffer   = WeatherMakerFullScreenEffect.DestroyRenderTexture(QuarterDepthBuffer);
     EighthDepthBuffer    = WeatherMakerFullScreenEffect.DestroyRenderTexture(EighthDepthBuffer);
     SixteenthDepthBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(SixteenthDepthBuffer);
     WeatherMakerFullScreenEffect.ReleaseCommandBuffer(ref depthCommandBuffer);
 }
Ejemplo n.º 4
0
        private RenderTargetIdentifier UpdateDepthDownsampler(ref RenderTexture tex, int scale)
        {
            RenderTextureDescriptor desc = WeatherMakerFullScreenEffect.GetRenderTextureDescriptor(scale, 0, 1, RenderTextureFormat.RFloat);

            if (tex == null || tex.width != desc.width || tex.height != desc.height)
            {
                WeatherMakerFullScreenEffect.DestroyRenderTexture(ref tex);
                tex      = WeatherMakerFullScreenEffect.CreateRenderTexture(desc, FilterMode.Point, TextureWrapMode.Clamp);
                tex.name = "WeatherMakerDepthTexture_" + scale;
            }
            return(tex);
        }
Ejemplo n.º 5
0
        private static void DestroyTextures()
        {
            DestroyInscatteringTextures();
            WeatherMakerFullScreenEffect.DestroyRenderTexture(ref lightColorTexture);
            WeatherMakerFullScreenEffect.DestroyRenderTexture(ref skyboxLUT);
            WeatherMakerFullScreenEffect.DestroyRenderTexture(ref skyboxLUT);

#if WEATHER_MAKER_ATMOSPHERE_HIGH_QUALITY
            WeatherMakerFullScreenEffect.DestroyRenderTexture(ref skyboxLUT2);
#endif

            if (randomVectorsLUT != null)
            {
                GameObject.DestroyImmediate(randomVectorsLUT);
                randomVectorsLUT = null;
            }
            if (particleDensityLUT != null)
            {
                GameObject.DestroyImmediate(particleDensityLUT);
                particleDensityLUT = null;
            }
        }
Ejemplo n.º 6
0
 private void DisposeRenderTextures()
 {
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref subFrameCurrent);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref prevFrameCurrent);
 }