Have a working skybox now.
This commit is contained in:
parent
87c513b9f0
commit
4ee5058e82
13 changed files with 158 additions and 2 deletions
11
24-cubemaps/shaders/24-skybox.frag.glsl
Normal file
11
24-cubemaps/shaders/24-skybox.frag.glsl
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
#version 330 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 TexCoords;
|
||||
|
||||
uniform samplerCube skybox;
|
||||
|
||||
void main()
|
||||
{
|
||||
FragColor = texture(skybox, TexCoords);
|
||||
}
|
||||
14
24-cubemaps/shaders/24-skybox.vert.glsl
Normal file
14
24-cubemaps/shaders/24-skybox.vert.glsl
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#version 330 core
|
||||
layout (location = 0) in vec3 aPos;
|
||||
|
||||
out vec3 TexCoords;
|
||||
|
||||
uniform mat4 projection;
|
||||
uniform mat4 view;
|
||||
|
||||
void main()
|
||||
{
|
||||
TexCoords = aPos;
|
||||
vec4 pos = projection * view * vec4(aPos, 1.0);
|
||||
gl_Position = pos.xyww;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue