浏览代码

[HDCameraEditor] Update UI

/main
Frédéric Vauchelles 7 年前
当前提交
33ee8d29
共有 2 个文件被更改,包括 23 次插入26 次删除
  1. 19
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Data.cs
  2. 30
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Drawers.cs

19
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Data.cs


{
SerializedHDCamera m_SerializedHdCamera;
AnimBool[] m_AnimBools = new AnimBool[7];
AnimBool[] m_AnimBools = new AnimBool[8];
public AnimBool isSectionExpandedTargetEyeOptions { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedShaderFeature { get { return m_AnimBools[2]; } }
public AnimBool isSectionExpandedLightLoop { get { return m_AnimBools[3]; } }
public AnimBool isSectionExpandedScreenSpace { get { return m_AnimBools[4]; } }
public AnimBool isSectionExpandedMiscellaneous { get { return m_AnimBools[5]; } }
public AnimBool isSectionExpandedRenderLoopSettings { get { return m_AnimBools[6]; } }
public AnimBool isSectionExpandedShaderFeature { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedLightLoop { get { return m_AnimBools[2]; } }
public AnimBool isSectionExpandedScreenSpace { get { return m_AnimBools[3]; } }
public AnimBool isSectionExpandedMiscellaneous { get { return m_AnimBools[4]; } }
public AnimBool isSectionExpandedRenderLoopSettings { get { return m_AnimBools[5]; } }
public AnimBool isSectionExpandedXR { get { return m_AnimBools[6]; } }
public AnimBool isSectionExpandedXRSupported { get { return m_AnimBools[7]; } }
public UIState()
{

public void Update()
{
isSectionExpandedOrthoOptions.target = !m_SerializedHdCamera.orthographic.hasMultipleDifferentValues && m_SerializedHdCamera.orthographic.boolValue;
var targetEyeValue = (StereoTargetEyeMask)m_SerializedHdCamera.targetEye.intValue;
isSectionExpandedTargetEyeOptions.target = targetEyeValue != StereoTargetEyeMask.Both || PlayerSettings.virtualRealitySupported;
isSectionExpandedXRSupported.target = PlayerSettings.virtualRealitySupported;
// SRP settings are available only if the rendering path is not the Default one (configured by the SRP asset)
var renderingPath = (HDAdditionalCameraData.RenderingPath)m_SerializedHdCamera.renderingPath.intValue;

30
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Drawers.cs


CED.space,
CED.Action(Drawer_Projection),
CED.Action(Drawer_FieldClippingPlanes),
CED.Action(Drawer_FieldNormalizedViewPort),
// Partial viewport not yet supported
//CED.Action(Drawer_FieldNormalizedViewPort),
CED.Action(Drawer_DeferredOrthographicWarning),
CED.Action(Drawer_FieldVR),
CED.FadeGroup(
(s, d, o, i) => s.isSectionExpandedTargetEyeOptions.faded,
true,
CED.Action(Drawer_FieldTargetEye)),
// XR not yet supported
//CED.FadeGroup(
// (s, d, o, i) => s.isSectionExpandedXRSupported.faded,
// false,
// CED.FoldoutGroup(
// "XR",
// (s, p, o) => s.isSectionExpandedXR,
// true,
// CED.Action(Drawer_FieldVR),
// CED.Action(Drawer_FieldTargetEye))),
"Shader Features",
"Shader Passes",
(s, p, o) => s.isSectionExpandedShaderFeature,
true,
CED.Action(Drawer_SectionShaderFeature)),

EditorGUILayout.PropertyField(p.renderingPath, _.GetContent("Rendering Path"));
}
static void Drawer_DeferredOrthographicWarning(UIState s, SerializedHDCamera p, Editor owner)
{
if (p.orthographic.boolValue && !p.frameSettings.enableForwardRenderingOnly.boolValue)
EditorGUILayout.HelpBox("Deferred rendering does not work with Orthographic camera, will use Forward.",
MessageType.Warning, true);
}
static void Drawer_FieldRenderTarget(UIState s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.targetTexture);

{
if (PlayerSettings.virtualRealitySupported)
{
EditorGUILayout.PropertyField(p.frameSettings.enableStereo, _.GetContent("Enable Stereo"));
EditorGUILayout.PropertyField(p.stereoSeparation, _.GetContent("Stereo Separation"));
EditorGUILayout.PropertyField(p.stereoConvergence, _.GetContent("Stereo Convergence"));
}

EditorGUILayout.PropertyField(p.frameSettings.enableTransparentObjects, _.GetContent("Enable Transparent Objects"));
EditorGUILayout.PropertyField(p.frameSettings.enableMSAA, _.GetContent("Enable MSAA"));
EditorGUILayout.PropertyField(p.frameSettings.enableStereo, _.GetContent("Enable Stereo"));
}
static void Drawer_SectionLightLoop(UIState s, SerializedHDCamera p, Editor owner)

正在加载...
取消
保存