Update deferred_shading.fs for GLES3
This commit is contained in:
parent
b0646d2867
commit
80f65821f4
|
|
@ -29,9 +29,9 @@ void main() {
|
||||||
vec3 fragPosition = texture(gPosition, texCoord).rgb;
|
vec3 fragPosition = texture(gPosition, texCoord).rgb;
|
||||||
vec3 normal = texture(gNormal, texCoord).rgb;
|
vec3 normal = texture(gNormal, texCoord).rgb;
|
||||||
vec3 albedo = texture(gAlbedoSpec, 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);
|
vec3 viewDirection = normalize(viewPosition - fragPosition);
|
||||||
|
|
||||||
for(int i = 0; i < NR_LIGHTS; ++i)
|
for(int i = 0; i < NR_LIGHTS; ++i)
|
||||||
|
|
@ -41,7 +41,7 @@ void main() {
|
||||||
vec3 diffuse = max(dot(normal, lightDirection), 0.0) * albedo * lights[i].color.xyz;
|
vec3 diffuse = max(dot(normal, lightDirection), 0.0) * albedo * lights[i].color.xyz;
|
||||||
|
|
||||||
vec3 halfwayDirection = normalize(lightDirection + viewDirection);
|
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;
|
vec3 specular = specular * spec * lights[i].color.xyz;
|
||||||
|
|
||||||
// Attenuation
|
// Attenuation
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user