LearnOpenGL/shader.fs

19 lines
383 B
Forth
Raw Normal View History

2022-02-11 21:24:15 +00:00
#version 460 core
out vec4 FragColor;
2022-10-16 18:27:25 +00:00
in vec3 Normal;
in vec3 Position;
2022-10-16 18:27:25 +00:00
uniform vec3 cameraPos;
uniform samplerCube skybox;
2022-10-16 18:14:06 +00:00
in vec2 TexCoords;
uniform sampler2D texture_diffuse1;
2022-02-16 19:32:55 +00:00
void main()
{
2022-10-16 18:27:25 +00:00
vec3 I = normalize(Position - cameraPos);
vec3 R = reflect(I, normalize(Normal));
FragColor = vec4(texture(skybox,R).rgb, 1.0); // texture( texture_diffuse1, TexCoords) ;
2022-02-11 21:24:15 +00:00
}