浏览代码
Merge pull request #760 from Unity-Technologies/feature/HDRenderPipelineEditor
Merge pull request #760 from Unity-Technologies/feature/HDRenderPipelineEditor
HDRenderPipelineInspector/main
GitHub
7 年前
当前提交
df79ad0d
共有 26 个文件被更改,包括 526 次插入 和 250 次删除
-
2ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/Camera/HDCameraUI.cs
-
25ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/FrameSettingsUI.cs
-
7ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs
-
15ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs
-
61ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/GlobalLightLoopSettingsUI.cs.meta
-
36ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineEditor.cs.meta
-
68ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/HDRenderPipelineUI.cs.meta
-
72ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/RenderPipelineSettingsUI.cs.meta
-
36ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedGlobalLightLoopSettings.cs.meta
-
36ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedHDRenderPipelineAsset.cs.meta
-
36ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedRenderPipelineSettings.cs.meta
-
20ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/SerializedShadowInitParameters.cs.meta
-
29ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs
-
11ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/ShadowInitParametersUI.cs.meta
-
12ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs.meta
-
13ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs.meta
-
51ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.Styles.cs
-
158ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.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; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 9b94e0ab156e7234a9448102e2ce2cf4 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a26b69e62f69f1f4a88f7417f469eb82 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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")); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 7164f1c72d9ea9249a0b1b2b11a5dc0c |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: d9573799396232a49a9f9eed33adb540 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: f3cfdcb35ee11de4a86fd2fb4f82d60d |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 936892ffe7e34684aacbbde56674c082 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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)); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: e20f66da3622dc9468c5e3cef5f95a69 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: a0e52dc13dec5924a9ac8a3f279cea36 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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; |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 5182f05875d6503459eda16786882b44 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 6e8669cdde22f4948a090da4b5fb5b7c |
|||
timeCreated: 1475763911 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: eaef7e9439aa2fb4093fa259575623d4 |
|||
timeCreated: 1507717754 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
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(); |
|||
} |
|||
} |
|||
} |
|
|||
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(); |
|||
} |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue