Assuming that the 2nd and 3rd of the following quotes are a sequence starting from the first
float rand(vec4 co) {
return fract(sin(dot(co.xyzw ,vec4(12.9898,78.233, 45.8438, 100.0)*fract(iTime))) * (43758.5453*fract(itime)));
}
Won't that change on every frame/pixel ?
Only if it is your Loop.
It is is joust at the top then it becomes static.
Call the function one time before entering the loop.
Then my answer to "Won't that change..." is still "Yes it will".
iTime, and hence the result of calling rand() will certainly be different for each frame and can be different for each pixel in the frame. This depends on exactly what iTime represents - if it is truely the instantaneous elapsed time then it will be slightly different for different pixels, if it is the elapsed time atthe start of the frame then it will be different for each frame. This is true even if to initialise a "global" variable in the shader - these initial declarations get re-evaluated for every pixel.
As to "call the function before entering the loop" - what loop is that ? You would need to call it outside the loop that invokes the graphics processing for each frame and the only place that we can do that is in the scene file which has no facilities for doing such calculations.
If I am ***** and you were referring to something else than I am sorry.