浏览代码

Differentiate face fade for advance and normal mode

/main
RSlysz 6 年前
当前提交
33412fa5
共有 3 个文件被更改,包括 39 次插入7 次删除
  1. 11
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs
  2. 29
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedInfluenceVolume.cs
  3. 6
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/InfluenceVolume.cs

11
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/InfluenceVolumeUI.Drawers.cs


d.boxBlendDistanceNegative.vector3Value = d.editorAdvancedModeBlendDistanceNegative.vector3Value;
d.boxBlendNormalDistancePositive.vector3Value = d.editorAdvancedModeBlendNormalDistancePositive.vector3Value;
d.boxBlendNormalDistanceNegative.vector3Value = d.editorAdvancedModeBlendNormalDistanceNegative.vector3Value;
d.boxSideFadePositive.vector3Value = d.editorAdvancedModeFaceFadePositive.vector3Value;
d.boxSideFadeNegative.vector3Value = d.editorAdvancedModeFaceFadeNegative.vector3Value;
d.boxSideFadeNegative.vector3Value = d.boxSideFadePositive.vector3Value = Vector3.one;
}
d.Apply();
}

if (advanced && drawFace)
{
EditorGUILayout.BeginHorizontal();
CoreEditorUtils.DrawVector6(faceFadeContent, d.boxSideFadePositive, d.boxSideFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
EditorGUI.BeginChangeCheck();
CoreEditorUtils.DrawVector6(faceFadeContent, d.editorAdvancedModeFaceFadePositive, d.editorAdvancedModeFaceFadeNegative, Vector3.zero, Vector3.one, HDReflectionProbeEditor.k_handlesColor);
if (EditorGUI.EndChangeCheck())
{
d.boxSideFadePositive.vector3Value = d.editorAdvancedModeFaceFadePositive.vector3Value;
d.boxSideFadeNegative.vector3Value = d.editorAdvancedModeFaceFadeNegative.vector3Value;
}
GUILayout.Space(28f + 9f); //add right margin for alignment
EditorGUILayout.EndHorizontal();

29
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedInfluenceVolume.cs


internal SerializedProperty boxSize;
internal SerializedProperty boxBlendDistancePositive;
internal SerializedProperty boxBlendDistanceNegative;
//internal SerializedProperty boxBlendSize;
//internal SerializedProperty boxBlendNormalSize;
internal SerializedProperty boxSideFadePositive;
internal SerializedProperty boxSideFadeNegative;
internal SerializedProperty sphereRadius;

internal SerializedProperty editorAdvancedModeBlendNormalDistanceNegative;
internal SerializedProperty editorSimplifiedModeBlendNormalDistance;
internal SerializedProperty editorAdvancedModeEnabled;
internal SerializedProperty editorAdvancedModeFaceFadePositive;
internal SerializedProperty editorAdvancedModeFaceFadeNegative;
public SerializedInfluenceVolume(SerializedProperty root)
{

boxSize = root.Find((InfluenceVolume i) => i.boxSize);
boxBlendDistancePositive = root.Find((InfluenceVolume i) => i.boxBlendDistancePositive);
boxBlendDistanceNegative = root.Find((InfluenceVolume i) => i.boxBlendDistanceNegative);
//boxBlendSize = root.Find((InfluenceVolume i) => i.boxBlendSize);
//boxBlendNormalSize = root.Find((InfluenceVolume i) => i.boxBlendNormalSize);
boxSideFadePositive = root.Find((InfluenceVolume i) => i.boxSideFadePositive);
boxSideFadeNegative = root.Find((InfluenceVolume i) => i.boxSideFadeNegative);
sphereRadius = root.Find((InfluenceVolume i) => i.sphereRadius);

editorAdvancedModeBlendNormalDistanceNegative = root.FindPropertyRelative("m_EditorAdvancedModeBlendNormalDistanceNegative");
editorSimplifiedModeBlendNormalDistance = root.FindPropertyRelative("m_EditorSimplifiedModeBlendNormalDistance");
editorAdvancedModeEnabled = root.FindPropertyRelative("m_EditorAdvancedModeEnabled");
editorAdvancedModeFaceFadePositive = root.FindPropertyRelative("m_EditorAdvancedModeFaceFadePositive");
editorAdvancedModeFaceFadeNegative = root.FindPropertyRelative("m_EditorAdvancedModeFaceFadeNegative");
if(editorAdvancedModeBlendDistancePositive.vector3Value == Vector3.zero
if (editorAdvancedModeBlendDistancePositive.vector3Value == Vector3.zero
&& editorAdvancedModeBlendDistanceNegative.vector3Value == Vector3.zero
&& editorSimplifiedModeBlendDistance.floatValue == 0f
&& editorAdvancedModeBlendNormalDistancePositive.vector3Value == Vector3.zero

|| boxBlendDistanceNegative.vector3Value != Vector3.zero))
|| boxBlendDistanceNegative.vector3Value != Vector3.zero
|| boxBlendNormalDistancePositive.vector3Value != Vector3.zero
|| boxBlendNormalDistanceNegative.vector3Value != Vector3.zero))
{
Vector3 positive = boxBlendDistancePositive.vector3Value;
Vector3 negative = boxBlendDistanceNegative.vector3Value;

|| negative.x != negative.y
|| negative.x != negative.z
|| positive.x != negative.x;
Apply();
}
if(editorAdvancedModeFaceFadePositive.vector3Value == Vector3.one
&& editorAdvancedModeFaceFadeNegative.vector3Value == Vector3.one
&& (boxSideFadePositive.vector3Value != Vector3.one
|| boxSideFadeNegative.vector3Value != Vector3.one))
{
editorAdvancedModeFaceFadePositive.vector3Value = boxSideFadePositive.vector3Value;
editorAdvancedModeFaceFadeNegative.vector3Value = boxSideFadeNegative.vector3Value;
if(!editorAdvancedModeEnabled.boolValue)
{
boxSideFadePositive.vector3Value = Vector3.one;
boxSideFadeNegative.vector3Value = Vector3.one;
}
Apply();
}
}

6
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/Volumes/InfluenceVolume.cs


float m_EditorSimplifiedModeBlendNormalDistance;
[SerializeField, FormerlySerializedAs("editorAdvancedModeEnabled")]
bool m_EditorAdvancedModeEnabled;
[SerializeField]
Vector3 m_EditorAdvancedModeFaceFadePositive = Vector3.one;
[SerializeField]
Vector3 m_EditorAdvancedModeFaceFadeNegative = Vector3.one;
// Sphere
[SerializeField, FormerlySerializedAs("m_SphereBaseRadius")]

data.m_EditorAdvancedModeBlendNormalDistanceNegative = m_EditorAdvancedModeBlendNormalDistanceNegative;
data.m_EditorSimplifiedModeBlendNormalDistance = m_EditorSimplifiedModeBlendNormalDistance;
data.m_EditorAdvancedModeEnabled = m_EditorAdvancedModeEnabled;
data.m_EditorAdvancedModeFaceFadePositive = m_EditorAdvancedModeFaceFadePositive;
data.m_EditorAdvancedModeFaceFadeNegative = m_EditorAdvancedModeFaceFadeNegative;
}
/// <summary>Shape of this InfluenceVolume.</summary>

正在加载...
取消
保存