浏览代码

Add common / sky settings to HD Inspector

/main
Tim Cooper 8 年前
当前提交
a529e88b
共有 2 个文件被更改,包括 54 次插入3 次删除
  1. 45
      Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
  2. 12
      Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs

45
Assets/ScriptableRenderLoop/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
//[CustomEditor(typeof(HDRenderPipeline))]
[CustomEditor(typeof(HDRenderPipeline))]
public class HDRenderPipelineInspector : Editor
{
private class Styles

public readonly GUIContent useForwardRenderingOnly = new GUIContent("Use Forward Rendering Only");
public readonly GUIContent useDepthPrepass = new GUIContent("Use Depth Prepass");
public readonly GUIContent useDistortion = new GUIContent("Use Distortion");
public readonly GUIContent useDistortion = new GUIContent("Use Distortion");
public readonly GUIContent shadowSettings = new GUIContent("Shadow Settings");
public readonly GUIContent commonSettings = new GUIContent("Common Settings");
public readonly GUIContent maxShadowDistance = new GUIContent("Max Shadow Distance");
public readonly GUIContent shadowCascadeCount = new GUIContent("Shadow Cascade Count");
public readonly GUIContent shadowCascadeSplit0 = new GUIContent("Cascade Split 0");
public readonly GUIContent shadowCascadeSplit1 = new GUIContent("Cascade Split 1");
public readonly GUIContent shadowCascadeSplit2 = new GUIContent("Cascade Split 2");
public readonly GUIContent skyParams = new GUIContent("Sky Settings");
public readonly GUIContent shadowSettings = new GUIContent("Shadow Settings");
public readonly GUIContent shadowsEnabled = new GUIContent("Enabled");
public readonly GUIContent shadowsAtlasWidth = new GUIContent("Atlas width");
public readonly GUIContent shadowsAtlasHeight = new GUIContent("Atlas height");

EditorGUI.indentLevel--;
}
private void CommonSettingsUI(HDRenderPipeline pipe)
{
EditorGUILayout.Space();
var commonSettings = pipe.commonSettings;
EditorGUILayout.LabelField(styles.commonSettings);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
commonSettings.shadowMaxDistance = Mathf.Max(0, EditorGUILayout.FloatField(styles.maxShadowDistance, commonSettings.shadowMaxDistance));
commonSettings.shadowCascadeCount = Mathf.Max(0, EditorGUILayout.IntField(styles.shadowCascadeCount, commonSettings.shadowCascadeCount));
commonSettings.shadowCascadeSplit0 = Mathf.Max(0, EditorGUILayout.FloatField(styles.shadowCascadeSplit0, commonSettings.shadowCascadeSplit0));
commonSettings.shadowCascadeSplit1 = Mathf.Max(0, EditorGUILayout.FloatField(styles.shadowCascadeSplit1, commonSettings.shadowCascadeSplit1));
commonSettings.shadowCascadeSplit2 = Mathf.Max(0, EditorGUILayout.FloatField(styles.shadowCascadeSplit2, commonSettings.shadowCascadeSplit2));
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.LabelField(styles.skyParams);
EditorGUI.indentLevel++;
pipe.skyParameters = (SkyParameters) EditorGUILayout.ObjectField(new GUIContent("Sky Settings"), pipe.skyParameters, typeof(SkyParameters), false);
EditorGUI.indentLevel--;
if (EditorGUI.EndChangeCheck())
{
pipe.commonSettings = commonSettings;
EditorUtility.SetDirty(pipe); // Repaint
}
}
private void ShadowParametersUI(HDRenderPipeline renderContext)
{
EditorGUILayout.Space();

return;
DebugParametersUI(renderContext);
CommonSettingsUI(renderContext);
ShadowParametersUI(renderContext);
TextureParametersUI(renderContext);
TilePassUI(renderContext);

12
Assets/ScriptableRenderLoop/HDRenderPipeline/HDRenderPipeline.cs


[SerializeField]
private CommonSettings.Settings m_CommonSettings = CommonSettings.Settings.s_Defaultsettings;
public CommonSettings.Settings commonSettings
{
get { return m_CommonSettings; }
set { m_CommonSettings = value; }
}
public CommonSettings.Settings commonSettingsToUse
{
get

[SerializeField]
private SkyParameters m_SkyParameters;
public SkyParameters skyParameters
{
get { return m_SkyParameters; }
set { m_SkyParameters = value; }
}
public SkyParameters skyParametersToUse
{

正在加载...
取消
保存