Frédéric Vauchelles
7 年前
当前提交
6bdf3918
共有 18 个文件被更改,包括 668 次插入 和 58 次删除
-
18ScriptableRenderPipeline/Core/CoreRP/Editor/CoreEditorDrawers.cs
-
29ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs
-
77ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDReflectionProbeEditor.Data.cs
-
18ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Lighting/HDReflectionProbeEditor.Drawers.cs
-
8ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera.meta
-
54ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Data.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Data.cs.meta
-
222ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Drawers.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.Drawers.cs.meta
-
34ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraEditor.cs.meta
-
76ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedFrameSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedFrameSettings.cs.meta
-
94ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedHDCamera.cs.meta
-
30ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedLightLoopSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/SerializedLightLoopSettings.cs.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 9dc3c4b1d2c33704f894c37b8b2a1057 |
|||
folderAsset: yes |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Collections.Generic; |
|||
using UnityEditor.AnimatedValues; |
|||
using UnityEngine; |
|||
using UnityEngine.Events; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
partial class HDCameraEditor |
|||
{ |
|||
public class UIState |
|||
{ |
|||
SerializedHDCamera m_SerializedHdCamera; |
|||
|
|||
AnimBool[] m_AnimBools = new AnimBool[4]; |
|||
|
|||
public AnimBool isSectionExpandedBGColorOptions { get { return m_AnimBools[0]; } } |
|||
public AnimBool isSectionExpandedOrthoOptions { get { return m_AnimBools[1]; } } |
|||
public AnimBool isSectionExpandedTargetEyeOptions { get { return m_AnimBools[2]; } } |
|||
public AnimBool isSectionExpandedMiscellaneous { get { return m_AnimBools[3]; } } |
|||
|
|||
public UIState() |
|||
{ |
|||
for (var i = 0 ; i < m_AnimBools.Length; ++i) |
|||
m_AnimBools[i] = new AnimBool(); |
|||
} |
|||
|
|||
public void Reset(SerializedHDCamera serializedHdCamera, UnityAction repaint) |
|||
{ |
|||
m_SerializedHdCamera = serializedHdCamera; |
|||
|
|||
for (var i = 0; i < m_AnimBools.Length; ++i) |
|||
{ |
|||
m_AnimBools[i].valueChanged.RemoveAllListeners(); |
|||
m_AnimBools[i].valueChanged.AddListener(repaint); |
|||
} |
|||
|
|||
Update(); |
|||
} |
|||
|
|||
public void Update() |
|||
{ |
|||
var clearFlags = (CameraClearFlags)m_SerializedHdCamera.clearFlags.intValue; |
|||
var clearFlagsHasMultipleValues = m_SerializedHdCamera.clearFlags.hasMultipleDifferentValues; |
|||
isSectionExpandedBGColorOptions.target = !clearFlagsHasMultipleValues && (clearFlags == CameraClearFlags.SolidColor || clearFlags == CameraClearFlags.Skybox); |
|||
|
|||
isSectionExpandedOrthoOptions.target = !m_SerializedHdCamera.orthographic.hasMultipleDifferentValues && m_SerializedHdCamera.orthographic.boolValue; |
|||
|
|||
var targetEyeValue = (StereoTargetEyeMask)m_SerializedHdCamera.targetEye.intValue; |
|||
isSectionExpandedTargetEyeOptions.target = targetEyeValue != StereoTargetEyeMask.Both || PlayerSettings.virtualRealitySupported; |
|||
} |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: c9928fc9bbbbba042be7d81ff05f0add |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
using System.Reflection; |
|||
using UnityEngine; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
using _ = CoreEditorUtils; |
|||
using CED = CoreEditorDrawer<HDCameraEditor.UIState, SerializedHDCamera>; |
|||
|
|||
partial class HDCameraEditor |
|||
{ |
|||
|
|||
static readonly CED.IDrawer[] k_PrimarySection = |
|||
{ |
|||
CED.Action(Drawer_FieldClearFlags), |
|||
CED.FadeGroup( |
|||
(s, d, o, i) => s.isSectionExpandedBGColorOptions.faded, |
|||
true, |
|||
CED.Action(Drawer_FieldBackgroundColor)), |
|||
CED.Action(Drawer_FieldCullingMask), |
|||
CED.space, |
|||
CED.Action(Drawer_Projection), |
|||
CED.Action(Drawer_FieldClippingPlanes), |
|||
CED.Action(Drawer_FieldNormalizedViewPort), |
|||
CED.space, |
|||
CED.Action(Drawer_FieldDepth), |
|||
CED.Action(Drawer_FieldRenderingPath), |
|||
CED.Action(Drawer_DeferredOrthographicWarning), |
|||
CED.Action(Drawer_FieldRenderTarget), |
|||
CED.Action(Drawer_FieldOcclusionCulling), |
|||
CED.Action(Drawer_FieldAllowMSAA), |
|||
CED.Action(Drawer_FieldAllowDynamicResolution), |
|||
CED.Action(Drawer_CameraWarnings), |
|||
CED.Action(Drawer_FieldVR), |
|||
#if ENABLE_MULTIPLE_DISPLAYS
|
|||
CED.Action(Drawer_SectionMultiDisplay), |
|||
#endif
|
|||
CED.FadeGroup( |
|||
(s, d, o, i) => s.isSectionExpandedTargetEyeOptions.faded, |
|||
true, |
|||
CED.Action(Drawer_FieldTargetEye)), |
|||
CED.FoldoutGroup( |
|||
"Misc", |
|||
(s, p, o) => s.isSectionExpandedMiscellaneous, |
|||
true, |
|||
CED.Action(Drawer_SectionMiscellaneous)) |
|||
}; |
|||
|
|||
static void Drawer_FieldClearFlags(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.clearFlags, _.GetContent("Clear Flags|What to display in empty areas of this Camera's view.\n\nChoose Skybox to display a skybox in empty areas, defaulting to a background color if no skybox is found.\n\nChoose Solid Color to display a background color in empty areas.\n\nChoose Depth Only to display nothing in empty areas.\n\nChoose Don't Clear to display whatever was displayed in the previous frame in empty areas.")); |
|||
} |
|||
|
|||
static void Drawer_FieldBackgroundColor(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.backgroundColor, _.GetContent("Background|The Camera clears the screen to this color before rendering.")); |
|||
} |
|||
|
|||
static void Drawer_FieldCullingMask(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.cullingMask, _.GetContent("Culling Mask")); |
|||
} |
|||
|
|||
static void Drawer_Projection(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
ProjectionType projectionType = p.orthographic.boolValue ? ProjectionType.Orthographic : ProjectionType.Perspective; |
|||
EditorGUI.BeginChangeCheck(); |
|||
EditorGUI.showMixedValue = p.orthographic.hasMultipleDifferentValues; |
|||
projectionType = (ProjectionType)EditorGUILayout.EnumPopup(_.GetContent("Projection|How the Camera renders perspective.\n\nChoose Perspective to render objects with perspective.\n\nChoose Orthographic to render objects uniformly, with no sense of perspective."), projectionType); |
|||
EditorGUI.showMixedValue = false; |
|||
if (EditorGUI.EndChangeCheck()) |
|||
p.orthographic.boolValue = (projectionType == ProjectionType.Orthographic); |
|||
|
|||
if (!p.orthographic.hasMultipleDifferentValues) |
|||
{ |
|||
if (projectionType == ProjectionType.Orthographic) |
|||
EditorGUILayout.PropertyField(p.orthographicSize, _.GetContent("Size")); |
|||
else |
|||
EditorGUILayout.Slider(p.fieldOfView, 1f, 179f, _.GetContent("Field of View|The width of the Camera’s view angle, measured in degrees along the local Y axis.")); |
|||
} |
|||
} |
|||
|
|||
static void Drawer_FieldClippingPlanes(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.nearClippingPlane, _.GetContent("Near|The closest point relative to the camera that drawing will occur.")); |
|||
EditorGUILayout.PropertyField(p.farClippingPlane, _.GetContent("Far|The furthest point relative to the camera that drawing will occur.\n")); |
|||
} |
|||
|
|||
static void Drawer_FieldNormalizedViewPort(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.normalizedViewPortRect, _.GetContent("Viewport Rect|Four values that indicate where on the screen this camera view will be drawn. Measured in Viewport Coordinates (values 0–1).")); |
|||
} |
|||
|
|||
static void Drawer_FieldDepth(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.depth, _.GetContent("Depth")); |
|||
} |
|||
|
|||
static void Drawer_FieldRenderingPath(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
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); |
|||
|
|||
// show warning if we have deferred but manual MSAA set
|
|||
// only do this if the m_TargetTexture has the same values across all target cameras
|
|||
if (!p.targetTexture.hasMultipleDifferentValues) |
|||
{ |
|||
var targetTexture = p.targetTexture.objectReferenceValue as RenderTexture; |
|||
if (targetTexture |
|||
&& targetTexture.antiAliasing > 1 |
|||
&& !p.frameSettings.enableForwardRenderingOnly.boolValue) |
|||
{ |
|||
EditorGUILayout.HelpBox("Manual MSAA target set with deferred rendering. This will lead to undefined behavior.", MessageType.Warning, true); |
|||
} |
|||
} |
|||
} |
|||
|
|||
static void Drawer_FieldOcclusionCulling(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.occlusionCulling, _.GetContent("Occlusion Culling")); |
|||
} |
|||
|
|||
static void Drawer_FieldAllowMSAA(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.allowMSAA, _.GetContent("Allow MSAA")); |
|||
} |
|||
|
|||
static void Drawer_FieldAllowDynamicResolution(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.allowDynamicResolution, _.GetContent("Allow Dynamic Resolution")); |
|||
} |
|||
|
|||
static void Drawer_CameraWarnings(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
foreach (Camera camera in p.serializedObject.targetObjects) |
|||
{ |
|||
var warnings = GetCameraBufferWarnings(camera); |
|||
if (warnings.Length > 0) |
|||
EditorGUILayout.HelpBox(string.Join("\n\n", warnings), MessageType.Warning, true); |
|||
} |
|||
} |
|||
|
|||
static void Drawer_FieldVR(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
if (PlayerSettings.virtualRealitySupported) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.stereoSeparation, _.GetContent("Stereo Separation")); |
|||
EditorGUILayout.PropertyField(p.stereoConvergence, _.GetContent("Stereo Convergence")); |
|||
} |
|||
} |
|||
|
|||
#if ENABLE_MULTIPLE_DISPLAYS
|
|||
static void Drawer_SectionMultiDisplay(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
if (ModuleManager_ShouldShowMultiDisplayOption()) |
|||
{ |
|||
var prevDisplay = p.targetDisplay.intValue; |
|||
EditorGUILayout.Space(); |
|||
EditorGUILayout.IntPopup(p.targetDisplay, DisplayUtility_GetDisplayNames(), DisplayUtility_GetDisplayIndices(), _.GetContent("Target Display")); |
|||
if (prevDisplay != p.targetDisplay.intValue) |
|||
UnityEditorInternal.InternalEditorUtility.RepaintAllViews(); |
|||
} |
|||
} |
|||
#endif
|
|||
|
|||
static readonly int[] k_TargetEyeValues = { (int)StereoTargetEyeMask.Both, (int)StereoTargetEyeMask.Left, (int)StereoTargetEyeMask.Right, (int)StereoTargetEyeMask.None }; |
|||
static readonly GUIContent[] k_TargetEyes = |
|||
{ |
|||
new GUIContent("Both"), |
|||
new GUIContent("Left"), |
|||
new GUIContent("Right"), |
|||
new GUIContent("None (Main Display)"), |
|||
}; |
|||
static void Drawer_FieldTargetEye(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.IntPopup(p.targetEye, k_TargetEyes, k_TargetEyeValues, _.GetContent("Target Eye")); |
|||
} |
|||
|
|||
static void Drawer_SectionMiscellaneous(UIState s, SerializedHDCamera p, Editor owner) |
|||
{ |
|||
EditorGUILayout.PropertyField(p.frameSettings.enableSSAO, _.GetContent("Enable SSAO")); |
|||
} |
|||
|
|||
static MethodInfo k_DisplayUtility_GetDisplayIndices = Type.GetType("UnityEditor.DisplayUtility,UnityEditor") |
|||
.GetMethod("GetDisplayIndices"); |
|||
static int[] DisplayUtility_GetDisplayIndices() |
|||
{ |
|||
return (int[])k_DisplayUtility_GetDisplayIndices.Invoke(null, null); |
|||
} |
|||
|
|||
static MethodInfo k_DisplayUtility_GetDisplayNames = Type.GetType("UnityEditor.DisplayUtility,UnityEditor") |
|||
.GetMethod("GetDisplayNames"); |
|||
static GUIContent[] DisplayUtility_GetDisplayNames() |
|||
{ |
|||
return (GUIContent[])k_DisplayUtility_GetDisplayNames.Invoke(null, null); |
|||
} |
|||
|
|||
static MethodInfo k_ModuleManager_ShouldShowMultiDisplayOption = Type.GetType("UnityEditor.Modules.ModuleManager,UnityEditor") |
|||
.GetMethod("ShouldShowMultiDisplayOption", BindingFlags.Static | BindingFlags.NonPublic); |
|||
static bool ModuleManager_ShouldShowMultiDisplayOption() |
|||
{ |
|||
return (bool)k_ModuleManager_ShouldShowMultiDisplayOption.Invoke(null, null); |
|||
} |
|||
|
|||
static readonly MethodInfo k_Camera_GetCameraBufferWarnings = typeof(Camera).GetMethod("GetCameraBufferWarnings", BindingFlags.Instance | BindingFlags.NonPublic); |
|||
static string[] GetCameraBufferWarnings(Camera camera) |
|||
{ |
|||
return (string[])k_Camera_GetCameraBufferWarnings.Invoke(camera, null); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 8ff246db187922e4d8a59b2f03e8a595 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
[CustomEditorForRenderPipeline(typeof(Camera), typeof(HDRenderPipelineAsset))] |
|||
[CanEditMultipleObjects] |
|||
partial class HDCameraEditor : Editor |
|||
{ |
|||
enum ProjectionType { Perspective, Orthographic }; |
|||
|
|||
SerializedHDCamera m_SerializedCamera; |
|||
UIState m_UIState = new UIState(); |
|||
|
|||
void OnEnable() |
|||
{ |
|||
m_SerializedCamera = new SerializedHDCamera(serializedObject); |
|||
m_UIState.Reset(m_SerializedCamera, Repaint); |
|||
} |
|||
|
|||
public override void OnInspectorGUI() |
|||
{ |
|||
var s = m_UIState; |
|||
var d = m_SerializedCamera; |
|||
|
|||
d.Update(); |
|||
s.Update(); |
|||
|
|||
k_PrimarySection.Draw(s, d, this); |
|||
|
|||
d.Apply(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 770782413fdaa404c8616b39223b69e9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
class SerializedFrameSettings |
|||
{ |
|||
public SerializedProperty root; |
|||
|
|||
public SerializedProperty enableShadow; |
|||
public SerializedProperty enableSSR; |
|||
public SerializedProperty enableSSAO; |
|||
public SerializedProperty enableSSSAndTransmission; |
|||
|
|||
public SerializedProperty diffuseGlobalDimmer; |
|||
public SerializedProperty specularGlobalDimmer; |
|||
|
|||
public SerializedProperty enableForwardRenderingOnly; |
|||
public SerializedProperty enableDepthPrepassWithDeferredRendering; |
|||
public SerializedProperty enableAlphaTestOnlyInDeferredPrepass; |
|||
|
|||
public SerializedProperty enableTransparentPrepass; |
|||
public SerializedProperty enableMotionVectors; |
|||
public SerializedProperty enableObjectMotionVectors; |
|||
public SerializedProperty enableDBuffer; |
|||
public SerializedProperty enableAtmosphericScattering; |
|||
public SerializedProperty enableRoughRefraction; |
|||
public SerializedProperty enableTransparentPostpass; |
|||
public SerializedProperty enableDistortion; |
|||
public SerializedProperty enablePostprocess; |
|||
|
|||
public SerializedProperty enableStereo; |
|||
public SerializedProperty enableAsyncCompute; |
|||
|
|||
public SerializedProperty enableOpaqueObjects; |
|||
public SerializedProperty enableTransparentObjects; |
|||
|
|||
public SerializedProperty enableMSAA; |
|||
|
|||
public SerializedProperty enableShadowMask; |
|||
|
|||
public SerializedLightLoopSettings lightLoopSettings; |
|||
|
|||
|
|||
public SerializedFrameSettings(SerializedProperty root) |
|||
{ |
|||
this.root = root; |
|||
|
|||
enableShadow = root.Find((FrameSettings d) => d.enableShadow); |
|||
enableSSR = root.Find((FrameSettings d) => d.enableSSR); |
|||
enableSSAO = root.Find((FrameSettings d) => d.enableSSAO); |
|||
enableSSSAndTransmission = root.Find((FrameSettings d) => d.enableSSSAndTransmission); |
|||
diffuseGlobalDimmer = root.Find((FrameSettings d) => d.diffuseGlobalDimmer); |
|||
specularGlobalDimmer = root.Find((FrameSettings d) => d.specularGlobalDimmer); |
|||
enableForwardRenderingOnly = root.Find((FrameSettings d) => d.enableForwardRenderingOnly); |
|||
enableDepthPrepassWithDeferredRendering = root.Find((FrameSettings d) => d.enableDepthPrepassWithDeferredRendering); |
|||
enableAlphaTestOnlyInDeferredPrepass = root.Find((FrameSettings d) => d.enableAlphaTestOnlyInDeferredPrepass); |
|||
enableTransparentPrepass = root.Find((FrameSettings d) => d.enableTransparentPrepass); |
|||
enableMotionVectors = root.Find((FrameSettings d) => d.enableMotionVectors); |
|||
enableObjectMotionVectors = root.Find((FrameSettings d) => d.enableObjectMotionVectors); |
|||
enableDBuffer = root.Find((FrameSettings d) => d.enableDBuffer); |
|||
enableAtmosphericScattering = root.Find((FrameSettings d) => d.enableAtmosphericScattering); |
|||
enableRoughRefraction = root.Find((FrameSettings d) => d.enableRoughRefraction); |
|||
enableTransparentPostpass = root.Find((FrameSettings d) => d.enableTransparentPostpass); |
|||
enableDistortion = root.Find((FrameSettings d) => d.enableDistortion); |
|||
enablePostprocess = root.Find((FrameSettings d) => d.enablePostprocess); |
|||
enableStereo = root.Find((FrameSettings d) => d.enableStereo); |
|||
enableAsyncCompute = root.Find((FrameSettings d) => d.enableAsyncCompute); |
|||
enableOpaqueObjects = root.Find((FrameSettings d) => d.enableOpaqueObjects); |
|||
enableTransparentObjects = root.Find((FrameSettings d) => d.enableTransparentObjects); |
|||
enableMSAA = root.Find((FrameSettings d) => d.enableMSAA); |
|||
enableShadowMask = root.Find((FrameSettings d) => d.enableShadowMask); |
|||
|
|||
lightLoopSettings = new SerializedLightLoopSettings(root.Find((FrameSettings d) => d.lightLoopSettings)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e99a59ea553fbb94c98d84bdb26d9093 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
class SerializedHDCamera |
|||
{ |
|||
public SerializedObject serializedObject; |
|||
public SerializedObject serializedAdditionalDataObject; |
|||
|
|||
public SerializedProperty clearFlags; |
|||
public SerializedProperty backgroundColor; |
|||
public SerializedProperty normalizedViewPortRect; |
|||
public SerializedProperty fieldOfView; |
|||
public SerializedProperty orthographic; |
|||
public SerializedProperty orthographicSize; |
|||
public SerializedProperty depth; |
|||
public SerializedProperty cullingMask; |
|||
public SerializedProperty _renderingPath; // Legacy rendering path
|
|||
public SerializedProperty occlusionCulling; |
|||
public SerializedProperty targetTexture; |
|||
public SerializedProperty HDR; |
|||
public SerializedProperty allowMSAA; |
|||
public SerializedProperty allowDynamicResolution; |
|||
public SerializedProperty stereoConvergence; |
|||
public SerializedProperty stereoSeparation; |
|||
public SerializedProperty nearClippingPlane; |
|||
public SerializedProperty farClippingPlane; |
|||
public SerializedProperty targetEye; |
|||
|
|||
#if ENABLE_MULTIPLE_DISPLAYS
|
|||
public SerializedProperty targetDisplay; |
|||
#endif
|
|||
|
|||
public SerializedProperty renderingPath; |
|||
public SerializedProperty volumeLayerMask; |
|||
public SerializedFrameSettings frameSettings; |
|||
|
|||
|
|||
public SerializedHDCamera(SerializedObject serializedObject) |
|||
{ |
|||
this.serializedObject = serializedObject; |
|||
var additionals = CoreEditorUtils.GetAdditionalData<HDAdditionalCameraData>(serializedObject.targetObjects); |
|||
serializedAdditionalDataObject = new SerializedObject(additionals); |
|||
|
|||
clearFlags = serializedObject.FindProperty("m_ClearFlags"); |
|||
backgroundColor = serializedObject.FindProperty("m_BackGroundColor"); |
|||
normalizedViewPortRect = serializedObject.FindProperty("m_NormalizedViewPortRect"); |
|||
nearClippingPlane = serializedObject.FindProperty("near clip plane"); |
|||
farClippingPlane = serializedObject.FindProperty("far clip plane"); |
|||
fieldOfView = serializedObject.FindProperty("field of view"); |
|||
orthographic = serializedObject.FindProperty("orthographic"); |
|||
orthographicSize = serializedObject.FindProperty("orthographic size"); |
|||
depth = serializedObject.FindProperty("m_Depth"); |
|||
cullingMask = serializedObject.FindProperty("m_CullingMask"); |
|||
_renderingPath = serializedObject.FindProperty("m_RenderingPath"); |
|||
occlusionCulling = serializedObject.FindProperty("m_OcclusionCulling"); |
|||
targetTexture = serializedObject.FindProperty("m_TargetTexture"); |
|||
HDR = serializedObject.FindProperty("m_HDR"); |
|||
allowMSAA = serializedObject.FindProperty("m_AllowMSAA"); |
|||
allowDynamicResolution = serializedObject.FindProperty("m_AllowDynamicResolution"); |
|||
|
|||
stereoConvergence = serializedObject.FindProperty("m_StereoConvergence"); |
|||
stereoSeparation = serializedObject.FindProperty("m_StereoSeparation"); |
|||
|
|||
#if ENABLE_MULTIPLE_DISPLAYS
|
|||
targetDisplay = serializedObject.FindProperty("m_TargetDisplay"); |
|||
#endif
|
|||
|
|||
targetEye = serializedObject.FindProperty("m_TargetEye"); |
|||
|
|||
renderingPath = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.renderingPath); |
|||
volumeLayerMask = serializedAdditionalDataObject.Find((HDAdditionalCameraData d) => d.volumeLayerMask); |
|||
frameSettings = new SerializedFrameSettings(serializedAdditionalDataObject.FindProperty("m_FrameSettings")); |
|||
} |
|||
|
|||
public void Update() |
|||
{ |
|||
serializedObject.Update(); |
|||
serializedAdditionalDataObject.Update(); |
|||
|
|||
// Be sure legacy HDR option is disable on camera as it cause banding in SceneView. Yes, it is a contradiction, but well, Unity...
|
|||
// When HDR option is enabled, Unity render in FP16 then convert to 8bit with a stretch copy (this cause banding as it should be convert to sRGB (or other color appropriate color space)), then do a final shader with sRGB conversion
|
|||
// When LDR, unity render in 8bitSRGB, then do a final shader with sRGB conversion
|
|||
// What should be done is just in our Post process we convert to sRGB and store in a linear 10bit, but require C++ change...
|
|||
HDR.boolValue = false; |
|||
} |
|||
|
|||
public void Apply() |
|||
{ |
|||
serializedObject.ApplyModifiedProperties(); |
|||
serializedAdditionalDataObject.ApplyModifiedProperties(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: dd7e7dd92935baf419c0d25a37bbb971 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline; |
|||
|
|||
namespace UnityEditor.Experimental.Rendering |
|||
{ |
|||
class SerializedLightLoopSettings |
|||
{ |
|||
public SerializedProperty root; |
|||
|
|||
public SerializedProperty enableTileAndCluster; |
|||
public SerializedProperty enableComputeLightEvaluation; |
|||
public SerializedProperty enableComputeLightVariants; |
|||
public SerializedProperty enableComputeMaterialVariants; |
|||
public SerializedProperty enableFptlForForwardOpaque; |
|||
public SerializedProperty enableBigTilePrepass; |
|||
public SerializedProperty isFptlEnabled; |
|||
|
|||
public SerializedLightLoopSettings(SerializedProperty root) |
|||
{ |
|||
this.root = root; |
|||
|
|||
enableTileAndCluster = root.Find((LightLoopSettings l) => l.enableTileAndCluster); |
|||
enableComputeLightEvaluation = root.Find((LightLoopSettings l) => l.enableComputeLightEvaluation); |
|||
enableComputeLightVariants = root.Find((LightLoopSettings l) => l.enableComputeLightVariants); |
|||
enableComputeMaterialVariants = root.Find((LightLoopSettings l) => l.enableComputeMaterialVariants); |
|||
enableFptlForForwardOpaque = root.Find((LightLoopSettings l) => l.enableFptlForForwardOpaque); |
|||
enableBigTilePrepass = root.Find((LightLoopSettings l) => l.enableBigTilePrepass); |
|||
isFptlEnabled = root.Find((LightLoopSettings l) => l.isFptlEnabled); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 757cc63cb14af6d4485632ea47a0f2a1 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue