This repository has been archived on 2022-05-21. You can view files and clone it, but cannot push or open issues or pull requests.
LEFTONE/core/loshader/cinescope.vshader

23 lines
424 B
Plaintext
Raw Normal View History

layout(std140) uniform param {
vec4 color;
float size;
} p;
const vec2[6] rect_ = vec2[](
vec2(-1., 1.),
vec2(-1., 0.),
vec2( 1., 0.),
vec2(-1., 1.),
vec2( 1., 0.),
vec2( 1., 1.)
);
void main(void) {
int id = gl_VertexID < 6? gl_VertexID: gl_VertexID-6;
vec2 p = rect_[id]*vec2(1., p.size) + vec2(0., 1.-p.size);
p.y *= (id == gl_VertexID? 1.: -1.);
gl_Position = vec4(p, 0., 1.);
}