浏览代码

Merge pull request #977 from Unity-Technologies/physcam-settings

Added a first set of physical settings to HDCamera
/main
GitHub 7 年前
当前提交
6602ff66
共有 3 个文件被更改,包括 45 次插入6 次删除
  1. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs
  2. 39
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs
  3. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs

5
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs


[Tooltip("Layer Mask used for the volume interpolation for this camera.")]
public LayerMask volumeLayerMask = -1;
// Physical parameters
public float aperture = 8f;
public float shutterSpeed = 1f / 200f;
public float iso = 400f;
// To be able to turn on/off FrameSettings properties at runtime for debugging purpose without affecting the original one
// we create a runtime copy (m_ActiveFrameSettings that is used, and any parametrization is done on serialized frameSettings)
[SerializeField]

39
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs


Inspector = new []
{
SectionPrimarySettings,
SectionPhysicalSettings,
SectionCaptureSettings,
SectionOutputSettings,
SectionXRSettings,

CED.Action(Drawer_FieldRenderingPath),
CED.space
);
public static readonly CED.IDrawer SectionPhysicalSettings = CED.FoldoutGroup(
"Physical Settings",
(s, p, o) => s.isSectionExpandedPhysicalSettings,
FoldoutOption.Indent,
CED.Action(Drawer_FieldAperture),
CED.Action(Drawer_FieldShutterSpeed),
CED.Action(Drawer_FieldIso));
public static readonly CED.IDrawer SectionCaptureSettings = CED.FoldoutGroup(
"Capture Settings",

SerializedHDCamera m_SerializedHdCamera;
public AnimBool isSectionExpandedOrthoOptions { get { return m_AnimBools[0]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedOutputSettings { get { return m_AnimBools[2]; } }
public AnimBool isSectionAvailableRenderLoopSettings { get { return m_AnimBools[3]; } }
public AnimBool isSectionExpandedXRSettings { get { return m_AnimBools[4]; } }
public AnimBool isSectionAvailableXRSettings { get { return m_AnimBools[5]; } }
public AnimBool isSectionExpandedPhysicalSettings { get { return m_AnimBools[1]; } }
public AnimBool isSectionExpandedCaptureSettings { get { return m_AnimBools[2]; } }
public AnimBool isSectionExpandedOutputSettings { get { return m_AnimBools[3]; } }
public AnimBool isSectionAvailableRenderLoopSettings { get { return m_AnimBools[4]; } }
public AnimBool isSectionExpandedXRSettings { get { return m_AnimBools[5]; } }
public AnimBool isSectionAvailableXRSettings { get { return m_AnimBools[6]; } }
public bool canOverrideRenderLoopSettings { get; set; }

: base(6)
: base(7)
{
canOverrideRenderLoopSettings = false;
}

"Clipping Planes",
new[] { p.nearClippingPlane, p.farClippingPlane },
new[] { _.GetContent("Near|The closest point relative to the camera that drawing will occur."), _.GetContent("Far|The furthest point relative to the camera that drawing will occur.\n") });
}
static void Drawer_FieldAperture(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.aperture, _.GetContent("Aperture"));
}
static void Drawer_FieldShutterSpeed(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
EditorGUILayout.PropertyField(p.shutterSpeed, _.GetContent("Shutter Speed (1 / x)"));
p.shutterSpeed.floatValue = 1f / p.shutterSpeed.floatValue;
}
static void Drawer_FieldIso(HDCameraUI s, SerializedHDCamera p, Editor owner)
{
EditorGUILayout.PropertyField(p.iso, _.GetContent("ISO"));
}
static void Drawer_FieldNormalizedViewPort(HDCameraUI s, SerializedHDCamera p, Editor owner)

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs


public SerializedProperty farClippingPlane;
public SerializedProperty targetEye;
public SerializedProperty aperture;
public SerializedProperty shutterSpeed;
public SerializedProperty iso;
#if ENABLE_MULTIPLE_DISPLAYS
public SerializedProperty targetDisplay;
#endif

targetEye = serializedObject.FindProperty("m_TargetEye");
aperture = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.aperture);
shutterSpeed = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.shutterSpeed);
iso = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.iso);
clearColorMode = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.clearColorMode);
backgroundColorHDR = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.backgroundColorHDR);

正在加载...
取消
保存