浏览代码

Merge pull request #760 from Unity-Technologies/feature/HDRenderPipelineEditor

HDRenderPipelineInspector
/main
GitHub 7 年前
当前提交
df79ad0d
共有 26 个文件被更改,包括 526 次插入250 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs
  2. 25
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs
  3. 7
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs
  4. 15
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs
  5. 61
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs
  6. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs.meta
  7. 36
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs
  8. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs.meta
  9. 68
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs
  10. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs.meta
  11. 72
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs
  12. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs.meta
  13. 36
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs
  14. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs.meta
  15. 36
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs
  16. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs.meta
  17. 36
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs
  18. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs.meta
  19. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs
  20. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs.meta
  21. 29
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs
  22. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs.meta
  23. 12
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs.meta
  24. 13
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs.meta
  25. 51
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs
  26. 158
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs

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


FrameSettingsUI.SectionRenderingSettings,
FrameSettingsUI.SectionLightingSettings),
CED.Select(
(s, d, o) => s.frameSettingsUI.lightLoopSettingsUI,
(s, d, o) => s.frameSettingsUI.lightLoopSettings,
(s, d, o) => d.frameSettings.lightLoopSettings,
LightLoopSettingsUI.SectionLightLoopSettings));

25
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs


class FrameSettingsUI : BaseUI<SerializedFrameSettings>
{
static FrameSettingsUI()
{
Inspector = CED.Group(
SectionRenderingPasses,
SectionRenderingSettings,
SectionXRSettings,
SectionLightingSettings,
CED.Select(
(s, d, o) => s.lightLoopSettings,
(s, d, o) => d.lightLoopSettings,
LightLoopSettingsUI.SectionLightLoopSettings
)
);
}
public static CED.IDrawer Inspector;
public static CED.IDrawer SectionRenderingPasses = CED.FoldoutGroup(
"Rendering Passes",
(s, p, o) => s.isSectionExpandedRenderingPasses,

public AnimBool isSectionExpandedUseForwardOnly { get { return m_AnimBools[5]; } }
public AnimBool isSectionExpandedUseDepthPrepass { get { return m_AnimBools[6]; } }
public LightLoopSettingsUI lightLoopSettingsUI = new LightLoopSettingsUI();
public LightLoopSettingsUI lightLoopSettings = new LightLoopSettingsUI();
public FrameSettingsUI()
: base(7)

public override void Reset(SerializedFrameSettings data, UnityAction repaint)
{
lightLoopSettingsUI.Reset(data.lightLoopSettings, repaint);
lightLoopSettings.Reset(data.lightLoopSettings, repaint);
base.Reset(data, repaint);
}

isSectionExpandedUseForwardOnly.target = !data.enableForwardRenderingOnly.boolValue;
isSectionExpandedUseDepthPrepass.target = data.enableDepthPrepassWithDeferredRendering.boolValue;
lightLoopSettingsUI.Update();
lightLoopSettings.Update();
}
static void Drawer_SectionRenderingPasses(FrameSettingsUI s, SerializedFrameSettings p, Editor owner)

{
EditorGUILayout.PropertyField(p.enableSSR, _.GetContent("Enable SSR"));
EditorGUILayout.PropertyField(p.enableSSAO, _.GetContent("Enable SSAO"));
EditorGUILayout.PropertyField(p.enableSubsurfaceScattering, _.GetContent("Enable SubsurfaceScattering"));
EditorGUILayout.PropertyField(p.enableSubsurfaceScattering, _.GetContent("Enable Subsurface Scattering"));
EditorGUILayout.PropertyField(p.enableTransmission, _.GetContent("Enable Transmission"));
EditorGUILayout.PropertyField(p.enableShadow, _.GetContent("Enable Shadow"));
EditorGUILayout.PropertyField(p.enableShadowMask, _.GetContent("Enable Shadow Masks"));

7
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs


if (EditorGUILayout.BeginFadeGroup(s.isSectionExpandedEnableTileAndCluster.faded))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(p.isFptlEnabled, _.GetContent("Enable FPTL"));
EditorGUILayout.PropertyField(p.enableFptlForForwardOpaque, _.GetContent("Enable FPTL For Forward Opaque"));
EditorGUILayout.PropertyField(p.enableBigTilePrepass, _.GetContent("Enable Big Tile Prepass"));
EditorGUILayout.PropertyField(p.enableComputeLightEvaluation, _.GetContent("Enable Compute Light Evaluation"));
GUILayout.BeginVertical();

}
EditorGUILayout.EndFadeGroup();
GUILayout.EndVertical();
EditorGUILayout.PropertyField(p.isFptlEnabled, _.GetContent("Enable FPTL"));
// Allow to disable cluster for forward opaque when in forward only (option have no effect when MSAA is enabled)
// Deferred opaque are always tiled
EditorGUILayout.PropertyField(p.enableFptlForForwardOpaque, _.GetContent("Enable FPTL For Forward Opaque"));
}
}
}

15
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
using UnityEngine.Serialization;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
// The HDRenderPipeline assumes linear lighting. Doesn't work with gamma.
public class HDRenderPipelineAsset : RenderPipelineAsset, ISerializationCallbackReceiver

// 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)
public FrameSettings serializedFrameSettings = new FrameSettings(); // This are the defaultFrameSettings for all the camera and apply to sceneView, public to be visible in the inspector
[SerializeField]
[FormerlySerializedAs("serializedFrameSettings")]
FrameSettings m_FrameSettings = new FrameSettings(); // This are the defaultFrameSettings for all the camera and apply to sceneView, public to be visible in the inspector
FrameSettings m_FrameSettings = new FrameSettings();
FrameSettings m_FrameSettingsRuntime = new FrameSettings();
return m_FrameSettings;
return m_FrameSettingsRuntime;
}
// Store the various RenderPipelineSettings for each platform (for now only one)

{
// Modification of defaultFrameSettings in the inspector will call OnValidate().
// We do a copy of the settings to those effectively used
serializedFrameSettings.CopyTo(m_FrameSettings);
m_FrameSettings.CopyTo(m_FrameSettingsRuntime);
}
}
}

61
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs


namespace UnityEditor.Experimental.Rendering
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<GlobalLightLoopSettingsUI, SerializedGlobalLightLoopSettings>;
class GlobalLightLoopSettingsUI : BaseUI<SerializedGlobalLightLoopSettings>
{
static GlobalLightLoopSettingsUI()
{
Inspector = CED.Group(
SectionCookies,
CED.space,
SectionReflection,
CED.space,
SectionSky
);
}
public static readonly CED.IDrawer Inspector;
public static readonly CED.IDrawer SectionCookies = CED.Action(Drawer_SectionCookies);
public static readonly CED.IDrawer SectionReflection = CED.Action(Drawer_SectionReflection);
public static readonly CED.IDrawer SectionSky = CED.Action(Drawer_SectionSky);
public GlobalLightLoopSettingsUI()
: base(0)
{
}
static void Drawer_SectionCookies(GlobalLightLoopSettingsUI s, SerializedGlobalLightLoopSettings d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Cookies"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.cookieTexArraySize, _.GetContent("Texture Array Size"));
EditorGUILayout.PropertyField(d.cubeCookieTexArraySize, _.GetContent("Cubemap Array Size"));
EditorGUILayout.PropertyField(d.pointCookieSize, _.GetContent("Point Cookie Size"));
EditorGUILayout.PropertyField(d.spotCookieSize, _.GetContent("Spot Cookie Size"));
--EditorGUI.indentLevel;
}
static void Drawer_SectionReflection(GlobalLightLoopSettingsUI s, SerializedGlobalLightLoopSettings d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Reflection"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.reflectionCacheCompressed, _.GetContent("Compress Reflection Probe Cache"));
EditorGUILayout.PropertyField(d.reflectionCubemapSize, _.GetContent("Reflection Cubemap Size"));
EditorGUILayout.PropertyField(d.reflectionProbeCacheSize, _.GetContent("Probe Cache Size"));
--EditorGUI.indentLevel;
}
static void Drawer_SectionSky(GlobalLightLoopSettingsUI s, SerializedGlobalLightLoopSettings d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Sky"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.skyReflectionSize, _.GetContent("Sky Reflection Size"));
EditorGUILayout.PropertyField(d.skyLightingOverrideLayerMask, _.GetContent("Sky Lighting Override Mask|This layer mask will define in which layers the sky system will look for sky settings volumes for lighting override"));
--EditorGUI.indentLevel;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs.meta


fileFormatVersion: 2
guid: 9b94e0ab156e7234a9448102e2ce2cf4
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

36
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs


using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
[CustomEditor(typeof(HDRenderPipelineAsset))]
public sealed class HDRenderPipelineEditor : Editor
{
SerializedHDRenderPipelineAsset m_SerializedHDRenderPipeline;
HDRenderPipelineUI m_HDRenderPipelineUI = new HDRenderPipelineUI();
void OnEnable()
{
m_SerializedHDRenderPipeline = new SerializedHDRenderPipelineAsset(serializedObject);
m_HDRenderPipelineUI.Reset(m_SerializedHDRenderPipeline, Repaint);
}
public override void OnInspectorGUI()
{
var hdPipeline = RenderPipelineManager.currentPipeline as HDRenderPipeline;
if (hdPipeline == null)
return;
var s = m_HDRenderPipelineUI;
var d = m_SerializedHDRenderPipeline;
var o = this;
s.Update();
d.Update();
HDRenderPipelineUI.Inspector.Draw(s, d, o);
d.Apply();
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs.meta


fileFormatVersion: 2
guid: a26b69e62f69f1f4a88f7417f469eb82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

68
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs


using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<HDRenderPipelineUI, SerializedHDRenderPipelineAsset>;
class HDRenderPipelineUI : BaseUI<SerializedHDRenderPipelineAsset>
{
static HDRenderPipelineUI()
{
Inspector = CED.Group(
SectionPrimarySettings,
CED.space,
CED.Select(
(s, d, o) => s.renderPipelineSettings,
(s, d, o) => d.renderPipelineSettings,
RenderPipelineSettingsUI.Inspector
),
CED.space,
CED.Action(Drawer_TitleDefaultFrameSettings),
CED.Select(
(s, d, o) => s.defaultFrameSettings,
(s, d, o) => d.defaultFrameSettings,
FrameSettingsUI.Inspector
)
);
}
public static readonly CED.IDrawer Inspector;
public static readonly CED.IDrawer SectionPrimarySettings = CED.Action(Drawer_SectionPrimarySettings);
public FrameSettingsUI defaultFrameSettings = new FrameSettingsUI();
public RenderPipelineSettingsUI renderPipelineSettings = new RenderPipelineSettingsUI();
public HDRenderPipelineUI()
: base(0)
{
}
public override void Reset(SerializedHDRenderPipelineAsset data, UnityAction repaint)
{
renderPipelineSettings.Reset(data.renderPipelineSettings, repaint);
defaultFrameSettings.Reset(data.defaultFrameSettings, repaint);
base.Reset(data, repaint);
}
public override void Update()
{
renderPipelineSettings.Update();
defaultFrameSettings.Update();
base.Update();
}
static void Drawer_TitleDefaultFrameSettings(HDRenderPipelineUI s, SerializedHDRenderPipelineAsset d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Default Frame Settings"), EditorStyles.boldLabel);
}
static void Drawer_SectionPrimarySettings(HDRenderPipelineUI s, SerializedHDRenderPipelineAsset d, Editor o)
{
EditorGUILayout.PropertyField(d.renderPipelineResources, _.GetContent("Render Pipeline Resources|Set of resources that need to be loaded when creating stand alone"));
EditorGUILayout.PropertyField(d.diffusionProfileSettings, _.GetContent("Diffusion Profile Settings"));
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs.meta


fileFormatVersion: 2
guid: 7164f1c72d9ea9249a0b1b2b11a5dc0c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

72
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs


using UnityEngine.Events;
namespace UnityEditor.Experimental.Rendering
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<RenderPipelineSettingsUI, SerializedRenderPipelineSettings>;
class RenderPipelineSettingsUI : BaseUI<SerializedRenderPipelineSettings>
{
static RenderPipelineSettingsUI()
{
Inspector = CED.Group(
SectionPrimarySettings,
CED.space,
CED.Select(
(s, d, o) => s.lightLoopSettings,
(s, d, o) => d.lightLoopSettings,
GlobalLightLoopSettingsUI.Inspector
),
CED.space,
CED.Select(
(s, d, o) => s.shadowInitParams,
(s, d, o) => d.shadowInitParams,
ShadowInitParametersUI.SectionAtlas
)
);
}
public static readonly CED.IDrawer Inspector;
public static readonly CED.IDrawer SectionPrimarySettings = CED.Group(
CED.Action(Drawer_SectionPrimarySettings)
);
GlobalLightLoopSettingsUI lightLoopSettings = new GlobalLightLoopSettingsUI();
ShadowInitParametersUI shadowInitParams = new ShadowInitParametersUI();
public RenderPipelineSettingsUI()
: base(0)
{
}
public override void Reset(SerializedRenderPipelineSettings data, UnityAction repaint)
{
lightLoopSettings.Reset(data.lightLoopSettings, repaint);
shadowInitParams.Reset(data.shadowInitParams, repaint);
base.Reset(data, repaint);
}
public override void Update()
{
lightLoopSettings.Update();
shadowInitParams.Update();
base.Update();
}
static void Drawer_SectionPrimarySettings(RenderPipelineSettingsUI s, SerializedRenderPipelineSettings d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Render Pipeline Settings"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.supportShadowMask, _.GetContent("Support Shadow Mask"));
EditorGUILayout.PropertyField(d.supportSSR, _.GetContent("Support SSR"));
EditorGUILayout.PropertyField(d.supportSSAO, _.GetContent("Support SSAO"));
EditorGUILayout.PropertyField(d.supportDBuffer, _.GetContent("Support Decal Buffer"));
EditorGUILayout.PropertyField(d.supportMSAA, _.GetContent("Support MSAA"));
EditorGUILayout.PropertyField(d.supportSubsurfaceScattering, _.GetContent("Support Subsurface Scattering"));
EditorGUILayout.PropertyField(d.supportAsyncCompute, _.GetContent("Support AsyncCompute"));
--EditorGUI.indentLevel;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs.meta


fileFormatVersion: 2
guid: d9573799396232a49a9f9eed33adb540
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

36
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
{
class SerializedGlobalLightLoopSettings
{
public SerializedProperty root;
public SerializedProperty spotCookieSize;
public SerializedProperty cookieTexArraySize;
public SerializedProperty pointCookieSize;
public SerializedProperty cubeCookieTexArraySize;
public SerializedProperty reflectionProbeCacheSize;
public SerializedProperty reflectionCubemapSize;
public SerializedProperty reflectionCacheCompressed;
public SerializedProperty skyReflectionSize;
public SerializedProperty skyLightingOverrideLayerMask;
public SerializedGlobalLightLoopSettings(SerializedProperty root)
{
this.root = root;
spotCookieSize = root.Find((GlobalLightLoopSettings s) => s.spotCookieSize);
cookieTexArraySize = root.Find((GlobalLightLoopSettings s) => s.cookieTexArraySize);
pointCookieSize = root.Find((GlobalLightLoopSettings s) => s.pointCookieSize);
cubeCookieTexArraySize = root.Find((GlobalLightLoopSettings s) => s.cubeCookieTexArraySize);
reflectionProbeCacheSize = root.Find((GlobalLightLoopSettings s) => s.reflectionProbeCacheSize);
reflectionCubemapSize = root.Find((GlobalLightLoopSettings s) => s.reflectionCubemapSize);
reflectionCacheCompressed = root.Find((GlobalLightLoopSettings s) => s.reflectionCacheCompressed);
skyReflectionSize = root.Find((GlobalLightLoopSettings s) => s.skyReflectionSize);
skyLightingOverrideLayerMask = root.Find((GlobalLightLoopSettings s) => s.skyLightingOverrideLayerMask);
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs.meta


fileFormatVersion: 2
guid: f3cfdcb35ee11de4a86fd2fb4f82d60d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

36
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
{
class SerializedHDRenderPipelineAsset
{
public SerializedObject serializedObject;
public SerializedProperty renderPipelineResources;
public SerializedProperty diffusionProfileSettings;
public SerializedRenderPipelineSettings renderPipelineSettings;
public SerializedFrameSettings defaultFrameSettings;
public SerializedHDRenderPipelineAsset(SerializedObject serializedObject)
{
this.serializedObject = serializedObject;
renderPipelineResources = serializedObject.FindProperty("m_RenderPipelineResources");
diffusionProfileSettings = serializedObject.Find((HDRenderPipelineAsset s) => s.diffusionProfileSettings);
renderPipelineSettings = new SerializedRenderPipelineSettings(serializedObject.Find((HDRenderPipelineAsset a) => a.renderPipelineSettings));
defaultFrameSettings = new SerializedFrameSettings(serializedObject.FindProperty("m_FrameSettings"));
}
public void Update()
{
serializedObject.Update();
}
public void Apply()
{
serializedObject.ApplyModifiedProperties();
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs.meta


fileFormatVersion: 2
guid: 936892ffe7e34684aacbbde56674c082
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

36
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs


using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
{
class SerializedRenderPipelineSettings
{
public SerializedProperty root;
public SerializedProperty supportShadowMask;
public SerializedProperty supportSSR;
public SerializedProperty supportSSAO;
public SerializedProperty supportDBuffer;
public SerializedProperty supportMSAA;
public SerializedProperty supportSubsurfaceScattering;
public SerializedProperty supportAsyncCompute;
public SerializedGlobalLightLoopSettings lightLoopSettings;
public SerializedShadowInitParameters shadowInitParams;
public SerializedRenderPipelineSettings(SerializedProperty root)
{
this.root = root;
supportShadowMask = root.Find((RenderPipelineSettings s) => s.supportShadowMask);
supportSSR = root.Find((RenderPipelineSettings s) => s.supportSSR);
supportSSAO = root.Find((RenderPipelineSettings s) => s.supportSSAO);
supportDBuffer = root.Find((RenderPipelineSettings s) => s.supportDBuffer);
supportMSAA = root.Find((RenderPipelineSettings s) => s.supportMSAA);
supportSubsurfaceScattering = root.Find((RenderPipelineSettings s) => s.supportSubsurfaceScattering);
supportAsyncCompute = root.Find((RenderPipelineSettings s) => s.supportAsyncCompute);
lightLoopSettings = new SerializedGlobalLightLoopSettings(root.Find((RenderPipelineSettings s) => s.lightLoopSettings));
shadowInitParams = new SerializedShadowInitParameters(root.Find((RenderPipelineSettings s) => s.shadowInitParams));
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs.meta


fileFormatVersion: 2
guid: e20f66da3622dc9468c5e3cef5f95a69
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

20
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs


using UnityEngine.Experimental.Rendering;
namespace UnityEditor.Experimental.Rendering
{
class SerializedShadowInitParameters
{
public SerializedProperty root;
public SerializedProperty shadowAtlasWidth;
public SerializedProperty shadowAtlasHeight;
public SerializedShadowInitParameters(SerializedProperty root)
{
this.root = root;
shadowAtlasWidth = root.Find((ShadowInitParameters s) => s.shadowAtlasWidth);
shadowAtlasHeight = root.Find((ShadowInitParameters s) => s.shadowAtlasHeight);
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs.meta


fileFormatVersion: 2
guid: a0e52dc13dec5924a9ac8a3f279cea36
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

29
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs


using UnityEditor.AnimatedValues;
using UnityEngine.Events;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering
{
using _ = CoreEditorUtils;
using CED = CoreEditorDrawer<ShadowInitParametersUI, SerializedShadowInitParameters>;
class ShadowInitParametersUI : BaseUI<SerializedShadowInitParameters>
{
public static readonly CED.IDrawer SectionAtlas = CED.Action(Drawer_FieldShadowSize);
public ShadowInitParametersUI()
: base(0)
{
}
static void Drawer_FieldShadowSize(ShadowInitParametersUI s, SerializedShadowInitParameters d, Editor o)
{
EditorGUILayout.LabelField(_.GetContent("Shadow Atlas Settings"), EditorStyles.boldLabel);
++EditorGUI.indentLevel;
EditorGUILayout.PropertyField(d.shadowAtlasWidth, _.GetContent("Atlas Width"));
EditorGUILayout.PropertyField(d.shadowAtlasHeight, _.GetContent("Atlas Height"));
--EditorGUI.indentLevel;
}
}
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs.meta


fileFormatVersion: 2
guid: 5182f05875d6503459eda16786882b44
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

12
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs.meta


fileFormatVersion: 2
guid: 6e8669cdde22f4948a090da4b5fb5b7c
timeCreated: 1475763911
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

13
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs.meta


fileFormatVersion: 2
guid: eaef7e9439aa2fb4093fa259575623d4
timeCreated: 1507717754
licenseType: Pro
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

51
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs


using UnityEngine;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
public sealed partial class HDRenderPipelineInspector
{
sealed class Styles
{
public readonly GUIContent defaults = new GUIContent("Defaults");
public readonly GUIContent renderPipelineResources = new GUIContent("Render Pipeline Resources", "Set of resources that need to be loaded when creating stand alone");
public readonly GUIContent settingsLabel = new GUIContent("Settings");
public readonly GUIContent renderPipelineSettings = new GUIContent("Render Pipeline Settings");
public readonly GUIContent supportDBuffer = new GUIContent("Support Decal buffer");
public readonly GUIContent supportMSAA = new GUIContent("Support MSAA");
public readonly GUIContent supportSubsurfaceScattering = new GUIContent("Support SubsurfaceScattering");
// Shadow Settings
public readonly GUIContent shadowSettings = new GUIContent("Shadow Settings");
public readonly GUIContent shadowsAtlasWidth = new GUIContent("Atlas Width");
public readonly GUIContent shadowsAtlasHeight = new GUIContent("Atlas Height");
// LightLoop Settings
public readonly GUIContent textureSettings = new GUIContent("LightLoop Settings");
public readonly GUIContent spotCookieSize = new GUIContent("Spot Cookie Size");
public readonly GUIContent pointCookieSize = new GUIContent("Point Cookie Size");
public readonly GUIContent reflectionCubemapSize = new GUIContent("Reflection Cubemap Size");
public readonly GUIContent reflectionCacheCompressed = new GUIContent("Compress Reflection Probe Cache");
public readonly GUIContent skyReflectionSize = new GUIContent("Sky Reflection Size");
public readonly GUIContent skyLightingOverride = new GUIContent("Sky Lighting Override Mask", "This layer mask will define in which layers the sky system will look for sky settings volumes for lighting override.");
public readonly GUIContent defaultFrameSettings = new GUIContent("Default Frame Settings");
// Rendering Settings
public readonly GUIContent renderingSettingsLabel = new GUIContent("Rendering Settings");
public readonly GUIContent diffusionProfileSettings = new GUIContent("Diffusion Profile Settings");
}
static Styles s_Styles;
// Can't use a static initializer in case we need to create GUIStyle in the Styles class as
// these can only be created with an active GUI rendering context
void CheckStyles()
{
if (s_Styles == null)
s_Styles = new Styles();
}
}
}

158
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs


using System.Linq;
using System.Reflection;
using UnityEngine.Experimental.Rendering;
using UnityEngine.Experimental.Rendering.HDPipeline;
namespace UnityEditor.Experimental.Rendering.HDPipeline
{
using CED = CoreEditorDrawer<FrameSettingsUI, SerializedFrameSettings>;
using _ = CoreEditorUtils;
[CustomEditor(typeof(HDRenderPipelineAsset))]
public sealed partial class HDRenderPipelineInspector : HDBaseEditor<HDRenderPipelineAsset>
{
static readonly CED.IDrawer[] k_FrameSettings = new[]
{
FrameSettingsUI.SectionRenderingPasses,
FrameSettingsUI.SectionRenderingSettings,
CED.Select(
(s, d, o) => s.lightLoopSettingsUI,
(s, d, o) => d.lightLoopSettings,
LightLoopSettingsUI.SectionLightLoopSettings),
FrameSettingsUI.SectionXRSettings
};
SerializedProperty m_RenderPipelineResources;
// Global Frame Settings
// Global Render settings
SerializedProperty m_supportDBuffer;
SerializedProperty m_supportMSAA;
SerializedProperty m_supportSubsurfaceScattering;
// Global Shadow settings
SerializedProperty m_ShadowAtlasWidth;
SerializedProperty m_ShadowAtlasHeight;
// Global LightLoop settings
SerializedProperty m_SpotCookieSize;
SerializedProperty m_PointCookieSize;
SerializedProperty m_ReflectionCubemapSize;
// Commented out until we have proper realtime BC6H compression
//SerializedProperty m_ReflectionCacheCompressed;
SerializedProperty m_SkyReflectionSize;
SerializedProperty m_SkyLightingOverrideLayerMask;
// Diffusion profile Settings
SerializedProperty m_DiffusionProfileSettings;
SerializedFrameSettings serializedFrameSettings = null;
FrameSettingsUI m_FrameSettingsUI = new FrameSettingsUI();
void InitializeProperties()
{
m_RenderPipelineResources = properties.Find("m_RenderPipelineResources");
// Global FrameSettings
// Global Render settings
m_supportDBuffer = properties.Find(x => x.renderPipelineSettings.supportDBuffer);
m_supportMSAA = properties.Find(x => x.renderPipelineSettings.supportMSAA);
m_supportSubsurfaceScattering = properties.Find(x => x.renderPipelineSettings.supportSubsurfaceScattering);
// Global Shadow settings
m_ShadowAtlasWidth = properties.Find(x => x.renderPipelineSettings.shadowInitParams.shadowAtlasWidth);
m_ShadowAtlasHeight = properties.Find(x => x.renderPipelineSettings.shadowInitParams.shadowAtlasHeight);
// Global LightLoop settings
m_SpotCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.spotCookieSize);
m_PointCookieSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.pointCookieSize);
m_ReflectionCubemapSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.reflectionCubemapSize);
// Commented out until we have proper realtime BC6H compression
//m_ReflectionCacheCompressed = properties.Find(x => x.globalFrameSettings.lightLoopSettings.reflectionCacheCompressed);
m_SkyReflectionSize = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.skyReflectionSize);
m_SkyLightingOverrideLayerMask = properties.Find(x => x.renderPipelineSettings.lightLoopSettings.skyLightingOverrideLayerMask);
// Diffusion profile Settings
m_DiffusionProfileSettings = properties.Find(x => x.diffusionProfileSettings);
serializedFrameSettings = new SerializedFrameSettings(properties.Find(x => x.serializedFrameSettings));
m_FrameSettingsUI.Reset(serializedFrameSettings, Repaint);
}
void GlobalLightLoopSettingsUI(HDRenderPipelineAsset hdAsset)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(s_Styles.textureSettings);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_SpotCookieSize, s_Styles.spotCookieSize);
EditorGUILayout.PropertyField(m_PointCookieSize, s_Styles.pointCookieSize);
EditorGUILayout.PropertyField(m_ReflectionCubemapSize, s_Styles.reflectionCubemapSize);
// Commented out until we have proper realtime BC6H compression
//EditorGUILayout.PropertyField(m_ReflectionCacheCompressed, s_Styles.reflectionCacheCompressed);
EditorGUILayout.PropertyField(m_SkyReflectionSize, s_Styles.skyReflectionSize);
EditorGUILayout.PropertyField(m_SkyLightingOverrideLayerMask, s_Styles.skyLightingOverride);
EditorGUI.indentLevel--;
}
void GlobalRenderSettingsUI(HDRenderPipelineAsset hdAsset)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(s_Styles.renderingSettingsLabel);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_supportDBuffer, s_Styles.supportDBuffer);
EditorGUILayout.PropertyField(m_supportMSAA, s_Styles.supportMSAA);
EditorGUILayout.PropertyField(m_supportSubsurfaceScattering, s_Styles.supportSubsurfaceScattering);
EditorGUI.indentLevel--;
}
void GlobalShadowSettingsUI(HDRenderPipelineAsset hdAsset)
{
EditorGUILayout.Space();
EditorGUILayout.LabelField(s_Styles.shadowSettings);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_ShadowAtlasWidth, s_Styles.shadowsAtlasWidth);
EditorGUILayout.PropertyField(m_ShadowAtlasHeight, s_Styles.shadowsAtlasHeight);
EditorGUI.indentLevel--;
}
void SettingsUI(HDRenderPipelineAsset hdAsset)
{
EditorGUILayout.LabelField(s_Styles.renderPipelineSettings, EditorStyles.boldLabel);
GlobalRenderSettingsUI(hdAsset);
GlobalShadowSettingsUI(hdAsset);
GlobalLightLoopSettingsUI(hdAsset);
EditorGUILayout.Space();
}
protected override void OnEnable()
{
base.OnEnable();
InitializeProperties();
}
public override void OnInspectorGUI()
{
if (!m_Target || m_HDPipeline == null)
return;
CheckStyles();
serializedObject.Update();
m_FrameSettingsUI.Update();
EditorGUILayout.PropertyField(m_RenderPipelineResources, s_Styles.renderPipelineResources);
EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_DiffusionProfileSettings, s_Styles.diffusionProfileSettings);
EditorGUILayout.Space();
SettingsUI(m_Target);
EditorGUILayout.LabelField(s_Styles.defaultFrameSettings, EditorStyles.boldLabel);
k_FrameSettings.Draw(m_FrameSettingsUI, serializedFrameSettings, this);
serializedObject.ApplyModifiedProperties();
}
}
}
正在加载...
取消
保存