浏览代码

Addressed Shawn's UI comment. Render scale cap is now at 4.

/main
Felipe Lira 7 年前
当前提交
cb54afc5
共有 2 个文件被更改,包括 47 次插入19 次删除
  1. 20
      ScriptableRenderPipeline/LightweightPipeline/Data/LightweightPipelineAsset.cs
  2. 46
      ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetEditor.cs

20
ScriptableRenderPipeline/LightweightPipeline/Data/LightweightPipelineAsset.cs


{
public enum ShadowCascades
{
NO_CASCADES = 1,
TWO_CASCADES = 2,
FOUR_CASCADES = 4,
NO_CASCADES = 0,
TWO_CASCADES,
FOUR_CASCADES,
}
public enum ShadowType

public int CascadeCount
{
get { return (int)m_ShadowCascades; }
private set { m_ShadowCascades = (ShadowCascades)value; }
get
{
switch (m_ShadowCascades)
{
case ShadowCascades.TWO_CASCADES:
return 2;
case ShadowCascades.FOUR_CASCADES:
return 4;
default:
return 1;
}
}
}
public float Cascade2Split

46
ScriptableRenderPipeline/LightweightPipeline/Editor/LightweightAssetEditor.cs


{
public static GUIContent renderingLabel = new GUIContent("Rendering");
public static GUIContent shadowLabel = new GUIContent("Shadows");
public static GUIContent defaults = new GUIContent("Defaults");
public static GUIContent defaults = new GUIContent("Default Materials");
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. When in VR mode, VR scaling configuration is used instead.");

public static GUIContent enableVertexLightLabel = new GUIContent("Enable Vertex Lighting",
public static GUIContent enableVertexLightLabel = new GUIContent("Vertex Lighting",
public static GUIContent shadowType = new GUIContent("Shadow Type",
public static GUIContent shadowType = new GUIContent("Type",
public static GUIContent shadowNearPlaneOffset = new GUIContent("Shadow Near Plane Offset",
public static GUIContent shadowNearPlaneOffset = new GUIContent("Near Plane Offset",
public static GUIContent shadowDistante = new GUIContent("Shadow Distance", "Max shadow rendering distance.");
public static GUIContent shadowDistante = new GUIContent("Distance", "Max shadow rendering distance.");
public static GUIContent shadowAtlasResolution = new GUIContent("Shadow Map Resolution",
public static GUIContent shadowAtlasResolution = new GUIContent("Shadowmap Resolution",
public static GUIContent shadowCascades = new GUIContent("Shadow Cascades",
public static GUIContent shadowCascades = new GUIContent("Cascades",
public static GUIContent shadowCascadeSplit = new GUIContent("Shadow Cascade Split",
public static GUIContent shadowCascadeSplit = new GUIContent("Cascades Split",
public static GUIContent defaultMaterial = new GUIContent("Default Material",
public static GUIContent defaultMaterial = new GUIContent("Mesh",
public static GUIContent defaultParticleMaterial = new GUIContent("Default Particle Material",
public static GUIContent defaultParticleMaterial = new GUIContent("Particles",
public static GUIContent defaultTerrainMaterial = new GUIContent("Default Terrain Material",
public static GUIContent defaultTerrainMaterial = new GUIContent("Terrain",
public static string[] shadowTypeOptions = {"No Shadows", "Hard Shadows", "Hard and Soft Shadows"};
public static string[] shadowCascadeOptions = {"No Cascades", "Two Cascades", "Four Cascades"};
private float kMinRenderScale = 0.1f;
private float kMaxRenderScale = 4.0f;
private SerializedProperty m_RenderScale;
private SerializedProperty m_MaxPixelLights;
private SerializedProperty m_SupportsVertexLightProp;

m_MSAA = serializedObject.FindProperty("m_MSAA");
}
protected void DoPopup(GUIContent label, SerializedProperty property, string[] options)
{
var mode = property.intValue;
EditorGUI.BeginChangeCheck();
mode = EditorGUILayout.Popup(label, mode, options);
if (EditorGUI.EndChangeCheck())
{
Undo.RecordObject(property.objectReferenceValue, property.name);
property.intValue = mode;
}
}
public override void OnInspectorGUI()
{
serializedObject.Update();

EditorGUI.indentLevel++;
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(Styles.renderScaleLabel);
m_RenderScale.floatValue = EditorGUILayout.Slider(m_RenderScale.floatValue, 0.1f, 1.0f);
m_RenderScale.floatValue = EditorGUILayout.Slider(m_RenderScale.floatValue, kMinRenderScale, kMaxRenderScale);
EditorGUILayout.EndHorizontal();
EditorGUILayout.BeginHorizontal();
EditorGUILayout.LabelField(Styles.maxPixelLightsLabel);

EditorGUILayout.LabelField(Styles.shadowLabel, EditorStyles.boldLabel);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(m_ShadowTypeProp, Styles.shadowType);
DoPopup(Styles.shadowType, m_ShadowTypeProp, Styles.shadowTypeOptions);
EditorGUILayout.PropertyField(m_ShadowCascadesProp, Styles.shadowCascades);
DoPopup(Styles.shadowCascades, m_ShadowCascadesProp, Styles.shadowCascadeOptions);
ShadowCascades cascades = (ShadowCascades)m_ShadowCascadesProp.intValue;
if (cascades == ShadowCascades.FOUR_CASCADES)

正在加载...
取消
保存