浏览代码

SSAO: Value validation on settings

/RenderPassXR_Sandbox
sebastienlagarde 8 年前
当前提交
e0c95831
共有 1 个文件被更改,包括 10 次插入5 次删除
  1. 15
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusionSettings.cs

15
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/AmbientOcclusion/ScreenSpaceAmbientOcclusionSettings.cs


[SerializeField]
bool m_Enable;
[SerializeField]
[SerializeField, Range(0, 2)]
[SerializeField]
[SerializeField, Range(1, 32)]
int m_SampleCount;
[SerializeField]
bool m_Downsampling;

public int sampleCount { set { m_SampleCount = value; OnValidate(); } get { return m_SampleCount; } }
public bool downsampling { set { m_Downsampling = value; } get { return m_Downsampling; } }
void OnValidate()
public void OnValidate()
m_Intensity = Mathf.Min(2, Mathf.Max(0, m_Intensity));
m_Intensity = Mathf.Clamp(m_Intensity, 0, 2);
m_SampleCount = Mathf.Min(1, Mathf.Max(32, m_SampleCount));
m_SampleCount = Mathf.Clamp(m_SampleCount, 1, 32);
}
public static readonly Settings s_Defaultsettings = new Settings

{
get { return m_Settings; }
set { m_Settings = value; }
}
public void OnValidate()
{
m_Settings.OnValidate();
}
}
}
正在加载...
取消
保存