minor changes
This commit is contained in:
parent
f03ed1fa4b
commit
33a09475d2
@ -1,5 +1,5 @@
|
||||
#version 330 core
|
||||
out vec4 gl_FragColor;
|
||||
|
||||
|
||||
uniform sampler2D textureSampler;
|
||||
in vec3 fragPos;
|
||||
@ -9,8 +9,9 @@ uniform vec3 cameraPos;
|
||||
uniform samplerCube skybox;
|
||||
|
||||
void main()
|
||||
{
|
||||
{
|
||||
float ratio = 1.00 / 1.52;
|
||||
vec3 I = normalize(fragPos - cameraPos);
|
||||
vec3 R = reflect(I, normalize(interpNormal));
|
||||
gl_FragColor = vec4(texture(skybox, R).rgb, 1.0);
|
||||
vec3 R = refract(I, normalize(interpNormal),ratio);
|
||||
gl_FragColor = vec4(texture(textureSampler, R).rgb, 1.0);
|
||||
}
|
@ -10,7 +10,7 @@ uniform mat4 modelViewProjectionMatrix;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
|
||||
interpNormal = (modelMatrix * vec4(vertexNormal, 0.0)).xyz;
|
||||
fragPos = (modelMatrix*vec4(vertexPosition,1)).xyz;
|
||||
interpNormal = mat3(transpose(inverse(modelMatrix))) * vertexNormal;
|
||||
fragPos = vec3(modelMatrix * vec4(vertexPosition, 1.0));
|
||||
gl_Position = modelViewProjectionMatrix * vec4(vertexPosition, 1.0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user