Created
May 29, 2019 13:35
-
-
Save hikiko/975ceda34efa8223576a0420832e0fae to your computer and use it in GitHub Desktop.
vkrunner test that generates a checkerboard pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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