Skip to content

Commit

Permalink
Update deferred_shading.fs for GLES3
Browse files Browse the repository at this point in the history
  • Loading branch information
MikiZX1 authored Jan 18, 2025
1 parent b0646d2 commit 80f6582
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ void main() {
vec3 fragPosition = texture(gPosition, texCoord).rgb;
vec3 normal = texture(gNormal, texCoord).rgb;
vec3 albedo = texture(gAlbedoSpec, texCoord).rgb;
float specular = texture(gAlbedoSpec, texCoord).a;
float specular = pow(texture(gAlbedoSpec, texCoord).a,8.0);

vec3 ambient = albedo * vec3(0.1f);
vec3 ambient = albedo * vec3(0.03f);
vec3 viewDirection = normalize(viewPosition - fragPosition);

for(int i = 0; i < NR_LIGHTS; ++i)
Expand All @@ -41,7 +41,7 @@ void main() {
vec3 diffuse = max(dot(normal, lightDirection), 0.0) * albedo * lights[i].color.xyz;

vec3 halfwayDirection = normalize(lightDirection + viewDirection);
float spec = pow(max(dot(normal, halfwayDirection), 0.0), 32.0);
float spec = pow(max(dot(normal, halfwayDirection), 0.0), 16.0);
vec3 specular = specular * spec * lights[i].color.xyz;

// Attenuation
Expand Down

0 comments on commit 80f6582

Please sign in to comment.