Varying `v_uv` has static-use in the frag shader, but is undeclared in the vert shader

The post process class is using a default vertex fragment which is using a uv variable named vUV, not v_uv. So you must use this name in your shader:

Note that you can use your own vertex shader with a post process by giving a value to the 11th parameter, but your existing vertex shader won’t work because the post process class is drawing a full screen 2D quad and the “position” attribute reflects that (it directly passes vertices for a triangle in the NDC coordinate system). The default vertex shader used by the post process class is:

attribute vec2 position;

uniform vec2 scale;

varying vec2 vUV;

const vec2 madd = vec2(0.5, 0.5);

void main(void) {
	vUV = (position * madd + madd) * scale;
	gl_Position = vec4(position, 0.0, 1.0);
}
4 Likes