Fix shader compile error due to saturate() not available

use `clamp()` instead
This commit is contained in:
Weizhen Huang
2023-08-29 15:00:54 +02:00
parent ea974b6681
commit 068e117a8b

View File

@@ -1274,7 +1274,7 @@ float4 utility_tx_sample_lut(sampler2DArray util_tx, float2 uv, float layer)
float4 utility_tx_sample_lut(sampler2DArray util_tx, float cos_theta, float roughness, float layer)
{
/* LUTs are parametrized by `sqrt(1.0 - cos_theta)` for more precision near grazing incidence. */
vec2 coords = vec2(roughness, sqrt(saturate(1.0 - cos_theta)));
vec2 coords = vec2(roughness, sqrt(clamp(1.0 - cos_theta, 0.0, 1.0)));
return utility_tx_sample_lut(util_tx, coords, layer);
}