public void RegisterVolume(LocalVolumetricFog volume) { m_Volumes.Add(volume); // In case the Local Volumetric Fog format is not support (which is impossible because all HDRP target supports R8G8B8A8_UNorm) // we avoid doing operations on the atlas. // This happens in the CI on linux when an editor using OpenGL is building a player for Vulkan. if (!SystemInfo.IsFormatSupported(localVolumetricFogAtlasFormat, FormatUsage.LoadStore)) { return; } if (volume.parameters.volumeMask != null) { if (volumeAtlas.IsTextureValid(volume.parameters.volumeMask)) { AddTextureIntoAtlas(volume.parameters.volumeMask); } } }
public void DeRegisterVolume(LocalVolumetricFog volume) { if (m_Volumes.Contains(volume)) { m_Volumes.Remove(volume); } // In case the Local Volumetric Fog format is not support (which is impossible because all HDRP target supports R8G8B8A8_UNorm) // we avoid doing operations on the atlas. // This happens in the CI on linux when an editor using OpenGL is building a player for Vulkan. if (!SystemInfo.IsFormatSupported(localVolumetricFogAtlasFormat, FormatUsage.LoadStore)) { return; } if (volume.parameters.volumeMask != null) { // Avoid to alloc the atlas to remove a texture if it's not allocated yet. if (m_VolumeAtlas != null) { volumeAtlas.RemoveTexture(volume.parameters.volumeMask); } } }
public bool ContainsVolume(LocalVolumetricFog volume) => m_Volumes.Contains(volume);