Advertisement Jump to content
Sign in to follow this  
jusa

Why GLSL noise only produces a black color?

This topic is 3190 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

I have a noob problem with GLSL where I can't seem to figure out why the pixel shader below only renders a black rectangle. I was expecting that it would draw a random-colored one instead. I figured the black color could result from the fact that the noise functions may return a negative value but even using abs() on them doesn't help.
#version 150

out vec4 pixel_color;

void main() {
    float r = abs(noise1(1.0));
    float g = abs(noise1(2.0));
    float b = abs(noise1(3.0));
    pixel_color = vec4(r, g, b, 1.0);
}

Share this post


Link to post
Share on other sites
Advertisement
I'm pretty sure that implementing noise is optional for the driver/card manufacturers, and most of them simply don't implement it :(

Share this post


Link to post
Share on other sites
Oh. How sad. At least that explains why it didn't work. Thanks!

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!