Implement skybox

This commit is contained in:
2024-12-28 00:14:25 +00:00
parent 68cc990650
commit 13bedc164c
9 changed files with 106 additions and 3 deletions

11
shaders/sb_frag.glsl Normal file
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
shaders/sb_vert.glsl Normal file
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;
}