Have the original lighting system back and a little lightbulb model to show where the light is.
This commit is contained in:
parent
3231f747a9
commit
a29494325b
143 changed files with 16360 additions and 9 deletions
17
33-shadow-mapping/shaders/26-frag.glsl
Normal file
17
33-shadow-mapping/shaders/26-frag.glsl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 Normal;
|
||||
in vec3 FragPos;
|
||||
in vec2 TexCoords;
|
||||
|
||||
uniform vec3 cameraPos;
|
||||
uniform samplerCube skybox;
|
||||
|
||||
void main()
|
||||
{
|
||||
float ratio = 1.0/1.52;
|
||||
vec3 I = normalize(FragPos - cameraPos);
|
||||
vec3 R = refract(I, normalize(Normal), ratio);
|
||||
FragColor = vec4(texture(skybox, R).rgb, 1.0);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue