浏览代码

Moved and renamed InverseLerp to RangeRemap in Common.hlsl

/main
Antoine Lelievre 7 年前
当前提交
9bdeb7cf
共有 2 个文件被更改,包括 5 次插入8 次删除
  1. 2
      com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Common.hlsl
  2. 11
      com.unity.render-pipelines.high-definition/HDRP/Debug/DebugColorPicker.shader

2
com.unity.render-pipelines.core/CoreRP/ShaderLibrary/Common.hlsl


return (x * x) * (x * x);
}
TEMPLATE_3_FLT(RangeRemap, min, max, t, return saturate((t - min) / (max - min)))
// ----------------------------------------------------------------------------
// Texture utilities
// ----------------------------------------------------------------------------

11
com.unity.render-pipelines.high-definition/HDRP/Debug/DebugColorPicker.shader


return output;
}
float InverseLerp(float min, float max, float t)
{
return saturate((t - min) / (max - min));
}
float3 FasleColorRemap(float lum, float4 thresholds)
{

float t = lerp(0.0, l / 3, InverseLerp(thresholds.x, thresholds.y, lum))
+ lerp(0.0, l / 3, InverseLerp(thresholds.y, thresholds.z, lum))
+ lerp(0.0, l / 3, InverseLerp(thresholds.z, thresholds.w, lum));
float t = lerp(0.0, l / 3, RangeRemap(thresholds.x, thresholds.y, lum))
+ lerp(0.0, l / 3, RangeRemap(thresholds.y, thresholds.z, lum))
+ lerp(0.0, l / 3, RangeRemap(thresholds.z, thresholds.w, lum));
return HsvToRgb(float3(l - t, 1, 1));
}

正在加载...
取消
保存