I'm trying to make a vertex shader that will make the screen wiggle, like it was made of waves. This is fine, except that I didn't realize that vertex shaders were in fact by vertices, when soing 2D as well, I thought it was by pixels.
This means that a large sprite, will only wiggle in the top and buttom, whereas I would like it to wiggle all the way down, is there any way to make it use more vertices on a given sprite? Except for chopping up the sprite that is?
Note: I'm using ´libgx´ in java.
Here's the shader:
attribute vec4 a_position;
attribute vec4 a_color;
attribute vec2 a_texCoord0;
uniform mat4 u_projTrans;
uniform float off = 0.0f;
varying vec4 vColor;
varying vec2 vTexCoord;
varying vec4 pos;
void main() {
vColor = a_color;
vTexCoord = a_texCoord0;
pos = a_position;
pos.x = pos.x + sin(pos.y/10+off)*10;
gl_Position = u_projTrans * pos;
}

as you can see the text waves very nicely, because theyr y coordinates are close, but the sprites should wave multiple times, but are unable to do so, because of the lack of vetors.



