2014-01-15 19:08:37 -05:00
|
|
|
#version 130
|
|
|
|
uniform sampler2D Albedo;
|
|
|
|
uniform sampler2D DiffuseMap;
|
|
|
|
uniform sampler2D SpecularMap;
|
2014-01-16 17:04:12 -05:00
|
|
|
uniform sampler2D SSAO;
|
2014-01-15 19:08:37 -05:00
|
|
|
uniform vec2 screen;
|
|
|
|
uniform vec3 ambient;
|
|
|
|
in vec2 uv;
|
|
|
|
|
|
|
|
void main(void)
|
|
|
|
{
|
|
|
|
vec2 tc = gl_FragCoord.xy / screen;
|
2014-01-19 12:53:35 -05:00
|
|
|
vec4 color = texture(Albedo, uv);
|
|
|
|
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
|
|
|
|
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
|
|
|
|
float ao = texture(SSAO, tc).x;
|
2014-01-16 17:04:12 -05:00
|
|
|
vec3 LightFactor = ao * ambient + DiffuseComponent + SpecularComponent * (1. - color.a);
|
2014-01-15 19:08:37 -05:00
|
|
|
gl_FragColor = vec4(color.xyz * LightFactor, 1.);
|
|
|
|
}
|