View Full Version : texture2D aborting my fragment?

07-18-2010, 12:43 AM
Hi.. I have this fragment program:

varying vec2 uv_interp;
varying vec4 color;

uniform sampler2D diffuse_texture;

void main() {

vec4 diffuse = texture2D(diffuse_texture, uv_interp);
vec4 diffuse = color;

gl_FragColor = diffuse;

the problem is that when I use a texture, no pixels appear on the screen when I call texture2D, even if I overwrite the alpha to 1.0 (in fact, even if I overwrite 3 of the components of 'diffuse', as long as the call to texture2D remain used, no pixels show up). If I don't call texture2D and just set an arbitrary color, or form one using uv_interp for example, it draws just fine.

What could be causing the fragment program to abort completely when texture2D is called? I get no errors from glGetError, I tried using 'isnan' to check the values from texture2D, and nothing..