Implement skybox
This commit is contained in:
11
shaders/sb_frag.glsl
Normal file
11
shaders/sb_frag.glsl
Normal 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
16
shaders/sb_vert.glsl
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user