浏览代码

Manager for Homogenous volumes.

/main
Raymond Graham 7 年前
当前提交
e4700710
共有 3 个文件被更改,包括 58 次插入0 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs
  2. 45
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs
  3. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs.meta

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/HomogeneousDensityVolume.cs


private void OnEnable()
{
DensityVolumeManager.manager.RegisterVolume(this);
DensityVolumeManager.manager.DeRegisterVolume(this);
}
private void Update()

45
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs


using System.Collections.Generic;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public class DensityVolumeManager
{
static private DensityVolumeManager _instance = null;
private DensityVolumeManager()
{
volumes = new List<HomogeneousDensityVolume>();
}
public static DensityVolumeManager manager
{
get
{
if (_instance == null)
{
_instance = new DensityVolumeManager();
}
return _instance;
}
}
private List<HomogeneousDensityVolume> volumes = null;
public void RegisterVolume(HomogeneousDensityVolume volume)
{
volumes.Add(volume);
}
public void DeRegisterVolume(HomogeneousDensityVolume volume)
{
if (volumes.Contains(volume))
{
volumes.Remove(volume);
}
}
public HomogeneousDensityVolume[] GetAllVolumes()
{
return volumes.ToArray();
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Volumetrics/DensityVolumeManager.cs.meta


fileFormatVersion: 2
guid: e6e40fb2a8972a44eb511a71c483fb8b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存