浏览代码

Volumetric system use the list of fog volumes from the manager.

/main
Raymond Graham 7 年前
当前提交
17d381ab
共有 1 个文件被更改,包括 12 次插入16 次删除
  1. 28
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs

28
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/VolumetricLighting.cs


m_VisibleVolumeData.Clear();
// Collect all visible finite volume data, and upload it to the GPU.
HomogeneousDensityVolume[] volumes = Object.FindObjectsOfType(typeof(HomogeneousDensityVolume)) as HomogeneousDensityVolume[];
HomogeneousDensityVolume[] volumes = DensityVolumeManager.manager.GetAllVolumes();
// Only test active finite volumes.
if (volume.enabled)
{
// TODO: cache these?
var obb = OrientedBBox.Create(volume.transform);
// TODO: cache these?
var obb = OrientedBBox.Create(volume.transform);
// Handle camera-relative rendering.
obb.center -= camOffset;
// Handle camera-relative rendering.
obb.center -= camOffset;
// Frustum cull on the CPU for now. TODO: do it on the GPU.
if (GeometryUtils.Overlap(obb, camera.frustum, 6, 8))
{
// TODO: cache these?
var data = volume.parameters.GetData();
// Frustum cull on the CPU for now. TODO: do it on the GPU.
if (GeometryUtils.Overlap(obb, camera.frustum, 6, 8))
{
// TODO: cache these?
var data = volume.parameters.GetData();
m_VisibleVolumeBounds.Add(obb);
m_VisibleVolumeData.Add(data);
}
m_VisibleVolumeBounds.Add(obb);
m_VisibleVolumeData.Add(data);
}
}

正在加载...
取消
保存