summaryrefslogtreecommitdiff
path: root/skybox/shaders/reflection.fs
blob: 3723ea956b29dc30fade8ca6f9819122e906e1e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#version 330 core

in vec3 pos;
in vec3 normal;

out vec4 frag_color;

uniform vec3 camera_pos;
uniform samplerCube skybox;

void
main(void)
{
    vec3 i = pos-camera_pos;
    vec3 r = reflect(i, normalize(normal));
    frag_color = texture(skybox, r);
}