Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////
- ////////// Screen.vert //////////
- /////////////////////////////////
- #version 450
- #extension GL_ARB_separate_shader_objects : enable
- out gl_PerVertex {
- vec4 gl_Position;
- };
- //Big triangle covering entire screen
- vec2 positions[3] = vec2[](
- vec2(-1.0, -1.0),
- vec2(3.0, -1.0),
- vec2(-1.0, 3.0)
- );
- vec2 uvs[3] = vec2[](
- vec2(0.0, 0.0),
- vec2(2.0, 0.0),
- vec2(0.0, 2.0)
- );
- layout(location = 0) out vec2 fragTexCoord;
- void main()
- {
- fragTexCoord = uvs[gl_VertexIndex];
- gl_Position = vec4(positions[gl_VertexIndex].x, positions[gl_VertexIndex].y, 0.0f, 1.0f);
- }
- //////////////////////////////////
- ////////// Screen.frag //////////
- /////////////////////////////////
- #version 450
- #extension GL_ARB_separate_shader_objects : enable
- layout(binding = 0) uniform sampler2D _screenTexture;
- layout(location = 0) in vec2 fragTexCoord;
- layout(location = 0) out vec4 frag_color;
- void main()
- {
- frag_color = texture(_screenTexture, fragTexCoord);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement