ToyEngine/Exp1/Engine/Shaders/plain.frag

23 lines
509 B
GLSL

#version 450 core
layout (location = 0) out vec4 gBaseColor;
layout (location = 1) out vec3 gNormal;
layout (location = 2) out vec3 gPosition;
layout (location = 3) out vec2 gMetallicRoughness;
in vec2 TexCoords;
in vec3 WorldPos;
in vec3 Normal;
// material parameters
uniform vec3 albedo;
uniform float metallic;
uniform float roughness;
void main()
{
gBaseColor = vec4(albedo, 1);
gPosition = WorldPos;
gNormal = normalize(Normal);
gMetallicRoughness = vec2(metallic,roughness);
}