Skip to content

Instantly share code, notes, and snippets.

@hikiko
Created May 29, 2019 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hikiko/975ceda34efa8223576a0420832e0fae to your computer and use it in GitHub Desktop.
Save hikiko/975ceda34efa8223576a0420832e0fae to your computer and use it in GitHub Desktop.
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