PollyPocket4eva
11-13-2010, 02:55 PM
Hi,
For testing purposes, I've written a glsl shader that does the following:
vec2 texCoord = gl_TexCoord[0].st;
gl_FragColor = vec4( texture2D(myTexture, vec2(texCoord.x-(1.0/width),texCoord.y)) );
where width is a uniform float giving the number of pixels in that dimension.
In other words, the curr pixel copies from the one to its left. This is being done on an FBO so if I initialize a single pixel wide line along the vertical axis, that line should travel across the screen. Instead, its propagation is uneven.
Please see image at: http://yfrog.com/71screenshot20101113at544p
When I change these parameters for my bound texture, the unevenness of the propagation changes.
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
But I can't seem to get it right.
Anyone know what the problem might be?
Thanks
For testing purposes, I've written a glsl shader that does the following:
vec2 texCoord = gl_TexCoord[0].st;
gl_FragColor = vec4( texture2D(myTexture, vec2(texCoord.x-(1.0/width),texCoord.y)) );
where width is a uniform float giving the number of pixels in that dimension.
In other words, the curr pixel copies from the one to its left. This is being done on an FBO so if I initialize a single pixel wide line along the vertical axis, that line should travel across the screen. Instead, its propagation is uneven.
Please see image at: http://yfrog.com/71screenshot20101113at544p
When I change these parameters for my bound texture, the unevenness of the propagation changes.
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
But I can't seem to get it right.
Anyone know what the problem might be?
Thanks