Forums > Jitter

co.alphablend.jxs error

September 26, 2007 | 6:05 pm

I get the following error when trying to read the co.alphablend.jxs shader into a jit.gl.slab:
• error: — START GLSL INFO LOG: fp –
ERROR: 0:18: ‘mix’ : no matching overloaded function found
ERROR: 0:18: ‘=’ : cannot convert from ‘const float’ to ’3-component vector of float’
• error: — END GLSL INFO LOG: fp –
• error: jit.gl.shader: GLSL program failed to compile.

I was expecting it to work like jit.alphablend, after first adding a alphachannel using the cc.alphaglue.jxs shader, but it seems to be expecting something else at the inputs?

macbook pro, osx 10.4.10, jitter 1.6.3

hc


September 26, 2007 | 9:54 pm

On Sep 26, 2007, at 11:05 AM, hc gilje wrote:

>
> I get the following error when trying to read the co.alphablend.jxs
> shader into a jit.gl.slab:
> • error: — START GLSL INFO LOG: fp –
> ERROR: 0:18: ‘mix’ : no matching overloaded function found
> ERROR: 0:18: ‘=’ : cannot convert from ‘const float’ to ’3-
> component vector of float’
> • error: — END GLSL INFO LOG: fp –
> • error: jit.gl.shader: GLSL program failed to compile.

change

vec3 mixr = mix(a.rgb,b.rgb,(1.-a.a)*amount);

to

vec3 mixr = mix(a.rgb,b.rgb,vec3(1.-a.a)*vec3(amount));

This error is from Apple’s strict GLSL compiler, which wasn’t
available when originally developed. The problem is that all the
arguments to the mix() function must be the same type, so we need to
use the vec3 casting operator to make the other values act as though
they are of the type vec3.

Sorry for the oversight.

-Joshua


September 26, 2007 | 10:21 pm

ok, thanks!

In the meantime, I modified the co.multiply.jxs shader and got it working, dont know if it is less efficient than the original alphablend, but it does the job. I just changed one line:

vec4 result = a*a.a+b*(1.-a.a);
gl_FragColor = mix(a,result,amount);

hc


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