water now has depth and looks much better

This commit is contained in:
2022-02-21 15:11:13 +08:00
parent 4204a15b1e
commit e2717aaaa9
3 changed files with 18 additions and 9 deletions

View File

@@ -11,6 +11,7 @@ layout (location = 2) in vec2 texCoord;
layout (location = 4) in float light;
out vec4 fragPos;
out vec4 fragPosView;
out vec4 fragPosLightspace;
out vec3 fragNormal;
out vec2 fragTexCoord;
@@ -19,8 +20,9 @@ out vec2 fragTexCoord;
void main() {
fragTexCoord = texCoord;
fragPos = model * vec4(vert, 1);
fragPosView = view * fragPos;
fragPosLightspace = lightspace * fragPos;
fragNormal = normal;
gl_Position = projection * view * fragPos;
gl_Position = projection * fragPosView;
}