Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
uniform sampler2D diffuseTexture;
uniform sampler2D aoSampler;
uniform sampler2D ambientTexture;
uniform vec4 ambientColor;

out vec4 FragColor;
in vec2 texCoord;

void main()
{
    float ambientOcclusion = texture(aoSampler, texCoord).r;
    vec4 ambientPixel = texture(ambientTexture, texCoord);
    FragColor = (ambientColor + ambientPixel) * texture(diffuseTexture, texCoord);
    FragColor.rgb *= ambientOcclusion;
    FragColor.a = ambientPixel.a;

    // TODO: Implement IBL.
}