浏览代码

Updates to LW Asset Inspector (#1741)

* Updated Inspector

Updated inspector with the feedback we got from UX/UI. looks sooooo purrrrrty now X0

* updated .md

* cleanup
/main
Felipe Lira 6 年前
当前提交
7385b99e
共有 2 个文件被更改,包括 79 次插入54 次删除
  1. 3
      com.unity.render-pipelines.lightweight/CHANGELOG.md
  2. 130
      com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightPipelineAssetEditor.cs

3
com.unity.render-pipelines.lightweight/CHANGELOG.md


and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [3.2.0-preview]
### Changed
- The UI for Lightweight asset has been updated with new categories. A more clean structure and foldouts has been added to keep things organized.
### Fixed
- Scriptable passes no longer have missing material references. Now they access cached materials in the renderer.(case 1061353)
- When you change a Shadow Cascade option in the Pipeline Asset, this no longer warns you that you've exceeded the array size for the _WorldToShadow property.

130
com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightPipelineAssetEditor.cs


[CustomEditor(typeof(LightweightPipelineAsset))]
public class LightweightPipelineAssetEditor : Editor
{
bool generalSettingsFoldout = false;
bool qualitySettingsFoldout = false;
bool shadowsSettingsFoldout = false;
public static GUIContent renderingLabel = new GUIContent("Rendering");
public static GUIContent qualityLabel = new GUIContent("Quality");
public static GUIContent capabilitiesLabel = new GUIContent("Capabilities");
public static GUIContent featuresLabel = new GUIContent("Shader Features");
public static GUIContent renderScaleLabel = new GUIContent("Render Scale", "Scales the camera render target allowing the game to render at a resolution different than native resolution. UI is always rendered at native resolution.");

SerializedProperty m_CustomShaderVariantStripSettingsProp;
SerializedProperty m_XRConfig;
public override void OnInspectorGUI()
{
serializedObject.Update();

DrawCapabilitiesSettings();
DrawShaderFeaturesSettings();
DrawQualitySettings();
DrawShadowSettings();
EditorGUILayout.PropertyField(m_XRConfig);
serializedObject.ApplyModifiedProperties();

{
{
m_RenderScale = serializedObject.FindProperty("m_RenderScale");
m_MaxPixelLights = serializedObject.FindProperty("m_MaxPixelLights");
m_SupportsVertexLightProp = serializedObject.FindProperty("m_SupportsVertexLight");

m_ShowOpaqueTextureScale.valueChanged.AddListener(Repaint);
m_ShowOpaqueTextureScale.value = m_RequireOpaqueTextureProp.boolValue;
m_XRConfig = serializedObject.FindProperty("m_SavedXRConfig");
}
void OnDisable()

m_ShowOpaqueTextureScale.target = m_RequireOpaqueTextureProp.boolValue;
}
void DrawGeneralSettings()
void DrawShaderFeaturesSettings()
EditorGUILayout.LabelField(Styles.generalSettingsLabel, EditorStyles.boldLabel);
EditorGUILayout.LabelField(Styles.featuresLabel, EditorStyles.boldLabel);
m_RenderScale.floatValue = EditorGUILayout.Slider(Styles.renderScaleLabel, m_RenderScale.floatValue, k_MinRenderScale, k_MaxRenderScale);
m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(Styles.maxPixelLightsLabel, m_MaxPixelLights.intValue, 0, k_MaxSupportedPixelLights);
EditorGUILayout.PropertyField(m_SupportsVertexLightProp, Styles.enableVertexLightLabel);
EditorGUILayout.PropertyField(m_DirectionalShadowsSupportedProp, Styles.supportsDirectionalShadows);
EditorGUILayout.PropertyField(m_LocalShadowSupportedProp, Styles.supportsLocalShadows);
EditorGUI.BeginDisabledGroup(!(m_DirectionalShadowsSupportedProp.boolValue || m_LocalShadowSupportedProp.boolValue));
EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
EditorGUILayout.Space();
}
bool directionalShadows = m_DirectionalShadowsSupportedProp.boolValue;
if (directionalShadows)
void DrawGeneralSettings()
{
generalSettingsFoldout = EditorGUILayout.Foldout(generalSettingsFoldout, Styles.generalSettingsLabel, true);
if (generalSettingsFoldout)
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_SupportsDynamicBatching, Styles.dynamicBatching);
EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTexture);
EditorGUI.BeginDisabledGroup(!m_RequireDepthTextureProp.boolValue);
EditorGUILayout.PropertyField(m_RequireSoftParticlesProp, Styles.requireSoftParticles);
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(m_RequireOpaqueTextureProp, Styles.requireOpaqueTexture);
EditorGUI.indentLevel++;
EditorGUI.BeginDisabledGroup(!m_RequireOpaqueTextureProp.boolValue);
EditorGUILayout.PropertyField(m_OpaqueDownsamplingProp, Styles.opaqueDownsampling);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.Space();
}
}
void DrawQualitySettings()
{
qualitySettingsFoldout = EditorGUILayout.Foldout(qualitySettingsFoldout, Styles.qualityLabel, true);
if (qualitySettingsFoldout)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_HDR, Styles.hdrContent);
EditorGUILayout.PropertyField(m_MSAA, Styles.msaaContent);
m_RenderScale.floatValue = EditorGUILayout.Slider(Styles.renderScaleLabel, m_RenderScale.floatValue, k_MinRenderScale, k_MaxRenderScale);
m_MaxPixelLights.intValue = EditorGUILayout.IntSlider(Styles.maxPixelLightsLabel, m_MaxPixelLights.intValue, 0, k_MaxSupportedPixelLights);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.Space();
}
}
void DrawShadowSettings()
{
shadowsSettingsFoldout = EditorGUILayout.Foldout(shadowsSettingsFoldout, Styles.shadowLabel, true);
if (shadowsSettingsFoldout)
{
// Directional Shadows
EditorGUI.BeginDisabledGroup(!m_DirectionalShadowsSupportedProp.boolValue);
EditorGUI.indentLevel++;
EditorGUILayout.LabelField(Styles.directionalShadowLabel);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_DirectionalShadowAtlasResolutionProp, Styles.directionalShadowAtlasResolution);

EditorGUI.indentLevel--;
EditorGUILayout.Space();
}
EditorGUI.EndDisabledGroup();
bool localShadows = m_LocalShadowSupportedProp.boolValue;
if (localShadows)
{
// Local Shadows
EditorGUI.BeginDisabledGroup(!m_LocalShadowSupportedProp.boolValue);
EditorGUILayout.Space();
EditorGUI.indentLevel--;
EditorGUI.EndDisabledGroup();
if (directionalShadows || localShadows)
EditorGUILayout.PropertyField(m_SoftShadowsSupportedProp, Styles.supportsSoftShadows);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.Space();
void DrawCapabilitiesSettings()
{
EditorGUILayout.LabelField(Styles.capabilitiesLabel, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_SupportsVertexLightProp, Styles.enableVertexLightLabel);
EditorGUILayout.PropertyField(m_RequireDepthTextureProp, Styles.requireDepthTexture);
EditorGUI.BeginDisabledGroup(!m_RequireDepthTextureProp.boolValue);
EditorGUILayout.PropertyField(m_RequireSoftParticlesProp, Styles.requireSoftParticles);
EditorGUI.EndDisabledGroup();
EditorGUILayout.PropertyField(m_RequireOpaqueTextureProp, Styles.requireOpaqueTexture);
EditorGUI.indentLevel++;
EditorGUI.BeginDisabledGroup(!m_RequireOpaqueTextureProp.boolValue);
EditorGUILayout.PropertyField(m_OpaqueDownsamplingProp, Styles.opaqueDownsampling);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
EditorGUILayout.PropertyField(m_HDR, Styles.hdrContent);
EditorGUILayout.PropertyField(m_MSAA, Styles.msaaContent);
EditorGUILayout.PropertyField(m_SupportsDynamicBatching, Styles.dynamicBatching);
EditorGUILayout.PropertyField(m_DirectionalShadowsSupportedProp, Styles.supportsDirectionalShadows);
EditorGUILayout.PropertyField(m_LocalShadowSupportedProp, Styles.supportsLocalShadows);
EditorGUI.indentLevel--;
EditorGUILayout.Space();
EditorGUILayout.Space();
}
}
}
正在加载...
取消
保存