ISF program - problem with PASSES
Posted: Sat Jun 24, 2017 5:15 pm
I've been experimenting with ISF programming, and have run into a problem with a simple ISF fragment shader I was using to test persistent buffers. The program is supposed to allow a frame to be captured, strobing the captured frame instead of the current frame every 1/2 sec. My program:
At present the effect just displays the last frame captured by the "capture" event. What am I missing here?
Code: Select all
/*{
"CREDIT": "Psyne",
"ISFVSN": "2.0",
"DESCRIPTION": "Strobes captured material every 1/2 second",
"CATEGORIES": [
"filter"
],
"INPUTS": [
{
"NAME": "inputImage",
"TYPE": "image"
},
{
"NAME": "capture",
"TYPE": "event"
}
],
"PASSES": [
{
"TARGET": "captureImage",
"PERSISTENT": true
}
]
}*/
void main() {
vec4 inputPixel = IMG_NORM_PIXEL(inputImage, isf_FragNormCoord);
if (capture == true || FRAMEINDEX == 0)
gl_FragColor = inputPixel;
else if (PASSINDEX == 1)
gl_FragColor = (fract(TIME) < 0.5) ? inputPixel : IMG_NORM_PIXEL(captureImage, isf_FragNormCoord);
else
discard;
}At present the effect just displays the last frame captured by the "capture" event. What am I missing here?