Forums > Gen

jit.gl.pix codebox invalid left-hand expression (simple problem)


Jul 02 2016 | 5:15 am

Hi everyone, working with jit.gl.pix again (its been a while), converting shadertoy to jit.gl.pix is throwing me an error I can’t figure out.
I just pasted the code as the rest of my patch is pretty messy right now.
The problem seems to be :
uvR.x = uv.x * 1.0 – rand(iTime) * 0.02 * 0.8; // — INVALID LEFT HAND EXPRESSION !

Why can’t I just cast uvR.x to another number ??
Any and all help appreciated !

// random float generator
rand (iTime) {
return fract(sin(iTime)*10000);//normally * 1e4
}

mainImage (in1 , iTime ) {
uv = norm;

uvR = uv;
uvB = uv;

uvR.x = uv.x * 1.0 – rand(iTime) * 0.02 * 0.8; // — INVALID LEFT HAND EXPRESSION !
uvB.y = uv.y * 1.0 + rand(iTime) * 0.02 * 0.8; // — INVALID LEFT HAND EXPRESSION !

return uv;

}
//do not delete these params !
Param iTime (0.);//incoming timer
Param iMouse (0,0);// mouse position in pixels
Param someMod (0.0);

out1 = mainImage(in1,iTime);

Jul 02 2016 | 7:51 am

AFAIK you can’t do that in gl.pix. You will have to do something like:

uvR.x = uv.x * 1.0 – rand(iTime) * 0.02 * 0.8; // — INVALID LEFT HAND EXPRESSION !

uvR = vec(uv.x * 1.0 – rand(iTime) * 0.02 * 0.8, uvR.y, uvR.z);

Jul 04 2016 | 2:07 am

Hi Ullrich, thank you so much ! That worked like a charm :)

Viewing 3 posts - 1 through 3 (of 3 total)

Forums > Gen