Fixes shader compile due to undefined 'diffuse_color' variable with Oren Nayer + Vertex Lighting

(cherry picked from commit 36c3b87883)
This commit is contained in:
Jason Neufeld 2022-01-14 13:09:30 -08:00 committed by Rémi Verschelde
parent d1c6673631
commit 965fbce9d4
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -204,7 +204,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, vec3 light_color, float roughness, in
float t = mix(1.0, max(NdotL, NdotV), step(0.0, s));
float sigma2 = roughness * roughness; // TODO: this needs checking
vec3 A = 1.0 + sigma2 * (-0.5 / (sigma2 + 0.33) + 0.17 * diffuse_color / (sigma2 + 0.13));
vec3 A = 1.0 + sigma2 * (-0.5 / (sigma2 + 0.33) + 0.17 * diffuse / (sigma2 + 0.13));
float B = 0.45 * sigma2 / (sigma2 + 0.09);
diffuse_brdf_NL = cNdotL * (A + vec3(B) * s / t) * (1.0 / M_PI);