コード例 #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
        }
コード例 #2
0
 private static void DestroyInscatteringTextures()
 {
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT2);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT2);
 }
コード例 #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);
 }
コード例 #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);
        }
コード例 #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;
            }
        }
コード例 #6
0
 private void DisposeRenderTextures()
 {
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref subFrameCurrent);
     WeatherMakerFullScreenEffect.DestroyRenderTexture(ref prevFrameCurrent);
 }