{
[ExecuteInEditMode]
[AddComponentMenu("RenderPipeline/High Definition/Homogeneous Medium Volume", -1)]
public class HomogeneousMediumVolume : MonoBehaviour
public class HomogeneousDensityVolume : MonoBehaviour
public VolumeParameters volumeParameters = new VolumeParameters();
}
// Returns NULL if a global fog component does not exist, or is not enabled.
public static HomogeneousMediumVolume GetGlobalHomogeneousMediumVolume()
public static HomogeneousDensityVolume GetGlobalHomogeneousDensityVolume()
HomogeneousMediumVolume globalVolume = null;
HomogeneousDensityVolume globalVolume = null;
HomogeneousMediumVolume[] volumes = FindObjectsOfType(typeof(HomogeneousMediumVolume)) as HomogeneousMediumVolume[];
HomogeneousDensityVolume[] volumes = FindObjectsOfType(typeof(HomogeneousDensityVolume)) as HomogeneousDensityVolume[];
foreach (HomogeneousMediumVolume volume in volumes)
foreach (HomogeneousDensityVolume volume in volumes)
if (volume.enabled && !volume.volumeParameters.IsLocalVolume())
if (preset == VolumetricLightingPreset.Off) return;
HomogeneousMediumVolume globalVolume = HomogeneousMediumVolume.GetGlobalHomogeneousMediumVolume();
HomogeneousDensityVolume globalVolume = HomogeneousDensityVolume.GetGlobalHomogeneousDensityVolume();
// TODO: may want to cache these results somewhere.
VolumeProperties globalVolumeProperties = (globalVolume != null) ? globalVolume.volumeParameters.GetProperties()
m_VisibleVolumeProperties.Clear();
// Collect all the visible volume data, and upload it to the GPU.
HomogeneousMediumVolume[] volumes = Object.FindObjectsOfType(typeof(HomogeneousMediumVolume)) as HomogeneousMediumVolume[];
HomogeneousDensityVolume[] volumes = Object.FindObjectsOfType(typeof(HomogeneousDensityVolume)) as HomogeneousDensityVolume[];
// Only test active finite volumes.
if (volume.enabled && volume.volumeParameters.IsLocalVolume())
VBuffer vBuffer = FindVBuffer(camera.GetViewID());
Debug.Assert(vBuffer != null);
float asymmetry = globalVolume != null ? globalVolume.volumeParameters.asymmetry : 0;
if (globalVolume == null)