Transparency in ISF shaders for Jitter

Hello All, I’m getting into ISF for Jitter. I have a fs that creates a row of red boxes. Each box’s position and scale are driven by inputs from Max so I can animate each one separatly.

Say I have a row of boxes and a row of triangles each created with a separate fs shader layered over one another. I know i can blend the two shaders (multiply, add,etc) but how do I do transparency? Ideally I want to pipe one jit.gl.isf into the other and make the black background transparent. Maybe somebody has a suggestion.

ISF shaders support transparency and this should be respected when you do composition in OpenGL in Jitter.

I would need to look at your specific shader code, but you could probably do something like

void main() {
vec4 outputColor = vec4(0.0);
… set the outputColor based on conditions …
gl_FragColor = outputColor;
// Do this to set the alpha channel to 0.0 if the red channel is zero
gl_FragColor.a = (gl_FragColor.r == 0.0) ? 0.0 : 1.0;
}

Hope that helps!

Eg here is the Brick Pattern.fs appearing on top of a Basic Shape.fs, using jit.gl.videoplane with blend_enable / alphablend.