Implement skybox

This commit is contained in:
abdelrahman committed 2024-12-28 00:14:25 +00:00
1 parent 68cc990650
commit 13bedc164c
9 files changed
+106 -3

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
#version 330 core
in vec3 uv_coords;
uniform samplerCube cubemap;
out vec4 color;
void main() {
color = texture(cubemap, uv_coords);
}
+16
View File
@@ -0,0 +1,16 @@
#version 330 core
layout(location=0) in vec3 position;
layout(location=1) in vec3 normal;
layout(location=2) in vec2 uv;
uniform mat4 view;
uniform mat4 projection;
out vec3 uv_coords;
void main() {
vec4 pos = projection * view * vec4(position, 1.0);
gl_Position = pos.xyww;
uv_coords = position;
}