Jump to content
  • Advertisement
Sign in to follow this  
Mads Ipsen

Simplest possible fragmen shader fails

This topic is 3171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!