#version 450

struct Material {
    vec4 ambient;
    vec4 diffuse;
    vec4 specular;
    vec4 bloom;
};

layout(location = 1) in vec2 fragUV;
layout(location = 0) out vec4 outColor;

layout(std140, binding = 0) uniform UniformBuffer
{
    mat4 projectionMatrix;
    mat4 viewMatrix;
    mat4 transformationMatrix;
    vec4 cameraPosition;
    Material material;

} uniformBuffer;

layout(binding = 1) uniform sampler2D diffuseTexture;

void main()
{
    vec3 baseColor = texture(diffuseTexture, fragUV).rgb;

    outColor = vec4(uniformBuffer.material.diffuse.rgb * baseColor, 1.0);
}