fix double emission

This commit is contained in:
2023-09-05 13:54:32 +03:00
parent 849063e846
commit 56a50715e2

View File

@@ -301,7 +301,9 @@ void main(void) {
vec3 diffuse = v0.rgb;
normal = v1.xyz;
geom_normal = v5.xyz;
#ifndef SPOT
vec3 emission = v3.rgb;
#endif
float alpha = v0.a;
float metalness = v2.r;
float roughness = v2.g;
@@ -336,7 +338,10 @@ void main(void) {
vec3 env_dir = view_mat * reflect(-v, normal);
vec3 env_col = textureLod(tex_env, env_dir, sqrt(roughness) * max_lod).rgb * spec_col;
vec3 res_col = max(vec3(0.), li * diffuse + si * spec_col + emission);
vec3 res_col = max(vec3(0.), li * diffuse + si * spec_col);
#ifndef SPOT
res_col += emission;
#endif
res_col = mix(res_col, env_col, env_spec * reflectivity);
if (bitfieldExtract(flags, 1, 1) == 1) {