Here is an ISF fragment shader that uses a persistent buffer with "FLOAT": true:
/*{
"DESCRIPTION": "Float buffer test",
"ISFVSN": "2.0",
"INPUTS": [
{
"NAME": "value",
"LABEL": "Value",
"TYPE": "float",
"DEFAULT": 0,
"MAX": 0.51,
"MIN": 0
}
],
"PASSES": [
{
"TARGET": "buffer",
"PERSISTENT": true,
"FLOAT": true
},
{
}
]
}*/
void main()
{
if (PASSINDEX == 0)
{
gl_FragColor = vec4(value / 255., 0., 0., 1.);
}
else
{
vec4 color = vec4(0., 0., 0., 1.);
vec4 pixel = IMG_PIXEL(buffer, gl_FragCoord.xy);
color.x = 255. * pixel.x;
if (pixel.x == 0. && gl_FragCoord.x > 0.5 * RENDERSIZE.x) {
color.y = 1.;
}
gl_FragColor = color;
}
}
In the first pass, the red channel in the persistent buffer is set to value / 255., and value can range from 0 to 0.51. In the second pass (the rendered image), the pixel is read from the persistent buffer, and the red channel of the rendered image is set to 255 times the red channel of the pixel from buffer. In addition, if the red channel of the buffer pixel is 0, the green channel of the right half of the image is set to 1.
When Videosync renders this shader, it produces an image where the right half is solid green and the left half solid black when value is less than 0.5. (This is the case even if value is 0.49999.) When value is 0.5 (or greater), the whole image is solid red.
This seems unexpected. What appears to be happening is that buffer is not stored using 32-bit floating-point numbers (even though "FLOAT": true is specified), but rather using 8 bits. When value is 0.5 or greater, writing value / 255. into buffer results in data being persisted. When value is less than 0.5, value / 255. is effectively rounded down to 0 due to lack of precision.
Does Videosync support floating-point persistent buffers? If not, is this support planned?
Apologies if this isn’t the right place for this question; I’m not sure if the ISF host is Videosync itself or Max.

