2022-01-01 12:21:15 +01:00
|
|
|
#version 330 core
|
2022-01-01 12:35:51 +01:00
|
|
|
|
2021-12-30 12:14:47 +01:00
|
|
|
|
2022-01-01 12:21:15 +01:00
|
|
|
in vec3 fragPos;
|
|
|
|
in vec3 interpNormal;
|
2022-01-01 14:05:58 +01:00
|
|
|
in vec3 TexCoords;
|
2021-12-30 12:14:47 +01:00
|
|
|
uniform vec3 cameraPos;
|
|
|
|
uniform samplerCube skybox;
|
|
|
|
|
|
|
|
void main()
|
2022-01-01 12:35:51 +01:00
|
|
|
{
|
2022-01-01 14:05:58 +01:00
|
|
|
float ratio = 1.01/1.0;
|
2022-01-01 12:21:15 +01:00
|
|
|
vec3 I = normalize(fragPos - cameraPos);
|
2022-01-01 14:05:58 +01:00
|
|
|
// vec3 R = refract(I, normalize(interpNormal),ratio);
|
|
|
|
vec3 R = reflect(I, normalize(interpNormal));
|
|
|
|
gl_FragColor = vec4(texture(skybox, R).rgb,1.0);
|
2021-12-30 12:14:47 +01:00
|
|
|
}
|