Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
vkrunner test that generates a checkerboard pattern
[require]
fbsize 800 600
[vertex shader passthrough]
[fragment shader]
#version 450
float checkerboard(in vec2 uv)
{
vec2 pos = floor(uv);
return mod(pos.x + mod(pos.y, 2.0), 2.0);
}
layout(location = 0) out vec4 out_color;
void main()
{
vec2 uv = gl_FragCoord.xy;
float p = checkerboard(uv);
out_color = vec4(p, p, p, 1.0);
}
[test]
draw rect -1 -1 2 2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment