Sorry, I don't quite understand what to do with the shader.
Here's my changed code:
greyscale.setParameter("texture", rtex.getTexture());
However, what do I change in the fragment shader to change the pixels to grey?
What do I need to add to this?
uniform sampler2D texture;
void main()
{
vec4 pixel = texture2D(texture, gl_TexCoord[0].xy);
//Compute level of gray
float gray = dot(gl_Color.rgb, vec3(0.299, 0.587, 0.114));
//Write destination color
gl_FragColor = vec4(gray, gray, gray, gl_Color.a);
}
Edit:
Solved by changing the pixel line to this:
float gray = dot(pixel.rgb, vec3(0.299, 0.587, 0.114));