浏览代码

Use f0 instead of albedo in blinn and phong

clayjohn 4 年之前
父节点
当前提交
a7c3e0dcd6
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl

+ 2 - 2
servers/rendering/renderer_rd/shaders/scene_forward_lights_inc.glsl

@@ -211,7 +211,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, float atte
 		float blinn = pow(cNdotH, shininess);
 		blinn *= (shininess + 2.0) * (1.0 / (8.0 * M_PI));
 
-		specular_light += light_color * attenuation * specular_amount * blinn * albedo * unpackUnorm4x8(orms).w;
+		specular_light += light_color * attenuation * specular_amount * blinn * f0 * unpackUnorm4x8(orms).w;
 
 #elif defined(SPECULAR_PHONG)
 
@@ -221,7 +221,7 @@ void light_compute(vec3 N, vec3 L, vec3 V, float A, vec3 light_color, float atte
 		float phong = pow(cRdotV, shininess);
 		phong *= (shininess + 1.0) * (1.0 / (8.0 * M_PI));
 
-		specular_light += light_color * attenuation * specular_amount * phong * albedo * unpackUnorm4x8(orms).w;
+		specular_light += light_color * attenuation * specular_amount * phong * f0 * unpackUnorm4x8(orms).w;
 
 #elif defined(SPECULAR_TOON)