
// from https://stackoverflow.com/a/34276128
bool isnan( float val )
{
  return ( val < 0.0 || 0.0 < val || val == 0.0 ) ? false : true;
  // important: some nVidias failed to cope with version below.
  // Probably wrong optimization.
  /*return ( val <= 0.0 || 0.0 <= val ) ? false : true;*/
}

void main()
{
    gl_FragData[1] = texture2D(tex1, texCoords);
    if (isnan(gl_FragData[1].z)) discard; //disable effects flag
    gl_FragData[0] = texture2D(tex0, texCoords);
