diff options
Diffstat (limited to 'assets/shaders/grid.vert')
-rw-r--r-- | assets/shaders/grid.vert | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/assets/shaders/grid.vert b/assets/shaders/grid.vert index a98eabe..bdfa477 100644 --- a/assets/shaders/grid.vert +++ b/assets/shaders/grid.vert @@ -6,6 +6,12 @@ uniform Camera { vec4 viewPos; } cam; +// Grid position are in xy clipped space +vec3 gridPlane[6] = vec3[]( + vec3(1, 1, 0), vec3(-1, -1, 0), vec3(-1, 1, 0), + vec3(-1, -1, 0), vec3(1, 1, 0), vec3(1, -1, 0) +); +// normal vertice projection void main() { - gl_Position = vec4(1.0); + gl_Position = cam.proj * cam.view * vec4(gridPlane[gl_VertexID].xyz, 1.0); }
\ No newline at end of file |