What governs how many vertices there are in a Shader?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By toblin

How do I steer how many vertices there are when using a shader? I’ve setup everything using a MeshInstance, where I’ve added a Mesh, a ShaderMaterial with a Shader. I’m guessing that it’s the vertices in the Mesh that are read by VERTEX in the Shader?

:bust_in_silhouette: Reply From: Tim Martin

Yes. The number of calls depends on the mesh you choose.

The vertex() function will be called once per frame per vertex in the mesh, and you can access the coordinate in this function via the VERTEX variable.