Simplest possible fragmen shader fails

Started by
3 comments, last by Mads Ipsen 14 years, 6 months ago
OK, so its time to write the first most simple fragment shader ever. But it doesn't work. Using a white background, I do as follow void main() { gl_FragColor = vec4(0.5, 0.5, 0.5, 1.0); } I get a black teapot but was expecting a gray. Changing to gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); gives red teapot, and vec4(0.0, 1.0, 0.0, 1.0) and vec4(0.0, 0.0, 1.0, 1.0) gives green and blue teapot. But any RGB triplet with values < 1.0 are always truncated to 0.0. For example: vec4(1.0, 0.5, 0.0, 1.0) -> pure red vec4(0.0, 0.5, 0.5, 1.0) -> pure black This is on an ATI card, Linux, Ubuntu 8.04. On NVidia it works and gives the correct colors. Any idea what could be wrong here? I pretty new to GLSL so forgive me if this is a really stupid question. Best regards, Mads
Advertisement
The exact same shader and program work on the other card?
Try updating your drivers.
Yes, it works like a charm on NVidia.

I am just amazed that something as simple as this can pass unnoticed through the hands of the ATI developer.

Mads
Are you using fglrx or the open source ATI drivers?
I am using fglrx

This topic is closed to new replies.

Advertisement