浏览代码

Merge pull request #1638 from Unity-Technologies/fix/ReflectionProbe-migration-serialization

Fix/reflection probe migration serialization
/main
GitHub 6 年前
当前提交
8327a1ae
共有 2 个文件被更改,包括 13 次插入9 次删除
  1. 7
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs
  2. 15
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/Volume/SerializedInfluenceVolume.cs

7
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/Reflection/SerializedHDReflectionProbe.cs


&& editorSimplifiedModeBlendDistance.floatValue == 0f
&& editorAdvancedModeBlendNormalDistancePositive.vector3Value == Vector3.zero
&& editorAdvancedModeBlendNormalDistanceNegative.vector3Value == Vector3.zero
&& editorSimplifiedModeBlendNormalDistance.floatValue == 0f)
&& editorSimplifiedModeBlendNormalDistance.floatValue == 0f
&& (blendDistancePositive.vector3Value != Vector3.zero
|| blendDistanceNegative.vector3Value != Vector3.zero
|| blendNormalDistancePositive.vector3Value != Vector3.zero
|| blendNormalDistanceNegative.vector3Value != Vector3.zero))
{
Vector3 positive = blendDistancePositive.vector3Value;
Vector3 negative = blendDistanceNegative.vector3Value;

//display old data
editorAdvancedModeEnabled.boolValue = true;
Apply();
}
proxyVolumeComponent = addso.Find((HDAdditionalReflectionData d) => d.proxyVolumeComponent);

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


&& editorSimplifiedModeBlendDistance.floatValue == 0f
&& editorAdvancedModeBlendNormalDistancePositive.vector3Value == Vector3.zero
&& editorAdvancedModeBlendNormalDistanceNegative.vector3Value == Vector3.zero
&& editorSimplifiedModeBlendNormalDistance.floatValue == 0f)
&& editorSimplifiedModeBlendNormalDistance.floatValue == 0f
&& (boxInfluencePositiveFade.vector3Value != Vector3.zero
|| boxInfluenceNegativeFade.vector3Value != Vector3.zero))
{
Vector3 positive = boxInfluencePositiveFade.vector3Value;
Vector3 negative = boxInfluenceNegativeFade.vector3Value;

//aproximated simplified
editorSimplifiedModeBlendDistance.floatValue = Mathf.Max(positive.x, positive.y, positive.z, negative.x, negative.y, negative.z);
positive = boxInfluenceNormalPositiveFade.vector3Value;
negative = boxInfluenceNormalNegativeFade.vector3Value;
//exact advanced
editorAdvancedModeBlendNormalDistancePositive.vector3Value = positive;
editorAdvancedModeBlendNormalDistanceNegative.vector3Value = negative;
//aproximated simplified
editorSimplifiedModeBlendNormalDistance.floatValue = Mathf.Max(positive.x, positive.y, positive.z, negative.x, negative.y, negative.z);
//no normal modification allowed anymore in PlanarReflectionProbe
boxInfluenceNormalPositiveFade.vector3Value = Vector3.zero;
boxInfluenceNormalNegativeFade.vector3Value = Vector3.zero;
Apply();
}
}

正在加载...
取消
保存