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/Ope...ml/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

on the web i found some pseudo-random stuff:

http://stackoverflow.com/questions/4...tions-for-glsl

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

currently i'm using:

Code glsl:

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

int current_level = 0;

uniform int lod_level = 1;

while(current_level < lod_level)

{

current_level++;

gl_Position = pos;

EmitVertex();

}

uniform int lod_level = 1;

while(current_level < lod_level)

{

current_level++;

gl_Position = pos;

EmitVertex();

}

This isn't all the code, but commenting out gl_positon or changing the while loop to;

while(current_level < 2)

will then work

Hope someone can shed some light on this. Thanks. ]]>

i have a Problem to understand this minnimal shader:

"#version 400\n"

"in vec3 vp;"

"void main() {"

" gl_Position = vec4(vp, 1.0);"

"}";

How does OpenGL know to put the vertex into the vp. variable.

I could write womething linke:

"#version 400\n"

"in vec3 vp;"

"in vec3 vp1;"

"in vec3 vp2;"

"void main() {"

" gl_Position = vec4(vp2, 1.0);"

"}";

so for me it is not celar how OpenGL passes a vertex to the shader...

Best Regards,

TinTin ]]>