I have 2 passes, the first one works when set to 0, that seems as it should be, but I would expect the 2nd pass to be 1, but it only works when set to 2.
So what am I missing in my understanding of what is going on? I'm coming from hlsl shading so I'm still trying to get to grips with the oddities on glsl, and isf in particular
I'm missing being able to SamplerStates for example, mirror, wrap etc for texcoords, is that possible?
Thanks
Code: Select all
/*{
"CREDIT": "",
"DESCRIPTION": "",
"CATEGORIES": [ "generator" ],
"INPUTS":
[
{
"NAME": "inputImage",
"TYPE": "image"
},
{
"NAME": "threshold",
"TYPE": "float",
"DEFAULT": 0.99,
"MIN": 0,
"MAX": 1
}
],
"PASSES":
[
{
"TARGET": "P01"
},
{
"TARGET": "P02"
}
]
}*/
void main()
{
if (PASSINDEX == 0) {
//Threshold
vec4 colBuf = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord);
float thresh= float(((colBuf.r+colBuf.g+colBuf.b)/3.0) > threshold);
gl_FragColor = vec4(thresh,thresh,thresh,thresh) ;
}
if (PASSINDEX == 2) { // Why does this pass need to be 2, surely it should be 1?
gl_FragColor = IMG_NORM_PIXEL(P01, isf_FragNormCoord)*vec4(1,1,0,1);
}
}