Sign in to follow this  

Why GLSL noise only produces a black color?

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this