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 | |
parent | 0f703b8a5129acfa13c92ce79699d86833dcc561 (diff) |
feat: grid: use hardcoded indices
Diffstat (limited to 'assets')
-rw-r--r-- | assets/shaders/grid.frag | 2 | ||||
-rw-r--r-- | assets/shaders/grid.vert | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/assets/shaders/grid.frag b/assets/shaders/grid.frag index 5bce13b..06eebc3 100644 --- a/assets/shaders/grid.frag +++ b/assets/shaders/grid.frag @@ -3,5 +3,5 @@ out vec4 FragColor; void main() { - FragColor = vec4(1.0); + FragColor = vec4(1.0, 0.0, 0.0, 1.0); }
\ No newline at end of file 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 |