diff options
author | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-31 10:48:51 +1000 |
---|---|---|
committer | omniscient <17525998+omnisci3nce@users.noreply.github.com> | 2024-07-31 10:48:51 +1000 |
commit | e3de98c8ee8a5ace29b8c3673358e9abfbdbdd1f (patch) | |
tree | 72c50cb8c51e4fc9f01b450375543607b2c84c34 /assets/shaders/grid.vert | |
parent | 0f703b8a5129acfa13c92ce79699d86833dcc561 (diff) |
feat: grid: use hardcoded indices
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 |