浏览代码

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

HDRenderPipelineEditor
/main
GitHub 7 年前
当前提交
9a3378ab
共有 3 个文件被更改,包括 15 次插入41 次删除
  1. 23
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/HDRenderPipelineInspector.cs
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Editor/RenderLoopSettings/LightLoopSettingsUI.cs
  3. 28
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs

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


m_FrameSettingsUI.Reset(serializedFrameSettings, Repaint);
}
static void HackSetDirty(RenderPipelineAsset asset)
{
EditorUtility.SetDirty(asset);
var method = typeof(RenderPipelineAsset).GetMethod("OnValidate", BindingFlags.FlattenHierarchy | BindingFlags.NonPublic | BindingFlags.Instance);
if (method != null)
method.Invoke(asset, new object[0]);
}
EditorGUI.BeginChangeCheck();
EditorGUILayout.PropertyField(m_SpotCookieSize, s_Styles.spotCookieSize);
EditorGUILayout.PropertyField(m_PointCookieSize, s_Styles.pointCookieSize);
EditorGUILayout.PropertyField(m_ReflectionCubemapSize, s_Styles.reflectionCubemapSize);

EditorGUILayout.PropertyField(m_SkyLightingOverrideLayerMask, s_Styles.skyLightingOverride);
if (EditorGUI.EndChangeCheck())
{
HackSetDirty(hdAsset); // Repaint
}
EditorGUI.indentLevel--;
}

EditorGUILayout.LabelField(s_Styles.renderingSettingsLabel);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
if (EditorGUI.EndChangeCheck())
{
HackSetDirty(hdAsset); // Repaint
}
EditorGUI.indentLevel--;
}

EditorGUILayout.LabelField(s_Styles.shadowSettings);
EditorGUI.indentLevel++;
EditorGUI.BeginChangeCheck();
if (EditorGUI.EndChangeCheck())
{
HackSetDirty(hdAsset); // Repaint
}
EditorGUI.indentLevel--;
}

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


{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(p.enableBigTilePrepass, _.GetContent("Enable Big Tile Prepass"));
// 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"));
EditorGUILayout.PropertyField(p.enableComputeLightEvaluation, _.GetContent("Enable Compute Light Evaluation"));
GUILayout.BeginVertical();
if (EditorGUILayout.BeginFadeGroup(s.isSectionExpandedComputeLightEvaluation.faded))

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"));
}
}

28
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipelineAsset.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
namespace UnityEngine.Experimental.Rendering.HDPipeline
public class HDRenderPipelineAsset : RenderPipelineAsset
public class HDRenderPipelineAsset : RenderPipelineAsset, ISerializationCallbackReceiver
{
HDRenderPipelineAsset()
{

public FrameSettings GetFrameSettings()
{
return m_FrameSettings;
}
public void OnEnable()
{
// At creation we need to copy serializedFrameSettings to m_FrameSettings
OnValidate();
}
public void OnValidate()
{
// Modification of defaultFrameSettings in the inspector will call OnValidate().
// We do a copy of the settings to those effectively used
serializedFrameSettings.CopyTo(m_FrameSettings);
}
// Store the various RenderPipelineSettings for each platform (for now only one)

public override Material GetDefault2DMaterial()
{
return null;
}
void ISerializationCallbackReceiver.OnBeforeSerialize()
{
}
void ISerializationCallbackReceiver.OnAfterDeserialize()
{
// Modification of defaultFrameSettings in the inspector will call OnValidate().
// We do a copy of the settings to those effectively used
serializedFrameSettings.CopyTo(m_FrameSettings);
}
}
}
正在加载...
取消
保存