I've started trying to develop effects for ZGE, and some basic built-in functions don't seem to be showing up.
I'm making a basic noise plugin. Here's my FragmentShaderSource code:
Code: Select all
uniform sampler2D tex1;
uniform float alpha;
uniform float sat;
uniform vec2 res,iViewport;
//-----------------------------
float slide (float a, float b, float c) {
return (a*(1-c))+(b*c);
}
void main()
{
vec2 uv = (gl_FragCoord.xy-iViewport.xy)/res.xy;
float red = rnd();
float green = rnd();
float blue = rnd();
vec4 col = vec4(red, slide(red, green, sat), slide(red, blue, sat), 1.);
gl_FragColor = mix(col,texture2D(tex1,uv),alpha);
}
Code: Select all
Error in Fragment shader compilation (CanvasShader)
ERROR: 0:18: 'rnd' : no matching overloaded function found
ERROR: 0:18: '' : compilation terminated
ERROR: 2 compilation errors. No code generated.