|
|
|
|
|
|
|
|
|
|
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)); |
|
|
|
} |
|
|
|