diff --git a/shaders/quad_fragment.glsl b/shaders/quad_fragment.glsl index 7e4033d..e96a142 100644 --- a/shaders/quad_fragment.glsl +++ b/shaders/quad_fragment.glsl @@ -7,7 +7,7 @@ in vec2 tex_coords; uniform sampler2D albedoGbuffer; uniform sampler2D positionGbuffer; -uniform sampler2D normalGbuffer; +uniform sampler2D normalGbuffer;h layout(std140, binding = 0) uniform SceneUniforms { @@ -23,7 +23,7 @@ vec3 calculateDisneySpecular(vec3 N, vec3 V, vec3 L, vec3 albedo) { vec3 F = F0 + (1.0f - F0) * pow(1.0f - dot(H, V), 5.0f); // Normal Distribution Function (GGX) - float roughness = 0.6f; + float roughness = 0.5f; float alpha = roughness * roughness; float alpha2 = alpha * alpha; @@ -38,9 +38,7 @@ vec3 calculateDisneySpecular(vec3 N, vec3 V, vec3 L, vec3 albedo) { float G1L = NdotL / (NdotL * (1.0f - k) + k); float G = G1V * G1L; - //vec3 specular = vec3(F); - - vec3 specular = (D * G * F) / (4.0f * NdotL * NdotV + 0.001); // Adding a small bias to prevent division by zero + vec3 specular = (D * G * F) / (4.0f * NdotL * NdotV + 0.001f); // Adding a small bias to prevent division by zero return specular; @@ -49,7 +47,7 @@ vec3 calculateDisneySpecular(vec3 N, vec3 V, vec3 L, vec3 albedo) { void main() { vec4 albedo = texture(albedoGbuffer, tex_coords); - //albedo = vec4(vec3(0.18f), texture(albedoGbuffer, tex_coords).a); + albedo = vec4(vec3(0.18f), texture(albedoGbuffer, tex_coords).a); vec4 position = texture(positionGbuffer, tex_coords); vec4 normal = texture(normalGbuffer, tex_coords);