
in vec3 v_position;
in vec3 v_fragpos;

layout (location = 0) out vec4 frag_color;
layout (location = 1) out vec3 g_normal;
layout (location = 2) out vec3 g_position;

void main() {
    vec3 col = vec3(0.18, 0.255, 0.447);
    vec2 grid = abs(mod(v_position.xz, 0.25) - 0.125) / 0.125;
    if (grid.x > 0.85 || grid.y > 0.85) {
        col = vec3(0.024, 0.082, 0.224);
    }
    frag_color = vec4(col, 1.0);
    g_position = v_fragpos;
    g_normal = vec3(0.0, 1.0, 0.0) * 0.5 + 0.5;
}
