john_connor

04-24-2017, 04:54 AM

hi,

i'm trying to create random values in shader, the first thing i found was the "float noise1(float)" function. i tried it, it didnt work, i tried all of those 4 noise functions, none worked, so i read about it in the registry:

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/noise.xhtml

which appears do be wrong or deprecated (or i'm doing something wrong), so i read about it in the GLSL 4.5 specs, and it says these functions are all deprecated since 4.4 :confused:

on the web i found some pseudo-random stuff:

http://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl

but isnt there another way to generate random (or pseudo-random) numbers ??

currently i'm using:

float rand(vec2 co)

{

return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);

}

i'm trying to create random values in shader, the first thing i found was the "float noise1(float)" function. i tried it, it didnt work, i tried all of those 4 noise functions, none worked, so i read about it in the registry:

https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/noise.xhtml

which appears do be wrong or deprecated (or i'm doing something wrong), so i read about it in the GLSL 4.5 specs, and it says these functions are all deprecated since 4.4 :confused:

on the web i found some pseudo-random stuff:

http://stackoverflow.com/questions/4200224/random-noise-functions-for-glsl

but isnt there another way to generate random (or pseudo-random) numbers ??

currently i'm using:

float rand(vec2 co)

{

return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453);

}