浏览代码

merge mode in HDProbe

/main
RSlysz 6 年前
当前提交
63135a85
共有 3 个文件被更改,包括 47 次插入7 次删除
  1. 40
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs
  2. 9
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDProbe.cs
  3. 5
      com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs

40
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDAdditionalReflectionData.cs


using UnityEngine.Serialization;
using UnityEngine.Experimental.Rendering.HDPipeline;
using System;
using UnityEngine.Rendering;
namespace UnityEngine.Experimental.Rendering
{

[HideInInspector]
const int currentVersion = 1;
const int currentVersion = 2;
ReflectionProbe m_LegacyProbe;
ReflectionProbe legacyProbe { get { return m_LegacyProbe ?? (m_LegacyProbe = GetComponent<ReflectionProbe>()); } }
public ShapeType influenceShape;
public float influenceSphereRadius = 3.0f;
public float sphereReprojectionVolumeRadius = 1.0f;

[SerializeField] private float editorSimplifiedModeBlendNormalDistance;
[SerializeField] private bool editorAdvancedModeEnabled;
bool needMigrateToHDProbeChild = false;
public Vector3 boxBlendCenterOffset { get { return (blendDistanceNegative - blendDistancePositive) * 0.5f; } }
public Vector3 boxBlendSizeOffset { get { return -(blendDistancePositive + blendDistanceNegative); } }
public Vector3 boxBlendNormalCenterOffset { get { return (blendNormalDistanceNegative - blendNormalDistancePositive) * 0.5f; } }

if (m_Version != currentVersion)
{
// Add here data migration code
m_Version = currentVersion;
if (m_Version < 2)
{
needMigrateToHDProbeChild = true;
}
else
{
m_Version = currentVersion;
}
}
}
private void OnEnable()
{
if (needMigrateToHDProbeChild)
MigrateToHDProbeChild();
}
void MigrateToHDProbeChild()
{
mode = legacyProbe.mode;
m_Version = 2;
OnAfterDeserialize(); //continue migrating if needed
}
public override ReflectionProbeMode mode
{
set
{
base.mode = value;
legacyProbe.mode = value; //ensure compatibility till we capture without the legacy component
}
}
}

9
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/HDProbe.cs


using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Serialization;
namespace UnityEngine.Experimental.Rendering.HDPipeline

[Range(0.0f, 1.0f)]
float m_Weight = 1.0f;
[SerializeField]
ReflectionProbeMode m_Mode = ReflectionProbeMode.Baked;
public virtual ReflectionProbeMode mode
{
get { return m_Mode; }
set { m_Mode = value; }
}
}
}

5
com.unity.render-pipelines.high-definition/HDRP/Lighting/Reflection/PlanarReflectionProbe.cs


[SerializeField]
Vector3 m_CaptureLocalPosition;
[SerializeField]
ReflectionProbeMode m_Mode = ReflectionProbeMode.Baked;
[SerializeField]
ReflectionProbeRefreshMode m_RefreshMode = ReflectionProbeRefreshMode.OnAwake;
[SerializeField]
Texture m_CustomTexture;

{
get
{
switch (m_Mode)
switch (mode)
{
default:
case ReflectionProbeMode.Baked:

}
public Bounds bounds { get { return m_InfluenceVolume.GetBoundsAt(transform); } }
public Vector3 captureLocalPosition { get { return m_CaptureLocalPosition; } set { m_CaptureLocalPosition = value; } }
public ReflectionProbeMode mode { get { return m_Mode; } }
public Matrix4x4 influenceToWorld
{
get

正在加载...
取消
保存