EEVEE-Next: Fix G1_V term used to compute the GGX pdf

Thanks goes to @weizhen for spotting the mistake.
This commit is contained in:
Clément Foucault
2023-09-03 13:41:55 +02:00
parent 2aebfb596e
commit ad71a04de0

View File

@@ -59,7 +59,7 @@ vec3 sample_ggx(vec3 rand, float alpha, vec3 Vt, out float G1_V)
float x = r * rand.y;
float y = r * rand.z;
float s = 0.5 * (1.0 + Vh.z);
G1_V = 1.0 / s;
G1_V = Vh.z / s;
y = (1.0 - s) * sqrt(1.0 - x * x) + s * y;
float z = sqrt(saturate(1.0 - x * x - y * y));
/* Compute normal. */