[PD] pix_contrast on Mac OS: black pixels have negative rgb values!!!

Matteo Sisti Sette matteosistisette at gmail.com
Fri Jun 24 18:10:49 CEST 2011


Hi,

I'm using a shader with a texture which is the output of a [pix_contrast].

On Mac (and only on Mac) with values of contrast > 1 for pix_contrast, 
the black pixels have slightly negative r/g/b component values!! I don't 
know how that is even possible!!!

That is, in the fragment shader:

//...
uniform sampler2DRect mytex;
//...
float x=gl_TexCoord[0].s;
float y=gl_TexCoolr[0].t
vec txcolor=texture2DRect(mytex,vec2(x,y))
//...

The red, green and blue components of txcolor turn out to be (small) 
negative numbers for the pixels that are supposed to be black.

I can test it in a number of ways, for example:

gl_FragColor=vec4(abs(txcolor.r),txcolor.r,txcolor.r);

This should only produce grey pixels, but instead, the should-be-black 
pixels are of a dark red, because the red component of the original 
image is slightly negative.


How is it even possible that a texture has negative components?
Is there a bug in pix_contrast on Mac? But even if there is, I cannot 
understand how a negative rgb component value can even get through to 
the shader program...

Has anybody ever experienced this before?

thanks
m.



More information about the Pd-list mailing list