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