Last active
February 28, 2023 01:58
-
-
Save khlorghaal/f3376d0a02adcc93385cc857a60bcbec to your computer and use it in GitHub Desktop.
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
layout(location=0) in ivec3 in_p; | |
smooth out vec2 v_uv;//ints cant smooth | |
void main(){ | |
//instanced triangle fan | |
const ivec2[] lxy= ivec2[]( | |
ivec2(-4,-4), | |
ivec2(-4, 4), | |
ivec2( 4, 4), | |
ivec2( 4,-4) | |
); | |
gl_Position= project( //project is mapping function onto screenspace, ie view matrix | |
in_p.xy*8 + lxy[gl_VertexID], | |
in_p.z); | |
const vec2[] luv= vec2[]( | |
ivec2( 0, 0), | |
ivec2( 0, 8), | |
ivec2( 8, 8), | |
ivec2( 8, 0) | |
); | |
v_uv= luv[gl_VertexID]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment