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 }
private static void DestroyInscatteringTextures() { WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT); WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT); WeatherMakerFullScreenEffect.DestroyRenderTexture(ref extinctionLUT2); WeatherMakerFullScreenEffect.DestroyRenderTexture(ref inscatteringLUT2); }
private void CleanupDepthTextures() { HalfDepthBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(HalfDepthBuffer); QuarterDepthBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(QuarterDepthBuffer); EighthDepthBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(EighthDepthBuffer); SixteenthDepthBuffer = WeatherMakerFullScreenEffect.DestroyRenderTexture(SixteenthDepthBuffer); WeatherMakerFullScreenEffect.ReleaseCommandBuffer(ref depthCommandBuffer); }
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); }
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; } }
private void DisposeRenderTextures() { WeatherMakerFullScreenEffect.DestroyRenderTexture(ref subFrameCurrent); WeatherMakerFullScreenEffect.DestroyRenderTexture(ref prevFrameCurrent); }