Updated namespace;
Added UTSPass; Chnaged the RTHanlde _HairShadowMap to not reallocate when screen resolution decreased;
This commit is contained in:
@@ -2,15 +2,14 @@ using UnityEngine;
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
namespace Unity.Rendering.Toon
|
||||
|
||||
namespace Misaki.HdrpToon
|
||||
{
|
||||
|
||||
|
||||
[ExecuteAlways]
|
||||
[DisallowMultipleComponent]
|
||||
[UTSHelpURL("ToonEVAdjustment")]
|
||||
|
||||
internal class SceneToonEvAdjustment : MonoBehaviour
|
||||
public class SceneToonEvAdjustment : MonoBehaviour
|
||||
{
|
||||
// flags
|
||||
bool m_initialized = false;
|
||||
@@ -69,10 +68,11 @@ namespace Unity.Rendering.Toon
|
||||
DefaultAnimationCurve();
|
||||
}
|
||||
|
||||
internal static AnimationCurve DefaultAnimationCurve()
|
||||
public static AnimationCurve DefaultAnimationCurve()
|
||||
{
|
||||
return AnimationCurve.Linear(-10f, -10f, -1.32f, -1.32f);
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Unity.Rendering.Toon
|
||||
|
||||
|
||||
// Fail safe in case the curve is deleted / has 0 point
|
||||
AnimationCurve curve = m_AnimationCurve;
|
||||
var curve = m_AnimationCurve;
|
||||
|
||||
|
||||
if (curve == null || curve.length == 0)
|
||||
@@ -90,16 +90,16 @@ namespace Unity.Rendering.Toon
|
||||
m_Min = 0f;
|
||||
m_Max = 0f;
|
||||
|
||||
for (int i = 0; i < kAdjustmentCurvePrecision; i++)
|
||||
for (var i = 0; i < kAdjustmentCurvePrecision; i++)
|
||||
m_ExposureArray[i] = 0.0f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Min = curve[0].time;
|
||||
m_Max = curve[curve.length - 1].time;
|
||||
float step = (m_Max - m_Min) / (kAdjustmentCurvePrecision - 1f);
|
||||
var step = (m_Max - m_Min) / (kAdjustmentCurvePrecision - 1f);
|
||||
|
||||
for (int i = 0; i < kAdjustmentCurvePrecision; i++)
|
||||
for (var i = 0; i < kAdjustmentCurvePrecision; i++)
|
||||
m_ExposureArray[i] = curve.Evaluate(m_Min + step * i);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user