public void ReleaseResources() { m_DebugLightClusterTexture.Release(); if (m_LightVolumeGPUArray != null) { CoreUtils.SafeRelease(m_LightVolumeGPUArray); m_LightVolumeGPUArray = null; } if (m_LightCluster != null) { CoreUtils.SafeRelease(m_LightCluster); m_LightCluster = null; } if (m_LightCullResult != null) { CoreUtils.SafeRelease(m_LightCullResult); m_LightCullResult = null; } if (m_LightDataGPUArray != null) { CoreUtils.SafeRelease(m_LightDataGPUArray); m_LightDataGPUArray = null; } }
void AllocateRenderTexture() { if (m_Atlas != null) { m_Atlas.Release(); } m_Atlas = RTHandles.Alloc(width, height, filterMode: m_FilterMode, depthBufferBits: m_DepthBufferBits, isShadowMap: true, name: m_Name); if (m_SupportMomentShadows) { string momentShadowMapName = m_Name + "Moment"; m_AtlasMoments = new RTHandleSystem.RTHandle[1]; m_AtlasMoments[0] = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R32G32B32A32_SFloat), enableRandomWrite: true, name: momentShadowMapName); string intermediateSummedAreaName = m_Name + "IntermediateSummedArea"; m_IntermediateSummedAreaTexture = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R32G32B32A32_SInt), enableRandomWrite: true, name: intermediateSummedAreaName); string summedAreaName = m_Name + "SummedAreaFinal"; m_SummedAreaTexture = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R32G32B32A32_SInt), enableRandomWrite: true, name: summedAreaName); } else if (m_isBlurredEVSM) { string[] momentShadowMapNames = { m_Name + "Moment", m_Name + "MomentCopy" }; m_AtlasMoments = new RTHandleSystem.RTHandle[2]; for (int i = 0; i < 2; ++i) { m_AtlasMoments[i] = RTHandles.Alloc(width / 2, height / 2, filterMode: FilterMode.Point, colorFormat: UnityEngine.Experimental.Rendering.HDPipeline.HDRenderPipeline.OverrideRTGraphicsFormat(GraphicsFormat.R32G32_SFloat), useMipMap: true, autoGenerateMips: false, enableRandomWrite: true, name: momentShadowMapNames[i]); } } identifier = new RenderTargetIdentifier(m_Atlas); }
void AllocateRenderTexture() { if (m_Atlas != null) { m_Atlas.Release(); } m_Atlas = RTHandles.Alloc(width, height, filterMode: m_FilterMode, depthBufferBits: m_DepthBufferBits, sRGB: false, colorFormat: m_Format, name: m_Name); identifier = new RenderTargetIdentifier(m_Atlas); }
void AllocateRenderTexture() { if (m_Atlas != null) { m_Atlas.Release(); } m_Atlas = RTHandles.Alloc(width, height, filterMode: m_FilterMode, depthBufferBits: m_DepthBufferBits, sRGB: false, colorFormat: m_Format, name: m_Name); if (m_SupportMomentShadows) { string momentShadowMapName = m_Name + "Moment"; m_AtlasMoments = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBFloat, sRGB: false, enableRandomWrite: true, name: momentShadowMapName); string intermediateSummedAreaName = m_Name + "IntermediateSummedArea"; m_IntermediateSummedAreaTexture = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBInt, sRGB: false, enableRandomWrite: true, name: intermediateSummedAreaName); string summedAreaName = m_Name + "SummedAreaFinal"; m_SummedAreaTexture = RTHandles.Alloc(width, height, filterMode: FilterMode.Point, colorFormat: RenderTextureFormat.ARGBInt, sRGB: false, enableRandomWrite: true, name: summedAreaName); } identifier = new RenderTargetIdentifier(m_Atlas); }