Added framebuffer to render screen to
This commit is contained in:
@@ -10,7 +10,9 @@ endmacro()
|
||||
|
||||
add_shader(flat.vert)
|
||||
add_shader(flat.frag)
|
||||
add_shader(screen.vert)
|
||||
add_shader(screen.frag)
|
||||
|
||||
add_custom_target(shader_headers
|
||||
DEPENDS flat.vert.h flat.frag.h
|
||||
DEPENDS flat.vert.h flat.frag.h screen.vert.h screen.frag.h
|
||||
COMMENT "Generated shaders headers.")
|
||||
|
||||
18
shaders/screen.frag
Normal file
18
shaders/screen.frag
Normal file
@@ -0,0 +1,18 @@
|
||||
#version 330 core
|
||||
|
||||
in vec2 UV;
|
||||
|
||||
out vec4 FragColor;
|
||||
|
||||
struct Material {
|
||||
vec3 color;
|
||||
bool usesColor;
|
||||
sampler2D tex;
|
||||
bool usesTex;
|
||||
};
|
||||
|
||||
uniform Material material;
|
||||
|
||||
void main() {
|
||||
FragColor = texture(material.tex, UV);
|
||||
}
|
||||
11
shaders/screen.vert
Normal file
11
shaders/screen.vert
Normal file
@@ -0,0 +1,11 @@
|
||||
#version 330 core
|
||||
|
||||
layout (location = 0) in vec3 pos;
|
||||
layout (location = 1) in vec2 uv;
|
||||
|
||||
out vec2 UV;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(pos, 1.0);
|
||||
UV = uv;
|
||||
}
|
||||
Reference in New Issue
Block a user