So, I’m trying to write a grass vertex shader using the StandardMaterial shader as a base and using shader chunks, but for some reason I can’t use the “gl_VertexID” variable which indicates what Vertex is currently being processed.
“gl_VertexID” is built in WebGL2 ES3, as seen here: https://www.khronos.org/files/webgl20-reference-guide.pdf
But for some reason I get this error when trying to use it:
“Vertex shader attribute “gl_VertexID” is not mapped to a semantic in shader definition.”
As if PlayCanvas thought that it’s actually an attribute when in fact it’s just a built-in variable…
Can anyone shed any light on this? I really need to use it to animate only the top vertices of a quad using a grass texture, it would allow for a cool sway animation.