What obvious thing am I missing? I'm trying to compile/run this vertex shader:
void mainImage( out vec4 fragColor, in vec2 fragCoord ) {
vec2 uv = (fragCoord * 2.0 - iResolution.xy) / iResolution.y;
vec2 uv0 = uv;
vec3 finalColor = vec3(0.0);
for (float i = 0.0; i < 4.0; i++) {
uv = fract(uv * 1.5) - 0.5;
float d = length(uv) * exp(-length(uv0));
vec3 col = palette(length(uv0) + i*.4 + iTime*.4);
d = sin(d*8. + iTime)/8.;
d = abs(d);
d = pow(0.01 / d, 1.2);
finalColor += col * d;
}
fragColor = vec4(finalColor, 1.0);
}
I get this error message
'palette' : no matching overloaded function found
'=' : dimension mismatch
'=' : cannot convert from 'const mediump float' to 'highp 3-component vector of float'
Thanks for your help.
I tried calling the function earlier in the script, but it didn't work. I'm still new to all this. thanks
Are you sure that is
vertexshader?Problem is, probably, in
paletteonly, like you wrote. Try definepalettefunction.Look at this implementation: