blob: 4e2d4eaec13d9f6b463db0bda7c6006be2e6f91f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//------------------------------------------------------------------------------
// shaders for offscreen-sapp sample
//------------------------------------------------------------------------------
@header const m = @import("../math.zig")
@ctype mat4 m.Mat4
// offscreen rendering shaders
@vs vs_offscreen
layout(binding=0) uniform vs_params {
vec2 position;
};
in vec2 vpos;
void main() {
gl_Position = vec4(vpos + position, 0, 1);
}
@end
@fs fs_offscreen
layout(binding=1) uniform fs_params {
vec4 color;
};
out vec4 frag_color;
void main() {
frag_color = color;
}
@end
@program offscreen vs_offscreen fs_offscreen
|